RimWorld

RimWorld

Sensible Bed Ownership
129 Comments
1trickPwnyta  [author] 14 hours ago 
@Tekuromoto Even without this mod, I'm unable to get a menu for force sleep with Reverse Commands. Are you thinking of the Go The Fork To Sleep mod? I know that mod does that as well. However, I tested it and it seems to work fine with Sensible Bed Ownership.
1trickPwnyta  [author] 3 Oct @ 12:13pm 
@Tekuromoto I'll see what I can do. If it's not a trivial fix it might take me a while to circle back to it. Thanks!
Tekuromoto 3 Oct @ 11:53am 
Hi there. Great mod, thanks!

There seems to be an incompatibility with Reverse Commands https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=858744731

That mod lets you give orders in reverse by right clicking an item then selecting an action and colonist from the flyout menu. When right clicking a bed (without this mod) it gives the option to force sleep. With this mod, however, I get a red error in the log and nothing happens. The game doesn't crash or anything.

The rest of the functionality of both mods seems to be fine. So I'm avoiding right clicking on beds for the moment 😏

Any chance of a compatibility patch from your end, since Brrainz doesn't accept comments on steam so I can't notify him.
WarKittyKat 22 Sep @ 1:02pm 
Just gonna leave a comment here in case other people need it - if you have royals, make sure that their preferred bed is the one that's suitable! I had my royal bedrooms on a gravship, and they would all start complaining unless I set the bed on the gravship to preferred.
Geojak 8 Sep @ 12:11pm 
seems to be the other mods fault, removed this and still get the error
Geojak 8 Sep @ 12:09pm 
seems to be some weird bug incompability with the poly bed mod
Geojak 8 Sep @ 12:09pm 
Varon threw exception in WorkGiver DoctorRescue: System.NullReferenceException: Object reference not set to an instance of an object
[]
at RimWorld.SpouseRelationUtility.GetLoveRelations (Verse.Pawn pawn, System.Boolean includeDead, System.Boolean orderByCommitmentLevel) [ in <>:0
at OneBedToSleepWithAll.PolygamyModeUtility.CheckIsHavePartnersPolygamyBedOccupied (
at OneBedToSleepWithAll.Patch.RestUtility__FindBedFor.Postfix () [] in <49f4dbaeffe44fa6ba819cb073663d00>:0
at RimWorld.RestUtility.FindBedFor (V
- TRANSPILER sensiblebedownership.1trickPwnyta: IEnumerable`1 SensibleBedOwnership.Patch_RestUtility:Transpiler(I)
- POSTFIX densevoid.hui.personalworkcat: Void OneBedToSleepWithAll.Patch.RestUtility__FindBedFor:Postfix(Building_Bed& __result, Pawn sleeper, Pawn traveler, Boolean checkSocialProperness, Boolean ignoreOtherReservations, Nullable`1 guestStatus)
at RimWorld.WorkGiver_TakeToBed.FindBed ()
Gabe Knight 3 Sep @ 6:44pm 
Really good mod. Thank you
1trickPwnyta  [author] 3 Sep @ 5:10pm 
@Kerpi @Ted I tried the Loft Bed mod and it was working fine for me, to my surprise. I added some extra logging to help troubleshoot the issue. The extra logging will only happen with dev mode enabled, so if you could try again with dev mode enabled (and make sure the mod is updated to version 1.2.6) and send me the log when it happens, that could help. Thanks!
Ted 2 Sep @ 10:39pm 
Can confirm @Kerpi comment based off what he said. I couldnt land my gravship but once I removed this mod I could. I also have Loft Beds mod.
Kerpi 2 Sep @ 3:04pm 
I was unable to land my gravship after takeoff and we identified this mod as the problem. Someone said it might be a "conflict between loft bed, bed ownership and odyssey". I removed this mod and the ship was able to land again. Here are my logs in case they can help!
https://gist.github.com/Kerpimon/9b3df053aede0f24a06a4d7434046620
horologium 28 Aug @ 11:20pm 
can't you just recreate the issue and get that log if its causing problems?
raz334 28 Aug @ 10:32pm 
* i no longer have the logs, but i gave them to Grok and had it examine them after i experienced a > Game Freeze < , and it identified this mod alone and very sure of itself despite a long list of nearly 500 mods. I removed and tested, it was right. Game worked fine after that.

It occurred when my GravShip was coming in to land, as it said "preparing to land" then it froze.
Just letting you know. Sorry i don't have the logs anymore, they tend to get overwritten quickly..
SourceShard 25 Aug @ 6:07pm 
Test went well everything worked fine
IX 21 Aug @ 12:08am 
Hi, I uploaded the log file earlier, but after repeating my tests several times, I wasn’t able to reproduce the bug again.
It seems that some specific conditions might be required for the error to occur.
https://gist.github.com/HugsLibRecordKeeper/fe7084ef2ad5df16d4dfe91b57eca1c9
1trickPwnyta  [author] 20 Aug @ 1:27pm 
I fixed the gravship issues with beds in a new update that is NOT published yet. I'll need a bit more time to make sure there aren't any new issues. You can try out the new update here: https://github.com/1trickPwnyta/SensibleBedOwnership/releases/tag/v1.2.5
1trickPwnyta  [author] 20 Aug @ 1:22pm 
@IX I'm not getting the same error in my game. Are you able to provide the full log file?
1trickPwnyta  [author] 20 Aug @ 6:39am 
@IX Thanks for reporting! I'll look into that.
IX 20 Aug @ 3:38am 
Exception while recalculating SharedBed thought state for pawn 斯泰尔: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 569775F5] Duplicate stacktrace, see ref for original
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
RimWorld.SituationalThoughtHandler:TryCreateThought (RimWorld.ThoughtDef)
RimWorld.SituationalThoughtHandler:UpdateAllMoodThoughts ()
RimWorld.SituationalThoughtHandler:SituationalThoughtInterval ()
RimWorld.ThoughtHandler:ThoughtInterval ()
RimWorld.Need_Mood:NeedInterval ()
RimWorld.Pawn_NeedsTracker:NeedsTrackerTickInterval (int)
Verse.Pawn:TickInterval (int)
Verse.Thing:DoTick ()
Verse.TickList:Tick ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
Verse.Game:UpdatePlay ()
Verse.Root_Play:Update ()
IX 20 Aug @ 3:36am 
Hi, I think I found a bug with the mod.

When pawns are out on temporary map without any bed, the game throws a related to the "SharedBed" thought calculation. It seems the mod is still trying to check bed ownership even though no bed exists on that map.NullReferenceException

Interestingly, this does not happen in the home base — if there are no beds there, pawns just sleep on the ground and no error appears. The issue seems specific to pawns on temporary maps without beds.

As a workaround, I assigned a sleeping spot to the pawn on the temporary map, and the error disappeared.

Thanks a lot for your work on this mod!
girlkisser 18 Aug @ 5:15pm 
Glad to hear it! Best of luck!
1trickPwnyta  [author] 18 Aug @ 5:07pm 
@girlkisser I'm planning a fix for this issue but it's taking a while for me to get to it, sadly. Hopefully soon!
girlkisser 18 Aug @ 4:51pm 
Hello, this mod seems to have odd behavior with gravships. When I send out some colonists in a gravship, they correctly have a bed both on the gravship and at the colony, and once the gravship is back home two beds are assigned to each colonist. Which is odd, but selecting the gravship beds and clicking "unassign all" is significantly easier than manually reassigning each bed, so I let it go.

Problem is, one of my colonists decided to randomly reclaim ownership of one of the gravship beds and go to sleep in it? They already had a colony bed prior. And when this happened, their colony bed was unassigned...

Would it be possible to have ownership on beds on gravship structure be wiped when the gravship lands on a tile that already has a bed assigned to the colonist? That's how I expected it to work, but instead it's... this?
SourceShard 16 Aug @ 2:33am 
@Hotshot53
I am going to risk the bisket and toss this in with One Be to test it out. However I cannot test Bunk Beds as I use Prison Commons.
Baccalon 15 Aug @ 5:18am 
Just what I was looking for, I had to reassign beds like 10 times just today :warmth_ats: You're a lifesaver
1trickPwnyta  [author] 11 Aug @ 3:18pm 
@Vinni Pukh Actually I have a theory as to what happened with the throne. It may have gotten out of sync with the pawn's ownership data due to it having been erased when the mod was broken. Seems like you fixed it, but if anyone else has this issue, a quick fix would be to use God mode to destroy the throne and recreate it. It shouldn't happen again since it's just an issue with the update from the old version to the current one.
JohnnyOffice 11 Aug @ 2:30pm 
You are a Prince among modders! Excellent bug fix turnaround :steamhappy:
Vinni Pukh 11 Aug @ 1:51pm 
The issue was the (vampire) pawn was assigned to the throne, the 'unassign' button did nothing, and he could not be removed from the throne either. Yet it said that he had no throneroom, he was not meditating on the throne, and the game was basically just not respecting that it was his throne at all lol. But I wasn't getting any errors popping up in the log like I was when pawns were trying to use their beds and failing.

Shuffling the load order around with some aggressive saving and reloading I *think* everything is working as it should now though. I built him a new throne and he's successfully claimed it , at least. I'm enjoying this colony a lot so I'm very grateful for all the help preserving it, thank you very much!
1trickPwnyta  [author] 11 Aug @ 10:30am 
@Vinni Pukh Thrones are definitely involved with this mod. What is the bug you're getting with the throne?
Vinni Pukh 11 Aug @ 8:47am 
The fixes have definitely improved things, my pawns can sleep in their beds again! No one has gotten ejected from a death casket yet! All is well!

However I'm still having issues with my throne, and I would normally think that there's nothing involved with this mod but... the unassign all gizmo that shows up on the beds also shows up on my bugged throne? And I'm wondering if that's somehow related? Is it possible that throne assignment somehow got wrapped up in all the caching stuff too?
Hotshot53 11 Aug @ 7:06am 
Has anyone tried to use this mod in conjunction with Bunk Beds (https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2961752749) and with the One Bed to Sleep With All mods? (https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3244294636) I'm worried it would introduce conflicts but I'd love to have them all running if anyone's ever tried it.
JustofArc 11 Aug @ 6:24am 
Can confirm, 1.2.4 has resolved the issue. Thanks a bunch!
1trickPwnyta  [author] 11 Aug @ 5:16am 
Okay, I think I found the root problem, and I believe the previous update should have fixed it, or at least prevented it from occurring in the future anyway. However, it did not address the broken save file issue.

I've just released a new version (1.2.4 - please verify this is the version you have now) that should fix any broken save files and add extra protection against it happening again. Thanks for your help and patience with this, everyone!

Technical explanation: The new bed caching mechanic added to increase performance had an issue where the cache wasn't cleared upon loading a new save file under certain conditions. This would cause an exception to occur while loading the data for a pawn's ownership node, specifically when deathrest caskets were involved, which would cause the pawn to have a null Pawn_Ownership tracker. This would cause a lot of NREs, producing many, if not all, of the recently reported issues.
1trickPwnyta  [author] 11 Aug @ 3:59am 
@JohnnyOffice Since the issue persists after disabling the mod, it is likely to be a problem with how the mod affects saving. Do you have an affected save file I can look at?
JustofArc 11 Aug @ 3:57am 
Commenting again just to drop a couple logs for the issue. Unfortunately I can't confirm whether the issue is occurring without other mods enabled (I think that'd mess up my save a lot).

https://gist.github.com/HugsLibRecordKeeper/a8e8773c54c0caa8003f624eb10a17c4

The below log is after I tried changing the name of the sanguophage. Included a short clip of what the assign menu looks like after changing a sanguophage name to start with Z.

https://gist.github.com/HugsLibRecordKeeper/ac30d43d676cab46ad0790b5b481c67c

https://streamable.com/red48y
JustofArc 11 Aug @ 2:21am 
Chiming in to confirm the same issue as JohnnyOffice. My three sanguophages can no longer be assigned to beds and whenever they do spend time in bed they don't get any rest. They also can't rest in hospital beds to heal. Currently getting around this by temporarily enabling dev mode's godmode to fill the rest meter. Only had this issue after I sent one of my sanguophages on a gravship flight to a different map, seems to have triggered the issue for all 3 even though the remaining 2 never left the colony tile.

That issue aside, great work on the mod. Works like a charm besides that.
JohnnyOffice 11 Aug @ 1:59am 
Also, the error is persisting after disabling the mod. I have a save prior to the the problem luckily, but I'll have lost a bit of time so I'm holding off on rewinding.
JohnnyOffice 10 Aug @ 11:36pm 
I've started having the same problem as the other recent posts... guess I posted too soon. It appears to have something to do with the sanguophages. The Assign Bed list stops at a sanguophage whose name is "Lute". I changed her name to "Zute" and the list now goes all the way through all the pawns to my second sanguophage whose name is "Shaper." I've changer her name to "Zaper" and now I can see and assign beds to the rest of my 31 colonists except my 2 sangouphages who are at the very end of the list. I cannot use my mousewheel to scroll through the list.

I noticed this all started around when both sanguophages independently assigned themselves to a masterwork royal bed that was in my gravship (captain's quarters and all that).
celsius 10 Aug @ 11:12pm 
im having issues where people switching to others beds when that person is caravaning or killed etc
1trickPwnyta  [author] 10 Aug @ 9:52pm 
Thanks for the info and logs everyone! I just published a small update that fixes a potential file load bug I noticed when testing (I couldn't get it to happen a second time though). This might help with some of the issues everyone is facing, but please let me know if you're still having trouble. And if so, if you could confirm whether you get the same errors with no other mods enabled, that would be very helpful!
Vinni Pukh 10 Aug @ 6:09pm 
Tangram I'm having similar issues as you. Right now in my colony, my pawns cannot sleep in any beds. A couple have gotten exhausted and collapsed, which alerted to me that something was off. When I right click on their assigned bed, there's no option to sleep.

I've also got my sangos getting randomly ejected from their deathrests too.

I wouldn't be surprised if it was something to do with the one bed to sleep with all polycule mod. I really regret choosing the free love precept at this point lmao because trying to keep all these lil idiots from being upset about sleeping alone has been the woooorst. Unfortunately removing it, this mod, or both, has not restored functionality to beds.

Anyways here's my log I hope someone can make some sense of all this https://gist.github.com/HugsLibRecordKeeper/f0b6c1742f353252381373d3cd21b08a
Tangram7 10 Aug @ 5:55pm 
I'm log is full of red errors and I don't know what to do. Removing the mod didn't help (I am using a previous save now). What can I do?
Tangram7 10 Aug @ 5:44pm 
edit: I'm still having this issue. Will my log help? https://gist.github.com/HugsLibRecordKeeper/6f3debe063ee43d6ad5c63d76181046d
Tangram7 10 Aug @ 5:31pm 
Hi. I'm having an issue where, first, the "Assign bed" button doesn't work (it literally doesn't let you click it). After that, when trying to hange ownership of a free bed, instead of my pawns list, I see only one, without their name, and the menu doesn´t work.

I don't know what caused this, but I fixed it by removing then adding the mod again.

I write this just in case someone runs into the same issue.

Great mod!!
LongJohnNoOne 10 Aug @ 4:51pm 
@Alphasaur i second your findings, mine is even more annoying, and i can't do anything with my pawn, he is just permanently incapacitated at the moment. I can probably fix with dev mode ofc :)

I can't even carry the pawn to deathrest casket, he gets dropped "on top" of the casket, not inside.
1trickPwnyta  [author] 10 Aug @ 12:48pm 
@Alphasaur Thanks for letting me know! Does anything appear in the log during either of these issues? And do you have other mods enabled as well?
Alphasaur 10 Aug @ 12:43pm 
I'll also add that before observing this UI issue, I observed an odd bug when this pawn was attempting to deathrest. He would periodically get ejected from his deathrest casket without any apparent cause, prompting me to rescue him and return him to the deathrest casket. This happened four or five times before deathrest was completed.
Alphasaur 10 Aug @ 12:41pm 
I have the same problem as Trinfinity, but I haven't been able to reproduce it in a test colony. I've confirmed that I have version 1.2.2 in my case. I'll describe what happens in my affected save.

Despite the mod being loaded, the bed assignment dialog is showing up without the pawn search tool. The scroll wheel is unresponsive, and there are several empty rows at the bottom of the list. Manually dragging the scrollbar works. All the visible assign/reassign buttons work. The button to close the dialog works. The very last pawn whose icon appears on the list is a sanguophage. His icon appears, but there is no associated assign/reassign button. The sanguophage has a bound deathrest casket. When I click on another unbound deathrest casket, the pawn search field appears normally. There are no other sanguophage pawns in the colony. When the problematic sanguophage leaves the map, the dialog appears normally again.
horologium 9 Aug @ 6:32pm 
I feel like primary bed/secondary bed(s) ownership might be worthwhile in separate mod. Just seems like a different function even if its related to beds. plus, i really like the performance added with the caching update, that would likely ruin this mod's performance again :steamsad:
JohnnyOffice 9 Aug @ 6:24pm 
Also, I'm not seeing Trinfinity's issue either with only 25 colonists showing up in in the Set Owner menu. I have 30 pawns from Ben to Yudoku and all of them are in the list. Also, my mouse wheel scrolls through the list.