TF2/Team-Specific Doors

From Valve Developer Community
< TF2
Jump to: navigation, search
English (en)русский (ru)한국어 (ko)
... Icon-Important.png

Team-Specific Doors only open for one team, and are often placed in front of a respawn or in certain base areas on control point maps.

Tutorial - Basic Team-Specific Doors

For our example, we will be making a door to the red spawn area that will open only for the red team.

The filter_activator_tfteam

First, place a filter_activator_tfteam entity. This is the filter that will determine which team can open the door. You will need to set its Team, Filter mode, and Name as appropriate. For our example, we will set Team to Red, Filter mode to "Allow entities that match criteria", and the Name to red_filter.

You should only need one filter_activator_tfteam per team on your map. All of your team-specific triggers can reference one of these two entities. It might be a good idea to place these entities in some easy to remember location. For our example, we will place our red_filter in our red team's spawn area.

The prop_dynamic

The prop_dynamic.

Next, place a prop_dynamic and set its World Model to a nice door. We'll use models/props_gameplay/door_slide_large_door.mdl for our example. Do not forget to set the "parent" field to match the name of the func_door, otherwise the prop will remain stationary when the trigger is activated.

The func_door

The func_door.

The second part of the door is a func_door brush-based entity that will determine how the door moves. As this entity will be only a moving scheme for the prop, use the material tools/toolsnodraw. The func_door will act as an invisible barrier to any player who runs into it, so the best thing to do is shape the brush close to the size of the model door, and overlap the two.

You will need to set a number of the func_door's properties:

Property Name Description Value
Name This should be something appropriate, such as door_red_spawn_01 for our example. door_red_spawn_01
Speed Changing this will effect how fast the door will open and close. Usually, this is set to 400 or 500 for a door that you don't have to wait for.
Move direction This determines which direction the door moves when it opens. Our example door will open Up, which can be chosen from the pull-down menu (this has been updated, there are now xyz numbers instead of a pulldown). Up (-90 0 0)
Lip This determines how much of the door, in Hammer units, sticks out when it is fully open. For our example, we will use a value of 3. 3
Delay Before Reset Set this to -1 so that the door will never close as long as someone is in the doorway. Otherwise, the door will close and NOT reopen until everyone has cleared the trigger. Anything other that -1 can lead to griefing (i.e. one player can lock an entire team in the spawnroom). -1

Next, go to the Flags tab in the func_door's properties, and make sure Touch Opens is UNCHECKED. If this were checked, it would allow the other team to bypass our filter by touching the door! Also, check the Toggle flag.

Now we need to give our func_door control of the door model. Select the prop_dynamic door model, and set its Parent property to the name of our func_door. In this case, that's door_red_spawn_01.

The trigger_multiple

The trigger_multiple.

The third and final component of the door is a trigger_multiple brush-based entity that will tell the door to open when a player touches the trigger, and then to close.

The trigger should be large enough to handle players approaching from odd angles, and to ensure that the door opens before the player reaches it. You will usually want to stretch the trigger volume so that it can be activated from either side of the door, rather than making two trigger volumes. It should use the tools/toolstrigger material.

Make sure to set "Delay Before Reset" to 0. As default it is set to -1, meaning the door will never close once opened.

Select the Outputs tab in the trigger_multiple's properties window. You will need to add two outputs, which look like this:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnEndTouchAll door_red_spawn_01 Close <none> 0.00 No
Io11.png OnStartTouchAll door_red_spawn_01 Open <none> 0.00 No

Finally, the trigger_multiple's Filter Name property should be set to your filter_activator_tfteam's name to make the door team-specific. In our case, that's red_filter.

That's it, we now have a door that will only open for the Red team!

Download the demo map here

Design Theory

Placement

In theory, team-specific doors can be placed anywhere, but be very careful as they can greatly alter the balance of a map.

Collision

Doors on the official maps have their prop_dynamic's Collisions property set to Not Solid. This is not required, but may be more efficient. In this case, the door's func_door brush will determine its collision, which is usually accurate enough.

Buildings

It may be necessary to add a func_nobuild brush-based entity in the doorway as well. This prevents engineers placing any buildings like sentries and dispensers in the doorway, which can cause various problems: It would look unrealistic when the door closes on the building, and it would prevent the door closing if you do not have the "Force-closed" property set to "yes". (However that property should always be set to "No" to prevent trapping the player within the door model.)

See also..