边缘世界 RimWorld

边缘世界 RimWorld

Work Tab
TinyMeatKing 2021 年 8 月 4 日 上午 3:27
Is there a way to fix this error I get when I try to activate robots from the Misc. Robots mod?
I wasn't having this problem before but once I built a second robot I kept getting this error when I tried to activate it. Deleting the second robot makes it work again but only having one robot kind of sucks. Thanks for any help!

System.NullReferenceException: Object reference not set to an instance of an object
at WorkTab.WorkPriority.set_Item (System.Int32 hour, System.Int32 value) [0x00035] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0
at WorkTab.PriorityTracker.SetPriority (RimWorld.WorkGiverDef workgiver, System.Int32 priority, System.Int32 hour, System.Boolean recache) [0x0001d] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0
at WorkTab.PriorityTracker.SetPriority (Verse.WorkTypeDef worktype, System.Int32 priority, System.Int32 hour, System.Boolean recache) [0x00016] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0
at WorkTab.PriorityTracker.SetPriority (Verse.WorkTypeDef worktype, System.Int32 priority, System.Collections.Generic.List`1[T] hours) [0x00020] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0
at WorkTab.Pawn_Extensions.SetPriority (Verse.Pawn pawn, Verse.WorkTypeDef worktype, System.Int32 priority, System.Collections.Generic.List`1[T] hours) [0x0000b] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0
at WorkTab.Pawn_WorkSettings_SetPriority.Prefix (RimWorld.Pawn_WorkSettings __instance, Verse.WorkTypeDef w, System.Int32& priority) [0x00006] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0
at (wrapper dynamic-method) RimWorld.Pawn_WorkSettings.RimWorld.Pawn_WorkSettings.SetPriority_Patch1(RimWorld.Pawn_WorkSettings,Verse.WorkTypeDef,int)
at AIRobot.X2_AIRobot_Pawn_WorkSettings.EnableAndInitialize () [0x000d0] in <1751a4a8abc04e79bf96a416f46629e8>:0
at AIRobot.X2_AIRobot_Pawn_WorkSettings..ctor (Verse.Pawn pawn) [0x00010] in <1751a4a8abc04e79bf96a416f46629e8>:0
at AIRobot.X2_Building_AIRobotCreator.CreateRobot (System.String pawnDefName, Verse.IntVec3 position, Verse.Map map, RimWorld.Faction faction) [0x000d2] in <1751a4a8abc04e79bf96a416f46629e8>:0
at AIRobot.X2_Building_AIRobotRechargeStation.Button_SpawnBot () [0x000f7] in <1751a4a8abc04e79bf96a416f46629e8>:0
at Verse.Command_Action.ProcessInput (UnityEngine.Event ev) [0x00007] in <1b9c4c73530448bcbb33283e1d4d7d05>:0
at Verse.GizmoGridDrawer.DrawGizmoGrid (System.Collections.Generic.IEnumerable`1[T] gizmos, System.Single startX, Verse.Gizmo& mouseoverGizmo, System.Func`2[T,TResult] customActivatorFunc, System.Func`2[T,TResult] highlightFunc, System.Func`2[T,TResult] lowlightFunc) [0x006a6] in <1b9c4c73530448bcbb33283e1d4d7d05>:0
at (wrapper dynamic-method) RimWorld.InspectGizmoGrid.RimWorld.InspectGizmoGrid.DrawInspectGizmoGridFor_Patch0(System.Collections.Generic.IEnumerable`1<object>,Verse.Gizmo&)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.Log:ErrorOnce (string,int)
(wrapper dynamic-method) RimWorld.InspectGizmoGrid:RimWorld.InspectGizmoGrid.DrawInspectGizmoGridFor_Patch0 (System.Collections.Generic.IEnumerable`1<object>,Verse.Gizmo&)
最后由 TinyMeatKing 编辑于; 2021 年 8 月 4 日 上午 3:49
< >
正在显示第 1 - 8 条,共 8 条留言
cawphee.black 2021 年 8 月 4 日 下午 3:17 
here's what the developer of misc robots has to say
essentially with work tab he cannot call SetPriority directly if you have this worktab mod as well.
it's frustrating because both these mods are "must have" mods for me


I think I found the source of the issue:
With the latest update I switched from Reflecting to directly setting the workPriorities.
It looks like there is something in Fluffy's WorkTabs that doesn't work when I directly set the workPriorities.
-> Now I'll catch this error and only give out a WARNING once.
-> This is not a bugfix, but a bug-suppression as I can't do anything about WorkTabs.
-> Problematic is: Pawn_WorkSettings.SetPriority
最后由 cawphee.black 编辑于; 2021 年 8 月 4 日 下午 3:20
crua9 2021 年 8 月 4 日 下午 5:47 
A quick fix for here and now is https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2271338001&searchtext=worktab+

This gives us access back to the robot. Now here is where the problem comes in. Some of the robot types like crafting doesn't have it checked to do anything so it will stand all day on it's charger.

But some of the robots work with this method vs them not at all. And to be blunt, I'm not sure if there is any other robots outside of crafters that have this problem.
cawphee.black 2021 年 8 月 4 日 下午 11:46 
@crua9 this doesn't fix anything for me.

the bots still do not do anything.

Basically I'm testing this with hauler bots and it just throw a null reference exception every time I hit activate.

So the bots don't even show up in the work tab

Here's what I get for crafter and hauler bots
and because it is on activate the bots do not even get added to the worktab because they do not even become pawns due to the error.

Error while generating pawn. Rethrowing. Exception: System.NullReferenceException: Object reference not set to an instance of an object at AIRobot.X2_AIRobot.TrySpawnResources (Verse.Map oldMap, Verse.IntVec3 oldPos) [0x00174] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_AIRobot.Destroy (Verse.DestroyMode mode) [0x000a1] in <1751a4a8abc04e79bf96a416f46629e8>:0 at RimWorld.Planet.WorldPawns.DiscardPawn (Verse.Pawn p, System.Boolean silentlyRemoveReferences) [0x00014] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at (wrapper dynamic-method) RimWorld.Planet.WorldPawns.RimWorld.Planet.WorldPawns.PassToWorld_Patch1(RimWorld.Planet.WorldPawns,Verse.Pawn,RimWorld.Planet.PawnDiscardDecideMode) at Verse.PawnGenerator.DiscardGeneratedPawn (Verse.Pawn pawn) [0x0001d] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at Verse.PawnGenerator.TryGenerateNewPawnInternal (Verse.PawnGenerationRequest& request, System.String& error, System.Boolean ignoreScenarioRequirements, System.Boolean ignoreValidator) [0x0084a] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GenerateNewPawnInternal_Patch1(Verse.PawnGenerationRequest&) at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00183] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch3(Verse.PawnGenerationRequest) (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39) System.NullReferenceException: Object reference not set to an instance of an object at AIRobot.X2_AIRobot.TrySpawnResources (Verse.Map oldMap, Verse.IntVec3 oldPos) [0x00174] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_AIRobot.Destroy (Verse.DestroyMode mode) [0x000a1] in <1751a4a8abc04e79bf96a416f46629e8>:0 at RimWorld.Planet.WorldPawns.DiscardPawn (Verse.Pawn p, System.Boolean silentlyRemoveReferences) [0x00014] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at (wrapper dynamic-method) RimWorld.Planet.WorldPawns.RimWorld.Planet.WorldPawns.PassToWorld_Patch1(RimWorld.Planet.WorldPawns,Verse.Pawn,RimWorld.Planet.PawnDiscardDecideMode) at Verse.PawnGenerator.DiscardGeneratedPawn (Verse.Pawn pawn) [0x0001d] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at Verse.PawnGenerator.TryGenerateNewPawnInternal (Verse.PawnGenerationRequest& request, System.String& error, System.Boolean ignoreScenarioRequirements, System.Boolean ignoreValidator) [0x0084a] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GenerateNewPawnInternal_Patch1(Verse.PawnGenerationRequest&) at Verse.PawnGenerator.GenerateOrRedressPawnInternal (Verse.PawnGenerationRequest request) [0x00183] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at (wrapper dynamic-method) Verse.PawnGenerator.Verse.PawnGenerator.GeneratePawn_Patch3(Verse.PawnGenerationRequest) at MiscRobotsWorkTabSupport.X2_Building_AIRobotCreator_CreateRobot2.Prefix (System.String pawnDefName, Verse.IntVec3 position, Verse.Map map, RimWorld.Faction faction, AIRobot.X2_AIRobot& __result) [0x0007a] in <5f00d42e769a4afd9a5badf152d7530f>:0 at (wrapper dynamic-method) AIRobot.X2_Building_AIRobotCreator.AIRobot.X2_Building_AIRobotCreator.CreateRobot_Patch1(string,Verse.IntVec3,Verse.Map,RimWorld.Faction) at AIRobot.X2_Building_AIRobotRechargeStation.Button_SpawnBot () [0x000f7] in <1751a4a8abc04e79bf96a416f46629e8>:0 at Verse.Command_Action.ProcessInput (UnityEngine.Event ev) [0x00007] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at Verse.GizmoGridDrawer.DrawGizmoGrid (System.Collections.Generic.IEnumerable`1[T] gizmos, System.Single startX, Verse.Gizmo& mouseoverGizmo, System.Func`2[T,TResult] customActivatorFunc, System.Func`2[T,TResult] highlightFunc, System.Func`2[T,TResult] lowlightFunc) [0x006a6] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 at (wrapper dynamic-method) RimWorld.InspectGizmoGrid.RimWorld.InspectGizmoGrid.DrawInspectGizmoGridFor_Patch0(System.Collections.Generic.IEnumerable`1<object>,Verse.Gizmo&) (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)
最后由 cawphee.black 编辑于; 2021 年 8 月 5 日 上午 12:00
cawphee.black 2021 年 8 月 7 日 上午 2:04 
ok last post for a bit, I setup a new game with just the mods involved here
harmony
mod manager
worktab
misc core
misc robots
misc robots++

I get one exception per bot I tried to activate, which is basically the same as above but maybe a bit shorter or cleaner hopefully

Exception ticking AIRobot_RechargeStation_Hauler_V18087 (at (144, 0, 118)): System.NullReferenceException: Object reference not set to an instance of an object at WorkTab.WorkPriority.set_Item (System.Int32 hour, System.Int32 value) [0x00035] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.PriorityTracker.SetPriority (RimWorld.WorkGiverDef workgiver, System.Int32 priority, System.Int32 hour, System.Boolean recache) [0x0001d] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.PriorityTracker.SetPriority (Verse.WorkTypeDef worktype, System.Int32 priority, System.Int32 hour, System.Boolean recache) [0x00016] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.PriorityTracker.SetPriority (Verse.WorkTypeDef worktype, System.Int32 priority, System.Collections.Generic.List`1[T] hours) [0x00020] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.Pawn_Extensions.SetPriority (Verse.Pawn pawn, Verse.WorkTypeDef worktype, System.Int32 priority, System.Collections.Generic.List`1[T] hours) [0x0000b] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.Pawn_WorkSettings_SetPriority.Prefix (RimWorld.Pawn_WorkSettings __instance, Verse.WorkTypeDef w, System.Int32& priority) [0x00006] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at (wrapper dynamic-method) RimWorld.Pawn_WorkSettings.RimWorld.Pawn_WorkSettings.SetPriority_Patch1(RimWorld.Pawn_WorkSettings,Verse.WorkTypeDef,int) at AIRobot.X2_AIRobot_Pawn_WorkSettings.EnableAndInitialize () [0x000d0] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_AIRobot_Pawn_WorkSettings..ctor (Verse.Pawn pawn) [0x00010] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_Building_AIRobotCreator.CreateRobot (System.String pawnDefName, Verse.IntVec3 position, Verse.Map map, RimWorld.Faction faction) [0x000d2] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_Building_AIRobotRechargeStation.Button_SpawnBot () [0x000f7] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_Building_AIRobotRechargeStation.Tick () [0x00045] in <1751a4a8abc04e79bf96a416f46629e8>:0 at Verse.TickList.Tick () [0x0015c] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)


and wow, how can anyone play this game without some of the other QoL mods???
Ludeon needs to look at all the QoL mods people made and incorporate some of them into the base game or something

最后由 cawphee.black 编辑于; 2021 年 8 月 7 日 上午 2:06
TinyMeatKing 2021 年 8 月 7 日 上午 5:34 
引用自 cawphee.black
ok last post for a bit, I setup a new game with just the mods involved here
harmony
mod manager
worktab
misc core
misc robots
misc robots++

I get one exception per bot I tried to activate, which is basically the same as above but maybe a bit shorter or cleaner hopefully

Exception ticking AIRobot_RechargeStation_Hauler_V18087 (at (144, 0, 118)): System.NullReferenceException: Object reference not set to an instance of an object at WorkTab.WorkPriority.set_Item (System.Int32 hour, System.Int32 value) [0x00035] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.PriorityTracker.SetPriority (RimWorld.WorkGiverDef workgiver, System.Int32 priority, System.Int32 hour, System.Boolean recache) [0x0001d] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.PriorityTracker.SetPriority (Verse.WorkTypeDef worktype, System.Int32 priority, System.Int32 hour, System.Boolean recache) [0x00016] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.PriorityTracker.SetPriority (Verse.WorkTypeDef worktype, System.Int32 priority, System.Collections.Generic.List`1[T] hours) [0x00020] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.Pawn_Extensions.SetPriority (Verse.Pawn pawn, Verse.WorkTypeDef worktype, System.Int32 priority, System.Collections.Generic.List`1[T] hours) [0x0000b] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at WorkTab.Pawn_WorkSettings_SetPriority.Prefix (RimWorld.Pawn_WorkSettings __instance, Verse.WorkTypeDef w, System.Int32& priority) [0x00006] in <cd123ec7d4b943f4b5b6cdfbd2cbe016>:0 at (wrapper dynamic-method) RimWorld.Pawn_WorkSettings.RimWorld.Pawn_WorkSettings.SetPriority_Patch1(RimWorld.Pawn_WorkSettings,Verse.WorkTypeDef,int) at AIRobot.X2_AIRobot_Pawn_WorkSettings.EnableAndInitialize () [0x000d0] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_AIRobot_Pawn_WorkSettings..ctor (Verse.Pawn pawn) [0x00010] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_Building_AIRobotCreator.CreateRobot (System.String pawnDefName, Verse.IntVec3 position, Verse.Map map, RimWorld.Faction faction) [0x000d2] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_Building_AIRobotRechargeStation.Button_SpawnBot () [0x000f7] in <1751a4a8abc04e79bf96a416f46629e8>:0 at AIRobot.X2_Building_AIRobotRechargeStation.Tick () [0x00045] in <1751a4a8abc04e79bf96a416f46629e8>:0 at Verse.TickList.Tick () [0x0015c] in <1b9c4c73530448bcbb33283e1d4d7d05>:0 (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)


and wow, how can anyone play this game without some of the other QoL mods???
Ludeon needs to look at all the QoL mods people made and incorporate some of them into the base game or something
I've been using WorkTab and Misc Robots++ together since 1.1 and never had a problem before. My last colony in 1.2 had over a dozen robots. I tried adding Misc Robots++ to my current colony since I've only been using the original Misc Robots but was still unable to get more than one robot to work. Maybe something changed in the code for WorkTab for 1.3 which is preventing robots from working. Kind of sucks since I hate having to have my pawns do things like cleaning and hauling in the late game
Fluffy  [开发者] 2021 年 8 月 10 日 上午 1:47 
thanks for the info here folks, investigating Misc Robots++ and Work Tab together is on my to-do list (even if only because I use those mods myself), but there are still updates to be made to a few of my mods that are top priority right now, so it may be a little while.

I'm also secretly hoping someone else (Haplo, EgotisticalElf, some anonymous coding hero) comes along and fixes the problem for me before then, either in another mod, or as a PR to Work Tab :coffee:.
cawphee.black 2021 年 8 月 11 日 上午 1:42 
thanks for the update

Not a C# dev, but tried to follow the stack trace through your code, and I don't even see a function or method named "set_Item" in WorkPriority.cs or even a variable named Item in case it's a dynamic setter or something
So basically stumped :P
Any suggestions of what to look at or why I can't see "set_Item"?
cawphee.black 2022 年 7 月 28 日 下午 12:06 
well it's been nearly a year, any chance this was fixed indirectly by changes to Rimworld or any of the mods in question?
< >
正在显示第 1 - 8 条,共 8 条留言
每页显示数: 1530 50