func_button

A func_button moves in and fires its targets when a player uses it, shoots it or touches it, and then comes back
out. While it is pressed, it shows its alternate textures, the +a frames.
Attributes
The entity also has these common keys:
- Naming and triggering: KillTarget and Global Entity Name
- Position: Pitch Yaw Roll
- Appearance: Render FX, Render Mode, FX Amount and FX Color
- Compiler keys of brush entities: all of them
targetnameTriggering the entity presses it like a player does, but not with the flag Touch Activates. See Common keys.
targetNames the entities to trigger when the button is pressed, with the use type that Use type sets, and passes on the player who pressed it as the activator.
delaySets how many seconds pass between the press and the firing of its targets.
0locked_soundSets the sound the entity plays when a player tries to use it while its Master locks it. A door also plays it when a player touches it and it only opens when triggered.
- None (0)
- Access Denied (2)
- Small zap (8)
- Buzz (10)
- Buzz Off (11)
- Latch Locked (12)
None (0)unlocked_soundSets the sound the entity plays when it is used while it isn't locked. A button plays it when it is pressed, and a door when it starts to open.The 12 choices
None (0)locked_sentenceSets an announcer sentence group the entity speaks when a player tries to use it while it is locked. Each try plays the next sentence of the group, at most one every few seconds.The 10 choices
None (0)unlocked_sentenceSets an announcer sentence group the entity speaks when it is used while it isn't locked. Each use plays the next sentence of the group.The 9 choices
None (0)Sets a sound file that plays instead of Locked Sound when a player uses the button while it is locked. If you leave this key empty, the button plays Locked Sound.
Sets a sound file that plays instead of Unlocked Sound when the button is pressed. If you leave this key empty, the button plays Unlocked Sound.
Sets the name of a sentence group of sound/sentences.txt, such as NA, which the entity speaks instead of Locked Sentence.
If you leave this key empty, the entity speaks Locked Sentence.
Sets the name of a sentence group of sound/sentences.txt, such as EA, which the entity speaks instead of Unlocked Sentence.
If you leave this key empty, the entity speaks Unlocked Sentence.
Shows brackets around the object for players near it. Within Hint Distance, the brackets are faint and in the HUD color. When the player is close enough to use the object and looks at it, the brackets take the color of the choice.
- None (empty) - No brackets
- button - Yellow, and orange while a master locks the object
- charger - Green, and red while the charger is empty
- eyescanner - Yellow
- pickup - Yellow
None (empty)objecthint_distanceSets how far from the player's eyes the faint brackets show, in units, up to 4096. The object must be in front of the player and in sight.
If you leave this key empty or set 0, the distance is 512 units.
Names the parent, an entity that this one moves and turns with. The entity keeps the place and the angles it has on the parent in the editor. If several entities have the name, the first one counts. A name ending in .1 to .4 puts a sprite or a model that isn't solid on that attachment point of the model of the parent. A solid brush on a parent that turns needs its own origin brush. Moving objects explains it all.
If you leave this key empty, the entity doesn't move with anything.
parentflagsKeeps some of the entity's own position or angles instead of following the parent. Add up the values of the axes to keep: 2 for X, 4 for Y, 8 for Z, 16 for pitch, 32 for yaw and 64 for roll. So 112 keeps the entity level. 0 follows the parent on every axis.
0speedSets how fast the button moves, in units per second, and 0 means 40.
5healthSets whether players shoot the button instead of using it. Above 0, any damage presses it, and players can't press it with their use key.
lipSets how many units of the button stay out when it is pressed in, and 0 means 4.
masterNames a master, and while the master is off, the button is locked and plays its locked sound.
soundsPicks the sound the button plays when it is pressed.The 13 choices
None (0)waitSets how many seconds the button stays pressed before it comes back out and can be pressed again, and -1 keeps it pressed for good. With 0, it waits 1 second.
3Names the entities to trigger when the button starts to move in.
Names the entities to trigger when a player uses it while its master keeps it locked, at most every 2 seconds.
Sets the use type its Target gets.
- Off (-1) - The Target gets Off
- Toggle (0) - The Target gets Toggle
- On (1) - The Target gets On
- On/Off (2) - With Toggle, On when the button goes in and Off when it comes out
- Off/On (3) - With Toggle, Off when the button goes in and On when it comes out
Toggle (0)With Toggle, sets how many seconds pass before players can use the button again.
Flags
1Don't moveThe button doesn't move when it is pressed
32ToggleThe button stays pressed until it is used again, which brings it back out, and it fires its targets each time
64SparksThe button gives off sparks while it isn't pressed
256Touch ActivatesPlayers press the button by walking into it, not with their use key, and triggering the button does nothing
Notes
- A
scripted_sentencecan make the button speak, and the sentence then plays from the button - Each player can turn the object hints off, or keep only the hint on what their use key would use, with the client
setting
cl_objecthint
See also
func_rot_button- a button that turnsbutton_target- a button that players shoot- Masters and states - how a Master locks an entity
- func_button on TWHL - the Half-Life entity
Changes since 1.38
- You can use the new keys Object Hint Template, Hint Distance, Trigger before move, Trigger on return, Target when locked, Use type, Wait before toggling again, Custom sound, Player use policy and the custom locked and unlocked sounds and sentences, and the new flag Player Can't Use
- A
scripted_sentencecan make a button speak, as in the Half-Life 25th Anniversary Update. In SBO 1.38, only monsters spoke


