Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: Khell on January 14, 2017, 05:32:34 AM

Title: [A17] Lockable Doors
Post by: Khell on January 14, 2017, 05:32:34 AM
(http://i.imgur.com/GI6du19.png?1)
Requires
(http://i.imgur.com/9L4f8u7.png) (https://ludeon.com/forums/index.php?topic=28066)

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 (http://steamcommunity.com/sharedfiles/filedetails/?id=841915667) and Github (https://github.com/khell/RimworldLockableDoors/releases).

Source
On Github (https://github.com/khell/RimworldLockableDoors).

License
You may include it in a modpack, but please give credit.
Title: Re: [A16] Lockable Doors
Post by: 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? 
Title: Re: [A16] Lockable Doors
Post by: Khell on January 14, 2017, 11:30:29 AM
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.
Title: Re: [A16] Lockable Doors
Post by: sanya02 on January 14, 2017, 11:56:55 AM
Thanks for the mod
Title: Re: [A16] Lockable Doors
Post by: 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)
Title: Re: [A16] Lockable Doors
Post by: mrofa on January 14, 2017, 05:30:55 PM
Khell this might be of a bit of help
Building_DoorLockable.cs (https://www.sendspace.com/file/0m1w41)
Visitors problem will still remain althrugh insted of spaming a message they will dig thier way thrugh, its a vanillia failsafe
Title: Re: [A16] Lockable Doors
Post by: Khell on January 14, 2017, 08:05:30 PM
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.
Title: Re: [A16] Lockable Doors
Post by: Khell on January 15, 2017, 02:17:26 AM
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. :)
Title: Re: [A16] Lockable Doors
Post by: Kesran on January 15, 2017, 06:07:32 AM
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 :)
Title: Re: [A16] Lockable Doors
Post by: 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.
Title: Re: [A16] Lockable Doors
Post by: Khell on January 15, 2017, 09:11:50 AM
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 :)
Title: Re: [A16] Lockable Doors
Post by: asquirrel on January 15, 2017, 05:29:27 PM
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!
Title: Re: [A16] Lockable Doors
Post by: mrofa on January 16, 2017, 03:45:32 AM
Hmm seems there is a compatibility problem between clutter lockable doors and this lockable doors.
Try to put clutter structure under lockable doors
Title: Re: [A16] Lockable Doors
Post by: asquirrel on January 16, 2017, 11:21:13 AM
Thanks!  I'll try that!  :)
Title: Re: [A16] Lockable Doors
Post by: sanya02 on January 16, 2017, 04:11:47 PM
Confirm! Error of incompatibility with CLUTTER! Put the mod LockableDoors TO before CLUTTER! And everything will work fine!
Title: Re: [A16] Lockable Doors
Post by: Khell on January 17, 2017, 05:39:02 AM
Yes, it seems Clutter Structure uses the same namespace (LockableDoors) for its doors as my mod. The DLLs are also named the same. The one that is first in load order will be loaded and the ones after ignored. Then when the game goes to load the XML defs it cannot find the required classes. mrofa is there a chance you can move your version into your ClutterStructure namespace with the rest of your mod?
Title: Re: [A16] Lockable Doors
Post by: faltonico on January 17, 2017, 03:32:43 PM
Hello there!
Is there any difference between in what this mod do and Mrofa's Clutter Structure?
Title: Re: [A16] Lockable Doors
Post by: sanya02 on January 18, 2017, 06:20:04 PM
Yes, big difference! This mod is very useful! Especially with a modded Dubs Bad Hygiene! Strangers will come to your room to wash)
Title: Re: [A16] Lockable Doors
Post by: Sarelth on January 20, 2017, 03:15:47 PM
I have not been able to get the door lock bit to work at all for my save. Is there a specific mod order needed? I have a ton of mods, but nothing shows up as conflicting with this one. Will keep trying to change mod order and find the culprit as I would really like to be able to lock doors in my colony.
Title: Re: [A16] Lockable Doors
Post by: Rocket_Raccoon on January 20, 2017, 06:34:41 PM
Mod works great, only thing that is a bit annoying is that pets of colonists gets locked out by locking the doors.
Is there a way to change that?
Anyhow, great work so far!
Title: Re: [A16] Lockable Doors
Post by: MercuryDoll on February 02, 2017, 10:20:17 AM
Sadly doesn't play well with Misc Robots, as they are technically not a colonist they can't use the door since they can't be assigned.
Title: Re: [A16] Lockable Doors
Post by: minakurafto on February 03, 2017, 12:24:45 AM
Quote from: MercuryDoll on February 02, 2017, 10:20:17 AM
Sadly doesn't play well with Misc Robots, as they are technically not a colonist they can't use the door since they can't be assigned.
it also aplies to animal/ pet cant enter because we cant assign animal

is it possible to add feature select all and deselect all? it's for circumstance like: i have 10 pawn and a want all pawn except 1 pawn cant enter, currently it's not effecient to click and search 9 name but with the feature it can reduced to only 2 click
Title: Re: [A16] Lockable Doors
Post by: drakulux on February 04, 2017, 06:59:50 AM
I have found a bug with the mod, If you assign 2 out of the 3 colonists to a door and then afterwards edit the list, unless you forbid and unforbid the door, the new edit will no take effect. So the edits do not take effect without forbidding and unforbidding.

I have also made this compatible with clutter structures for myself :P I do not mind sharing as long as the author doesnt mind and also I will not keep up with the updates, Hopefully Khell will decide to make his mod compatible, all I did was change the namespaces to ownedDoors and the dll name as well. Took me half the day to get the tools and figure out as I do not know C#, but it works fine, just tested, that's how I found the bug above. I have 0 error messages too.
Title: Re: [A16] Lockable Doors
Post by: mrofa on February 04, 2017, 08:29:47 AM
No need for Khell to make it compatibile. Since it was my lazines to not change namespace  ;D New version of clutter structure is compatibile.
Thrugh i must admit that Khell version is better from game management point



Title: Re: [A16] Lockable Doors
Post by: drakulux on February 04, 2017, 11:34:43 AM
Quote from: mrofa on February 04, 2017, 08:29:47 AM
No need for Khell to make it compatibile. Since it was my lazines to not change namespace  ;D New version of clutter structure is compatibile.
Thrugh i must admit that Khell version is better from game management point

Thats nice that they are now compatible after I spent have the day cracking my skull :p thank you very much.  And i agree khells method is very nice gameplay wise but it still needs some stuff to be ironned out like with pets, and having to forbid and unforbid.
Title: Re: [A16] Lockable Doors
Post by: Rocket_Raccoon on June 16, 2017, 03:01:27 AM
An update for A17 for this would be awesome since without the option to restrict access there is something missing.
Title: Re: [A16] Lockable Doors
Post by: kaptain_kavern on June 16, 2017, 03:35:14 AM
Mrofa's mod : Clutter   also have a lockable door and is A17 ready
Title: Re: [A16] Lockable Doors
Post by: Rocket_Raccoon on June 19, 2017, 12:47:32 PM
Yeah, but in a different way than in this mod. I want to be able to select who gets a key and who not :p
Title: Re: [A16] Lockable Doors
Post by: mrofa on June 19, 2017, 12:53:57 PM
Thats a interesting aspect just might add it in when i get to figure out how mod menu works :D
Title: Re: [A16] Lockable Doors
Post by: drakulux on June 19, 2017, 05:10:50 PM
Quote from: mrofa on June 19, 2017, 12:53:57 PM
Thats a interesting aspect just might add it in when i get to figure out how mod menu works :D

Yay!
Title: Re: [A16] Lockable Doors
Post by: Khell on June 29, 2017, 12:00:04 AM
Will update for A17 very soon. :)
Title: Re: [A17] Lockable Doors
Post by: Khell on July 14, 2017, 11:25:36 PM
A17 compatibility beta release is available. :)

I haven't forgotten all the features I wanted and said I would implement back in January... this is still planned when I get the time to play RimWorld again. :)
Title: Re: [A17] Lockable Doors
Post by: lance_hardwood on July 15, 2017, 07:26:41 AM
thank YOU, sir!
Title: Re: [A17] Lockable Doors
Post by: AngleWyrm on July 15, 2017, 07:57:56 AM
Quote from: Khell on January 17, 2017, 05:39:02 AM
Yes, it seems Clutter Structure uses the same namespace (LockableDoors) for its doors as my mod.
This is where it's not just vanity to use your developer name as a namespace in order to avoid naming collisions.
It's also nice to see your name up in lights...Ok, well maybe a little vanity 8)

Title: Re: [A17] Lockable Doors
Post by: faltonico on July 16, 2017, 06:04:20 PM
I just tested, lockable doors seems to be working as intended and it doesn't seem to be any kind of incompatibility with clutter structure.

Great work!

EDIT: Pets doesn't seem to be able to get out of a room trough a door not assigned to them. Is this intended? Is there a way to make doors free pass for pets or not?
Title: Re: [A17] Lockable Doors
Post by: Crazyabe on July 27, 2017, 07:23:14 PM
I attempted to use this mod, but I get an error when I add it, and (Rimworld) Deletes any lockable doors I build while giving me another error.
The errors are "Could not find a type named lockabledoors.buildings.building_lockabledoor"
And "Exception in Tick (pawn=Cervexa, job=FinishFrame A=Thing_LockableDoor_Frame171267, CurToil=2): System.ArgumentNullException: Argument cannot be null." when I finally build the things. Is there any way to fix these issues?
Title: Re: [A17] Lockable Doors
Post by: sidfu on July 27, 2017, 11:35:53 PM
was gonna use this then saw its only for his 2 doors which renders use llimited if u have mod doors
Title: Re: [A17] Lockable Doors
Post by: crusader2010 on January 02, 2018, 11:07:29 AM
Any chance for a B18 update for this mod? Maybe some configurable options for pets too? :D