by Young Cunhambebe, messenger of the Tupi
The game works with 3 basic kinds of files:
<user>Kastor</user>
<age>15</age>
It’s also important to know that the game will read those files only once. Doesn’t matter if you’re using control+tab to mod the game while it’s open, it’s not going to work until you restart it. There are few exceptions, the following files can be changed while the game is open, and the effects will appear as soon you click control+tab again. They are:
I’ll use a different example this time, the turkey. Everyone with the xpack noticed that the old AoE3 peacock called “turkey” became a real turkey. But how? Did you know that you still have the old peacock? The new model and texture didn’t delete the old ones, but replaced them.
The game cannot delete anything because most files are found inside “zipped” packs, called .bar. They work exactly like Winrar compacted files. Each AoE3 folder has its .bar file. It’s not only used to turn over 1000 files into a single one, but also to make them load faster. Bar files are protected from newbie modders, thankfully. Since you cannot edit anything that’s inside them, you have to place something outside it, and that’s what TWC does: brings a new .bar file and its turkey model is loaded instead of old AoE3’s.
It’s told that file is found inside Art\units\animals\turkey\
What will it do?
If you look yourself, there are no folders with those names. So, the game will look inside Art’s .bar file:
Pay attention: No matter if the game opened art2.bar or not, it’ll still look for the same file, in the same folder. The file’s address doesn’t change!
It’s important that you notice something: game searched inside the real folder, then inside the .bar. If you ever wanted to replace a file, all you needed to do was putting a file with the correct name in the correct folder. It’ll be read before .bar, and you’ll see it in-game.
With the arrival of TWC, how is the turkey texture loaded?
As you see, TWC will look for that file in a folder; then, inside art4.bar. Then, inside art2.bar. It’s found first in art4, so that’s the image that’ll appear in game. I repeat: If you put a frog called “turkey.ddt” inside those folders that don’t exist (you’ll have to create), the little toad will be loaded instead of the usual texture.
Let’s talk about a more complex file, civs.xml. This will be an interesting experience. I’m considering a game with all patches installed.
It’s told that file is found inside Data\
What will it do?
When you download a patch, an extra .bar file appears: datap.bar or datapx.bar. Every time you see an “x” is because that’s the expansion. As you see, the game will look for it in the folder; then, inside dataPX.bar; then, inside data2.bar (comes with xpack); then, inside dataP.bar; finally, in data.bar. The patch .bars are found outside the data folder and they contain all kinds of files. So, even sharing the “data” name, they’re different than data.bar and data2.bar. If no .xmls are found, the game will look for its encrypted form, .xmb:
Whew, 4 files were found. What will the game do? Load the first one found. If you ever need to create your own civs.xml file, now you know that if you don’t put it in the correct folder (data) the game will directly look for it inside the .bars.
Why is the dataPX.bar read before the other files? It must be read before the others, otherwise the game will load an old version of it, thus, no patch effect. Correct? There’s an order of .bar opening. I’ll try to list them to you, including the possible .bars that will come with the next expansion, TAD. Remember that art.bar comes from modpacks only:
Game
Although it says data files are read before the art ones, you cannot have textures inside data folder. That’s because the game is hardcoded to look for textures inside the art folder. Also, you cannot have songs anywhere but inside the sound folder.
To finish my tutorial, how does a modded file behave?
Extra tips:
║ Lord Tahattus - Register yourselves at the WotTA forum!
║ WOTTA WEBSITE!
║ War of the Triple Alliance Beta!
║ Flags for new Civilizations, The Asian Dynasties, Knights and Barbarians and Napoleonic Era
║ TWC Tutorials: Basics of Modding - The List of Modding No-nos - Adding a Nation - Music and Sounds - Initilization Failed
WotTA back to active!
[This message has been edited by Lord Tahattus (edited 08-25-2007 @ 01:02 PM).]