RimWorld

RimWorld

3,522 ratings
XML Extensions
5
5
6
4
2
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.2, 1.3, 1.4, 1.5, 1.6
File Size
Posted
Updated
968.616 KB
Aug 13, 2021 @ 6:55pm
Sep 17 @ 8:52pm
162 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)
94
Aug 18 @ 1:13pm
PINNED: Bug Reports
Imranfish
12
Jul 23 @ 10:36am
PINNED: Suggestions
Imranfish
1
May 29, 2023 @ 12:21am
Getting these kind of errors along with Real Ruins
p20 hammerpoints
302 Comments
Shinzou Sep 15 @ 12:00am 
Thanks for the quick fix, seems to work, error disappeared :hawtdawgman:
Imranfish  [author] Sep 12 @ 4:21pm 
@Shinzou
Thank you for reporting this issue, I just uploaded a fix; let me know if it works.
Shinzou Sep 12 @ 1:09pm 
'ello there, getting one red error when loading with only error checker mods and Harmony: https://gist.github.com/HugsLibRecordKeeper/36aee4b2299943144956cd4a5f1a7e47
deadlieremu84 Aug 21 @ 9:07pm 
I will confirm this was not the problem. I do believe another mod update corrupted files. I just reinstalled everything with the same mod list and it worked fine.
Kaedys Aug 19 @ 2:12pm 
They could probably fix it by using either 0 instead of -1 for the ticks for childbirth, or by adding an xpath condition to exclude childbirth from the first patch. Glad you got the issue worked around in the mean time, though.
Raitlor Aug 19 @ 1:30pm 
It looks like its an XML only option. I loaded in, unticked the option, and reloaded Rimworld and it seems to have been solved at least for me.

It looks like the WVC author is aware of the problem and planning to rework that option entirely later.
Kaedys Aug 19 @ 12:57pm 
Based on looking at the patch defs in WVC, this is either occurring because of an overlapping patch that applies a 0.7 multiplier to all rituals, and then also overrides childbirth to -1 ticks. If the former is run again after the latter, the result is -0.7 ticks. The other alternative, though I'd have to go hunt through the C# code for the mode, is that you have that setting ticked on both the XML and C# tabs in the mod, so it is applying the XML version, and then applying the same thing in the C# code and effectively doing the above through a different mechanism. In the latter case, you should be able to correct it yourself by disabling the option on one of the two tabs (note: I've not installed or loaded the mod, I'm just going off the description here), in the former case, it's an error by the mod author.
Kaedys Aug 19 @ 12:48pm 
WVC Tweaks and Patches has an optional dependency on this mod. If you choose not to load this mod, only the C# patches in WVC are available. But if the XML patches are written incorrectly, which they appear to be, then including this mod would cause the issue, despite this mod not actually being the source of the issue, since including this mod activates that section of WVC.
Raitlor Aug 19 @ 11:03am 
Looks like it might be a known issue with their setting to reduce ritual times over there!
Raitlor Aug 19 @ 10:54am 
I mean stable in that everything seems to mostly work as intended and I do not run into gamebreaking issues.

I did just try and create a new world with just Rimworld, all DLC, Harmony, and XML Extensions, and it seems to be working fine. Sorry for accidentally thinking it was directly this mod causing issues!

I think it might actually be an issue between WVC Tweaks and Patches and XML Extensions, since I've been using *just* WVC Tweaks and Patches lately and had no issues, but every time I've tried adding back in XML Extensions, something goes awry with the GravshipLaunch ritual in RitualBehaviors.xml breaking everything else. I'll report this to the WVC author!