Level Editor/Entities/Button
Jump to navigation
Jump to search
| Button | |
|---|---|
| Made with | Functional > Button (from Selection) |
| What it is | Brushes and props a player presses with the use key, firing outputs |
| In the game | Yes, it is exported with the map |
A button is a set of brushes and props that a player presses with the use key, standing close to it. Pressing it fires its outputs: open a door, ring a bell, add one to a counter, start a timer. A button does not move.
Making one
- Build the button from brushes and props (a panel, a lever, a switch box).
- Select them all.
- Choose Functional > Button (from Selection). (With nothing selected: Select the brushes and props the button is made of first.)
- Set its prompt, reach and outputs in the inspector. The status line reminds you: Button made of N node(s): its prompt, reach and outputs in the inspector.
As with a door, the selection goes into the button, and you change what it holds by dragging rows in the scene tree.
Inspector
| Setting | Type | Default | What it does |
|---|---|---|---|
| Use Prompt | Text | Press | What the HUD tells a player standing at it to press the use key for. |
| Reach | Meters | 1.0 | How far round what it holds a player can press it from. |
| Team | List | Anyone | Who may press it: Anyone, Team 1 or Team 2. |
| Wait | Seconds | 1.0 | How long before it can be pressed again. Below 0: once a match. |
| Starts Locked | Check box | Off | A locked button fires OnUseLocked instead of OnPressed, until something sends it Unlock. |
| Press Sound | Game sound | none | Plays when it is pressed. |
| Locked Sound | Game sound | none | Plays when it is pressed while locked. |
| Outputs | Outputs panel | none | What it fires and at whom. See Outputs. |
Outputs and inputs
Events: OnPressed (a player pressed use at it, or it took Press) and OnUseLocked (a player pressed it while it was locked). The activator is the player.
Inputs: Press (as a player would), Lock and Unlock.
A gamemode script hears a press in _logic_event with the event "OnPressed".