Yet another door locking mod for all of your [b][DATA EXPUNGED][/b] needs, heavily inspired by [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3629205139]Card Doors[/url].
Description
[hr]
Adds several types and clearance levels of keycards and microchip implants, and makes it possible to restrict any powered door (i.e. autodoors, security doors) to a specific level. More specifically, it adds:
[list]
[*] Five "standard" clearance levels of Alpha through Epsilon, each of which can unlock doors of its own clearance level or below (e.g. a Gamma keycard can unlock Gamma, Delta and Epsilon doors).
[*] Four "special" clearance levels of Theta, Lambda, Tau, and Phi, each of which can only unlock its own associated door (e.g. only a Theta keycard can unlock a Theta door).
[*] And last but not least an Omega clearance level, which can unlock everything. Omega clearance doors can only be unlocked with Omega keycards.
[/list]
Pawns can wear both standard and special clearance keycards at once.
Everything is unlocked via a dedicated research after autodoors, and keycards/implants can be crafted at the machining table. Mechanoid clearance levels can be set by clicking on them like for doors by default, and can be inherited from mechanitors with a mod setting.
If you'd rather assign clearance levels to human pawns directly as well rather than using keycard apparel/implants, that can also be enabled in mod settings.
Compatibility
[hr]
Should work with pretty much everything (including other lock mods like [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1157085076]Locks[/url] and [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3391523928]Lockable Doors[/url]). If anything is broken (and isn't already listed in known issues), let me know in the [url=https://steamcommunity.com/workshop/filedetails/discussion/3634353108/690871777622156649/]dedicated steam discussion[/url] or elsewhere.
Can be safely added mid-save, removing might throw a few red errors but should otherwise be fine as well.
Includes explicit compatibility patches for:[list]
[*] [url=https://steamcommunity.com/workshop/filedetails/?id=839005762]Humanoid Alien Races[/url]
[*] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=724602224]Misc. Robots[/url] (and extensions)
[*] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2051042827]Autocleaner[/url]
[/list]
Known issues:[list]
[*] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3121742525]Dead Man's Switch[/url]: Drones spawned from stations like Trashpans can't have a security clearance. Might be fixed in the future, for now just make one station per restricted zone.
[*] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2033979700]Project Rimfactory Revived[/url]: Drones spawned from buildings can't have a security clearance. Unlikely to be fixed, since the drones' range is very limited anyway.
[/list]
Performance
[hr]
I've done my best to optimize everything, but since the game checks whether a pawn can pass through a door [i]very[/i] often when pathing (up to a few hundred times per second, per pawn, per door), there could still be a performance hit with big numbers of pawns and doors (even though it should be negligible under normal playthrough conditions).
I benchmarked the mod with 144 pawns and 98 doors and compared it to some other popular door lock mods, which you can check in the last two preview images - TLDR, the mod should be ~14x faster than [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3629205139]Card Doors[/url] and ~2x slower than [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3391523928]Lockable Doors[/url] when processing locked doors as of 2026-01-03 (when I ran the benchmarks). When processing unlocked doors (meaning non-powered doors or doors with clearance set to None), it performs only slightly slower than Lockable Doors. [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1157085076]Locks[/url] was also included, but might not be directly comparable since instead of running checks after the vanilla PawnCanOpen() method it completely replaces it.
[hr]Source code: [url=https://steamcommunity.com/linkfilter/?u=https%3A%2F%2Fcodeberg.org%2Fmaevi%2Frimworld-mods%2Fsrc%2Fbranch%2Fmain%2Fsecurity-clearance]https://codeberg.org/maevi/rimworld-mods/src/branch/main/security-clearance[/url]