Need help troubleshooting

Started by Yozzy, October 09, 2021, 09:04:51 PM

Previous topic - Next topic

Yozzy

I'm having an issue where pawns can't be assigned to prioritize work at certain workbenches, and I can't wrap my head around the logs.

Any advice?

VitaKaninen

Are you trying to prioritize research? 

JT

#2
The trick to debugging spamlogs is to look for the earliest Harmony patch you can find in the "stack" of calls that are being made.


Root level exception in OnGUI(): System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.ListerBuildings+<AllBuildingsColonistOfDef>d__14.MoveNext () [0x00038] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at RimWorld.IdeoBuildingPresenceDemand+<AllBuildings>d__22.MoveNext () [0x00087] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at RimWorld.RitualObligationTargetWorker_Altar+<GetTargetsWorker>d__3.MoveNext () [0x000a8] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable`1[T] source, TSource value, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x00036] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable`1[T] source, TSource value) [0x0000a] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at RimWorld.RitualObligationTargetWorker_Altar.CanUseTargetWorker (Verse.TargetInfo target, RimWorld.RitualObligation obligation, RimWorld.Ideo ideo) [0x0003a] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at RimWorld.RitualObligationTargetWorker_AnyGatherSpotOrAltar.CanUseTargetInternal (Verse.TargetInfo target, RimWorld.RitualObligation obligation) [0x00082] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at RimWorld.RitualObligationTargetFilter.CanUseTarget (Verse.TargetInfo target, RimWorld.RitualObligation obligation) [0x0001f] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at RimWorld.Precept_Ritual.ShouldShowGizmo (Verse.TargetInfo target) [0x00076] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at Verse.Thing+<GetFloatMenuOptions>d__147.MoveNext () [0x0042f] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at Verse.ThingWithComps+<GetFloatMenuOptions>d__40.MoveNext () [0x00078] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at (wrapper dynamic-method) RimWorld.FloatMenuMakerMap.RimWorld.FloatMenuMakerMap.AddHumanlikeOrders_Patch11(UnityEngine.Vector3,Verse.Pawn,System.Collections.Generic.List`1<Verse.FloatMenuOption>)
  at RimWorld.FloatMenuMakerMap.ChoicesAtFor (UnityEngine.Vector3 clickPos, Verse.Pawn pawn, System.Boolean suppressAutoTakeableGoto) [0x000a5] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at RimWorld.FloatMenuMakerMap.TryMakeFloatMenu (Verse.Pawn pawn) [0x000a1] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at (wrapper dynamic-method) RimWorld.Selector.RimWorld.Selector.HandleMapClicks_Patch1(RimWorld.Selector)
  at RimWorld.Selector.SelectorOnGUI () [0x00000] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at RimWorld.MapInterface.HandleLowPriorityInput () [0x0000f] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at RimWorld.UIRoot_Play.UIRootOnGUI () [0x000dd] in <b64badbf3c3d41018b3ca5d3e8c77771>:0
  at (wrapper dynamic-method) Verse.Root.Verse.Root.OnGUI_Patch1(Verse.Root)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)


PRE: [800]LWM.DeepStorage.Patch_AddHumanlikeOrders.Prefix, BioReactor.BioReactorPatches.Prefix_AddHumanlikeOrders post: CompTurret.HarmonyInstance.FloatMenuMakerMap_AddHumanlikeOrders_CompTurret_Patch.Postfix, MVCF.Harmony.Brawlers.AddHumanlikeOrders_Postfix, HeavyWeapons.Patch_FloatMenuMakerMap+AddHumanlikeOrders_Fix.Postfix, VFECore.Patch_FloatMenuMakerMap+AddHumanlikeOrders_Fix.Postfix, JecsTools._HumanlikeOrdersUtility.AddHumanlikeOrders_PostFix, OgsCompSlotLoadable.HarmonyCompSlotLoadable.AddHumanlikeOrders_PostFix, rjw.RMB_Menu.SexFloatMenuOption, [0 ]CallTradeShips.Patch_FloatMenuMakerMap_AddHumanlikeOrders.Postfix, [0 ]LWM.DeepStorage.Patch_AddHumanlikeOrders.Postfix TRANS: LWM.DeepStorage.Patch_AddHumanlikeOrders.Transpiler



The actual failure is occurring in the 11th patch in the list, there, which is Deep Storage.  However, as Deep Storage works for me, that means that the culprit is a mod that is interfering with it.

One or more of CallTradeShips, JecsTools, RimJobWorld, OgsCompSlotLoadable, Vanilla Expanded Core, HeavyWeapons, or BioReactor is causing compatibility problems with [LWM]DeepStorage.  OgsCompSlotLoadable and JecsTools are the more notorious culprits (the former because I've never heard of it, the latter because it was hastily updated for 1.3, so double-check to make sure you're running the latest version), although RJW is an inefficient mess of code that could also be responsible.

I do run Deep Storage without any issues along with JecsTools, VFE Core, and BioReactor.

That all said, what's failing is a call to check for ideology buildings around a target building, so your next debugging step is to search for any mods that might affect that process.  CallTradeShips seems most likely to me.

Next, if you have ruled out all of the above (the problem doesn't disappear by uninstalling any of the mods that conflicts with Deep Storage), you'll have to set your sights on the next Harmony patch line:

  at (wrapper dynamic-method) RimWorld.Selector.RimWorld.Selector.HandleMapClicks_Patch1(RimWorld.Selector)

and figure out what edits that:

Selector.HandleMapClicks: PRE: LWM.DeepStorage.Patch_HandleMapClicks.Prefix

...which is also LWM Deep Storage.  It's also possible you're running an incorrect version of Deep Storage, so double-check that, too.

Since OnGUI is the root level interface with the game, and it's HugsLib that patches that one, it's extremely unlikely to be the cause of the problem.

I couldn't find any missing defs or cross-referencing errors, so it looks like it's not an indirect problem caused by a mod that's removing a building that the game expects to be there, so that's not a problem, at least.

You've got a few other weird things going on, such as many of your mods are listed as copies rather than as originals -- are you subscribed to items at the same time as you have them installed loosely in your mod folder, or do you have multiple copies in the same folder?  That's probably not a good idea. =)