RimWorld

RimWorld

Toughness Skill
Possible bug with Toughness Skill Mod + Alpha Memes - Funeral Dreadnought
I ran into a NullReferenceException during a Funeral Dreadnought ritual—the pawn was supposed to be resurrected, but disappeared instead. The log pointed to CompToughnessCache.NotifyDowned. However, when I reloaded the same save and repeated the ritual, it worked fine with no error.

Error while applying ritual outcome effect: System.NullReferenceException: Object reference not set to an instance of an object
[Ref D5CA4357]
at ToughnessSkillMod.CompToughnessCache.NotifyDowned (System.Nullable`1[T] dinfo, Verse.Hediff hediff, Verse.Pawn pawn) [0x00105] in <36e47a2b861a4b9c857ba91e8048afae>:0
at ToughnessSkillMod.Patch_GainToughnessXP_OnDowned.Postfix (Verse.Pawn_HealthTracker __instance, System.Nullable`1[T] dinfo, Verse.Hediff hediff) [0x00024] in <36e47a2b861a4b9c857ba91e8048afae>:0
at Verse.Pawn_HealthTracker.MakeDowned (System.Nullable`1[T] dinfo, Verse.Hediff hediff) [0x00562] in <630e2863bc9a4a3493f2eff01e3a9556>:0
- PREFIX OskarPotocki.VanillaSocialInteractionsExpanded: Void VanillaSocialInteractionsExpanded.MakeDowned_Patch:Prefix(Pawn ___pawn, Nullable`1 dinfo, Hediff hediff)
- POSTFIX VFEEmpire.Mod: Void VFEEmpire.HarmonyPatches.Patch_StateChange:Postfix(PawnHealthState ___healthState, Pawn ___pawn)
- POSTFIX OskarPotocki.VFEMedieval: Void VFEMedieval.Pawn_HealthTracker_MakeDowned_Patch:Postfix(Pawn_HealthTracker __instance)
- POSTFIX com.alphagenes: Void AlphaGenes.AlphaGenes_Pawn_HealthTracker_MakeDowned_Patch:BreakSomeBones(Pawn ___pawn)
- POSTFIX alt4s.visitsettlements: Void VS_Pawn_Downed_Patch:Postfix(Pawn_HealthTracker __instance)
- POSTFIX GiddyUp: Void GiddyUp.Harmony.Patch_MakeDowned:Postfix(Pawn_HealthTracker __instance)
- POSTFIX com.yourname.ToughnessSkillMod: Void ToughnessSkillMod.Patch_GainToughnessXP_OnDowned:Postfix(Pawn_HealthTracker __instance, Nullable`1 dinfo, Hediff hediff)
- POSTFIX com.yourname.ToughnessSkillMod: Void ToughnessSkillMod.Patch_GainToughnessXP_OnDowned:Postfix(Pawn_HealthTracker __instance, Nullable`1 dinfo, Hediff hediff)
at Verse.Pawn_HealthTracker.CheckForStateChange (System.Nullable`1[T] dinfo, Verse.Hediff hediff) [0x00457] in <630e2863bc9a4a3493f2eff01e3a9556>:0
- POSTFIX OskarPotocki.VFECore: Void VFECore.Patch_Pawn_HealthTracker+CheckForStateChange:Postfix(Pawn_HealthTracker __instance, Pawn ___pawn)
at Verse.Pawn_HealthTracker.Notify_HediffChanged (Verse.Hediff hediff) [0x00031] in <630e2863bc9a4a3493f2eff01e3a9556>:0
- PREFIX V1024.EBFramework: Void EBF.Patches.Prefix_HealthTracker_NotifyHediffChanged:PreFix(Pawn ___pawn, Hediff hediff)
at Verse.Pawn_HealthTracker.Notify_Resurrected (System.Boolean restoreMissingParts, System.Single gettingScarsChance) [0x0034c] in <630e2863bc9a4a3493f2eff01e3a9556>:0
- POSTFIX VFEEmpire.Mod: Void VFEEmpire.HarmonyPatches.Patch_StateChange:Postfix(PawnHealthState ___healthState, Pawn ___pawn)
- POSTFIX Troy_Alias.TacticalGroups: Void TacticalGroups.HarmonyPatches:EntriesDirty()
at RimWorld.ResurrectionUtility.TryResurrect (Verse.Pawn pawn, RimWorld.ResurrectionParams parms) [0x000e5] in <630e2863bc9a4a3493f2eff01e3a9556>:0
at RimWorld.ResurrectionUtility.TryResurrectWithSideEffects (Verse.Pawn pawn) [0x00057] in <630e2863bc9a4a3493f2eff01e3a9556>:0
- PREFIX VREAndroidsMod: Boolean VREAndroids.ResurrectionUtility_TryResurrectWithSideEffects_Patch:Prefix(Pawn pawn)
at AlphaMemes.RitualOutcomeEffectWorker_FuneralDreadnought.ApplyOn (Verse.Pawn pawn, Verse.Corpse corpse, System.Collections.Generic.List`1[T] thingsToSpawn, System.Collections.Generic.Dictionary`2[TKey,TValue] totalPresence, RimWorld.LordJob_Ritual jobRitual, RimWorld.RitualOutcomePossibility outcome) [0x000af] in <d56185254a514758b87cf09da85f8b7f>:0
at AlphaMemes.RitualOutcomeEffectWorker_FuneralFramework.ApplyExtraOutcome (System.Collections.Generic.Dictionary`2[TKey,TValue] totalPresence, RimWorld.LordJob_Ritual jobRitual, RimWorld.RitualOutcomePossibility outcome, System.String& extraOutcomeDesc, Verse.LookTargets& letterLookTargets) [0x00147] in <d56185254a514758b87cf09da85f8b7f>:0
at RimWorld.RitualOutcomeEffectWorker_FromQuality.Apply (System.Single progress, System.Collections.Generic.Dictionary`2[TKey,TValue] totalPresence, RimWorld.LordJob_Ritual jobRitual) [0x0001e] in <630e2863bc9a4a3493f2eff01e3a9556>:0
at RimWorld.LordJob_Ritual.ApplyOutcome (System.Single progress, System.Boolean showFinishedMessage, System.Boolean showFailedMessage, System.Boolean cancelled) [0x001c2] in <630e2863bc9a4a3493f2eff01e3a9556>:0
- POSTFIX com.alphamemes: Void AlphaMemes.FuneralFramework_LordJobRitual_ApplyOutcome_Patch:Postfix(LordJob_Ritual __instance, List`1 ___ritualStagePositions)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch7 (string)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.LordJob_Ritual.ApplyOutcome_Patch1 (RimWorld.LordJob_Ritual,single,bool,bool,bool)
AlphaMemes.LordJob_Ritual_FuneralFramework:ApplyOutcome (single,bool,bool,bool)
RimWorld.LordJob_Ritual:<CreateGraph>b__81_10 ()
Verse.AI.Group.TransitionAction_Custom:DoAction (Verse.AI.Group.Transition)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.AI.Group.Transition.Execute_Patch2 (Verse.AI.Group.Transition,Verse.AI.Group.Lord)
Verse.AI.Group.Transition:CheckSignal (Verse.AI.Group.Lord,Verse.AI.Group.TriggerSignal)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.AI.Group.Lord.CheckTransitionOnSignal_Patch1 (Verse.AI.Group.Lord,Verse.AI.Group.TriggerSignal)
Verse.AI.Group.Lord:LordTick ()
Verse.AI.Group.LordManager:LordManagerTick ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Map.MapPostTick_Patch2 (Verse.Map)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch3 (Verse.TickManager)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.TickManagerUpdate_Patch0 (Verse.TickManager)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Game.UpdatePlay_Patch3 (Verse.Game)
Verse.Root_Play:Update ()


Looks like it might be a timing issue or race condition during resurrection. Just wanted to report this in case others run into the same thing.

Hope this helps, and thanks for the mod!
< >
Showing 1-1 of 1 comments
[Toughness Skill - Start of stack trace]
Verse.PatchOperationAdd(xpath="Defs/StatDef[defName="IncomingDamageFactor" and not(parts)]"): Failed to find a node with the given xpath
[End of stack trace]
Source file: C:\Program Files (x86)\Steam\steamapps\workshop\content\294100\3448693012\Patches\IncomingDamageFactor.xml

UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
XmlExtensions.ErrorManager:PrintErrors (string,Verse.ModContentPack)
XmlExtensions.PatchOperation_Patch:Postfix (Verse.PatchOperation,bool&,System.Xml.XmlDocument)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.PatchOperation.Apply_Patch2 (Verse.PatchOperation,System.Xml.XmlDocument)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.LoadedModManager.ApplyPatches_Patch3 (System.Xml.XmlDocument,System.Collections.Generic.Dictionary`2<System.Xml.XmlNode, Verse.LoadableXmlAsset>)
Verse.LoadedModManager:LoadAllActiveMods (bool)
Verse.PlayDataLoader:DoPlayLoad ()
Verse.PlayDataLoader:LoadAllPlayData (bool)
Verse.Root/<>c:<Start>b__10_1 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__28_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()


[Toughness Skill] Patch operation Verse.PatchOperationAdd(Defs/StatDef[defName="IncomingDamageFactor" and not(parts)]) failed
file: C:\Program Files (x86)\Steam\steamapps\workshop\content\294100\3448693012\Patches\IncomingDamageFactor.xml
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
Verse.PatchOperation:Complete (string)
Verse.LoadedModManager:ClearCachedPatches ()
Verse.LoadedModManager:LoadAllActiveMods (bool)
Verse.PlayDataLoader:DoPlayLoad ()
Verse.PlayDataLoader:LoadAllPlayData (bool)
Verse.Root/<>c:<Start>b__10_1 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__28_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()
< >
Showing 1-1 of 1 comments
Per page: 1530 50