Ludeon Forums

RimWorld => Mods => Help => Topic started by: ExoticButts on May 03, 2018, 02:34:17 PM

Title: Adding entirely new defs using Xpath.
Post by: ExoticButts on May 03, 2018, 02:34:17 PM
As usual, my title says it all. How does one achieve this? Let's say I have my example code here;
https://pastebin.com/xGZmaEZU

Now, this is all placed after a bunch of code-that actually works-that adds segments to existing defs, which is all well and good, but only half of the versatility I need in this particular case.

Am I simply doing something wrong, or can you not add whole new defs (note, not Defs, their child nodes, such as ThingDef, RecipeDef, etc.) using xpath patching?
Title: Re: Adding entirely new defs using Xpath.
Post by: Karthas077 on July 07, 2018, 04:32:40 AM
You don't need to use XPath at all. Just create a new Def and specify ParentName="OtherModDefBase". Unless the mod author wrote some really specific C# code to look for hardcoded defNames, the inheritance should do all the work for you.