User Tools

Site Tools


secure_airlocks

This code will allow you to set a passcode on the interior door to your ship's airlock.

A few notes regarding nomenclature. When I build a starship, I typically have a specific layout for the airlock system that includes an “EVA Prep Room” that you pass through before entering an “Airlock Room” that can be depressurized prior to entering or exiting your ship. You can call this room (which is where I usually store spacesuits and other gear used for extravehicular activity) whatever you want, but for purposes of this document, I use “EVA Prep Room” to designate that room, and “Airlock Room” to designate the actual room that you can depressurize or repressurize. - Hagalaz

Set the following props in the ship's parent room

You will need the database reference numbers for two exits: The DBREF# for the exit leading FROM the Airlock Room to your ship's EVA Prep Room goes in this prop:

@propset here=dbref:_reg/indoor:#<You go inside through this exit>

The DBREF# for the exit leading TO the Airlock Room from your ship's EVA Prep Room goes in this prop:

@propset here=dbref:_reg/outdoor:#<You go outside through this exit>

Copy and paste the following code inside your airlock room

@action Secure;security=here=tmp/exit1

@link $tmp/exit1=$nothing

@propset $tmp/exit1=str:/_/de:You can ^green^SECURE LOCK^normal^ or ^green^SECURE UNLOCK^normal^ the inner door leading into the rest of the ship – if you have clearance.

@propset $tmp/exit1=str:/_/fl:You do not have the security card needed to operate this control.

@propset $tmp/exit1=str:/_/ofl:tries to tamper with the security seal on the entryway, but doesn't have the security card for it.

@propset $tmp/exit1=str:/_/sc:{if:{&arg}, {if:{prop:{&arg},this}, {exec:{&arg},this}, {exec:_bad}},{exec:_bad}}

@propset $tmp/exit1=str:/_bad:{color:^gray^The valid commands are ^green^SECURE LOCK ^gray^and ^green^SECURE UNLOCK^gray^.}

@propset $tmp/exit1=str:/do_lock:{null:{store:1,_/secured?,$indoor}{store:1,_/secured?,$outdoor}}

@propset $tmp/exit1=str:/do_unlock:{null:{store:0,_/secured?,$indoor}{store:0,_/secured?,$outdoor}}

@propset $tmp/exit1=str:/lock:{if:{exec:_/secured?,$indoor},The entryway door already has a security seal., You lock the entryway door with a security seal.{exec:do_lock}{null:{otell:{name:me} locks the security seal on the entryway door.}}}

@propset $tmp/exit1=str:/unlock:{if:{exec:_/secured?,$indoor},You remove the security seal and unlock the entryway door.{null:{otell:{name:me} unlocks the security seal on the entryway.}}{exec:do_unlock},The entryway door is already unlocked.}

Then step through the exit into your ship's EVA Prep Room, and copy/paste this code:

@action Secure;security=here=tmp/exit1

@link $tmp/exit1=$nothing

@propset $tmp/exit1=str:/_/de:You can ^green^SECURE LOCK^normal^ or ^green^SECURE UNLOCK^normal^ the airlock's inner door – if you have clearance.

@propset $tmp/exit1=str:/_/fl:You do not have the security card needed to operate this control.

@propset $tmp/exit1=str:/_/ofl:tries to tamper with the security seal on the airlock, but doesn't have the security card for it.

@propset $tmp/exit1=str:/_/sc:{if:{&arg},{if:{prop:{&arg},this},{exec:{&arg},this},{exec:_bad}},{exec:_bad}}

@propset $tmp/exit1=str:/_bad:{color:^gray^The valid commands are ^green^SECURE LOCK ^gray^and ^green^SECURE UNLOCK^gray^.}

@propset $tmp/exit1=str:/do_lock:{null:{store:1,_/secured?,$indoor}{store:1,_/secured?,$outdoor}}

@propset $tmp/exit1=str:/do_unlock:{null:{store:0,_/secured?,$indoor}{store:0,_/secured?,$outdoor}}

@propset $tmp/exit1=str:/lock:{if:{exec:_/secured?,$outdoor},The airlock door already has a security seal., You lock the airlock door with a security seal.{exec:do_lock}{null:{otell:{name:me} locks the security seal on the airlock.}}}

@propset $tmp/exit1=str:/unlock:{if:{exec:_/secured?,$outdoor},You remove the security seal and unlock the airlock door.{null:{otell:{name:me} unlocks the security seal on the airlock.}}{exec:do_unlock},The airlock door is already unlocked.}

Creating the security code

Once this is done, you can then use any kind of lock on the secure actions. You can lock them to specific people, or to key card objects, or to properties – just as you would any normal action – an only those who pass the lock test will be able to secure or release the door.

To encode security keycards, just set a prop on them, such as _lock:yes. Once you do that, you can lock the “secure” action using the same prop, like this: @lock secure=_lock:yes. You can use anything you want as a prop for the lock string, as long as it follows the “<blurb>:<blurb>” format.

secure_airlocks.txt · Last modified: 2011/06/19 08:30 by hagalaz