#1
9th Oct 2014 at 3:32 PM
Last edited by justJones : 7th May 2018 at
12:13 AM.
Posts: 11,006
Thanks: 424884 in 1123 Posts
47 Achievements
XML Tuning How-To
Quick walkthrough of what you need to get started. This is not a tutorial on how to get a
specific thing done since what exactly you need to change is very different depending on what you want to do.
Reference/Documentation:
- The Maxis CC guide from here; also check that thread for patch updates
- The Maxis tuning descriptions (aka tdesc files); see this thread for the most recent version (they are updating them with every patch). These are XML, i.e. text files, that describe all of the tuning in exorbitant detail. Use as a reference whenever you're unsure how any of the EA tuning works.
Tools you will need:
- A sensible text editor; Notepad++ is a common one that is free (both as in beer and in software) and has an XML Tools plugin
- scumbumbo's XML Extractor, to extract the giant XML blob inside the game files into a handy directory of human-readable pieces (this is what I call "the XML folder" below)
- s4pe to put your finished mod into a package
Other useful tools/tutorials:
--
1. Depending on what you want to do, search for appropriate terms over the entire XML folder and also the tdesc folder. Like "cake" for changing the ingredients in a cake, for instance. (I usually search filenames first, and if that doesn't turn up anything useful, file contents. But the file names are often specific enough.)
2. Read the XML (it's not difficult to understand, it's just markup similar to HTML etc) to see where/what exactly the stuff you want to change might be. Also compare with files that already do what you want to achieve (like for changing/adding ingredients, take a peek at existing recipes that have ingredients to see how it's done). It's probably a good idea to do this with a text editor that can do syntax colouring.
References within the XML are often given as decimal value; these are the instance numbers of the resources it's referring to -- most often tuning; when objects are referenced with "definition" that means the instance ID of the actual object definition (OBJD), not the tuning. You can use Fogity's
ModdingToolbox or any online converter (google for "hex") to convert — the filenames/instances you see in s4pe are hexadecimal.
3. Save your edited XML somewhere; if what you're doing is a custom XML (not an override) refer to the EA CC guide for naming conventions (i.e. what type/group/instance it needs to have).
4. Import into a package with s4pe (File > New; Resource > Import > From File), put in your /Mods folder, test in game.
--
In some cases changes to the corresponding DATA file have to be made in addition to tuning the XML (specifically if there are fields in the tdesc marked as client_binary and/or server_binary). This is often the case when things have an UI component. You can use velocitygrass'
DATA file tool for that; look for the DATA with the same instance as the XML.
If you have questions abut your specific mod, please make a new thread in Modding Discussion and ask there. If any of the above is unclear, please ask here.
Stuff for
TS2 ·
TS3 ·
TS4 | Please do not PM me with technical questions – we have
Create forums for that.
In the kingdom of the blind, do as the Romans do.