XML Extractor for The Sims 4
SCREENSHOTS
Downloaded 32,630 times
502 Thanks
158 Favourited
112,290 Views
Say Thanks!
Thanked!
February 06, 2020 - Scumbumbo has passed on but his work and memories are still being kept alive by many of those whose lives he has touched. To download fixes for his mods, please check https://scumbumbomods.com/ and please direct any questions or concerns to the discord channel linked there.
Picked Upload!
This is a picked upload! It showcases some of the best talent and creativity available on MTS and in the community.
Author scumbumbo
Uploaded: 28th Aug 2015 at 7:15 AM
Updated: 8th Dec 2018 at 1:51 AM - Version 3.6.2 - December 7, 2018
Updated: 8th Dec 2018 at 1:51 AM - Version 3.6.2 - December 7, 2018
Update 12/07/2018 - Version 3.6.2
Update 09/30/2018 - Version 3.6.1
Update 09/02/2018 - Version 3.5.8
Update 06/20/2018 - Version 3.5.6
If you have an archive of old XML in folders by date as I do AND you have Cygwin bash available, you can open a bash window to your archive folder and fix all the archived filenames using something like this (you may need to change the number of wildcard stars - and this will not work if you have any spaces in your folder names):
Update 11/08/2017 - Version 3.5.3 includes a few bug fixes. Full details below, but basically support is added for up to SP20 and ASM/JAZZ resources end up in the proper folders on a full extract.
Minor Update 02/24/2016 - Version 3.5.2 restricts the search results in the file finder to 1000 results to keep the Windows dialog from getting bogged down. Since I've heard no negative reports of issues with the threading in newer versions, 3.4.2 is being removed.
Version 3.5.1 has an option to extract the ASM/JAZZ (type 0x02D5DF13 resources) XML from the game packages. These are placed in the AsmJazz subfolders of a game pack's extract. Note that many of the game pack deltas don't have any of these resources, so if you don't own that game pack only those which have been changed by a game patch and thus are present in the delta can be extracted.
ASM/JAZZ extracted from a single package will have no white space, similar to the output from the process previously posted by Plasticbox. When performing a full extract, the XML is reformatted nicely with line breaks and indentation.
Version 3.5.0 is available which adds major improvements to speed when performing a full extract by using RAM instead of temporary files, and allowing game packs to be processed in parallel using multiple threads. Selecting the maximum number of simultaneous threads to use is easily selectable in a combobox, it defaults to 1/2 of your available "logical CPUs" which typically will mean one thread per CPU core. Running more threads than suggested typically will not gain significant speed increases (only a second, two or three in my testing).
On a relatively fast quad-core machine with 16 GB of RAM, my time to perform an extract was reduced from an average of 3 minutes 10 seconds, to 1 minute 8 seconds! If my math is right, that's a 65% improvement in speed!
Note - this may actually be slower for machines with low RAM, even if you select only to run an extract with only a single thread. The old version will continue to be available until it is known how the new version performs on machines with less than 4GB of RAM. Anyone with four or less gigs of RAM please let me know how well it performs for you!
Description
This is a utility program to extract the game's XML files for use in creating mods. XML can be extracted from the installed game packages or a single combined tuning file. The program can also easily be used to extract a single binary tuning file from the game packages and convert that to a combined XML tuning file.
The program is designed to perform these functions quickly by only loading those parts of the game packages that are required for producing the XML and looking ahead to quickly build required lookup tables.
When extracting the XML in Full Automatic mode (the recommended and default mode) the game's strings and references to other XML resource names can be included in comments. This feature is not available when working with a single combined tuning file. If you have multiple game language packages installed, you can select which language you want the XML comments to use.
Also in Full Automatic, the program can optionally output three tab delimited text files with all strings and XML resource names. The two reference files are suitable for opening in a spreadsheet package for easy searching, and the XML File Index can be loaded into the companion XML File Finder program to quickly locate files for viewing and editing.
There are three naming conventions available for the final XML files:
Requirements
The program requires Windows XP or higher with the .Net Framework 4.5.1.
The program requires access to an installed copy of the game in order to extract the XML from the packages. To work on a machine that does not have the game installed you would need to copy the required packages, binary or combined tuning files to the PC you need to work on. These files cannot be provided by the author for copyright reasons.
Basic Usage
File Finder Usage
In order to use the file finder, you must have extracted the full XML using the "Create XML File Index" option. This option is on by default.
If you installed using the MSI file, a hot key is registered with Windows to launch the File Finder application using the Ctrl-Alt-F keys. Note that this key sequence will not be active until Windows Explorer is restarted - the easiest way to do this is to logout and log back in after installing. You can change this key sequence if desired by editing the properties of the XML File Finder application in your Start menu.
The first time you launch the file finder, you will need to load an index file produced by the extractor. This file should be in the output folder of the XML extract in a text file called "XML File Index". Since the full path to the XML files is included inside the file index, if you move the XML files to another location on your hard drive you will have to recreate the index file using the extractor.
Once an index file is loaded, simply type the search terms you wish to look for in the Search For field. There is no need to hit Enter to search, if you pause typing for 1/2 second the search will being. You can continue typing to modify the search. Searches are not case sensitive.
So for instance, when looking for interactions dealing with the piano, you might start by typing "interaction". The program will find (currently) 7,720 matches, which is a bit much to look through, so add a space and type "piano" which yields 53 matches. You can keep adding terms until you find what you are looking for, so if you then added "pract" to the search terms you would see 6 matches.
The search can find files using portions of the TGI, so if you're looking for the 0x7B2E action (loot_Buff_Computer_HighScore_Typing) you could find this using the terms from the name, or by just typing "7b2e" (which also finds the interaction 0x17B2E).
The instance is also stored for searching in decimal form, so if you see the broadcaster type "129459" in an XML file which doesn't have comments, you can easily find that file by just typing "129459" into your search terms to find "broadcaster_Jealousy_ClubEncouraged".
Once you have a short enough list of files that you can find what you're looking for, you can simply right-click the file in the list to select either "Open in Windows Explorer" or "Open in XML Editor".
Version History
Additional Credits
- Updated pack names to add Get Famous
- Added option to use "Sims 4 Studio" style file naming for the extracted XML
Update 09/30/2018 - Version 3.6.1
- First, before the New Feature, just some Boring Enhancements
- Numbers in XML that are not references to other actual XML files should no longer be commented with an incorrect XML reference name. For instance, just having the number 100000 for a buff cooldown will no longer show that as being a reference to PaintingTexture_Sml_IMP_High_01. This is also true for references to OBJD or icon resources that do not have actual XML names.
- Old path information stored in the XML File Index is removed when loaded by the File Finder, so renaming or moving an extract folder will no longer make finding the actual files an irrelevant process.
- The new XML File Index no longer includes irrelevant path information. One minor side effect is that an XML File Index produced by this and future versions of the program will NOT be able to be loaded by an older version of the program.
- The decimal instance ID is now shown as a column in the File Finder.
- Some rare bugs were found and stomped.
- Feature for File Finder - Cross Reference Browser
- The full extract process now produces an additional index file (XML Cross Reference.dat) which contains a cross-reference of all game XML. This index is loaded automatically by the File Finder when it is available.
- Adds a Browse References selection to the right-click context menu in the file finder. Selecting this will open a cross-reference browser window with two lists. The left list shows all XML files which reference the current XML selection and the right list shows all XML files refered to by the current XML.
- This allows you to easily find every XML file which references a particular XML resource without resorting to manually searching all the XML files using another program.
- Click on an XML file in either of the reference lists to change the view to the chosen XML file.
- Right-click on an XML file in either of the reference lists to view a context menu with options to show the selected file in the search window, view the file in Windows Explorer, or copy or edit the selected file.
- If no cross-reference index file is available (for extracts generated by a previous version of the program) or if the right-clicked XML file in the search window does not have any references, the Browse References option will not be available.
- The screenshots above show a few images of the Browse References usage.
Update 09/02/2018 - Version 3.5.8
- Pretty minor update - just adds a clipboard monitor option to File Finder, but I find it quite useful (which of course is why I added it in the first place!)
- Monitors the clipboard and immediately pastes any copied text into the search field
- Option must be turned on in order function it is always off by default (you don't want the File Finder constantly searching for things when you're copying and pasting text).
- Useful for quickly finding another game file while editing one - while in your editor simply highlight the XML name, or instance ID number in the file you are editing, press Ctrl-C and File Finder will immediately start searching.
- For example, say you are editing the HaveBabyAtHospital interaction and you see the buff 27833, buff_Suppress_Visible_Motives referenced in it. Not sure what that does you want to take a quick look, simply highlight 27833 or buff_Suppress_Visible_Motives and press Ctrl-C, if the clipboard monitor is on File Finder will immediately search for it (no need to paste it into File Finder).
- Added an option to "normalize" the output order of n and t attributes in XML elements.
- Due to how the combined XML tuning is stored, sometimes between patches an XML element will have the n and t attributes switch from n-first to t-first, or vice-versa. This can be annoying.
- Default option is normalization off which is the old behavior of generating the attributes in the order EAxis has given them to us.
- If enabled you can choose either to always use n-first or t-first order.
- If using XML Compare to check changes between older XML releases this will result in a huge number of XML changes.
- Helpful Tip for those using XML Compare....
- Use the normalization off this one last time to check for changes between the previous patch's XML and this latest update.
- Once you have finished updating your mods, extract the XML again using the normalization ordering you prefer.
- In the future, all patches will compare accurately due to the enforcement of the normalized order, so once you start using it leave that option on!
Update 06/20/2018 - Version 3.5.6
- Name set on EP05 (Seasons)
- Right-clicking a file in the File Finder with multiple selections highlighted will no longer clear those selections
- Added names for newly released game and stuff packs to the extractor.
- File Finder
- Altered the index file loading process, it is now far faster on startup.
- Multiple lines of the search results can be selected using Ctrl and/or Shift keys.
- Double-clicking a selected search result will open the file in the XML editor, which previously required right-click and choosing from the menu.
- Added the ability to copy the selected search results to a folder from the right-click menu.
- If an XML file has been inadvertantly deleted but exists in the index it will be struckthrough
like soin the search results and will not be selectable.
If you have an archive of old XML in folders by date as I do AND you have Cygwin bash available, you can open a bash window to your archive folder and fix all the archived filenames using something like this (you may need to change the number of wildcard stars - and this will not work if you have any spaces in your folder names):
Code:
for ORIGINAL_FILE in */*/relbit/*; do mv $ORIGINAL_FILE ${ORIGINAL_FILE/07DFB83/0904DF10}; done
Update 11/08/2017 - Version 3.5.3 includes a few bug fixes. Full details below, but basically support is added for up to SP20 and ASM/JAZZ resources end up in the proper folders on a full extract.
Minor Update 02/24/2016 - Version 3.5.2 restricts the search results in the file finder to 1000 results to keep the Windows dialog from getting bogged down. Since I've heard no negative reports of issues with the threading in newer versions, 3.4.2 is being removed.
Version 3.5.1 has an option to extract the ASM/JAZZ (type 0x02D5DF13 resources) XML from the game packages. These are placed in the AsmJazz subfolders of a game pack's extract. Note that many of the game pack deltas don't have any of these resources, so if you don't own that game pack only those which have been changed by a game patch and thus are present in the delta can be extracted.
ASM/JAZZ extracted from a single package will have no white space, similar to the output from the process previously posted by Plasticbox. When performing a full extract, the XML is reformatted nicely with line breaks and indentation.
Version 3.5.0 is available which adds major improvements to speed when performing a full extract by using RAM instead of temporary files, and allowing game packs to be processed in parallel using multiple threads. Selecting the maximum number of simultaneous threads to use is easily selectable in a combobox, it defaults to 1/2 of your available "logical CPUs" which typically will mean one thread per CPU core. Running more threads than suggested typically will not gain significant speed increases (only a second, two or three in my testing).
On a relatively fast quad-core machine with 16 GB of RAM, my time to perform an extract was reduced from an average of 3 minutes 10 seconds, to 1 minute 8 seconds! If my math is right, that's a 65% improvement in speed!
Note - this may actually be slower for machines with low RAM, even if you select only to run an extract with only a single thread. The old version will continue to be available until it is known how the new version performs on machines with less than 4GB of RAM. Anyone with four or less gigs of RAM please let me know how well it performs for you!
Description
This is a utility program to extract the game's XML files for use in creating mods. XML can be extracted from the installed game packages or a single combined tuning file. The program can also easily be used to extract a single binary tuning file from the game packages and convert that to a combined XML tuning file.
The program is designed to perform these functions quickly by only loading those parts of the game packages that are required for producing the XML and looking ahead to quickly build required lookup tables.
When extracting the XML in Full Automatic mode (the recommended and default mode) the game's strings and references to other XML resource names can be included in comments. This feature is not available when working with a single combined tuning file. If you have multiple game language packages installed, you can select which language you want the XML comments to use.
Also in Full Automatic, the program can optionally output three tab delimited text files with all strings and XML resource names. The two reference files are suitable for opening in a spreadsheet package for easy searching, and the XML File Index can be loaded into the companion XML File Finder program to quickly locate files for viewing and editing.
There are three naming conventions available for the final XML files:
- Type, Group and Instance (TGI) for quick import into S4PE (e.g. S4_E882D22F_00000000_000000000001A2BC.xml)
- TGI plus resource name, formatted to automatically create a _KEY Name when imported in S4PE (e.g. S4_B61DE6B4_00000001_000000000001C8C5_object_drink_Cider.xml)
- Native TS4 naming format using the TGI (e.g. 0x00000000!0x00000000000029c3.0x2451c101)
- Or just the resource name
Requirements
The program requires Windows XP or higher with the .Net Framework 4.5.1.
The program requires access to an installed copy of the game in order to extract the XML from the packages. To work on a machine that does not have the game installed you would need to copy the required packages, binary or combined tuning files to the PC you need to work on. These files cannot be provided by the author for copyright reasons.
Basic Usage
- Launch the program. This step is important!
- Select the Full Automatic Extract mode. This should be selected by default.
- The program should automatically locate your Sims 4 install folder. If not, you can browse manually for it (this setting is saved when you exit the program).
- Choose the options for the extract. Again, these options will be saved for the next time you use the program.
- Under Output Options, select the Destination Folder for the XML files. You should create a new empty work folder for your first time. Subfolders will automatically be created for each game pack (see screenshot).
- By default, the program will ask you before overwriting any files. You can also choose automatic overwrite at this time, which is useful if you're performing a full extract overr an existing extract (to avoid being prompted billions and billions of times). If you forget, you can select to "Stop Asking Me" when the overwrite dialog appears.
- If you choose to rename existing files, any file will be automatically renamed with (Copy #) appended to that file rather than overwriting. You will be warned if you choose this option as it is very slow if doing a full extract over an existing extract (30,000+ files would need to be renamed).
- Click the Begin Extracting button and wait. The program only updates it's user interface once for every file, so for the long steps it may appear to hang. Just wait and it will move on. The entire extraction process should take less than 3 minutes on a fast PC. Including strings, XML references and the file index will take only a few extra seconds!
File Finder Usage
In order to use the file finder, you must have extracted the full XML using the "Create XML File Index" option. This option is on by default.
If you installed using the MSI file, a hot key is registered with Windows to launch the File Finder application using the Ctrl-Alt-F keys. Note that this key sequence will not be active until Windows Explorer is restarted - the easiest way to do this is to logout and log back in after installing. You can change this key sequence if desired by editing the properties of the XML File Finder application in your Start menu.
The first time you launch the file finder, you will need to load an index file produced by the extractor. This file should be in the output folder of the XML extract in a text file called "XML File Index". Since the full path to the XML files is included inside the file index, if you move the XML files to another location on your hard drive you will have to recreate the index file using the extractor.
Once an index file is loaded, simply type the search terms you wish to look for in the Search For field. There is no need to hit Enter to search, if you pause typing for 1/2 second the search will being. You can continue typing to modify the search. Searches are not case sensitive.
So for instance, when looking for interactions dealing with the piano, you might start by typing "interaction". The program will find (currently) 7,720 matches, which is a bit much to look through, so add a space and type "piano" which yields 53 matches. You can keep adding terms until you find what you are looking for, so if you then added "pract" to the search terms you would see 6 matches.
The search can find files using portions of the TGI, so if you're looking for the 0x7B2E action (loot_Buff_Computer_HighScore_Typing) you could find this using the terms from the name, or by just typing "7b2e" (which also finds the interaction 0x17B2E).
The instance is also stored for searching in decimal form, so if you see the broadcaster type "129459" in an XML file which doesn't have comments, you can easily find that file by just typing "129459" into your search terms to find "broadcaster_Jealousy_ClubEncouraged".
Once you have a short enough list of files that you can find what you're looking for, you can simply right-click the file in the list to select either "Open in Windows Explorer" or "Open in XML Editor".
Version History
- Version 3.3.1 - Initial release
- Version 3.3.2 (August 29, 2015)
- Added language choice for string comments if multiple language packages available.
- Added native XML naming convention
- Version 3.3.3 (January 14, 2016)
- Bugfix: Missing or invalid XML extracts will get placed into an error directory rather than crashing
- Bugfix: Empty XML attribute values will correctly generate an empty string on output
- Version 3.4.0 (January 17, 2016)
- XML Extractor can produce a file index when performing a full extract
- Added XML File Finder program to load file index and quickly search for XML files
- Version 3.4.1 (January 18, 2016)
- Bugfix: Warn if a game package contains no binary tuning instead of crashing.
- Version 3.4.2 (February 3, 2016)
- Option to group results in File Finder by resource type
- Results in File Finder are sorted by name
- The input focus in the File Finder defaults to the search terms input
- Version 3.5.0 (February 5, 2016)
- Uses RAM instead of temporary files for the conversion process.
- Can process each game pack in a separate thread to use multiple CPU cores.
- Maximum number of simultaneous threads is easily selectable.
- Added package name for SP05
- Version 3.5.1 (February 7, 2016)
- Option added to unpack ASM/JAZZ resources.
- Exiting the program during a full extract is now (a slight bit) cleaner.
- Version 3.5.2 (February 24, 2016)
- Limit file finder will only show 1000 matches to keep the Windows dialog from getting bogged down with too many entries in the listview box.
- Updated the two programs to use same version numbers, regardless of which program has changed, to keep versioning simpler.
- Version 3.5.3 (November 8, 2017)
- Name info for packs through GP05/EP04/SP13 are defined
- Support for up to SP20 (TGI group number 0x00000029)
- Core code will support group numbers up to 0x0000003F if future packs are created (only the XML resource in sources will need updating)
- AsmJazz resources are extracted to proper folders when a full extract is performed
- Version 3.5.4 (January 3, 2018)
- Fixes the resource type ID used for extracting relationship bit (relbit) resources.
- Version 3.5.5 (March 20, 2018)
- Name info for packs through GP06/EP04/SP14 are defined
- File Finder
- Improved index file load times substantially.
- Multiple search results selectable.
- Double-click a selected search result to launch XML editor.
- Copy to Folder feature added to right-click menu.
- Mark search results if the XML file has been deleted.
Additional Credits
- Velocitygrass for the original XML Extractor and source code.
- SimGuruModSquad for obtaining permission to share the game's PackedXmlDocument source code with me.
- Too many people to mention by name at Mod The Sims who have tested and given suggestions. But thanks to all of you, feel free to visually insert your name here!
- Caphyon Ltd. for the freeware Advanced Installer used to create the install file.
- Microsoft for the Visual Studio Express IDE for .Net.
MTS has all free content, all the time. Donate to help keep it running.
XML Extractor for The Sims 4 (MSI Installer).zip
| Installer for the XML Extractor
Download
Uploaded: 8th Dec 2018, 282.0 KB.
16,349 downloads.
|
||||||||
XML Extractor for The Sims 4 (EXE Only).zip
| The EXE files only if you dont want an installer
Download
Uploaded: 8th Dec 2018, 162.7 KB.
12,846 downloads.
|
||||||||
TS4 Combined XML Extractor (VS 2015 Source Code).zip
| Visual Basic source code for the project (v 3.6.2)
Download
Uploaded: 8th Dec 2018, 268.4 KB.
2,874 downloads.
|
||||||||
For a detailed look at individual files, see the Information tab. |
Install Instructions
Basic Download and Install Instructions:
1. Download: Click the File tab to see the download link. Click the link to save the .rar or .zip file(s) to your computer.
2. Extract: Use WinRAR (Windows) to extract the file(s) from the .rar or .zip file(s).
3. Cut and paste the file(s) into your Mods folder
Need more information?
- Windows XP: Documents and Settings\(Current User Account)\My Documents\Electronic Arts\The Sims 4\Mods\
- Windows Vista/7/8/8.1: Users\(Current User Account)\Documents\Electronic Arts\The Sims 4\Mods\
- Anyone can use both .rar and .zip files easily! On Windows, use WinRAR.
- If you don't have a Mods folder, just make one.
Packs Needed
None, this is Sims 4 base game compatible!
Other Information
Operating System:
– Windows
: Windows XP, Windows Vista, Windows 7, etc
Utility Type:
– Miscellaneous
: Tools which do not fit into the above categories.
Plugin Type:
– Not Applicable
: Standalone tools
Tags
#xml, #extract, #xml extractor