Buttons

There are different ways to open a door. By shooting, by approaching and of course by pressing a button. I built a small box around a brush which uses a texture out of the base_button category.

(Image boxbutton)

Select the placeholder, press the right mouse button, go to func and then click on func_button. You've just created your first button (blue lines).

(Image converted)

Leave the button selected and open the entity window:

(Image buttonsettings) health: Normally a button is enabled when it's touched, but setting the health key forces the player to shoot at it to activate.

The "lip" key determines the units remaining at the end of a move.

wait: When the key and value box is set like in the picture, the button can be used again after 1 second. "-1" reenables the button immediately after it hit the end of its move. If the button is active again it is possible to press it once again so the doors keep opening.

speed: Defines the moving speed of the button when it's pushed (default: 40). The entities, the button is connected to, will take effect when the button is at the end of its move.

The button can only be connected to entities, whatever they may fulfill. You could connect it to a target_delay (that's another tutorial) or to a door so it opens. That's what we will do now. First deselect everything. Now select the button, then the door and press Ctrl+k. Do this with the other part of the door, too. You should see two blue lines with arrows now, directing from the button to the doors.

(Image connected)

You should copy the button and place it in the other room, too, so you can also go back. But don't forget to change the "angle" value then. Here it would be possible to delete the "health" key so you can try out both settings.

Here you can get the maps for this tutorial (place them into baseq3/maps):

Note: Any func_button entity with a health key can be triggered by projectiles and weapons and therefore can also activate targets.

Written by Bliccer