(SOLVED)Help using PatchOperationAdd for comp customThingToEat

Started by Kuratheris, March 24, 2021, 08:39:19 PM

Previous topic - Next topic

Kuratheris

I'm trying to create a patch between my stone mod and Alpha Animals so that the CrystalMit will eat the stones from my mod, but the CrystalMit code is more than what I know how to patch.

This is the part of the Alpha Animals CrystalMit def I'm trying to add to:
<ThingDef ParentName="AnimalThingBase">
<defName>AA_CrystalMit</defName>

<comps>
<li Class="AlphaBehavioursAndEvents.CompProperties_EatWeirdFood">

<customThingToEat>

<li>ChunkSandstone</li>
<li>ChunkGranite</li>
<li>ChunkLimestone</li>
<li>ChunkSlate</li>
<li>ChunkMarble</li>
<li>GU_ChunkRoseQuartz</li>
<li>AB_ChunkCragstone</li>
<li>AB_ChunkObsidian</li>
<li>AB_ChunkMudstone</li>
<li>AB_ChunkSlimeStone</li>

</customThingToEat>
<nutrition>1</nutrition>
<digThingIfMapEmpty>false</digThingIfMapEmpty>
<fullyDestroyThing>false</fullyDestroyThing>
<percentageOfDestruction>0.1</percentageOfDestruction>

</li>

</comps>

Kopp

Try this:

<Operation Class="PatchOperationAdd">
   <xpath>/Defs/ThingDef[defName="AA_CrystalMit"]/comps/li[@Class = "AlphaBehavioursAndEvents.CompProperties_EatWeirdFood"]/customThingToEat</xpath>
   <value>
      <li>YourStone1Here</li>   
      <li>YourStone2Here</li>                  
   </value>
</<Operation >

Kuratheris

I've figured it out. Turns out my file wasn't an XML. lol.