[A17] Lockable Doors

Started by Khell, January 14, 2017, 05:32:34 AM

Previous topic - Next topic

Khell

Requires


Description
Adds lockable doors and autodoors to the game after appropriate research projects Door Locks for normal doors and Locking Autodoors for autodoors have been completed. Finally, your colonists can have a night of undisturbed sleep without needing to build a hallway if you don't want to!

I was inspired to create this mod after my colonists kept entering other colonist's rooms to use their furniture, and installing other mods that added hygiene and bladder requirements which prompted me to build ensuites.

Download
Available on Steam Workshop and Github.

Source
On Github.

License
You may include it in a modpack, but please give credit.

swampslug

One of my big issues with the game at the moment is that visitors and their animals ignore forbidden doors and eat your food and crops when they are hungry.
Does this mod prevent visitors using locked doors? 

Khell

Quote from: swampslug on January 14, 2017, 11:08:52 AM
One of my big issues with the game at the moment is that visitors and their animals ignore forbidden doors and eat your food and crops when they are hungry.
Does this mod prevent visitors using locked doors?

I haven't tested this personally as I play on an ice sheet with at least -60C outside all the time, meaning no visitors ever, but I believe so. The unlockable condition is that no matter what a pawn must be assigned to be able to open the door. The caveat is that if they have a berserk mental break, well I found they like to attack and break the doors. :)

If this isn't the case please let me know and I'll fix it.

sanya02


Kesran

Great idea, but had to uninstall - even though I hadn't actually locked any doors, or even before i competed the required research, whenever guests tried to leave I got constant 'guest is leaving' message spam and guests couldn't actually leave. (I was using steam workshop version)

mrofa

Khell this might be of a bit of help
Building_DoorLockable.cs
Visitors problem will still remain althrugh insted of spaming a message they will dig thier way thrugh, its a vanillia failsafe
All i do is clutter all around.

Khell

I add a new door building and detour an unrelated method, I'm not sure how my mod could be causing that spam especially if you haven't built any of the new doors. Will take a look when I can.

Khell

#7
Quote from: Kesran on January 14, 2017, 04:43:27 PM
Great idea, but had to uninstall - even though I hadn't actually locked any doors, or even before i competed the required research, whenever guests tried to leave I got constant 'guest is leaving' message spam and guests couldn't actually leave. (I was using steam workshop version)

I've tested with caravans, visitors etc and wasn't able to reproduce this. I get the normal "XYZ is leaving" notice and they leave as normal. No spam. I also tested with doors locked, and then I got the notice that mrofa raised, which is that they've been trapped and will dig their way out. It will also happen if you trap them inside before they leave by locking all the doors - but still no spam.

Given how little actual core game code this affects, and that they are exactly identical to normal doors until they are locked, I think it's something else? Maybe one of your other mods? If you can give me exact steps to reproduce or let me know if it is conflicting with another mod I'd be happy to look at it again.

Also - if you aren't already make sure you restart the game when you activate new mods. I had various issues after activating new mods without restarting the game.

@mrofa
Thanks for sharing, but I didn't get any spam. I also didn't know someone else had already made a lockable door mod! Looking at your implementation it's a bit different though. :)

Kesran

#8
Thanks for the reply Khell. I've got quite a few mods running so I'm sure it's just a conflict with one of those rather than an issue with your mod in particular, which as I mentioned earlier is a great idea, and such a simple concept it really should have been in the base game.
The first time it happened, the guest was actually wandering outside the colony when they decided to leave and the message just spammed while the guest continued to wander about.
I'm going to give it another go in a fresh colony, play around with the other mods/load order and see what happens - I'll let you know if I still get the problem.
Thanks again for your reply, and for the mod! (which others are using without incident so am sure it's my loadout that's the problem!)

Kes

*EDIT* Have just been running a fresh colony/ clean save after having removed a couple of mods which were outdated, and that seems to have fixed the conflict :)

Shabazza

Can you block doors for colonists that are raging from a mental breakdown with this?
Because in vanilla, I hate that those guys can just beat up my other colonists without much chance to avoid them.

Khell

Quote from: Shabazza on January 15, 2017, 06:17:39 AM
Can you block doors for colonists that are raging from a mental breakdown with this?
Because in vanilla, I hate that those guys can just beat up my other colonists without much chance to avoid them.

Yes. They will attack the doors though if there isn't anyway out, so they may eventually still get to your colonists. :)

@Kesran
Glad you were able to get it working :)

asquirrel

Getting a red error with this mod:
"could not find a type named LockableDoors.Buildings.Building_LockableDoor"
https://gist.github.com/bcf18d7c1a8c656a2323ef7a423812cb

Any suggestions would be appreciated!

mrofa

#12
Hmm seems there is a compatibility problem between clutter lockable doors and this lockable doors.
Try to put clutter structure under lockable doors
All i do is clutter all around.

asquirrel


sanya02

#14
Confirm! Error of incompatibility with CLUTTER! Put the mod LockableDoors TO before CLUTTER! And everything will work fine!