Patch operation not doing anything

Started by Ruddygreat, March 02, 2020, 10:56:23 AM

Previous topic - Next topic

Ruddygreat

i'm trying to make a little patch mod that adds a recipe for the psychic amplifiers and silencers, but no matter what i try, the patch will return no errors but also do nothing, here's the code.
<Patch>
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationAdd">
<xpath>/Data/Royalty/Defs/HediffDefs/Hediffs_BodyParts_Archotech_EmpireRoyal/ThingDef[defName = "PsychicAmplifier"]</xpath>
<value>
<costlist>
<Plasteel>15</Plasteel>
<ComponentSpacer>4</ComponentSpacer>
<PsychicSoothePulser>1</PsychicSoothePulser>
<Luciferium>3</Luciferium>
</costlist>
</value>
</li>

<li Class="PatchOperationAdd">
<xpath>/Data/Royalty/Defs/HediffDefs/Hediffs_BodyParts_Archotech_EmpireRoyal/Thingdef[defName = "PsychicAmplifier"]</xpath>
<value>
<recipemaker>
<ResearchPrerequisites>RG_Psyamp</ResearchPrerequisites>
<Recipeusers>FabricationBench</Recipeusers>
<unfinishedThingDef>UnfinishedHealthItemBionic</unfinishedThingDef>
</recipemaker>
</value>
</li>
</operations>
</Operation>
</Patch>


LWM

Easy start: take out Success - Always, then you should get useful error messages!

If you don't, that's useful too.

Ruddygreat

ok so i did that and I started getting this error, the first patch appears to be going through, but the second patch doesn't
[Craftable psychics] Patch operation Verse.PatchOperationSequence(count=2, lastFailedOperation=Verse.PatchOperationInsert(/Defs/Thingdef[defName = "PsychicAmplifier"])) failed
file: C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\Craftable psychics\Patches\Patches.xml
Verse.Log:Error(String, Boolean)
Verse.PatchOperation:Complete(String)
Verse.PatchOperationSequence:Complete(String)
Verse.LoadedModManager:ClearCachedPatches()
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.<>c:<Start>b__6_1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.<>c:<UpdateCurrentAsynchronousEvent>b__27_0()
System.Threading.ThreadHelper:ThreadStart_Context(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object)
System.Threading.ThreadHelper:ThreadStart()

LWM

I don't yet have Royalty, but I would hazard a guess that it's ThingDef not Thingdef?

Ruddygreat

Oh man thank you so much, I dont think i'd have caught that on my own, but it's still not doing anything with that fix

LWM

As in, the recipe gets added but you don't see it?