Code Monkey home page Code Monkey logo

locks's Introduction

Locks

v2.9.3

Locks mod for RimWorld

Steam Workshop | Ludeon Forums

Description

This addon adds new locking door system.

  • Doors can be unlocked to allow enemies and prisoners to pass by (only races that have inteligence "humanlike" or above). Note: In order to unlock/lock door, colonist must "flick" the door. Unflicked door will work as unchanged for enemies and prisoners.
  • Doors can exclude visitors (wanna lock some traders?).
  • Pet doors for small animals can now be added to doors.
  • Doors can be assigned to colonists (you can simply restrict rooms to specific colonists without allowed area manager).
  • New Flicking job: Locking/unlocking doors, it has higher priority than normal flicking job. ("Flicking" doors is needed).

How to use

Select door and left click "Lock" command if you want to unlock/lock door. Right click for more options. Alternatively you can use "Lock" inspector tab.

Performance

This mod has almost zero impact on performance. It's quick and light.

Why do I need this?

I've created this mod to allow prisoners walk through doors while keeping temperature indoors with Prison Labor mod. You can use this mod to create heat/cold killboxes, lock traders inside, keeping base safe from animals but avoiding destroying doors by pirates. Also you can lock bedrooms for specific colonists. When that colonist will be in second camp-like base, nobody will sleep in his bed. You can lock areas from dirty vistors, or lock them when horde of manhunter animals is waiting outside.

Compatibility

  • You can enable this mod to old saves.
  • You can disable this mod from saves, but you need to clear all locking/unlocking job first (all semi-transparent locks shouldn't be visible).
  • There can be compatibility issues with mods that add custom doors with custom security mechanics.

locks's People

Contributors

aviuz avatar cody-spring avatar hazzer avatar jonnynova avatar mergatto avatar shiuanyue avatar sokyranthedragon avatar stonenimrod avatar thephluxer avatar thisissp4rtan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

locks's Issues

Locked for everyone (No owner)

Can't lock doors to everyone, so without an owner set everyone just walks in a locked door. Could it be possible to add an option to set no owner/locked for all?

Latest 2.2.1 release zip file problem

Cannot open to unzip the contents with 7-zip and Windows says the file is invalid when I try to view the contents in explorer or with 7-zip. Both say that it isn't an archive.

Some strange things:

  1. Even though Windows says it isn't an archive and there seems no way for me to view it, Windows Defender still scans 28 files when I tell it to scan it.
  2. When I view its property attributes (next to read only/hidden) it says the file is blocked because it has come from another computer and there's a checkbox to unblock it - which I do, but it makes no difference. I've never seen this before on another file.

And lastly, when I try Extract All... using explorer the Extraction Wizard (which I never normally use) says that it is empty.

I tried DLing the file several times to make sure but all the same. Not really sure what's going on here.

Thanks,
Dannii

Error spam while exploring a Real Ruins map

While exploring a large ruin created by Real Ruins there were a large number of hostiles. They spammed this error continuously in the error logs, and I could also sometimes trigger it by right clicking:

Exception ticking Morison (at (92, 0, 9)): System.NullReferenceException: Object reference not set to an instance of an object
at LocksDoorsExpanded.LockUtility.PawnCanOpen (RimWorld.Building_Door,Verse.Pawn) <0x000de>

Root level exception in OnGUI(): System.NullReferenceException: Object reference not set to an instance of an object
at LocksDoorsExpanded.LockUtility.PawnCanOpen (RimWorld.Building_Door,Verse.Pawn) <0x000de>

PawnCanOpen() looks like it does a good job guarding against nulls. Possibly the respectedState.owners check on line 71?

Highlighting important lock settings

Some settings are ignored when specific combination of other settings is applied.
There should be some indicator whenever some setting is not changing anything.

Propositions:

  • Graying out those settings
  • Disabling those settings
  • Highlight other settings

Compatibility for Misc Robots

Robots in Misc Robots cannot use doors that are locked and there is no option to allow them.

I never did any Rimworld modding myself but I tried to dig into this repo as well as Misc Robot's source code.

For robots in Misc Robots it looks like all of the robots use this class which is inherited from the Pawn class.

If I'm not mistaken, this is where you are checking whether a pawn can you a door?

Is it possible to add an option to each door to allow robots to open them? I hope that the information I found can be somewhat helpful. I can also try to make the changes myself but I need to set up the dev environment and I figure it might take you much less time to do it. Please let me know if you prefer me to take a shot at it first.

Thanks for making and maintaining this mod.

Red error log spam

Hello, when i open up the mod in the newest version without the anomaly dlc the game gets spammed with errors about not finding defs for mutantdef.canOpenAnydoor. This leads to extreme drops in tps and makes the game unplayable.

Issue with the Lock mod of rimworld

Dear Aviruz.

Note: i made my request in bold, just incase u didnt have time to read through this long message

first of all, thank you for the mod and all, the mod is working perfectly, but i have one small problem.
I am pretty sure you are aware of a mod called 'Wilding cacoon' (ignore the speeling mistakes). if you are not, basically it is a mod to allow plantation of human to be colonists, and here lies the problem. the mod identifies these humans as Animals until they are tamed. so since i had that in mind, i thought of making some sort of a prison connected to the grow area to keep them in one place so that they dont wander outside and kill my animals and plants for food. so the lock mod doesn't recognize them and so it allows them in even though i locked it. so i was hopping you could tweak this mod to include these people so that i can safely lock them up.

Thank you @Aviuz

Visitors stuck trying to path through locked doors

20191217224620_1
As you can see in the above screenshot via dev mode, the visitor pawns are trying to path through two locked doors that they do not have access to. They're attempting to regroup with their friends before departing, but are permanently stuck until I unlock the doors.

I apologize if this is a duplicate of #15 as I'm not sure if it's directly related. Also, I don't believe this is a mod conflict as it's happened before with non-android pawns; However I could be wrong.

Prisoners cannot pass the door

Hi! I'm wondering if it is a bug or something, but my prisoners cannot just pass the unlocked door to get to the pasta dispenser. Take a look. My version is 1.2.2753 (64-bit).
Please let me know if it is something I am doing wrong.
image

Multiplayer Mod Compatibility

  1. Synced on ztrith's multiplayer mod. (mod list: Core, Multiplayer, Prison labor, Locks)
  2. Right click door
  3. Click unlock door
  4. Game desyncs for player who attempted to unlock door (other player is unaffected)
  5. When returned to the game, the door remains locked(All mods used by both players is mirrored and the same)

Copy and paste door settings

Another great feature would be copy and paste door settings. It could be implemented just like stockpile zones and get around the limitation of not being able to use inspection tables on multiple select.

Revert button

Something that would be awesome is a button to click to cancel a lock change for a door. It can be confusing as to what the settings were originally when trying to revert them

Prototype

Okay so this mod should add locks to all doors:

new option when door selected:

  • lock mode (allies - default / colony - no traders etc.)
  • lock / unlock. When unlocked prisoners/enemies/and any others can pass
  • assign owners (overrides lock mode)
  • clear owners (will bring back option lock mode )

Info

add info to doors if they're locked or not

More red errors

Hey getting the following on load with the latest version:

Error in static constructor of Locks.Initialization: System.TypeInitializationException: The type initializer for 'Locks.Initialization' threw an exception. ---> System.ArgumentException: You can only patch implemented methods/constructors. Patch the declared method virtual System.Boolean RimWorld.Building_Door::PawnCanOpen(Verse.Pawn p) instead.
[Ref 954C37C7]
at HarmonyLib.PatchProcessor.Patch () [0x00051] in :0
at HarmonyLib.Harmony.Patch (System.Reflection.MethodBase original, HarmonyLib.HarmonyMethod prefix, HarmonyLib.HarmonyMethod postfix, HarmonyLib.HarmonyMethod transpiler, HarmonyLib.HarmonyMethod finalizer) [0x0002a] in :0
at Locks.CompatibilityPatches.DoorsExpanded.Init () [0x00077] in <5e837cb6233f47dd86ca0419e4b5ec04>:0
at <0x1eb3f85f220 + 0x0003a>
--- End of inner exception stack trace ---
[Ref 8424EA15]
at (wrapper managed-to-native) System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(intptr)
at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (System.RuntimeTypeHandle type) [0x0002a] in :0
at Verse.StaticConstructorOnStartupUtility.CallAll () [0x00028] in <332f949bcc384ea8b3e92bd925a3878c>:0
- POSTFIX LunarFramework.Bootstrap: Void LunarFramework.Internal.Patches.Patch_Verse_StaticConstructorOnStartupUtility:CallAll_Postfix()
- POSTFIX net.avilmask.rimworld.mod.NonUnoPinata: Void NonUnoPinata.Patches.StaticConstructorOnStartupUtility_CallAll_NonUnoPinataPatch:Postfix()
- POSTFIX VanillaTradingExpandedEarly.Mod: Void VanillaTradingExpanded.Initializer:Postfix()
- POSTFIX LayeredDestruction.patch: Void LayeredDestruction.StaticConstructorOnStartupUtilityPatch:Postfix()
- POSTFIX PerformanceOptimizer.Main: Void PerformanceOptimizer.InitializeMod:Postfix()
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch3 (string)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.StaticConstructorOnStartupUtility.CallAll_Patch5 ()
Verse.PlayDataLoader/<>c:b__4_4 ()
Verse.LongEventHandler:ExecuteToExecuteWhenFinished ()
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent ()
Verse.LongEventHandler:LongEventsUpdate (bool&)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root.Update_Patch1 (Verse.Root)
Verse.Root_Entry:Update ()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.