Skip to content

Creating Godpowers using XML

created 11/13/03

By xLpx

Introduction
This is an advanced tutorial on how to modify AoM's original god powers and customize them.


Tools:
Ykkrosh's AoMED
Notepad


Starting Out
Open up AoMED. Click in the "Set Data Input" button, select the "data.bar" file and extract the file into some folder where you want it, now click on direct conversion and convert the techtree.xmb file into techtree.xml file,then do the same thing for the godpowers.bar open the file using notepad.

Choosing a power - Godpowers.bar
First of all, you have to think of a template to the god power you want to make, lets say you want to make all military units into monkeys (either yours or enemy's) you might want to open ragnarok.xml , if you want to have raining cows, you might want to open meteor.xml , its all up to you, I'll give you an example so you can work with it.

Editing - Ragnarok.xml(or whatever template you picked):
For the first example, we're going to use the change to monkeys god power, we will call it wrath of Cheezy Monkey ( ;) ) , open the file using notepad, the file should look like this:

<?xml version="1.0" encoding="UTF-8"?>

<power name="Ragnorok" type="swapunit" techname="Ragnorok">
<activetime>0.6</activetime>
<radius>20.0</radius>
<soundset type="StartSound" listenertype="AllExceptCaster">GodPowerStart</soundset>
<soundset type="StartSound" listenertype="IfOnScreenAll">RagnarokBirth</soundset>
<placement forceonmap="1">skip</placement>
<powerplayerrelation>player</powerplayerrelation>
<overallchance>1.0</overallchance>
<global></global>
<abstracttype swapto="Hero Ragnorok">AbstractVillager</abstracttype>
<swapdelay>0.5</swapdelay>
<sfx>Ragnorok SFX</sfx>
<swapselfonly></swapselfonly>
<icon>god power ragnarok icon</icon>
<usedicon>god power ragnarok icon done</usedicon>
</power>


Now I will explain what to do with each line:

<?xml version="1.0" encoding="UTF-8"?> - do not mind this line, it is the header of any XML document in AoM.

<power name="Ragnorok" type="swapunit" techname="Ragnorok"> -- The power name and the techname are very important, they will be explained latter, right now change the power name to "Monkey" same for the techname.

<activetime>0.6</activetime> - This is the time in which the God power will be active, if you had meteor for example, it would be the time meteors would continually fall.
<radius>20.0</radius> - This is the range in which the god power will take effect, not important for powers like Ragnarok since it affects the whole map.
<soundset type="StartSound" listenertype ="AllExceptCaster">GodPowerStart</soundset> <--"Soundset type ="StartSound" -this tells AoM to play this sound when the godpower starts, "listenertype= AllExceptCaster" - This tells AoM who will hear the sound, this for example, tells AoM to play the sound to All players, except the one who used the god power (you can replace it with "All" and all players will hear it).

<soundset type="StartSound" listenertype="IfOnScreenAll">RagnarokBirth</soundset> -- This tells the game to play this sound ("Ragnarokbirth") to everyone who has the godpower on the screen (example: if you have Meteor, you will only hear the meteors falling if you are on screen, watching it).

<powerplayerrelation>player</powerplayerrelation> -- This tells which player the god power effects, player = self, enemy = enemy, ally = friendlies.

<overallchance>1.0</overallchance> -- percentage that decides if the god power will work or not, 1.0 = 100% , just move the decimal 2 places to the right to see the percent ( example: .3 = 30% )

<global></global> -- tells the game that the whole map will be affected
<abstracttype swapto="Hero Ragnorok">AbstractVillager</abstracttype> -- This part tells which units will be affected on the god power, Abstract Villager means all villager types will be affected (Dwarfs, Norse Villager, Greek Villager...) you can use either the unit name or it's class (AbstractSoldier, AbstractBuilding, Throwing Axeman...), the "Hero Ragnarok" should be changed to whatever unit you are swaping the Abstract Villager(or whatever you pick) to it.

<swapdelay>0.5</swapdelay> -- time that will take to the change to be finished
<sfx>Ragnorok SFX</sfx>- the glowing effect on the unit while changing, you can remove this if you want.

<swapselfonly></swapselfonly> -- tells the game to change the units of this player only, no ally or enemy.
<icon>god power ragnarok icon</icon> -- the icon to be used for the god power.


Save the file and copy the .xml file into the godpowers folder, open AoM and an error box will pop up, it's ok, click it and continue, test your god power on the scenario editor (the error will have blocked any other god power from being used) test your god power, see if you like it and if you do, do the below:

Adding the Power to a god:

Editing the TechTree.xml file:

Open you techtree.xml file, search for Ragnavok tech, copy it and paste it to the botton of the document. It should look like this:
<tech name="Ragnorok" type="Power">
<dbid>536</dbid>
<displaynameid>11757</displaynameid>
<researchpoints>0.1000</researchpoints>
<status>OBTAINABLE</status>
<icon>God Power Ragnarok icon</icon>
<rollovertextid>11759</rollovertextid>
<prereqs>
<techstatus status="Active">Age 4 Baldr</techstatus>
</prereqs>
</tech>
Change the tech name to Monkey(whatever name(Techname) you put in the god power XML), then the dbid to 537(since the last tech on AoM is 536).

<displaynameid>11757</displaynameid> -- edit this if u have Vachu's text editor and want to create a custom name for the tech, if not , leave it alone.

<prereqs><techstatus status="Active">Age 4 Baldr</techstatus></prereqs> -- Change this to whatever research will be required to be researched before using the power, if you want Skadi to have the power, then put "Age 3 Skadi", the techtree.xml should contain all the gods names, so look around.

Editing- Inserting the god power into the god:
Inside your previous made god, there should be a a few lines like these ( these are Skadi's):

<effects>
<effect type="TextOutput">11333</effect>
<effect all="true" type="TextOutput">11334</effect>
<effect type="Sound">researchComplete1.wav</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Frost Giant</target>
</effect>
<effect type="TechStatus" status="active">Age 3</effect>
<effect type="TechStatus" status="unobtainable">Age 3 Bragi</effect>
<effect type="TechStatus" status="unobtainable">Age 3 Njord</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Hill Fort</target>
</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Portable Ram</target>
</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Huskarl</target>
</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Jarl</target>
</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Market</target>
</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Caravan Norse</target>
</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Ramming Ship Norse</target>
</effect>
<effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
<target type="ProtoUnit">Siege Ship Norse</target>
</effect>
<effect type="Data" amount="-1.00" subtype="AllowedAge" relativity="Absolute">
<target type="ProtoUnit">Frost Giant</target>
</effect>
<effect tech="Frost" type="Data" amount="1.00" subtype="GrantedTech" relativity="Absolute">
<target type="Player"></target>
</effect>


Note the last effect : <effect tech="Frost" type="Data" amount="1.00" subtype="GrantedTech" relativity="Absolute"><target type="Player"></target></effect> -- This grants Skadi her god power, Frost, we want her to have the Monkey power, remember back on the god power edit we changed power name? Well, in here you put whatever god name you put there, in this case, Monkey.

Converting the XML:
You should probably have gotten a XMB file in your godpowers folder after testing the power out, delete that file (no use for it) and go on AoMED, click on "direct conversion" button, and select our Monkey.xml power, convert it to XMB and put it in your /godpowers folder, this time, delete the .xml from there.

Finishing up- Now save your techtree.xml and put it in your /data folder, and you are done, try the power out!

Back to the Modding Section