Age of Mythology: Extended Edition Guide

How to Make UMC Units Trainable from Buildings for Age of Mythology: Extended Edition

How to Make UMC Units Trainable from Buildings

Overview

This guide will explain, step by step, two methods for making any unit from the UMC collection trainable by buildings which already exist in the game. I have not made any of the UMC units trainable at vanilla buildings such as the barracks, temple, etc. because this would go against the core philosophy of UMC: to not alter or replace any original game code, but only add new, original content. However, I understand that many of you will want to use these units in a match without having to design custom scenarios in the editor, hence I have made this guide for your convenience.This guide is written at a very basic level and assumes no previous modding or scenario editing experience on the part of the reader.You can find a video guide for both of the below methods here: https://www.youtube.com/watch?v=NlNgazfWju0

Method 1 – Modding the Proto & Techtree

This method will make units trainable noramlly from buildings of your choice. It should be used if you want to train the units for yourself and don’t mind if the AI can’t train them, or if you want to be able to play online with other people who have the same data files (which is explained in the last few steps). If you want the AI to be able to train UMC units, you will either have to write new AI files (not explained here) or use Method 2 below.

Note that the campaign scenarios use different proto & techtree files so if you want to use trainable UMC units in campaign, you will have to rename your data files to the appropriate version number.

  1. open File Explorer and access the High Priority mod files located in the directory: Steam/SteamApps/common/Age of Mythology/mods/UMC High Priority
  2. open the folders Language/en and open the en-language.txt document in notepad (or any other basic text editor)
  3. do a ctrl-f search for the name of the unit you want to make trainable, the UMC units are named near the bottom of the document, once you have found the unit, copy or write down the number on the left of the unit’s name. In the picture below, I have done a search for the unit called “Durin’s Guard” and I now copy the number 100001 which is the text ID number for that name.

    You will notice that the numbers just below this also refer to this unit. I have formatted the text ID numbers in a logical way so that the first digit indicates the unit pack (100,000 series is the Anim Mod, 200,000 series is the LotR pack, etc. etc.), if the second digit is a 1, it’s the name that displays in the scenario editor, if the third digit is a 1, it’s for the rollover text ID (which only a few UMC units have).

  4. once you have the text ID number, close the en-language file and return to the UMC High Priority folder and access the data folder
  5. open the protoX.X.xml file (where “X.X” indiactes the update version, when this guide was published, it was proto2.5.xml)
  6. do a ctrl-f search for the text ID number you found for your unit in the en-language file, for example 100001, this will take you to the data for your unit
  7. you may notice that the proto name is not necessarily the same as the text display name which is why we had to look up the ID number in the en-language file, for example, the proto name for unit 100001 “Durin’s Guard” is actually name=”Dwarf Guard”.

    You will notice that the unit ID number is the same as the text ID number for all UMC units. You’re welcome 🙂

  8. scroll down until you see the <allowedculture> line in your unit’s proto data (it should be right below the armor stats), change the allowed culture to whatever civ you plan on using to train your unit
  9. if you look through the unit data a little bit more, you will notice tags such as <allowedage> and <cost resourcetype=”_”> and <trainpoints>, these tags do exactly what they sound like, you may edit them accordingly to change the age, resource cost, train time, etc. of your unit.
  10. go back to the top of the unit’s proto entry and copy the proto name inside the quotation marks
  11. do a ctrl-f for the building from which you want to be able to train your unit, remember that the in-game display name may not be the same as the proto name as we just discovered, you may need to go back to the en-language.txt file to find the proto name for your building
  12. once you have found your building, we will need to insert a line of code that will allow the building to train your unit, this line of code looks like:

    <train row=”0″ page=”1″ column=”0″>Ulfsark</train>

    which I have take from the Longhouse proto data. The page number doesn’t seem to do anything. However, you will want to choose a row and column that isn’t already being used by that building. If your buidling already has these training lines, just copy-paste a new one below the others and edit the values so they don’t overlap with any others. If the buidling you choose doesn’t have this line, you can just copy/paste from above. Paste the proto name of your unit into the obvious field (instead of Ulsfark). If you simply want to make the UMC unit replace the vanilla unit, just paste the UMC unit’s proto name over the vanilla unit and you don’t need to make a new line of code.

  13. we are now done editing the proto file so we can save the file and close. Make sure that you are editing and saving the proto file in the UMC High Priority mods folder and not in your vanilla game files as it will be impossible to undo edits to the vanilla files without manually editing them or verifying the game cache. I trust you to make backups of your files as you see fit.
  14. close the proto XML and open the techtree XML in the UMC High Priority data folder
  15. take a look at how this document is formatted, every technology in the game is presented along with what units it unlocks and what other stuff it does, the ages 1, 2, 3, 4 are technologies, likewise, the major and minor gods are technologies. Now you just have to decide which technology you want to unlock your unit. For simpliciy, I usually just use the age 1 technology to unlock units as the buildings will already control at which age you can train the unit. So for example, I could unlock the Dwarf Guard unit in Age 1 but not be able to train it until age 2 because I wouldn’t have Longhouse. Remember as well that the unlock age is also defined in the unit’s proto data. Once you decide which tech to use to unlock your unit, paste the following lines of code into that tech’s entry:

    <effect amount=”1.00″ relativity=”Absolute” subtype=”Enable” type=”Data”>
    <target type=”ProtoUnit”>YOUR UNITS PROTO NAME</target>
    </effect>

  16. save and exit out of the techtree XML
  17. start the game and test to make sure everything is working, a common mistake is making the training code in step 11 overlap with another unit or technology, that is to say, the button for your unit has the same row and column values and overlaps with another unit or tech preventing you from training either at the building you chose

And to play online with other people just send them your edited proto and techtree XML files via email, dropbox, etc. However, please do not upload your edited files to the Steam Workshop. There are better and easier ways to share files. To play online with your friends, they will need to have your edited XML files in their UMC High Priority folders replacing the old files (again, make backups as you see fit).

Method 2 – Using the Scenario Editor

Method 2 is essentially using triggers in the scenario editor to make units trainable for custom scenarios. It has the benefit of allowing the AI to train UMC units but also several drawbacks.

Benefits:

  • the AI will make UMC units in your scenarios
  • doesn’t require modding

Drawbacks:

  • you will have to make or load a specific scenario for which to use the triggers, the AI will only be able to train UMC units in scenarios with your triggers
  • units spawned using the “Change Units” trigger don’t respect waypoints. So for example, if you train a Hoplite and set the waypoint to somewhere infront of the military academy, but you have a looped trigger than instantly changes Hoplites into War Elephants, then the Hoplite will spawn, then change into a War Elephant and the War Elephant will just stand next to the academy instead if going to the waypoint you set which is a minor annoyance (any of you who have played my Lord of the Rings scnearios will know this)

So now you know the pros and cons. I would recommend using this method only if you really want the AI to be able to train the UMC units. If you really really really want the AI to be able to train UMC units without having to use the scenario editor and deal with all this nonsense, talk to me and I will refer you to someone who can help you write AI scripts.

  1. open the scenario editor
  2. load a scenario of your choice (or make one), you can load campaign levels and some multiplayer scenarios from the editor
  3. once you have a scenario you want with other AIs, you will need to asign the AI files to each, go to Scenario>Player Data and a table will open displaying most of the player data for each player in the scenario
  4. on the right-hand side, there is a column with buttons that say “AI”, click these for the player numbers that you want to have an AI (do not assign an AI to the player number you want to play as
  5. an in-game file explorer will open to the AI script directory, choose an AI that you think is suitable, not all of the AI files will work on EE, I find that the default AI is suitable for most purposes
  6. close the Player Data table and go to objects
  7. place a cinematic block somewhere near the middle of the map
  8. go to Triggers>Trigger Editor to open the trigger editor box
  9. click Insert to make a new trigger
  10. check the boxes “Active” and “Loop” and set to high priority
  11. make sure the conditions are set to always
  12. in the effects box, change the type to “Change Units in Area”
  13. select the cinematic block at the center of your map to be the “Center Unit”, click the “Show” button to make sure the cinematic block was selected
  14. set the radius to something that will encompass the entire map, if you aren’t sure how big your map is, go to Scenario Data and it will show you the dimensions
  15. in the fields, set the player number to your number, find your UMC unit in the drop down, type in the name of the unit you want to replace

  16. to unlock the unit for other players, copy the effect and change the player number, you may also have to change the base unit, for example, if P1 is Greek and P2 is Egypt, P2 won’t have Hoplite, etc.
  17. make sure the player number you want to play as is selected, to do this, you can simply open the objects editor and set it to Player X (you don’t need to place any objects, just set the player number)
  18. save the scenario and return to the main menu
  19. go to Single Player>Load Scenario to open your scenario and enjoy
SteamSolo.com