func_button
Jump to navigation
Jump to search
Note:
func_button
is a mesh entity available in all Source 2 games.
FGD definition

- Keyvalues:
displaytext
,override_anticipation_name
,forcenpcexclude
- Inputs: Enable / Disable
- Flags
32768: "Skip Player Animation"
,2: "Starts Disabled"
,
@BaseClass = Button
[
// Inputs
input Lock(void) : "Lock the button, preventing it from functioning."
input Unlock(void) : "Unlock the button, allowing it to function."
input Disable(void) : "Disable the button, preventing entities from finding the button (removes all capabilities of the button)"
input Enable(void) : "Enable the button, allowing entities to find the button again"
input Press(void) : "Activate the button as if it was pressed."
input PressIn(void) : "Activate the button as if it was pressed, sending it to the bottom position."
input PressOut(void) : "Unpress the button, sending it to the top position."
// Outputs
output OnDamaged(void) : "Fired when the button is damaged."
output OnPressed(void) : "Fired when the button is pressed."
output OnUseLocked(void) : "Fired when the button is used while locked."
output OnIn(void) : "Fired when the button reaches the in/pressed position."
output OnOut(void) : "Fired when the button reaches the out/released position."
displaytext(string) : "Display Text" : : "Place localization text here and it will be displayed in tooltips, etc."
]
@BaseClass = ButtonSounds
[
use_sound(sound) : "Use sound" : "" : "Sound event played when the button is successfully used."
locked_sound(sound) : "Locked Sound" : "" : "Sound played when the player tries to use the button, and fails because it's locked."
unlocked_sound(sound) : "Unlocked Sound" : "" : "Sound played when the button is unlocked."
]
@BaseClass base(Targetname, Parentname, RenderFields,DamageFilter, Button, ButtonSounds) = BaseFuncButton
[
movedir(angle) : "Move Direction (Pitch Yaw Roll)" : "0 0 0" : "Specifies the direction of motion to move when the button is used."
speed(integer) : "Speed" : 5 : "The speed that the button moves, in inches per second."
glow(target_destination) : "Glow Entity" : : "The name of an entity that will get the +use glow for this button."
wait(float) : "Delay Before Reset (-1 stay)" : 3 : "Amount of time, in seconds, after the button has been pressed before it returns to the starting position. Once it has returned, it can be used again. If the value is set to -1, the button never returns."
_minlight(string) : "Minimum Light Level" : : "The minimum level of ambient light that hits this brush."
]
@SolidClass base(BaseFuncButton) drawangles_local{ angles_key = "movedir" } = func_button :
"A brush entity that's designed to be used for a player-useable button. When used by the player, it moves to a pressed position."
[
lip(integer) : "Lip" : 0 : "The amount, in inches, of the button to leave sticking out of the wall it recedes into when pressed. Negative values make the button recede even further into the wall."
master(string) : "Master (Obsolete)" : : "Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be pressed."
override_anticipation_name(string) : "Override Anticipation Action Name" : : "Specify an override for the GetUsePreviewAction for this button (the anticipation type)"
forcenpcexclude(boolean) : "Force NPC Exclude" : "0" : "NPC movement and collision will ignore this button"
spawnflags(flags) =
[
1: "Don't move" : 0
2: "Starts Disabled" : 0
32: "Toggle" : 0
256: "Touch Activates": 0
512: "Damage Activates": 0
1024: "Use Activates" : 1
2048: "Starts locked" : 0
4096: "Sparks" : 0
16384: "Non-solid" : 0
32768: "Skip Player Animation" : 0
]
]