Ludeon Forums

RimWorld => Mods => Help => Topic started by: Ruddygreat on March 02, 2020, 10:56:23 AM

Title: Patch operation not doing anything
Post by: Ruddygreat on March 02, 2020, 10:56:23 AM
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>

Title: Re: Patch operation not doing anything
Post by: LWM on March 02, 2020, 12:07:02 PM
Easy start: take out Success - Always, then you should get useful error messages!

If you don't, that's useful too.
Title: Re: Patch operation not doing anything
Post by: Ruddygreat on March 02, 2020, 03:15:41 PM
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()
Title: Re: Patch operation not doing anything
Post by: LWM on March 02, 2020, 11:44:22 PM
I don't yet have Royalty, but I would hazard a guess that it's ThingDef not Thingdef?
Title: Re: Patch operation not doing anything
Post by: Ruddygreat on March 03, 2020, 03:35:21 AM
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
Title: Re: Patch operation not doing anything
Post by: LWM on March 03, 2020, 01:56:23 PM
As in, the recipe gets added but you don't see it?
Title: Re: Patch operation not doing anything
Post by: Ruddygreat on March 04, 2020, 03:27:50 AM
probably?