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 doors have even more options since there are rotating doors in Quake2.

The First thing you need to do is make brushes that are going to make up the door and turn it into a func_door. Then you need to decide which way the door is going to open and set the angle. After you have done this your door will be in working order. As of now the door will open when you touch it. If you want to set it so that you have to set off a trigger to open it then just give your func_door a targetname and target it with a trigger.

There are a ton of key value pairs and spawnflags for func_doors that do a variety of cool things. We will go over all the spawnflags first. They are: message, angle, health, speed, wait, lip, dmg, and sounds. Message will print a message when the door is touched ONLY when it is triggered open. Message won't do anything if your func_door does'nt have a targetname. Angle is of course the opening direction. If health is set then the door must be shot to open. Speed determines how fast the door moves. 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 is the length 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 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. Sounds determines the sound the door with put out when opened. Choices are 1)silent, 2)light, 3)medium, 4)heavy.

The spawnflags that you can set for a func_door are: start_on, crusher, nomonster, and toggle. Start_on will make the door operate in reverse. So the door will be open and then close. 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 makes it so a creature can not open the door. By default a monster can open a door. Toggle will only make a difference when a door has a opened by a trigger. It makes it so it wait until triggered in both the opening position and the closing position.

Those are all the different spawnflags and key value pairs that are available for a regular func_door. Now I am going to explain a bit more about getting more complicated doors to work properly.

In the pic that I showed earlier in this tutorial about lip you will notice that there are actually 2 parts to the door. One section on the left and one section on the right. To get this effect each side is a seperate door but they have different opposite angles. It's that simple! If the door is triggered then both doors will have the same targetname. For example. If we want a door where half of it opens straight left and the other half opens straight right then the left side and right side will each be a func_door. The left door will have an angle of 180 and the right door will have an angle of 0. If the door is triggered open the both doors will have the same exact targetname.

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.

There are also a few additional key value pairs and spawnflags for a rotating door that I will of course tell you about.

There is only 1 new key value pair called distance. Distance determines the degrees the rotating door will travel. So a distance of 90 will make the door rotate 90 degrees. There are also 3 new spawnflags. reverse, x-axis, and y-axis. Reverse will make the door rotate in the opposite direction. X-axis will make the door rotate along the x-axis and 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. Everything else about a func_door_rotating is exactly like a regular door so to save me from typing all that over again like....just go up and read it there. =)

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.

The final type of door is a 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. There are 3 key value pairs. angle, dmg, wait. Angle is the direction the door will slide open. dmg is the amount of damage the door will give off when the player blocks the progress of the door. wait is the duration of time that the door stays open before closing. There is also 4 spawnflags. once_open, 1st_left, 1st_down, and always_shoot. open_once makes the door open once...duh. 1st_left makes the door move a small amount to the left and then go the angle of the door. 1st_down does the same thing but it goes down instead of left. Always_shoot makes the door always open when shot even where the door is targeted to open my another trigger.

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