(Beginner)Basics of XML - Forum
Main My profile Registration Log out Login
Welcome Guest | RSS
Saturday
2017-03-25
3:02 AM
World of Gamerz
[ New messages · Members · Forum rules · Search · RSS ]
Page 1 of 11
Forum moderator: MasterOfEagles 
Forum » Age of Empires 3 » Modding Tutorials » (Beginner)Basics of XML (You need to start from here in order to start modding AOE 3)
(Beginner)Basics of XML
MasterOfEaglesDate: Tuesday, 2009-11-10, 8:58 PM | Message # 1
Right Hand of God
Group: Administrators
Messages: 19
Awards: 0
Reputation: 25
Status: Offline
In this tutorial you will learn all the things you need about XML for modding Age of Emires 3.

Tools you need:
A text editor (Notepad for example)
Internet Explorer(Comes with windows)

Remember: AOE3 = Age of Empires 3

XML files contain main data of AOE3's game engine. All data about units,nations,user interface,texts, ect... can be found in .xml files.

XML files are somehow similar to HTML files beacuse they both use tags.A tag is started by <TagName> and ends with </TagName> There can be infinitive tags inside another one. Look an this example:
<Units>
<Unit>
<ID>1</ID>
<Name>Unit1</Name>
</Unit>
<Unit>
<ID>2</ID>
<Name>Unit2</Name>
</Unit>
</Units>
In first part of tags you can add extra information. Like this:
<Units>
<Unit id='1'>
<Name>Unit1</Name>
</Unit>
<Unit id='2'>
<Name>Unit2</Name>
</Unit>
</Units>
Remember this: Extra information you add must be like this: <TagName ExtraInfo='Something'>
There is a good way to check if your XML file is made correctly. Now we will make two XML files. One of them made correctly and the other one incorrectly.

1:Open your text editor.
2:Copy this XML code there.
<Units>
<Unit id='1'>
<Name>Unit1</Name>
<Hitpoint>100</Hitpoint>
<Damage>20</Damage>
</Unit>
<Unit id='2'>
<Name>Unit2</Name>
<Hitpoint>200</Hitpoint>
<Damage>30</Damage>
</Unit>
</Units>
3:Click save button. Click where says "Save as type" . Change the format to all files.
4: Name your file "Correct.xml"
5:Click Save
6: Now copy this one in your editor. We didn't put ending part of the tag for <Unit id='1'> tag. So XML file is incorrect.
<Units>
<Unit id='1'>
<Name>Unit1</Name>
<Hitpoint>100</Hitpoint>
<Damage>20</Damage>
<Unit id='2'>
<Name>Unit2</Name>
<Hitpoint>200</Hitpoint>
<Damage>30</Damage>
</Unit>
</Units>
7:Click Save as button.
8:Do what you have done in part 3
9: Name your file "Incorrect.xml"
10:Click Save
11:Now double click on your Correct.xml file. Internet Explorer will show concepts of XML file to you. This means your XML file is correct.
12:Double click on your Incorrect.xml file.
13:It will say:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
14:This means you made some mistakes during XML coding.

Extra
In AOE3 there are many .xml files containing all game data. Most of them can be found in data folder in AOE3's installation root. Here I will introduce some of them to you.

Proto.xml
Contians data for all units,buildings,plants,projectiles, ect....
Techtree.xml
Contains data for upgrades,nation units,homecity cards, ect...
Stringtable.xml
Contains all texts which are used in game exept history.(unit names,button texts,tooltips, ect...)
Civs.xml
This file must be extracted from data.bar. It contains data of nations which are in the game.(Brithish,Ottomans,Aztecs,Tupi,Malta ect...)

Hope this helps you.

 
DarkShadowSaintDate: Tuesday, 2009-11-10, 11:11 PM | Message # 2
Obliterator of the Gods
Group: Administrators
Messages: 73
Awards: 0
Reputation: 1337
Status: Offline
Very good job. I think you deserve a +25 rep for its completedness, length, and understandability. I will post this as a headline for a short while.
 
Forum » Age of Empires 3 » Modding Tutorials » (Beginner)Basics of XML (You need to start from here in order to start modding AOE 3)
Page 1 of 11
Search:


 Copyright MyCorp © 2017
Free website builderuCoz