PDA

View Full Version : XML Tuning How-To


plasticbox
9th Oct 2014, 3:32 PM
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 (http://forums.thesims.com/en_US/discussion/779844/maxis-documentation); also check that thread for patch updates
The Maxis tuning descriptions (aka tdesc files); see this thread (http://forums.thesims.com/en_US/discussion/858947/maxis-info-index) 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++ (https://notepad-plus-plus.org/) is a common one that is free (both as in beer and in software) and has an XML Tools plugin
scumbumbo's XML Extractor (http://modthesims.info/download.php?t=563256), 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 (https://github.com/s4ptacle/Sims4Tools/releases) to put your finished mod into a package


Other useful tools/tutorials:



scumbumbo's tdesc Browser (http://modthesims.info/showthread.php?t=555233) (if you want) for easier reading of the tdesc files
XML Compare (http://modthesims.info/download.php?t=570775) can also be useful to compare XML tuning between patch versions
D3OI — Debug Display and Dump Object Information (http://modthesims.info/showthread.php?t=549155) (scumbumbo) -- can be useful for debugging purposes
Here is a tutorial (http://modthesims.info/showthread.php?t=573047) on how to find Maxis string or object IDs; you might sometimes need to know this for tuning mods. Requires s4pe or D3OI (see above).
Here is a tutorial (http://modthesims.info/showthread.php?t=573055) on how to put custom strings in your package (s4pe); you could use STBL Editor (http://modthesims.info/download.php?t=564576) (Deaderpool) to translate/manage them


--

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 (http://modthesims.info/showpost.php?p=4732780) 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 (http://www.modthesims.info/showthread.php?t=531876) 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.

Gardan
9th Oct 2014, 6:49 PM
Step 5 (I'm doing an override):
When I import the XML file (created with Sims 4 Tuning Tool (http://modthesims.info/showthread.php?t=537509) ) should S4PE recognize the values for Type/Group/Instance? Because for me it does not. Must I then use the Hasher tool to get those values?

plasticbox
9th Oct 2014, 7:03 PM
The file needs to conform to the S4PE naming convention in order for it to be recognised automatically. That's an option you can check when exporting with the XMLExtractor (S4_{TYPE}_{GROUP}_{INSTANCE}.xml, e.g. S4_E882D22F_00000000_0000000000009B92.xml). I don't know what TuningTool does with the naming (if anything).

KeyEnPeyDee
25th Apr 2015, 7:46 AM
Anyone make a video of it? I really don't understand it. :)

Tiger3018
12th Jul 2016, 5:42 PM
It's helpful.Thanks a lot.
A question:How can I open the file(OBJD 0xC0DB5AE7) to edit the object tuning?