RimWorld

RimWorld

3,457 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.104 KB
Aug 13, 2021 @ 6:55pm
Aug 22 @ 5:13pm
159 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
299 Comments
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!
Kaedys Aug 19 @ 10:03am 
You say stable enough, but there are a remarkable number of XML errors in that log. There are quite a few of those mods that are not working correctly.

The error you cited is from a file called Ritual_Behavoirs.xml, which is not a file in this mod. There is an error prior to that that references this mod, but it's just this mod reporting an issue with a PatchOperation from another mod, that being WVC Tweaks and Patches. And in fact, that exact error is literally the first comment reply on WVC Tweaks and Patches, incidentally.

And frankly, that's how nearly all errors that are attributed to this mod work: they aren't an error in this mod, they are an error in the mod that utilizes this one as a dependency.

Do you have a log from trying to generate a world where it's just this mod enabled?
Raitlor Aug 19 @ 8:45am 
I've run into something similar to what @fallengrace ran into with this mod. I confirmed it seems to be related to this mod only, as with XML Extensions, no factions will generate, removing it allows factions to spawn again.
I think it may be related to the following error I was seeing:
Exception loading def from file Ritual_Behaviors.xml: System.ArgumentException: Exception parsing Verse.IntRange from "-0.7" ---> System.FormatException: Input string was not in a correct format.
This led to the GravshipLaunch ritual missing and it caused a complete breakdown of the Ideology generator on my end, which broke faction generation.
That error was only showing up when I had XML Extensions enabled, removing it removed the error.
Below is my logs from when I was trying to diagnose my issue in case it helps (yes I know its a lot of mods, but it is stable enough for my purposes)
https://gist.github.com/HugsLibRecordKeeper/f5d5abf46545f2e90ef89fda377f5747
Kaedys Aug 18 @ 6:11pm 
Imranfish covered that a number of pages ago (Page 7, as of writing). It doesn't matter where it is loaded versus hugslib. Rimsort insisting it needs to be before hugslib is a community-added rule that someone somewhere decided needed to be a thing, since Rimsort uses community-added rules for its sorting.