RimWorld

RimWorld

Insect Caravan Pack & Graze
Suggested code changes for patch
Replace:
<Operation Class="PatchOperationConditional">
<xpath>Defs/ThingDef[
defName="VFEI2_Megapede"
or defName="VFEI2_RoyalMegaspider"
or defName="VFEI2_Tankroach"
or defName="VFEI2_Ironclad"
or defName="VFEI2_RoyalSpelopede"
]/race/packAnimal</xpath>
<match Class="PatchOperationReplace">
<xpath>Defs/ThingDef[
defName="VFEI2_Megapede"
or defName="VFEI2_RoyalMegaspider"
or defName="VFEI2_Tankroach"
or defName="VFEI2_Ironclad"
or defName="VFEI2_RoyalSpelopede"
]/race/packAnimal</xpath>
<value>true</value>
</match>
<nomatch Class="PatchOperationAdd">
<xpath>Defs/ThingDef[
defName="VFEI2_Megapede"
or defName="VFEI2_RoyalMegaspider"
or defName="VFEI2_Tankroach"
or defName="VFEI2_Ironclad"
or defName="VFEI2_RoyalSpelopede"
]/race</xpath>
<value><packAnimal>true</packAnimal></value>
</nomatch>
</Operation>


With thisL



<Operation Class="PatchOperationFindMod">
<mods>
<li>Vanilla Factions Expanded - Insectoids</li>
</mods>
<match Class="PatchOperationSequence">
<operations>
<li Class="PatchOperationConditional">
<xpath>Defs/ThingDef[
defName="VFEI2_Megapede"
or defName="VFEI2_RoyalMegaspider"
or defName="VFEI2_Tankroach"
or defName="VFEI2_Ironclad"
or defName="VFEI2_RoyalSpelopede"
]/race/packAnimal</xpath>
<match Class="PatchOperationReplace">
<xpath>Defs/ThingDef[
defName="VFEI2_Megapede"
or defName="VFEI2_RoyalMegaspider"
or defName="VFEI2_Tankroach"
or defName="VFEI2_Ironclad"
or defName="VFEI2_RoyalSpelopede"
]/race/packAnimal</xpath>
<value>true</value>
</match>
<nomatch Class="PatchOperationAdd">
<xpath>Defs/ThingDef[
defName="VFEI2_Megapede"
or defName="VFEI2_RoyalMegaspider"
or defName="VFEI2_Tankroach"
or defName="VFEI2_Ironclad"
or defName="VFEI2_RoyalSpelopede"
]/race</xpath>
<value><packAnimal>true</packAnimal></value>
</nomatch>
</li>
</operations>
</match>
</Operation>
< >
Showing 1-2 of 2 comments
kurogiko  [developer] 16 Sep @ 10:07pm 
I haven’t gone home yet, so I haven’t tested it on the actual device, but this means that if VFE-i2 isn’t installed, the target can’t be found and an error will occur, right? Even so, I’d like to think that the operation itself probably still worked.
If that’s not what you meant, please let me know again. I’ll think it over tonight.
Kasa 17 Sep @ 2:48am 
Indeed, even if it doesn't find VFE-i2 is should still work, but it will give the user an error every time because it's trying to patch something that does not exist.

The code suggestion I provided will look for VFE-i2 first, and if does find it then apply the patch, else it skips trying to apply the patch and so does not throw an error.
< >
Showing 1-2 of 2 comments
Per page: 1530 50