MTS has all free content, all the time. Find out how YOU can help to keep it running. Tell me how...

Featured upload! XML Injector version 2

by scumbumbo Posted 24th Jan 2019 at 10:22 AM - Updated 27th Mar 2019 at 12:43 AM by scumbumbo : Version 2 Released (New Features)
190 Comments / replies (Who?) - 12 Feedback Posts, 3 Thanks Posts
This is a featured upload! It showcases the best talent and creativity available on MTS and in the community.
Version 2 Released
  • Contains new features which may be required by some mods.
  • Don't forget to remove version 1 when you upgrade!

Description

The XML Injector for The Sims 4 is a mod library to allow mods that would normally require a script for simple changes to instead use a custom snippet. The library provides the scripting, and the modder can release their mod without having to concern themselves with writing, compiling and maintaining a script. Currently the XML Injector snippet handles adding interactions to game objects in a variety
of ways with a simple XML definition.

Player Info

If you just play the game then you only need to download and install this library mod if another mod you download tells you that you must have this installed. On it's own this mod does nothing, it works in the background to make other modders able to code their mods more easily.

If another mod does inform you that this mod is required for it to work, then you should proceed to download and install this. You do not need to download the Modder's Documentation file, this contains the technical information for modders to reference.

Installation is simple. The file you download will contain two files, a script named XmlInjector_Script_v2.ts4script and XmlInjector_Test_v2.package.

Extract both of these files from the download file into your game Mods folder. You should install it directly into your Mods folder, and not a subfolder, in order to ensure that it can be easily located if you need to upgrade the script to a newer version.

The current version of the XML Injector is version 2, and denoted by the _v2 in the filenames. It has been written to work with the most recent game patch, 1.50.67 (February 21, 2019).

Once both files are installed, you must also ensure that script mods are enabled in your game options. This is very important as, though the XML Injector allows other mods to eliminate their scripts, the XML Injetor does the scripting for them and so script mods must be allowed in your game.

After installing the XML Injector, you should test to make sure it is working properly. The included test package adds several test interactions to several game objects. Choosing one of these "XML Injector Test" interactions from the pie menu should display a notification that the XML Injector is working properly. If you do not see these test interactions then the XML Injector is not installed properly and will not work for mods that depend on it.

The "XML Injector Test" test interactions can be selected from any of the following six locations in the game.
  • On a household's mailbox
  • Any of the game's computer objects
  • Clicking on any Sim
  • In the "Friendly" chat choices when clicking on another Sim
  • From a Sim on the relationship panel
  • From the "Household" phone category
There is not really any need to test more than one of these choices, any single one should suffice. The test is primarily in so many places in order to serve as a useful reference for modders to see how to code their own mods.

Once you have verified that the XML Injector is working, you may remove the XmlInjector_Test_v2.package file and test interactions will no longer appear on your pie menus.

The script file should remain in your Mods folder. If the script is removed, other mods which depend on it will no longer operate properly.

You should check back here occasionally, particularly a day or two after game updates if it stops working, to see if the mod has been updated with any important additions or fixes for new game patches. In the future, a mod you download may specify that it requires features from a version newer than the one you have installed, and again this is an important reason to keep the mod installed in the main Mods folder so it can always be located easily and the version number verified.

Modder Info

The primary purpose of this mod is to eliminate the need for modder's to write, compile and maintain their own scripts for the simple tasks of modifying the game's XML tunings (e.g. _super_affordances list). It currently supports:
  • Add interactions to game objects. The game objects can be selected by instance number, an existing interaction (e.g. sink_washHands), or a partial name search.
  • Add interactions to the Sim's object.
  • Add interactions to the relationship panel.
  • Add interactions to the phone panel.
  • Add interactions to AffordanceLists ("Friendly" mixers, etc.)
  • Version 2
    • Test that XML Injector v2 or higher is installed.
    • Test that that the installed version of XML Injector supports your mod.
    • Add loot actions to LootActions and RandomWeightLoot tunings.
    • Add buffs to traits.
    • Add name and object relationship components to game object tunings.
    • Add states and state_triggers to object tunings.

By offloading these tasks to a shared script, controlled by a simple XML snippet that you include in your mod package, this eliminates the need for you to include a script. In addition, if future game updates alter the method that these XML tunings must be modified in a script, this library will be promptly updated with any necessary fixes - and no changes will be required to your mod.

The majority of the documentation for the library is contained in the Modder's Documentation. This contains the following resources:
  • A PDF document with the technical details on creating an XmlInjector snippet tuning, including several examples.
  • The raw XML and STBL files contained in the test package.
  • A tuning description file for the XmlInjector snippet. If you use the TS4 Tuning Description Browser, you can place this file into your snippets folder where you have stored the EA TDesc files to view it within the browser.
  • The script source files for reference. At least one other script modder should acquaint themselves with the code (feel free to ask me any questions on how something works!) in the event that I am unable to update it myself for whatever unplanned and involuntary reason.

Once you've setup your mod to use an XmlInjector snippet, you should inform players who download your mod to obtain and install a copy of the XML Injector from this download page. Do not distribute the library with your own mod. This ensures that players have only one copy of the script installed, and that they can easily determine if they have the latest version installed and know where they can get the most recent updates if required.

The XML Injector can be extended to update other tunings. If you have any ideas, feel free to ask if they can be implemented. Ideal candidates for new features would be common tuning changes that would otherwise create the possibility of mod conflicts without a script. More complex or rare changes would not receive any priority for implementation as the mods that make those complex changes are likely to require a script for other reasons. The main goal is to allow other mods to be implemented and distributed without requiring their own scripts.

If you have any questions or run into technical difficulties, please post here on the mod library's discusion thread. In addition, some alternative methods of contacting me are given in the PDF documentation.

Thank you to all the modders who have tested, and given me ideas and encouragement for implementing this library snippet!

Thank you to Triplis for joining the development team and creating new features for future XML Injector versions!

You must have the expansion, game version or stuff packs listed below installed to use this custom content. Please see the post text for any exceptions.

Sims 4
Built with Game Version: 1.50.67
Key: - File was updated after upload was posted
Filename - Tip: You can click the magnifying glass to see the archive contents Size Downloads Date
XmlInjector_Modders_Documentation_v2.zip | Documentation for Modders

Size: 1.30 MB · Downloads: 29,969 · 27th Mar 2019
1.30 MB 29,969 27th Mar 2019
XmlInjector_v2.zip | XML Injector Version 2

Size: 13.0 KB · Downloads: 113,192 · 27th Mar 2019
13.0 KB 113,192 27th Mar 2019
Don't forget to Thank the creator after downloading! Use the Thanks button located above the screenshots above.
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.
Read the upload description for installation instructions. If nothing else is specified, do the following:
2. Extract: Use WinRAR (Windows) to extract the .package file(s) (if included, ts4script as well) from the .rar or .zip file(s).
3. Cut and paste the .package file(s) (if included, ts4script as well) into your Mods folder
  • 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\

Need more information?
  • Anyone can use both .rar and .zip files easily! On Windows, use WinRAR.
  • If you don't have a Mods folder, just make one.
  • Mod still not working? Make sure you have script mods enabled
 
190 Comments / Replies (Who?) - 123 Feedback Posts, 52 Thanks Posts
Hide Thanks Posts for this thread (Show only feedback)
Page 8 of 8
Test Subject
DELETED POST
5th Feb 2020 at 9:48 PM
This message has been deleted by Starshinedraws.
Lab Assistant
#176 Old 7th Feb 2020 at 9:58 PM
Default So sad miss him never meet even
Quote:
Originally Posted by Krud
Hi, Heidi. I can appreciate your skepticism, and don't blame you if you continue to doubt, but this is an unfortunate side effect of anonymous usernames online. I knew him in real life, and you're right, he would go quiet for long periods, which is why it was so long before I had even thought to investigate further. But I also know his real life name, and the city he was living in, and I read his obituary, and comments/tributes from his relatives. If I thought it would help to share it here, I would consider doing so. But you would still have no way of knowing that the man I knew by both his real name and as scumbumbo was in fact him. Though if you did know him in real life, his obituary is still available online. Otherwise it's not my place to link real-world personal data to online accounts. Again, the only reason I said anything is because I saw how much he meant to this community and I thought people might want some degree of closure. You are well within your rights to refuse.

Please krud, send his family a hug from players here, that miss him so much.
Lab Assistant
#177 Old 11th Feb 2020 at 5:35 AM
Oh my, that makes me so sad! I gave praise on one of his mods, and his reply really stuck with me. He was friendly, helpful, and witty. May he rest in peace.
Field Researcher
#178 Old 15th Feb 2020 at 12:16 AM
The news of scumbumbo's passing breaks my heart. He's always been one of the anchors in the modding community and I have missed him. RIP and blessed be, scumbumbo.

You can never have too much yarn, fabric, or books.
Test Subject
#179 Old 21st Feb 2020 at 3:33 PM
Quote:
Originally Posted by Valdesca
Please krud, send his family a hug from players here, that miss him so much.

Yes, please. His genius gifts are all over my game. I wish I could thank him enough.
Test Subject
#180 Old 29th Feb 2020 at 1:52 AM
For those of you still questioning his death here is a link to his obit. He passed away at a WHO concert on 05/23/19.
RIP Rich https://www.baue.com/obit/richard-gade/
Test Subject
#181 Old 17th Mar 2020 at 7:00 PM
Are there any known mods or issues that would prevent the injector from working ? I feel like I’ve been installing it correctly,it isn’t hard. But it isn’t working for me .
Test Subject
#182 Old 18th Mar 2020 at 6:22 PM
Can someone help me installing this? i downloaded the version of Triplis but whenever i run the gamt it doesn't show up. i use it for my 'paint by reference'' app. I have places it in my Mods folder and when i run the game i see that they have been installed.
Test Subject
#183 Old 28th Mar 2020 at 1:35 AM
Here is a link to the updated version (Feb. 2, 2020) by Triplis

https://scumbumbomods.com/#/xml-injector/
Test Subject
#184 Old 28th Mar 2020 at 1:40 AM
Quote:
Originally Posted by zLauraa
Can someone help me installing this? i downloaded the version of Triplis but whenever i run the gamt it doesn't show up. i use it for my 'paint by reference'' app. I have places it in my Mods folder and when i run the game i see that they have been installed.


From the link in my previous comment:

Installation is simple. The file you download will contain two files, a script named XmlInjector_Script_v2.ts4script and XmlInjector_Test_v2.package.

Extract both of these files from the download file into your game Mods folder. You should install it directly into your Mods folder, and not a subfolder, in order to ensure that it can be easily located if you need to upgrade the script to a newer version.

The current version of the XML Injector is version 2, and denoted by the _v2 in the filenames. It has been written to work with the most recent game patch, 1.50.67 (February 21, 2019).

Once both files are installed, you must also ensure that script mods are enabled in your game options. This is very important as, though the XML Injector allows other mods to eliminate their scripts, the XML Injector does the scripting for them and so script mods must be allowed in your game.

After installing the XML Injector, you should test to make sure it is working properly. The included test package adds several test interactions to several game objects. Choosing one of these "XML Injector Test" interactions from the pie menu should display a notification that the XML Injector is working properly. If you do not see these test interactions then the XML Injector is not installed properly and will not work for mods that depend on it.

The "XML Injector Test" test interactions can be selected from any of the following six locations in the game.

On a household's mailbox

Any of the game's computer objects

Clicking on any Sim

In the "Friendly" chat choices when clicking on another Sim

From a Sim on the relationship panel

From the "Household" phone category

There is not really any need to test more than one of these choices, any single one should suffice. The test is primarily in so many places in order to serve as a useful reference for modders to see how to code their own mods.

Once you have verified that the XML Injector is working, you may remove the XmlInjector_Test_v2.package file and test interactions will no longer appear on your pie menus.

The script file should remain in your Mods folder. If the script is removed, other mods which depend on it will no longer operate properly.

You should check back here occasionally, particularly a day or two after game updates if it stops working, to see if the mod has been updated with any important additions or fixes for new game patches. In the future, a mod you download may specify that it requires features from a version newer than the one you have installed, and again this is an important reason to keep the mod installed in the main Mods folder so it can always be located easily and the version number verified.
Test Subject
THANKS POST
#185 Old 9th Jun 2020 at 12:30 AM
I don't know what this is but my game says a mod requires this and i don't understand whats going on.
Mad Poster
#186 Old 9th Jun 2020 at 1:43 AM
Quote:
Originally Posted by jamjamputty
I don't know what this is but my game says a mod requires this and i don't understand whats going on.

It's a file that allows other mods to work without having to have completely new scripts which makes it easier for other creators to make certain mods.
The best place to get the latest version though is from here> https://scumbumbomods.com/#/xml-injector/ since scumbumbo has sadly passed away and the injector is now being maintained by Triplis.
You only need the file that ends in .ts4script
The test package is only needed to check if you have it set up correctly.

My deviantART, MTS Yearbook Origin ID = Alistu
Test Subject
#187 Old 27th Jul 2020 at 3:08 PM
Default oh
Quote:
Originally Posted by Mendota
Thank you for coming to the rescue! I very much appreciate it. On another note... I hope Scumbumbo is alright.

i thought he pased away sadly
Test Subject
#188 Old 8th Aug 2020 at 2:48 PM
I downloaded the mod from the official site, but it doesn't work. Did everything as explained, but the test package doesn't do what it's supposed to do and the mods I need it for also don't work. There's nothing that explains what to do in that case, can anybody help?
Test Subject
THANKS POST
#189 Old 7th Sep 2020 at 5:17 PM
v3 is available on the official website: https://scumbumbomods.com/xml-injector

I'm not having any issues with it, apart from one of my custom spells not appearing as obtained in the spellbook (although I can cast it). The modder of that spell confirmed XML Injector is most likely to blame. Still, I have no other issues and all the tests say they are completed successfully, so I guess v3 is where it's at for now. Hope that helps!
Test Subject
THANKS POST
#190 Old 27th Oct 2020 at 11:06 PM
thanks
Page 8 of 8