How to make key activated doors
Note: This tutorial assumes you already have the basics of a level, ie. a hollowed box and a player start inside it. =]  

For this tutorial we'll be creating a door that will only open if you have the blue key.  

Step 1: 

Ok, key activated doors are a little complicated, so bare with me. =] You're going to need a door to start of with, so go ahead and make that. I'm using the standard Quake 2 door from the last tutorial. You can edit most of it's properties to your liking except for spawnflags. Keep that blank, and give the door a targetname.

Step 2: 

Now, create a brush that goes through the door, extending a little bit on each side, make sure it covers the length of the door as well. It should look like a bar, running across the door. Refer to the picture on the right for an example. Texture it with the trigger texture and apply a Trigger\Multiple entity to it. In it's properties, have it target the door. Give it a targetname such as "dooract" and select triggered in the spawnflags pulldown menu. This trigger is going to act as an activator for the door. It will open the door rather than having the door open itself. Though it sounds odd, there's a point for this which will be discussed later.
 
 

______________________________________Step 3: 

 
 
Add a Trigger\Key entity, just have it float near your door. In it's properties, have it target the Trigger\Multiple from step two. Give it a targetname and add a new item field, this is where you specify what key will be needed to open the door. For it's value, put the string name of the key required. A list of valid keys is listed below: 
 
Keys
key_data_cd
key_power_cube
key_pyramid
key_data_spinner
key_pass
key_blue_key
key_red_key
key_commander_head
key_airstrike_target
 

______________________________________Step 4: 

 
Make a copy of the brush made in step two, and past it into the level. Position it right below or above the last brush having it go through the door like the other brush. Refer to the picture on the left for an example. In it's properties have it target the Trigger\Key made in step three and leave the targetname field blank.
Notes 
The reason we created that brush in step two, is so the door would act normally after it was unlocked. If that brush isn't there, the door will only open the first time with the key. After that, it will no longer open, which probably isn't how you want it to work. =]
_ 
That's it! Go lock some doors!
Back to index | Download the map and bsp

Copyright ©1998 Bryan Beretta and Lithium Software. All rights reserved. Permission required for
use of any and all material found on or downloaded off this site for purposes other than learning.