RimWorld

RimWorld

4,242 ratings
XML Extensions
6
5
5
4
2
2
28
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.2, 1.3, 1.4, 1.5, 1.6
File Size
Posted
Updated
971.301 KB
Aug 13, 2021 @ 6:55pm
Jun 17 @ 8:35pm
165 Change Notes ( view )

Subscribe to download
XML Extensions

In 1 collection by Imranfish
Imranfish's Mods
6 items
Description
Read the wiki at the GitHub page[github.com] to learn more.

Note: Steam keeps taking down my GitHub links, you can simply Google "XML Extensions GitHub" directly instead

Read the change notes for the latest news.

XML Extensions is a framework and modding tool that is focused on extending the general functionality of XML mods. This framework adds many more patch operations and allows for the easy creation of mod settings in XML.

More Patch Operations
XML Extensions includes many new patch operations for modders to use. These operations are much more powerful and dynamic, and allow you to basically do programming in XML; you have access to if-statements, for-loops, mathematical operations, etc.

Create Mod Settings in XML
With XML Extensions, you can easily create mod settings for your mod, all in XML! You may use these settings to toggle patch operations, change values within your patch operations, or use them in C# to do anything else.

Enhanced Error Reporting for XML Errors
With XML Extensions active, all XML patch errors will now generate a stack trace. This means that you can figure out exactly which patch failed, and in some cases, it will even tell you what part of the patch failed. All you need to do is have XML Extensions activated in your modlist while testing your mod.

Here is an example of a trace for a broken patch (you can easily figure out the error is that the letter "N" should be capital in defName):



The vanilla error message for the exact same patch (only reports the parent patch, not the one that actually failed; no clue as to what went wrong):



There is a standalone version of this feature as well.

How to Use
To use this mod as a user, just load this mod after core and the DLCs, but before all other mods that depend on it. As a modder, you need to mark this mod as a dependency in Steam Workshop, and include the dependency in your About.xml.

I am willing to take suggestions for improvements and additions to this framework, and will try to fix any bugs reported.

Join the discord! https://discord.gg/mrrEhHnSQy

Read the wiki at the GitHub page[github.com] to learn more.

Also check out XmlDocument Viewer for another helpful XML modding tool.
Popular Discussions View All (4)
104
Oct 11 @ 11:58am
PINNED: Bug Reports
Imranfish
12
Jul 23, 2025 @ 10:36am
PINNED: Suggestions
Imranfish
1
May 29, 2023 @ 12:21am
Getting these kind of errors along with Real Ruins
p20 hammerpoints
344 Comments
Sep 28 @ 9:58am 
Thank you so much for creating this mod, I just used this framework to add settings to my mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1211661009

Every single feature of my mod can now be toggled on/off! This makes me so happy.
Jul 14 @ 2:08am 
hi it might be worth asking on a unity forum too, since the game is unity, maybe there is (or can be) an xslt parser or something for it
Jul 14 @ 2:01am 
I tried this mod but I can't get it to work. Does anyone think it's possible to make .xslt mods work with this game?
Jul 11 @ 4:33pm 
I want to do many things like:
Calculate the nutrition of plants to make them more varied and realistic.
Multiply the speed of certain projectiles such as bullets so they're faster than arrows rather than being stupidly slower.
Calculate the armor penetration of projectiles based on damage and speed.
Calculate some stat changes based on personality in "/Defs/BackstoryDefs/".

I want to do many things in this game but I'm limited by the fact that what I want to do in a simple short .xslt page I have to make it hundreds of times bigger to patch or create a replacement def for every single individual item.

I wanted your opinion to hopefully educate me better on this. What capabilities does your mod have compared to .xslt and do you believe it's possible to ever use .xslt for RimWorld in the near future?
Jul 11 @ 4:32pm 
Yo bro.
https://steamcommunity.com/workshop/discussions/18446744073709551615/572668324079490585/?appid=294100
https://steamcommunity.com/sharedfiles/filedetails/comments/2221387317
I made this little discussion post before and also had a little conversation with @greenking2000 about .xslt in RimWorld.

So with my "Realistic Weapons Stats" mod for Bannerlord I used to play before I bought RimWorld this summer sale, I have in .xslt a variety of different mathematical calculations to calculate the weight and damage of weapons parts.

For RimWorld I want to mod it more but the most demoralising part of it is that RimWorld doesn't accept .xslt mods. So currently in a personal mod I'm working on I have a long ass list of dozens of files. And within them sometimes my .xml can become a long list because I'm pretty much doing the patch replacements/adds for every individual item rather than making a smaller .xslt .
Jul 4 @ 10:18am 
please add the option to hide vanguard from integrated implants
May 20 @ 6:10pm 
@Imranfish - Thanks for the answer!
Imranfish  [author]
May 20 @ 3:20pm 
@Gerewoatle
I do not know exactly, but if missile girl is actively maintained, then the only incompatibility is that after you change the settings for a mod that uses xml extensions, you need to remember to clear the missile girl Defs cache before those settings will apply.
That should be the only incompatibility since xml extensions adds new custom patch operations, but they interfere with the Defs cache added by those mods. So it should not be a hard incompatibility with missile girl.
May 20 @ 5:38am 
@Imranfish - Out of curiosity, do you know offhand if Missile Girl has similar incompatibilities to Rocketman?
Imranfish  [author]
May 20 @ 4:50am 
@Vandegrand
Unfortunately I do not see anything in the log that pinpoints the issue. You are running some incompatible or outdated mods, like rocketman and hugslib. hugslib is not maintained, and rocketman is for 1.5. rocketman also has some compatibility issues with xml extensions in general, since the optimizations it applies during the loading overrides xml extensions settings. Clearing the rocketman cache usually works. But the log itself was not enough to exactly determine the issue.

@Cinereous Monk
This mod does not even run any code until after all Defs are already loaded. Are you running other mods? if so, could you send your modlist so I can try to replicate? The release on github was outdated, so I have also uploaded the most recent version, and the version right before I made the changes.