Ludeon Forums

RimWorld => Mods => Help => Topic started by: imtav on September 22, 2019, 04:35:00 PM

Title: Patching sequence for core def. Some work, some don't, no errors.
Post by: imtav on September 22, 2019, 04:35:00 PM
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!
Title: Re: Patching sequence for core def. Some work, some don't, no errors.
Post by: Red192 on September 23, 2019, 06:32:00 AM
In the first patch you mispelled the def name durign the declaration:

[defname = "SmokeleafJoint"]

instead of

[defName = "SmokeleafJoint"]

Title: Re: Patching sequence for core def. Some work, some don't, no errors.
Post by: imtav on September 23, 2019, 01:03:47 PM
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.
Title: Re: Patching sequence for core def. Some work, some don't, no errors.
Post by: Red192 on September 24, 2019, 05:48:37 AM
just for the first one thou... in the third one i can't see any problem