Patching sequence for core def. Some work, some don't, no errors.

Started by imtav, September 22, 2019, 04:35:00 PM

Previous topic - Next topic

imtav

I'm trying a patching sequence on a core def.  Some of the patches are working, others do not.  No errors raised.  In the below example, the first patch does not work, the second patch does, and the last one does not.

<li Class="PatchOperationAdd">
    <xpath>Defs/ThingDef[defname = "SmokeleafJoint"]/ingestible</xpath>
    <value>
    <tasteThought>IngestSmokeleafExample</tasteThought>
    </value>
</li>

<li Class="PatchOperationReplace">
    <xpath>Defs/ThingDef[defName = "SmokeleafJoint"]/ingestible/outcomeDoers/li[1]</xpath>
    <value>
<li Class="IngestionOutcomeDoer_GiveHediff">
        <hediffDef>Example_SmokeleafHigh</hediffDef>
        <severity>0.39</severity>
        <toleranceChemical>Example_Smokeleaf</toleranceChemical>
</li>
    </value>
</li>

<li Class="PatchOperationReplace">
<xpath>Defs/ThingDef[defName = "SmokeleafJoint"]/statBases/MarketValue</xpath>
<value>
<MarketValue>7.62</MarketValue>
</value>
</li>



As a test, I tried adding: <tasteThought>IngestSmokeleafExample</tasteThought> directly into the core file, and that works.  What's going on with my patching?  Thanks for any help!

Red192

In the first patch you mispelled the def name durign the declaration:

[defname = "SmokeleafJoint"]

instead of

[defName = "SmokeleafJoint"]


imtav

Wow!  I can't believe I didn't catch that.  Was staring at that code for hours yesterday trying to find the problem.  Thank you.

Red192

just for the first one thou... in the third one i can't see any problem