Help patching out vanilla content.

Started by klun222, January 12, 2020, 02:25:35 PM

Previous topic - Next topic

klun222

Hey, I did this (3 code examples):

<li Class="PatchOperationRemove">
            <xpath>Defs/ResearchProjectDef[defName = "PlateArmor"]</xpath>
         </li>

<li Class="PatchOperationRemove">
            <xpath>ThingDef[defName = "Gun_PumpShotgun"]</xpath>
         </li>

<li Class="PatchOperationRemove">
            <xpath>ThingDef[defName = "Apparel_PowerArmor"]</xpath>
         </li>



So you see what kinds of things Im trying to patch out. So removing research works (it did remove successfully), but removing weapons and armor doesn't. Is there something wrong with my code?

Thanks.

hauvega

Do not forget the Defs/ part in xpath.

Work on mod
Break mod
Fix Mod
Break mod again

klun222


LWM

For what it's worth, "/Defs/" is better than just "Defs/"

I assume this is all part of a PatchOperationSequence?


<li Class="PatchOperationRemove">
            <xpath>/Defs/ThingDef[defName = "Gun_PumpShotgun"]</xpath>
         </li>


That code does look like it should work, if it is in a sequence thing?  What does your entire XML look like?

klun222

Yes, its a part of patch operation sequence, it should remove about 10 resserch and 15 weapons or apparel. In the same file, it removes resserch but not the other.

hauvega

I just tried with a single line patch file and it does remove a weapon. 

Work on mod
Break mod
Fix Mod
Break mod again

LWM

Quote from: klun222 on January 13, 2020, 07:00:13 AM
Yes, its a part of patch operation sequence, it should remove about 10 resserch and 15 weapons or apparel. In the same file, it removes resserch but not the other.

And your patch sequence isn't getting stopped by one of the earlier patches returning "fail"?


klun222

I dunno, it works now, seems the patch was too long maybe? I made 3 patch files and now they work.