creating a door that must be unlocked
-
this example shows how to create a door that must be unlocked and, once unlocked, will function as a normal door.

included files
-
keydoor.txt
keydoor.jpg
keydoor.map
keydoor.bsp

steps
-
1. build the func_door(s) as you normally would. be sure to give them a targetname (in the example map, "door1")

2. build a trigger_multiple field surrounding the door.  this will be its "activation field" (trigger_multiple #2, in the keydoor.jpg).  give it a targetname ("door_trigger" in the example map) and a target of whatever the func_door's targetname was ("door1").

if you compiled and ran your map now, the door would act like a normal door, with the trigger_multiple opening the door when you approached it.  you don't want it to act like this until you have unlocked the door.  to accomplish this, go into the activation field trigger_multiple and set the TRIGGERED flag.  That will cause the trigger_multiple to not function until it has been triggered once.

3. place a trigger_key somewhere (it doesn't really matter where) and give it a targetname of something ("door_key" in the example map) and make it target the trigger_multiple which was build in step 2.  you must also give it an "item" key with a value equal to the classname of the key that will be used (in this example, "key_pass").

4. build a trigger_multiple (trigger_multiple #1 in keydoor.jpg) and target it at the trigger_key ("door_key").

5. place the appropriate key somewhere in the level (in this case, a key_pass).

-

now, compile and run the level.  you will find that you can't get through the door unless you have the key, but once you unlock the door, it will continue to function normally.

-

example map by autolycus.  autolycus@planetquake.com
(to run example map, place keydoor.bsp in the quake2/baseq2/maps directory, and run quake with the "+map keydoor" parameter, or type "map keydoor" at the console)