Detecting DLC in XML-only mod?

Started by Napoleonite, April 08, 2020, 03:52:28 AM

Previous topic - Next topic

Napoleonite

I have this in my XML:
<ThingDef ParentName="ApparelArmorHelmetCataphractBase">
...
</ThingDef>

It uses a parent XML-node from the Royalty DLC. However, players w/o the DLC installed get an error: XML error: Could not find parent node named "ApparelArmorHelmetCataphractBase" for node "ThingDef".

Is there an option somehow to add a conditional or do I have to put everything that uses Royalty code inside HUGE xpatches like this:
<Operation Class="PatchOperationFindMod">
<mods>
<li>Royalty</li>
</mods>
<match Class="PatchOperationAdd">
<xpath>check forsome Royalty node here?</xpath>
<value>
Okay so DLC is installed. Dump DLC-related items all here? That would be so messy!
</value>
</match>
</Operation>


There's probably some simple XML element or attribute that I'm missing to only execute it if the DLC is installed?

Canute

I am not a modder, but royality is just another mod.
So you just need to do a patch operation based on that mod.
How these patch operation looks like, you could check from other mods that did patches.