Tutorials

quake2 - func_door, func_door_rotating, func_door_secret, trigger_key


To me I think that doors are one of the hardest entities to master. There are just so many different options and uses for a door. Now with quake2 they are somewhat more difficult due to the fact you can have rotating doors.

Func_door

A func_door is made simple by creating the brush(es) that will make up the door and turning them into the func_door entity.

Remember though that if your door is going to include 2 or more pieces each opening in different directions then you are going to have to make each piece a seperate func_door entity. So if you have a door that slides open from the middle, half moving left and half moving right then you will have to make 2 func_door entities. On the other hand if you have 20 different pieces of a door but they all move in the same direction then you can make all 20 of them into the same func_door. Understand? I'll try to explain a bit more below.

Key Value Pairs

Message

Message will print a message when the door is triggered. Message will NOT work when the door is not triggered open.


Angle
Angle is of course the direction the door will open.


Health
If you set health to a value then the door will only be opened when damage equal to the amount of health is given to door. So if you want to create the effect of a door opening only when shot by the player set the health to 1. Of course it doesnt have to have a value of 1. You could give it a health of 10000 and have the player shooting it for 10 minutes. =)


Speed
Speed determines how fast the door moves when opened(or closed). When using


Wait
Wait is the length of time between opening the door and when the door closes. If you never want the door to close then set wait=-1


lip
Lip is the length of the door remaining after the door opens. Here is an example pic of what lip actually is. I get a lot of question asking for this.

lip



dmg
dmg is of course the amount of damage the door will give off when blocked by an entity like the player. Damn! I sure made that sound difficult. hehe. You could use this to set up some sort of trap that if the door closes on the player it will gib him. Just give the door a damage of 500 or so.


sounds
the key sounds will default to the same sound that quake2 uses for doors no matter what the value except for the value 1, which makes the door not have any sound at all. Useful if you wish to use a target_speaker for a door sound.

Spawnflags

start_on

Start_on will make the door operate in reverse. So the door will be open and then close when triggered.


crusher
By default when a door crushes you again a wall it will take off damage and then go back a bit and then take off damage again. If crusher is on then there won't be that little pause between trying to close again. It will just keep trying to close and crush you. No matter what, if crush is turned on or turned off a door will take off damage and eventually kill you. Crusher will just do it quicker.


nomonster
nomonster makes it so a monster_ entity can not open the door. By default a monster can open a door.


toggle
Toggle will only make a difference when a door has a opened by a trigger. It makes it so it will wait until triggered in both the opening position and the closing position. So if a door with toggle turned on is open it will stay open until triggered again, in which it will close.

func_door_rotating

All the key value pairs and spawnflags for the func_door entity also work for the func_door_rotating. There are some differences though that I will explain.

Now to the amazing func_door_rotating. A func_door_rotating basically works the exact same way a normal door does except for a few minor things. A func_door_rotating must have an origin brush as part of the brush. This is the actual part that the door rotates around. So the first thing you have to do is make the brushes that will make up the func_door_rotating and the brush you want as the origin brush. Then select the brushes for the actual door and the origin brush and make them into func_door_rotating.

Next thing you have to do is select the brush that is going to be the origin brush and change the surface property of this brush to an origin brush. All the editors have different ways of setting the surface properties. Hit the 'S' key in BSP and Qed4. Alt T will do it for QOOLE. Check your editor documentation if you don't know.

Key Value Pairs
there is 1 more key value pair for a func_rotating door

distance

Distance determines the degrees the rotating door will travel. So a distance of 90 will make the door rotate 90 degrees. This is handy when trying to make levers or switches that you want to rotate on a few degrees since a func_rotating will keep on rotating and not stop.

Spawnflags
there are 3 extra spawnflags for a func_door_rotating

reverse

Reverse will make the door start to rotate in the oppisite direction.


x-axis
X-axis will make the door rotate along the x-axis.


y-axis
y-axis will make the door rotate along the y-axis. By default the door will rotate along the z-axis so there isn't a spawnflag for that.

func_door_secret

Creating the func_door_secret

These of course are the doors that usually look like walls and when you shoot them they slide forward or back and then to the side. I'm sure you've seen them before. They are actually pretty simple to use. First you need to make the door of course then make it into a func_door_secret entity.

Key Value Pairs

angle

Angle is the direction the door will slide open.

dmg

dmg is the amount of damage the door will give off when the player blocks the progress of the door.

wait

wait is the duration of time that the door stays open before closing.

Spawnflags

once_open

once_open makes the door open once and stay open.


1st_left
1st_left makes the door move a small amount to the left and then go the angle of the door.


1st_down
1st_down makes the door move a small amount down and then go the angle of the door.


always_shoot
Always_shoot makes the door always open when shot even where the door is targeted to open my another trigger.

Tips and hits on making doors

Key opened doors
Now I am going to try to explain how to make a door that must have a key to be opened. This is kind of nasty.

First you need to make the door. I already explained all that. Next you need to give the door a targetname and a message. The message should be a message that tells what item the player needs to open the door. Now you must place a trigger_key somewhere. It really doesn't matter where. The trigger_key entity only has one key value pair...item. Set this to the name of the entity that is required to open the door. Now you must target the door with the trigger_key. Now here is the trick. The trigger_key entity must be triggered by another trigger to work. So you must make another trigger that will be targeted to the trigger_key. Kind of nasty huh? If you want the door to open only once and stay open then you should use a trigger_once entity and target the trigger_key. So therefore the trigger_key must also have a targetname. If you havn't a clue what I am talking about then just download the example map and see how I did it.



a door that must be unlocked and, once unlocked, will function as a normal door.
by autolycus

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).

Here is a pic of everything talked about. -

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.

-

An [example .map] by autolycus. autolycus@planetquake.com

As you can see there are a ton of different options for all the different types of doors. I tried to put an example of every kind of door mentioned that you can check out in the [example .map]. I even included an example of how to use a door as a crusher trap. If there is anything I missed or if you still have questions then please post to the discussion board.

Return to Tutorials Page...







Copyright Crap