Any way to add new Def under certain conditions? Compatibility patch etc.

Started by LWM, July 03, 2019, 07:06:03 PM

Previous topic - Next topic

LWM

So I want to add some more defs to the game in my mod IF another mod is loaded.

Is there any better way to do it than doing a Patch:

<Patch>
  <Operation Class="does mod exist"><!-- names changed because I cannot remember them off the top of my head -->
    <match Class="PatchOperationAdd">
      <value>Other Mod Name</value>
      <xpath>/Defs</xpath>
      <value>
         <ThingDef>
          <defName>NewThingEtc</defName>
           <!--ETC-->


--LWM
(edited because I repeately didn't hit "Preview")


LWM

That is FANTASTIC.

If I petition Tynan to add this to vanilla, may they use your code?

--LWM