Level Editor/Entities/Button: Difference between revisions

From TeamSpec Wiki
Jump to navigation Jump to search
Level Editor: Button page
 
American spelling
 
Line 18: Line 18:
{{Property table start}}
{{Property table start}}
{{Property row|name=Use Prompt|type=Text|default=Press|desc=What the HUD tells a player standing at it to press the use key for.}}
{{Property row|name=Use Prompt|type=Text|default=Press|desc=What the HUD tells a player standing at it to press the use key for.}}
{{Property row|name=Reach|type=Metres|default=1.0|desc=How far round what it holds a player can press it from.}}
{{Property row|name=Reach|type=Meters|default=1.0|desc=How far round what it holds a player can press it from.}}
{{Property row|name=Team|type=List|default=Anyone|desc=Who may press it: Anyone, Team 1 or Team 2.}}
{{Property row|name=Team|type=List|default=Anyone|desc=Who may press it: Anyone, Team 1 or Team 2.}}
{{Property row|name=Wait|type=Seconds|default=1.0|desc=How long before it can be pressed again. Below 0: once a match.}}
{{Property row|name=Wait|type=Seconds|default=1.0|desc=How long before it can be pressed again. Below 0: once a match.}}

Latest revision as of 04:44, 20 October 2026

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

  1. Build the button from brushes and props (a panel, a lever, a switch box).
  2. Select them all.
  3. Choose Functional > Button (from Selection). (With nothing selected: Select the brushes and props the button is made of first.)
  4. 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".

Related pages

TeamSpec Level Editor
Basics Getting started · Interface · Viewport and camera · Selecting and hiding · Keyboard shortcuts · Settings · Map Config · Troubleshooting
Menus File · Edit · View · Tools · Functional
Panels Scene tree · Inspector · Materials · Props · Snapping · UV editor · Displacement · Terrain
Tools Move, Rotate and Scale · Box · Sphere · Cylinder · Prism · Stairs · Spiral Stairs · Spiral Tower · Arch · Path Brush · Plane · Terrain · Clip · Duplicate · Ruler and Cordon · Edit Vertex and Edge · Edit Face · Loop Cut · Material Brush · Vertex Color Brush · Displacement · Prop Path
Entities Brush · Zone · Group · Mirror Node · Prop · Spawn Point · Supply Pickup · World Boundary · Lights · Water · Sounds · Anchor Platform · Payload Track · Boss Spawn · Map Marker · World Text · Decal · Door · Button · Logic entities · 3D Skybox · Nav Region
Workflows Your first map · Brushes and CSG · Materials and UVs · Lighting and lightmaps · Bots and navigation · Mirrored maps · Outputs and logic · Custom assets · Playtesting · Exporting and publishing · Importing Source maps
Scripting Overview · Server rules · Client HUD · Bots · Teams and spawning · Zones · Pickups · Payload tracks · Map entities · Sandbox limits · Testing · King of the Hill · Team Deathmatch · API reference · What a script may use