边缘世界 RimWorld

边缘世界 RimWorld

Insect Caravan Pack & Graze
Kasa 9 月 16 日 上午 7:36
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>
< >
正在显示第 1 - 2 条,共 2 条留言
kurogiko  [开发者] 9 月 16 日 下午 10:07 
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 9 月 17 日 上午 2:48 
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.
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50