[1.3.0] Hospitality

Started by Orion, March 13, 2015, 11:19:16 AM

Previous topic - Next topic


@Daelight: I can tell from your video that your game state is corrupted, but not what caused it.
But it looks like you have visitors with animals, so that should be it.
You might be able to recover it by destroying these animals and visitors with the destroy tool from the developer menu.

@Chrome: Thanks!


Thank you so much, using the destroy tool fixed it, the offender was a Muffalo calf.


There were some changes in TropiCKAPP Rainforest recently regarding adding animals, seems like they aren't come with guests anymore, so incompatibility is gone now. But I think that problem may raise again with some other mod(s), so it would be better to find it's roots. May be it's like when there are animals with guests, game "looks" at these animals first and treats them like "real" guests, giving them that thinknode, whatever, and "forgetting" about humans? I don't really know how it works here, it's only wild guess based on some similar situations in other programs, so excuse me if I'm completely wrong.
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.


Oh sweet! I wasn't sure about my changes / been able to fix it.

Turns out it was most probably coming from one of my patches (In the updated version I made one line patch per TraderKind / opposing to try to patch them all in once in the previous version)



Hi Orion. With Zombieland mod I can't change any beds like guests bed. When I click on the "For Guests" button only error appears:
Failed to find Verse.ThingDef named SleepingSpotGuest. There are 2125 defs of this type loaded.
Verse.DefDatabase`1:GetNamed(String, Boolean)
Hospitality.Building_GuestBed:MakeBed(Building_Bed, String)
Verse.GizmoGridDrawer:DrawGizmoGrid(IEnumerable`1, Single, Gizmo&)

Object reference not set to an instance of an object
at ZombieLand.Patches/ThingMaker_MakeThing_Patch.Prefix (Verse.ThingDef) <0x00010>
at (wrapper dynamic-method) Verse.ThingMaker.MakeThing_Patch1 (Verse.ThingDef,Verse.ThingDef) <0x00016>
at Hospitality.Building_GuestBed.MakeBed (RimWorld.Building_Bed,string) <0x0002c>
at Hospitality.Building_GuestBed.Swap (RimWorld.Building_Bed) <0x00104>
at Hospitality.Harmony.Building_Bed_Patch/GetGizmos/<>c__DisplayClass5.<Process>b__2 () <0x00014>
at Verse.Command_Toggle.ProcessInput (UnityEngine.Event) <0x00026>
at Verse.GizmoGridDrawer.DrawGizmoGrid (System.Collections.Generic.IEnumerable`1<Verse.Gizmo>,single,Verse.Gizmo&) <0x00823>
at (wrapper dynamic-method) RimWorld.InspectGizmoGrid.DrawInspectGizmoGridFor_Patch0 (System.Collections.Generic.IEnumerable`1<object>) <0x00469>
at RimWorld.MainTabWindow_Inspect.DrawInspectGizmos () <0x0003e>
at RimWorld.InspectPaneUtility.ExtraOnGUI (RimWorld.IInspectPane) <0x00062>
at RimWorld.MainTabWindow_Inspect.ExtraOnGUI () <0x00014>
at Verse.WindowStack.WindowStackOnGUI () <0x00065>
at RimWorld.UIRoot_Play.UIRootOnGUI () <0x000d7>
at Verse.Root.OnGUI () <0x000c6>

And it does not matter which mod is installed first


Interestingly, the code for that prefix looks like this:
static void Prefix(ThingDef def)
if (def.IsCorpse == false) return;
if (def.ingestible == null) return;
if (def.ingestible.sourceDef is ThingDef_Zombie)
def.selectable = false;
def.neverMultiSelect = true;
def.drawGUIOverlay = false;
def.hasTooltip = false;
def.hideAtSnowDepth = 99f;
def.inspectorTabs = new List<Type>();
def.passability = Traversability.Standable;
def.affectsRegions = false;
def.stackLimit = 1;
def.thingClass = typeof(ZombieCorpse);
and the only possibility for a null reference exception is if the def passed into the method is NULL which would be rather bad. Since I am about to update my mod anyway, I am adding a null check for the def too but overall, I am a bit unclear on what is going on here.

I guess that somewhere in your code you try to load a def and it is null and Zombieland is the only/first to dislike that. As I said, I'll fix it but I gues BadThingsMightHappen(tm) if you deal with null defs anyway.


Would this prevent a null error when processing the ThingDef object passed into the function?

static void Prefix(ThingDef def)

   if( def == null ) return; // validate input before processing
   if (def.IsCorpse == false) return;
   if (def.ingestible == null) return;

My 5-point rating system: Yay, Kay, Meh, Erm, Bleh


Quote from: AngleWyrm on June 24, 2017, 12:40:12 AM
Would this prevent a null error when processing the ThingDef object passed into the function?

static void Prefix(ThingDef def)

   if( def == null ) return; // validate input before processing
   if (def.IsCorpse == false) return;
   if (def.ingestible == null) return;

Yes, I added that to the version I released yesterday. I am just worried that me getting such a null def is usually not a good thing and might lead to other problems without Zombieland or with other mods.



Imagine part of your coding army includes a division of young and/or over-caffeinated ADD types who consider the phrase "I know a short cut" to be a point of merit.

They produce, but it's necessary to do some screening in a noisy environment.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh


I'm quite sure the real issue here is "Failed to find Verse.ThingDef named SleepingSpotGuest" which returns a null def which is then passed on.

I'll see if I can reproduce this.


Okay, I can't reproduce it.
@bullet: Please upload your full log. Most likely stuff is already going wrong before you even load your game.


I'm not sure if you already talked about this, I checked last 15 pages but checking another 100 is just nope.

I'm getting this error since I got Hospitality mod, and just now when the first guests came in I noticed, that they keep sleeping on the floor, next to the bed signed as a guest bed. Everytime they'd look for a bed cause 'rest' stat is really low, the game throws that error and they fall asleep on the ground. Everything else is working perfectly fine. Any idea why is that?

Exception in Verse.AI.ThinkNode_PrioritySorter TryIssueJobPackage: System.MissingMethodException: Method not found: 'Verse.GenClosest.ClosestThingReachable'.
  at Hospitality.JobGiver_Sleep.TryIssueJobPackage (Verse.Pawn pawn, JobIssueParams jobParams) [0x00000] in <filename unknown>:0
  at Verse.AI.ThinkNode_PrioritySorter.TryIssueJobPackage (Verse.Pawn pawn, JobIssueParams jobParams) [0x00115] in C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:162
Verse.Log:Error(String) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:48)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:166)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:18)
Hospitality.ThinkNode_FilterGuestRooms:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:18)
RimWorld.ThinkNode_Duty:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\AI\ThinkNodes\ThinkNode_Duty.cs:26)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:18)
RimWorld.ThinkNode_Conditional:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\AI\ThinkNodes\ThinkNodes_Conditionals.cs:27)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:18)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:231)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Subtree.cs:36)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:18)
RimWorld.ThinkNode_JoinVoluntarilyJoinableLord:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\AI\ThinkNodes\ThinkNode_JoinVoluntarilyJoinableLord.cs:36)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\ThinkNodes\ControlFlow\ThinkNode_Controls.cs:18)
Verse.AI.Pawn_JobTracker:DetermineNextJob(ThinkTreeDef&) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\Pawn_JobTracker.cs:451)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob() (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\Pawn_JobTracker.cs:397)
Verse.AI.Pawn_JobTracker:EndCurrentJob(JobCondition, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\Pawn_JobTracker.cs:297)
Verse.AI.Pawn_JobTracker:JobTrackerTick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\AI\Pawn_JobTracker.cs:105)
Verse.Pawn:Tick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Pawn\Pawn.cs:485)
Verse.TickList:Tick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Ticking\TickList.cs:126)
Verse.TickManager:DoSingleTick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Ticking\TickManager.cs:276)
Verse.TickManager:TickManagerUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Ticking\TickManager.cs:243)
Verse.Game:UpdatePlay() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Game.cs:481)
Verse.Root_Play:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root_Play.cs:73)


Hm. I can't tell much from the error, but it looks to me like you are using the wrong version of the mod with the game. Which alpha are you using? Did you delete the Hospitality folder before updating? Which Hospitality version did you use?


Quote from: Orion on June 24, 2017, 06:55:36 AM
I'm quite sure the real issue here is "Failed to find Verse.ThingDef named SleepingSpotGuest" which returns a null def which is then passed on.

In a maybe-related issue, it's possible to make animal sleeping spots into 'guest' spots. At first I thought this was a feature for guest's animals, but it appears that guests will use them for sleeping.
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh