You must be logged in to post messages.
Please login or register

Modding Discussions
Moderated by Alexastor, MosheLevi, Mister SCP

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: TWC Tutorial: How do I add a nation?
posted 06-04-07 10:38 PM EDT (US)   


How do I add a new civilization?
by Cuauhtemoc, lord of all Aztecs!




Cuauhtemoc says: Hello, mortals. This tutorial will teach you how to add your very own civilization. It's easy, easier than massing macehualtins. But STOP right now! You won't mod without these stuff:
  • Searched on Google and downloaded AoE3ED.
  • Got a trial version of Photoshop CS 3, at www.adobe.com
  • Read my List of Modding No-nos, that will tell you everything that you can't do when modding. Don't think higher than the Huitzilopochtli!

    Extract the Aoe3ED files. It's a .zip. Put them in a folder easy to find. You'll get two programs:



    Archive Viewer is used to open .bar files, compressed AoE3's files, just like a .zip or a .rar. File Converter is used to convert from AoE3 file types to Photoshop/Notepad readable files and vice-versa.

    Cuauhtemoc says: There are five file types that you must know, they are: .tga, .ddt, .xml, .xmb and .txt. TGA is an image, usually texture, that can be read and edited by Photoshop, but cannot be read by AoE3. It can be converted into a DDT by the File Converter. AoE3 reads DDTs. XMLs are the texts that contain all kinds of information, and we'll use them a lot when modding. It can be read by Notepad and AoE3. However, you won't find XMLs inside the .bar files, but XMBs, which are a compressed form of XMLs. They're smaller, but cannot be read by Notepad and must be converted into XMLs. TXTs are Notepad files, we may use them sometimes. AoE3 cannot read TXTs, so we need to convert them into XML. Easy task, just rename them:



    To convert a XML, XMB, TGA or DDT, you may open the File Converter and select the files or just drag them over the program's icon.

    Cuauhtemoc says: AoE3ED is a very powerful tool and extremely easy to use. It reads .xml, .xmb, .ddt, .tga, .txt and .wav files. Before opening any file, activate the preview function, so you'll be able to preview the file you're selecting. This will make things easier, you won't need to extract XMLs anymore, just copy texts directly from AoE3ED.



    The most important .bar files are:

  • data.bar and data2.bar, found inside the data folder. Data2 comes with TWC.
  • art1.bar, art2.bar, art3.bar and art4.bar, found inside the art folder. Art4 comes with TWC.
  • Sounds.bar and SoundXML.bar, found inside the sound folder.

    When modding, we'll always consider the main AoE3 folder, found inside Program Files\Microsoft Games\Age of Empires 3. So, don't make questions about the "My documents" folder or I'll play patolli with your head!

    Cuauhtemoc says: No more silly conversation. Cuauhtemoc will now teach you how to make your very own, very original American civilization. Open data.bar and extract a file called civs.xml. If it isn't there, that's because it's already extracted and you'll find it inside the data folder. Put the extracted file here. It's probably an unreadable XMB, convert it into a XML using... you are supposed to know! Well, now it can be read by Notepad. Your computer will say it cannot be read, so choose "notepad" in the list. You'll find this information:



    "Spanish" shows where the spanish information starts. You'll see it ends with a "/civ" tag. All tags, when opened, must be closed, or game will crash. This is how XMLs work. Notice that after this, the british information begins. See? So, what you'll do is to copy all the british information and then paste at the very end of the file, but before the "/civs" tag! And "civ" is different than "civs", pay attention! Both are different tags!

    Now that you have pasted this information, we can start working on our new civilization, the Americans!



    Change all orange-marked information from "British" into "Americans". "StatsID" from "BR" into "US". Open data.bar (I'm not gonna tell how... silly!), look for stringtable.xmb, extract it into the data folder. It may be already extracted, and It'll be known as stringtablex.xmb if you have the x-pack. Stringtable is a very important file, contains all "words" that will be read by the game. At the very end of the file, let's add two new strings:



    Add them, just like in the picture, before the "language" tag. 50000 and 50001 are numbers that Cuauhtemoc invented. You can choose your own. Once you did that, go to civs.xml and replace the strings marked blue in the picture with your strings. Now, your new nation will be known from string 22861 (British) to 50001 (Americans). Replace "Age0British" with "Age0Americans".

    Cuauhtemoc says: Your national code is almost finished. Start the game, create a British Homecity, close the game and open My documents\my games\Age of Empires 3\savegame\sp_London_homecity.xml - rename from "London" to "Washington". Open the file and change the following tags to match your new civ: defaultfilename (homecitybritish into homecityamericans), civ, name and heroname.

    Open data.bar (not gonna tell how...), find a file called homecitybritish.xmb. It's the file that tells the game what are the British cards, HC buildings and other information. Extract it, place it inside the data folder, rename it to homecityamericans, as shown in the savegame file. Convert it into a XML (I'll start skipping these hints) and open. Change the following tag to match your new civilization: civ. Don't change the rest - that's advanced modding that only Aztecs understand.

    Cuauhtemoc says: There's a really important task now. Open data.bar and look for techtree.xml. That file shows the techs of every civilization. Find the "Age0British" tag, copy it, paste it anywhere, and rename it to "Age0Americans". Save. Did you know that... your nation is now playable? Load AoE3, and you'll see Washington between the saved games. However, it shows a british flag. That's bad, separatists. Put your mouse over the british flag and it'll show "Americans". Good. Cuauhtemoc can't feel his fingers anymore, but let's go. Your units won't speak anything, and that's correct. They aren't supposed to, Cuauhtemoc hate Americans. But you want them saying something, don't you? They are mute because the units don't know your new civilization yet.

    Open SoundXML.bar found inside the sound folder. Type "hussar" in the search bar. You'll get just one file. Extract it into the sound folder. Open it and you'll notice there are references to all civs, with the exception of... yours. Copy and paste the British information, and rename the tags from [choice name="British"] to [choice name="Americans"]. Don't change "BritishLightCavalrySelect"! Silly boy! If you get the expansion, however, there are sets of truly american voices, which is very good! You can replace it with "SPCAmericanSelect". These are "soundsets", a group of sounds with the same name. Duplicate all the British references, rename them to American, save and test the American hussar. Is it ok? Fine, of course it is, silly snake. You'll have to do this little job with every single American unit: spies, explorers, settlers (a nightmare, in my opinion), caravels, war dogs... no, war dogs no.

    Cuauhtemoc says: Don't read this until you got all units speaking English. This part is tough and requires Photoshop. Any version of it is fine. The Aztecs are rich enough to afford PS CS3, but PS 6 is more than enough. Let's learn how the .ddt system works.

  • Art1.bar contains most XMBs related to buildings and units.
  • Art2.bar contains most DDT textures.
  • Art3.bar contains most DDT terrain textures.
  • Art4.bar contains all x-pack DDTs and XMBs.

    Open Art2, search for Art\objects\flags\british.ddt and you'll find the top-building British flag. Extract it. Take the shot and extract Art\objects\flags\ottomans.ddt. Let's make a test: rename the ottoman flag to "british". Put it in this folder:



    It's not a joke: If you put your British "ottoman" flag inside this folder (create it if needed), a folder with the same "path" as the file inside the Art2.bar, the game will read YOUR file, instead of the .bar one. Put your renamed ottoman flag there, start AoE3 and play as the british: Their flag look Ottoman now! This is the golden rule of file replacement. Extremely useful. This is the reason why you must put the sound XMLs inside the sound folder: the game will read yours instead of its. If you put it in a different folder, the game will simply ignore.

    File replacement: the "data.bar" file is a compressed form of the data folder. If you have two files with the same name, but one in data.bar and another in the folder, the game will read the one outside the .bar. If you want to replace a file, you won't replace anything in the data.bar file, but will put your modded file with the same name in the data folder. Simple?


    Let's stop the joke now. Rename the ottoman flag to "american", convert it to DDT, open it at Photoshop. Lord Tahattus has made a pack of American flags, found here. Open this image in PS. Well, guess what you're going to do... Just replace the ottoman flag with this sweet 24-star American one.

    Everytime you convert a DDT into a TGA, the name of the image will change from "file.ddt" to "file.(x,x,x,x).tga". These numbers are important for the conversion. Also, the image must not be bigger or smaller than normal - keep the same size. Don't change the size of the flag, snake! Save it (american.(x,x,x,x).tga), convert it into a DDT, place it in the same folder we've been putting flags for a while. Now, open civs.xml (remember?) and change the portrait and homecityflagtexture tags to match your flag. All you need to do is to rename from "British" to "american". If you put everything in the correct folder, the American flag WILL APPEAR! To edit the buttons, the system is the same. The button information is found inside data.bar, in a file called buttonsets.xml. Open it, and you'll understand how it works.

  • If the image was NOT changed, that's because you replaced the original image but didn't put the new file in the correct folder.
  • If it's appearing black (or white) it's because you have created a new flag but didn't put in the correct folder, or the image has problems (did you resize it?)

    Cuauhtemoc says: Silly snake, Cuauhtemoc says that your American nation is now finished. Change the post-game flags using the same knowledge shown above. Cuauhtemoc is proud of you, little jaguar kid.

    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 07-15-2007 @ 01:44 PM).]

  • Replies:
    posted 06-04-07 10:40 PM EDT (US)     1 / 13  
    I don't have time to read this, but I will... and fix it later. I'll post two more tutorials, "how to create an unit" and "other silly things" ^^' Good bye.

    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!
    posted 06-05-07 08:17 AM EDT (US)     2 / 13  
    Ummmmm what data does Data2.bar hold?

    'Cause it's not in my file

    AOEIII:The Reinforcements Mod

    "Check in your wallet,that's me on the dollar bill" - George Crushington
    posted 06-05-07 12:54 PM EDT (US)     3 / 13  
    data2.bar is for TWC owners only.

    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!
    posted 07-01-07 01:06 PM EDT (US)     4 / 13  
    My WarChiefs will not recognize my save files, but my AoE3 will. Is there any way to have both games accept the homecity savefiles? Thanks

    [This message has been edited by Essay (edited 07-01-2007 @ 01:26 PM).]

    posted 07-01-07 01:37 PM EDT (US)     5 / 13  
    You probably modded Aoe3 files (proto.xml, techtree.xml...) instead of TWC files (protox.xml, techtreex.xml)

    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!
    posted 07-02-07 04:45 AM EDT (US)     6 / 13  
    I always wondered why civsx.xml doesn't excist...


    peugeot407

    PS: Want to make a new set of buildings for your civilisation created with this tutorial? Look at my 'Tutorial: Cultures'

    |> Robert Faber (aka peugeot407)
    |> Humble Creator of: Knights and Barbarians, Danish Civ Mod, Several Tutorials and the Tutorial Database
    |> November 2007 Modding Contest: 2nd place (me: 360 pts, Captain_Soanso: 365 pts!)
    |> January 2008 Modding Contest: first place!

    When in doubt, flat out! (Colin McRae)
    posted 07-02-07 05:50 AM EDT (US)     7 / 13  
    Lol, you're disgusting peugeot407 :P

    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!
    posted 07-09-07 07:42 PM EDT (US)     8 / 13  
    Oh, yeah. Call me Silly Snake Cuauhtemoc, I earn it. I have tried everything to make a new flag but it simply doesn't work. Plus, when I want to elevate my new civ to Age1 the game crash. So, in short words...

    - Can you (or anybody) send me the Inca flags and buttoms in the DDT version, ready to use them? My mail is eljuma_1@hotmail.com

    - Can you say how I can make my civ advance to new ages after Discovery?

    Thanks in advance.
    posted 07-09-07 11:49 PM EDT (US)     9 / 13  
    When does the game crash? When you click the age-up button or after researching it? You should know that it's IMPOSSIBLE to recreate the TWC-5-politician screen, new civilizations MUST choose politicians like the europeans do.

    If your nation has the iro, sioux or aztec politicians, GAME WILL CRASH.

    I'll update the thread tomorrow, as you showed me, it's not that easy and i found a couple of mistakes.

    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 07-09-2007 @ 11:57 PM).]

    posted 07-10-07 04:25 AM EDT (US)     10 / 13  
    Right. The civ is modeled on the Aztecs (though I plan to change several things in the future, of course). It crashes when I press the "Advance to Age2" buttom.
    posted 07-15-07 02:01 PM EDT (US)     11 / 13  
    a little update.

    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!
    posted 07-20-07 08:42 AM EDT (US)     12 / 13  
    i think this tutorial is one of the easiest to understand, for guys people trying their first new civ. great work.

    how come it's labelled as TWC... the process is the same for vanilla, is it not?

    [This message has been edited by ShadowEden (edited 07-20-2007 @ 08:44 AM).]

    posted 07-23-07 00:13 AM EDT (US)     13 / 13  
    Yes. "TWC" are your instructors.

    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!
    Age of Empires III Heaven » Forums » Modding Discussions » TWC Tutorial: How do I add a nation?
    Top
    You must be logged in to post messages.
    Please login or register
    Hop to:    
    Age of Empires III Heaven | HeavenGames