Can't seem to get my patch working

Started by Maaxar, November 06, 2018, 10:10:44 PM

Previous topic - Next topic

Maaxar

Hello, I am trying to write a small patch (first time using xml patching).

The patch is supposed to add recipes from the VGP Garden Resources mod to the smelter from the Lord of the Rims mod.

This is what I have:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationTest">
<xpath>*/ThingDef[defName = "LotR_TableSmithy"]</xpath>
<success>Invert</success>
</li>
<li Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "LotR_TableSmithy"]/recipes</xpath>
<value>
<li>ExtractRawSteelLeaf</li>
<li>ExtractRawPlasteelLeaf</li>
<li>ExtractRawGoldLeaf</li>
<li>ExtractRawJadeLeaf</li>
<li>ExtractRawSilverLeaf</li>
<li>ExtractRawUraniumLeaf</li>
<li>ExtractBulkSteelLeaf</li>
<li>ExtractBulkPlasteelLeaf</li>
<li>ExtractbulkGoldLeaf</li>
<li>ExtractBulkRawJadeLeaf</li>
<li>ExtractBulkSilverLeaf</li>
<li>ExtractBulkUraniumLeaf</li>
</value>
</li>
</operations>
</Operation>
</Patch>


Everything loads okay, but when I get in the game the smelter does not have the recipes.

Am I missing something obvious?

Wildfire628

Set the <success> field value under the test operation to Normal
The way it's set now if it finds the defName "LotR_TableSmithy" it returns True and then the Invert value inverts the value to False causing it to register as a failed test thus ending your patch sequence.

N7Huntsman

I'd investigate what Wildfire said, seems like a good start. I'd also double-check that the smithy indeed has a <recipes> tag--it's possible the LotR_TableSmithy doesn't, and simply depends on a <recipeUsers> built into the recipeDefs to name it.
The Rim is a cruel place.