Func button: Difference between revisions
Jump to navigation
Jump to search
Tip:If you have a button over a prop, which fires outputs by damaging the button brush, you might as well use a prop_dynamic with its "OnTakeDamage" output. This will use the prop's collision mesh as the button, instead of a brush.
This is very useful for small items, since small button brushes may compile with missing faces, due to a vbsp bug[Clarify].
Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
Tip:Use func_rot_button instead for non-solid buttons in other games, or use a %CompileNonSolid material.
Bug:In Half-Life 2 series nonsolid buttons may cause you to interact with things besides or behind the buttons.
Spazzing K-9 (talk | contribs) (added sound file descriptions for plunger and buzz off (both are hl1 sounds by the way)) |
Le Glaconus (talk | contribs) No edit summary |
||
(81 intermediate revisions by 26 users not shown) | |||
Line 1: | Line 1: | ||
{{base brush|func_button}} | {{LanguageBar}} | ||
{{TabsBar|main=gs2|base=func_button}} | |||
{{CD|CBaseButton|file1=buttons.cpp}} | |||
{{This is a|brush entity|name=func_button}} | |||
It is designed to be used for a [[player]]-usable button. When [[+use]]d by the player, it moves to a pressed position. | |||
It is designed to be used for a player-usable button. When | |||
For an example of a <code>func_button</code> used to make a keypad, see the [[button_keypad]] prefab. | For an example of a <code>func_button</code> used to make a keypad, see the [[button_keypad]] prefab. | ||
{{ | {{tip|If you have a button over a prop, which fires outputs by damaging the button brush, you might as well use a {{ent|prop_dynamic}} with its "OnTakeDamage" output. This will use the prop's [[collision mesh]] as the button, instead of a brush.</br> | ||
This is very useful for small items, since small button brushes may compile with missing faces, due to a [[vbsp]] bug{{clarify}}.}} | |||
== Keyvalues == | |||
{{Brush rendering note}} | |||
== | {{KV Targetname}} | ||
{{KV|Move Direction (Pitch Yaw Roll)|angle|Specifies the direction of motion to move when the button is used.}} | {{KV|Glow Entity|intn=glow|targetname|only={{l4ds}}|The name of an entity that will get a {{ent|+use}} glow for this button. {{note|{{l4d2}} the "Hand Extend" animation will play when looking at Glow Entity.}}{{bug|The Engine cannot properly find the Glow entity if it's off-grid. It will pick several entities close to where the supposed off-grid glow entity is.}} }} | ||
{{KV|Speed|integer|The speed that the button moves, in | {{KV|Use Look-At Limit|intn=min_use_angle|since={{csgo}}|also={{gmod}}|string|Limit the usable look-at angle. -1 is looking directly away, 0 is looking perpendicular, 1 is looking directly at. To allow a deviation of at most 45°, insert cos(45°) ≈ 0.7071 or for 5° use cos(5°) ≈ 0.9962 (see [[dot product|dot product]]).}} | ||
{{KV|Health (Obsolete)|integer|Legacy method of specifying whether or not the button can be shot to activate it. Use the 'Damage Activates' spawnflag instead.}} | {{KV|Move Direction (Pitch Yaw Roll)|intn=movedir|angle|Specifies the direction of motion to move when the button is used.}} | ||
{{KV|Lip|integer|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.}} | {{KV|Delay Before Reset (-1 stay)|intn=wait|integer|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.}} | ||
{{KV| | {{KV|Speed|intn=speed|integer|The speed that the button moves, in units per second.}} | ||
{{KV|Health (Obsolete)|intn=health|integer|Legacy method of specifying whether or not the button can be shot to activate it. Use the ''Damage Activates'' spawnflag instead.}} | |||
:{| class= | {{KV|Lip|intn=lip|integer|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.}} | ||
{{KV|Sounds|intn=sounds|integer choices|Make this button emit a sound when pressed. {{note|The list below was made for Half-Life 2. All games support this keyvalue, but some don't have a number of these sound files. To edit these sounds, look for <code>Buttons.snd</code> (followed by a number from the Value column in this table) in <code>hl2/scripts/game_sounds_world.txt</code> or your game's appropriate [[Soundscript]] file.}}}} | |||
:{| class="wikitable mw-collapsible mw-collapsed" | |||
! colspan=3 | Choices | |||
|- | |||
! Value || Description || Default Sound | ! Value || Description || Default Sound | ||
|- | |- | ||
| <code>0</code> || None (Silent) || | | colspan=3 | Buttons | ||
|- | |||
| <code>0</code> || None (Silent) || common/null.wav | |||
|- | |||
| <code>1</code> || Big zap & Warmup || buttons/button1.wav | |||
|- | |||
| <code>2</code> || Access Denied || buttons/button2.wav | |||
|- | |||
| <code>3</code> || Access Granted || buttons/button3.wav | |||
|- | |- | ||
| <code> | | <code>4</code> || Quick Combolock || buttons/button4.wav | ||
|- | |- | ||
| <code> | | <code>5</code> || Power Deadbolt 1 || buttons/button5.wav | ||
|- | |- | ||
| <code> | | <code>6</code> || Power Deadbolt 2 || buttons/button6.wav | ||
|- | |- | ||
| <code> | | <code>7</code> || Plunger || buttons/button7.wav | ||
|- | |- | ||
| <code> | | <code>8</code> || Small zap || buttons/button8.wav | ||
|- | |- | ||
| <code> | | <code>9</code> || Keycard Sound || buttons/button9.wav | ||
|- | |- | ||
| <code> | | <code>10</code> || Buzz || buttons/button10.wav | ||
|- | |- | ||
| <code> | | <code>11</code> || Buzz Off || buttons/button11.wav | ||
|- | |- | ||
| <code> | | <code>12</code> || latch locked || doors/latchlocked2.wav | ||
|- | |- | ||
| <code> | | <code>13</code> || Latch Unlocked || doors/latchunlocked1.wav | ||
|- | |- | ||
| <code> | | <code>14</code> || Lightswitch || buttons/lightswitch2.wav | ||
|- | |- | ||
| <code> | | <code>15</code> || small bleek || buttons/button15.wav | ||
|- | |- | ||
| <code> | | <code>16</code> || small deny || buttons/button16.wav | ||
|- | |- | ||
| <code> | | <code>17</code> || small doop || buttons/button17.wav | ||
|- | |- | ||
| <code> | | <code>18</code> || small tech deny || buttons/button18.wav | ||
|- | |- | ||
| <code> | | <code>19</code> || click and combine screen fuzz || buttons/button19.wav | ||
|- | |- | ||
| <code> | | <code>20</code> || roomy beep || buttons/button20.wav | ||
|- | |- | ||
| | | colspan=3 | Levers | ||
|- | |- | ||
| <code> | | <code>21</code> || lever or wheel: turn + move sqeek || buttons/lever1.wav | ||
|- | |- | ||
| <code> | | <code>22</code> || lever or wheel: latch + release gas || buttons/lever2.wav | ||
|- | |- | ||
| <code> | | <code>23</code> || lever or wheel: ratchet + sqeek || buttons/lever3.wav | ||
|- | |- | ||
| <code> | | <code>24</code> || lever or wheel: large ratchet || buttons/lever4.wav | ||
|- | |- | ||
| <code> | | <code>25</code> || lever or wheel: clanky + gas release || buttons/lever5.wav | ||
|- | |- | ||
| <code> | | <code>26</code> || lever or wheel: latch + large metal thud || buttons/lever6.wav | ||
|- | |- | ||
| <code> | | <code>27</code> || lever or wheel: smaller ratchet || buttons/lever7.wav | ||
|- | |- | ||
| <code> | | <code>28</code> || lever or wheel: smaller lever move || buttons/lever8.wav | ||
|- | |- | ||
| | | colspan=3 | New buttons | ||
|- | |- | ||
| <code> | | <code>31</code> || shock buzz || buttons/button21.wav | ||
|- | |- | ||
| <code> | | <code>32</code> || clickbeep || buttons/button22.wav | ||
|- | |- | ||
| <code> | | <code>33</code> || tech blip || buttons/button23.wav | ||
|- | |- | ||
| <code> | | <code>34</code> || clickbeepbeep open || buttons/button24.wav | ||
|- | |- | ||
| <code> | | <code>35</code> || small high blip || buttons/button12.wav | ||
|- | |- | ||
| <code> | | <code>36</code> || small tech fuzz blip || buttons/button13.wav | ||
|- | |- | ||
| <code> | | <code>37</code> || small click bleep (change to lightswitch) || buttons/button14.wav | ||
|- | |- | ||
| | | colspan=3 | Combine Buttons | ||
|- | |- | ||
| <code>40</code> || combine door lock - locked || combine_button_locked.wav | | <code>40</code> || combine door lock - locked || buttons/combine_button_locked.wav | ||
|- | |- | ||
| <code>41</code> || combine blip growl || combine_button1.wav | | <code>41</code> || combine blip growl || buttons/combine_button1.wav | ||
|- | |- | ||
| <code>42</code> || combine squick growl || combine_button2.wav | | <code>42</code> || combine squick growl || buttons/combine_button2.wav | ||
|- | |- | ||
| <code>43</code> || combine whine purr || combine_button3.wav | | <code>43</code> || combine whine purr || buttons/combine_button3.wav | ||
|- | |- | ||
| <code>44</code> || combine click talk | | <code>44</code> || combine click talk || buttons/combine_button4.wav | ||
|- | |- | ||
| <code>45</code> || combine click growl fizz || combine_button5.wav | | <code>45</code> || combine click growl fizz || buttons/combine_button5.wav | ||
|- | |- | ||
| <code>46</code> || combine click fizz (deny) | | <code>46</code> || combine click fizz (deny) || buttons/combine_button6.wav | ||
|- | |- | ||
| <code>47</code> || combine click talker || combine_button7.wav | | <code>47</code> || combine click talker || buttons/combine_button7.wav | ||
|} | |} | ||
{{KV|Locked Sound|intn=locked_sound|integer choices|Sound played when the player tries to use the button, and fails because it's locked.}} | |||
{{KV|Locked Sound|choices|Sound played when the player tries to use the button, and fails because it's locked.}} | :{| class="wikitable mw-collapsible mw-collapsed" | ||
:{| class= | ! colspan=3 | Choices | ||
|- | |||
! Value || Description || Default Sound | ! Value || Description || Default Sound | ||
|- | |- | ||
| <code>0</code> || None || | | <code>0</code> || None || common/null.wav | ||
|- | |- | ||
| <code>2</code> || Access Denied || button2.wav | | <code>2</code> || Access Denied || buttons/button2.wav | ||
|- | |- | ||
| <code>8</code> || Small zap || button8.wav | | <code>8</code> || Small zap || buttons/button8.wav | ||
|- | |- | ||
| <code>10</code> || Buzz || button10.wav | | <code>10</code> || Buzz || buttons/button10.wav | ||
|- | |- | ||
| <code>11</code> || Buzz Off || button11 | | <code>11</code> || Buzz Off || buttons/button11.wav | ||
|- | |- | ||
| <code>12</code> || Latch Locked || | | <code>12</code> || Latch Locked || doors/latchlocked2.wav | ||
|} | |} | ||
{{KV|Unlocked Sound|choices|Sound played when the button is unlocked.}} | {{KV|Unlocked Sound|intn=unlocked_sound|integer choices|Sound played when the button is unlocked. {{confirm|doesn't seem to work?}}}} | ||
:{| class= | :{| class="wikitable mw-collapsible mw-collapsed" | ||
! colspan=3 | Choices | |||
|- | |||
! Value || Description || Default Sound | ! Value || Description || Default Sound | ||
|- | |- | ||
| <code>0</code> || None | | <code>0</code> || None || common/null.wav | ||
|- | |- | ||
| <code>1</code> || Big zap & Warmup || button1.wav | | <code>1</code> || Big zap & Warmup || buttons/button1.wav | ||
|- | |- | ||
| <code>3</code> || Access Granted || button3.wav | | <code>3</code> || Access Granted || buttons/button3.wav | ||
|- | |- | ||
| <code>4</code> || Quick Combolock || button4.wav | | <code>4</code> || Quick Combolock || buttons/button4.wav | ||
|- | |- | ||
| <code>5</code> || Power Deadbolt 1 || button5.wav | | <code>5</code> || Power Deadbolt 1 || buttons/button5.wav | ||
|- | |- | ||
| <code>6</code> || Power Deadbolt 2 || button6.wav | | <code>6</code> || Power Deadbolt 2 || buttons/button6.wav | ||
|- | |- | ||
| <code>7</code> || Plunger || button7.wav | | <code>7</code> || Plunger || buttons/button7.wav | ||
|- | |- | ||
| <code>8</code> || Small zap || button8.wav | | <code>8</code> || Small zap || buttons/button8.wav | ||
|- | |- | ||
| <code>9</code> || Keycard Sound || button9.wav | | <code>9</code> || Keycard Sound || buttons/button9.wav | ||
|- | |- | ||
| <code>10</code> || Buzz || button10.wav | | <code>10</code> || Buzz || buttons/button10.wav | ||
|- | |- | ||
| <code>13</code> || Latch Unlocked || | | <code>13</code> || Latch Unlocked || doors/latchunlocked1.wav | ||
|- | |- | ||
| <code>14</code> || Lightswitch || lightswitch2.wav | | <code>14</code> || Lightswitch || buttons/lightswitch2.wav | ||
|} | |} | ||
{{KV|Locked Sentence|choices|A sentence played when the player tries to use the button, and fails because it's locked.}} | {{KV|Locked Sentence|intn=locked_sentence|integer choices|A sentence played when the player tries to use the button, and fails because it's locked.}} | ||
:{| class= | :{| class="wikitable mw-collapsible mw-collapsed" | ||
! colspan=3 | Choices | |||
|- | |||
! Value || Description | ! Value || Description | ||
|- | |- | ||
Line 175: | Line 196: | ||
| <code>9</code> || Broken Shut Door | | <code>9</code> || Broken Shut Door | ||
|} | |} | ||
{{KV|Unlocked Sentence|choices|A sentence played when the button is unlocked.}} | {{KV|Unlocked Sentence|intn=unlocked_sentence|integer choices|A sentence played when the button is unlocked.}} | ||
:{| class= | :{| class="wikitable mw-collapsible mw-collapsed" | ||
! colspan=3 | Choices | |||
|- | |||
! Value || Description | ! Value || Description | ||
|- | |- | ||
Line 197: | Line 220: | ||
| <code>8</code> || Maintenance area | | <code>8</code> || Maintenance area | ||
|} | |} | ||
{{KV| | {{KV|Master (Obsolete)|intn=master|target_destination|Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be pressed.|obsolete=1}} | ||
== Flags == | == Flags == | ||
{{fl|1|Don't move}} | |||
{{fl|32|Toggle|Makes the button fire the outputs "OnIn" and "OnOut" if being pressed repeatedly.<br>Does not fire "OnOut" when "Damage Activates" is also set. As a workaround you can have this button "press" another button somewhere out of reach, which only has the "toggle" and "don't move" flag.}} | |||
{{fl|256|Touch Activates}} | |||
{{fl|512|Damage Activates|If set, makes the button fire "OnPressed" when damaged. Honors the lock like any other input option.<br>"OnDamaged" would fire any time the button is pressed, even if locked.}} | |||
{{fl|1024|[[Use]] Activates}} | |||
{{fl|2048|Starts locked}} | |||
{{fl|4096|Sparks}} | |||
{{fl|16384|Non-solid|since={{csgo}}{{also|{{gmod}}}}}} | |||
{{Tip|Use {{ent|func_rot_button}} instead for non-solid buttons in other games, or use a [[%CompileNonSolid]] material.{{bug|hidetested=true|In {{hl2series|1}} nonsolid buttons may cause you to interact with things besides or behind the buttons.}}}} | |||
== Inputs == | == Inputs == | ||
{{I | {{I|Lock|Lock the button, preventing it from functioning. {{Bug|Do not lock while pressed; it will not return when unlocked.}}}} | ||
{{I | {{I|Unlock|Unlock the button, allowing it to function.}} | ||
{{I | {{I|Press|Activate the button as if it was pressed.}} | ||
{{I | {{I|PressIn|Activate the button as if it was pressed, sending it to the bottom position.}} | ||
{{I | {{I|PressOut|Unpress the button, sending it to the top position. Fire OnPressed output.}} | ||
== Outputs == | == Outputs == | ||
{{O | {{O|OnDamaged| activator = entity that damages this | ||
{{O | |Fired when the button is damaged, regardless of whether it is locked, or if the "Damage Activates" is set.{{example|This could be used to destroy a locked button to open doors, while pressing "+use" would play a "Deny" sound.}} }} | ||
{{O|OnPressed| activator = player that pressed the button or activator of the input causing this | |||
|Fired when the button is activated through any means set by the flags.}} | |||
{{O|OnUseLocked| activator = player that uses the button | |||
|Fired when the button is used while locked.}} | |||
{{O|OnIn| activator = entity that caused the press or entity that last damaged the button{{confirm}} | |||
|Fired when the button reaches the in/pressed position.}} | |||
{{O|OnOut| activator = entity that caused the press or entity that last damaged the button{{confirm}} | |||
|Fired when the button reaches the out/released position. "Delay Before Reset" will fire this output, after the delay is over. If the "Toggle" flag is set, pressing the button again will fire this output.}} | |||
== See also == | == See also == | ||
* | * {{ent|func_rot_button}} | ||
* | * {{ent|momentary_rot_button}} |
Latest revision as of 09:55, 29 May 2025
![]() |
---|
CBaseButton |
![]() |
func_button
is a brush entity available in all Source games.
It is designed to be used for a player-usable button. When +used by the player, it moves to a pressed position.
For an example of a func_button
used to make a keypad, see the button_keypad prefab.

This is very useful for small items, since small button brushes may compile with missing faces, due to a vbsp bug[Clarify].
Keyvalues

- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Glow Entity (glow) <targetname> (only in
)
- The name of an entity that will get a +use glow for this button.
Bug:The Engine cannot properly find the Glow entity if it's off-grid. It will pick several entities close to where the supposed off-grid glow entity is. [todo tested in ?]
- Use Look-At Limit (min_use_angle) <string> (in all games since
) (also in
)
- Limit the usable look-at angle. -1 is looking directly away, 0 is looking perpendicular, 1 is looking directly at. To allow a deviation of at most 45°, insert cos(45°) ≈ 0.7071 or for 5° use cos(5°) ≈ 0.9962 (see dot product).
- Move Direction (Pitch Yaw Roll) (movedir) <angle>
- Specifies the direction of motion to move when the button is used.
- Delay Before Reset (-1 stay) (wait) <integer>
- 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.
- Speed (speed) <integer>
- The speed that the button moves, in units per second.
- Health (Obsolete) (health) <integer>
- Legacy method of specifying whether or not the button can be shot to activate it. Use the Damage Activates spawnflag instead.
- Lip (lip) <integer>
- 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.
- Sounds (sounds) <integer choices>
- Make this button emit a sound when pressed.
Note:The list below was made for Half-Life 2. All games support this keyvalue, but some don't have a number of these sound files. To edit these sounds, look for
Buttons.snd
(followed by a number from the Value column in this table) inhl2/scripts/game_sounds_world.txt
or your game's appropriate Soundscript file.
Choices Value Description Default Sound Buttons 0
None (Silent) common/null.wav 1
Big zap & Warmup buttons/button1.wav 2
Access Denied buttons/button2.wav 3
Access Granted buttons/button3.wav 4
Quick Combolock buttons/button4.wav 5
Power Deadbolt 1 buttons/button5.wav 6
Power Deadbolt 2 buttons/button6.wav 7
Plunger buttons/button7.wav 8
Small zap buttons/button8.wav 9
Keycard Sound buttons/button9.wav 10
Buzz buttons/button10.wav 11
Buzz Off buttons/button11.wav 12
latch locked doors/latchlocked2.wav 13
Latch Unlocked doors/latchunlocked1.wav 14
Lightswitch buttons/lightswitch2.wav 15
small bleek buttons/button15.wav 16
small deny buttons/button16.wav 17
small doop buttons/button17.wav 18
small tech deny buttons/button18.wav 19
click and combine screen fuzz buttons/button19.wav 20
roomy beep buttons/button20.wav Levers 21
lever or wheel: turn + move sqeek buttons/lever1.wav 22
lever or wheel: latch + release gas buttons/lever2.wav 23
lever or wheel: ratchet + sqeek buttons/lever3.wav 24
lever or wheel: large ratchet buttons/lever4.wav 25
lever or wheel: clanky + gas release buttons/lever5.wav 26
lever or wheel: latch + large metal thud buttons/lever6.wav 27
lever or wheel: smaller ratchet buttons/lever7.wav 28
lever or wheel: smaller lever move buttons/lever8.wav New buttons 31
shock buzz buttons/button21.wav 32
clickbeep buttons/button22.wav 33
tech blip buttons/button23.wav 34
clickbeepbeep open buttons/button24.wav 35
small high blip buttons/button12.wav 36
small tech fuzz blip buttons/button13.wav 37
small click bleep (change to lightswitch) buttons/button14.wav Combine Buttons 40
combine door lock - locked buttons/combine_button_locked.wav 41
combine blip growl buttons/combine_button1.wav 42
combine squick growl buttons/combine_button2.wav 43
combine whine purr buttons/combine_button3.wav 44
combine click talk buttons/combine_button4.wav 45
combine click growl fizz buttons/combine_button5.wav 46
combine click fizz (deny) buttons/combine_button6.wav 47
combine click talker buttons/combine_button7.wav
- Locked Sound (locked_sound) <integer choices>
- Sound played when the player tries to use the button, and fails because it's locked.
Choices Value Description Default Sound 0
None common/null.wav 2
Access Denied buttons/button2.wav 8
Small zap buttons/button8.wav 10
Buzz buttons/button10.wav 11
Buzz Off buttons/button11.wav 12
Latch Locked doors/latchlocked2.wav
- Unlocked Sound (unlocked_sound) <integer choices>
- Sound played when the button is unlocked.
Confirm:doesn't seem to work?
Choices Value Description Default Sound 0
None common/null.wav 1
Big zap & Warmup buttons/button1.wav 3
Access Granted buttons/button3.wav 4
Quick Combolock buttons/button4.wav 5
Power Deadbolt 1 buttons/button5.wav 6
Power Deadbolt 2 buttons/button6.wav 7
Plunger buttons/button7.wav 8
Small zap buttons/button8.wav 9
Keycard Sound buttons/button9.wav 10
Buzz buttons/button10.wav 13
Latch Unlocked doors/latchunlocked1.wav 14
Lightswitch buttons/lightswitch2.wav
- Locked Sentence (locked_sentence) <integer choices>
- A sentence played when the player tries to use the button, and fails because it's locked.
Choices Value Description 0
None 1
Gen. Access Denied 2
Security Lockout 3
Blast Door 4
Fire Door 5
Chemical Door 6
Radiation Door 7
Gen. Containment 8
Maintenance Door 9
Broken Shut Door
- Unlocked Sentence (unlocked_sentence) <integer choices>
- A sentence played when the button is unlocked.
Choices Value Description 0
None 1
Gen. Access Granted 2
Security Disengaged 3
Blast Door 4
Fire Door 5
Chemical Door 6
Radiation Door 7
Gen. Containment 8
Maintenance area
- Master (Obsolete) (master) <targetname>
- Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be pressed.
Flags
- Don't move : [1]
- Toggle : [32]
- Makes the button fire the outputs "OnIn" and "OnOut" if being pressed repeatedly.
Does not fire "OnOut" when "Damage Activates" is also set. As a workaround you can have this button "press" another button somewhere out of reach, which only has the "toggle" and "don't move" flag.
- Touch Activates : [256]
- Damage Activates : [512]
- If set, makes the button fire "OnPressed" when damaged. Honors the lock like any other input option.
"OnDamaged" would fire any time the button is pressed, even if locked.
- Use Activates : [1024]
- Starts locked : [2048]
- Sparks : [4096]
- Non-solid : [16384] (in all games since
(also in
))


Inputs
- Lock
- Lock the button, preventing it from functioning.
Bug:Do not lock while pressed; it will not return when unlocked. [todo tested in ?]
- Unlock
- Unlock the button, allowing it to function.
- Press
- Activate the button as if it was pressed.
- PressIn
- Activate the button as if it was pressed, sending it to the bottom position.
- PressOut
- Unpress the button, sending it to the top position. Fire OnPressed output.
Outputs
- OnDamaged
- !activator = entity that damages this
!caller = this entity
Fired when the button is damaged, regardless of whether it is locked, or if the "Damage Activates" is set.Example:This could be used to destroy a locked button to open doors, while pressing "+use" would play a "Deny" sound.
- OnPressed
- !activator = player that pressed the button or activator of the input causing this
!caller = this entity
Fired when the button is activated through any means set by the flags.
- OnUseLocked
- !activator = player that uses the button
!caller = this entity
Fired when the button is used while locked.
- OnIn
- !activator = entity that caused the press or entity that last damaged the button[confirm]
!caller = this entity
Fired when the button reaches the in/pressed position.
- OnOut
- !activator = entity that caused the press or entity that last damaged the button[confirm]
!caller = this entity
Fired when the button reaches the out/released position. "Delay Before Reset" will fire this output, after the delay is over. If the "Toggle" flag is set, pressing the button again will fire this output.