Door with switch

  • author: Maddin
  • required skills: “Getting Started” tutorials
  • required tools: GtkRadiant

1. The door

First you need two rooms which have to be connected.

Create a brush which shall be the door and right-click in the 2D and choose “func → func_door”:

Open the entity properties by pressing N.

You can now change the direction where the door will move to, the speed of the door and a lot of things more.

The door also needs a targetname to make the switch work.

key value description
angle -1 which direction the door will move to
classname func_door entity-name
closetarget switch which entity to fire when the door is closed
soundSet impdoor1 the door will play this sound when moving
target switch which entity to fire when the door opens
targetname door the name of the door

2. The switch

Build a simple switch out of some brushes and duplicate it.

Now texture one switch with a “on” texture (e.g. “imperial/switch_elevator_grn”) and the other one with a “off” texture (e.g. “imperial/switch_elevator_red”):

Make them both (but seperate) “func → func_usable” and add these keys and values to it:

“on” switch:

key value
classname func_usable
spawnflags 1
targetname switch

“off” switch:

key value
classname func_usable
targetname switch

Then move them both together that they are at the exact same position. Be sure that you checked “Texture Lock” (or press SHIFT+T) before you move them!

Do the same thing at the other side to allow the player to open the door from each side.

3. The trigger

Create a brush in front of the switch and cover it with the “system/trigger” texture.

Right-click in the 2D view and choose “trigger → trigger_multiple”.

Add the following keys and values:

key value description
angle 360 which angle to look at to be able to fire the trigger
classname trigger_multiple entity-name
noise sound/movers/switches/switch1.mp3 adds a specific sound to the switch
spawnflags 7
target door will use the door when triggered
wait 5 only can be triggered each 5 seconds

Again do the same thing with the other switch.

This is how it should look like in the end:

After that, you are done! :-)

tutorials/switchable_door.txt · Last modified: 2011/11/10 16:37 by Maddin
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki