Func button: Difference between revisions
Jump to navigation
Jump to search
Bug:Do not lock while pressed; it will not return when unlocked. [todo tested in ?]
Bug:The Engine cannot properly find the Glow entity if its off-grid. It will pick several entities close to where the supposed off-grid glow entity is. [todo tested in ?]
mNo edit summary |
mNo edit summary |
||
| Line 30: | Line 30: | ||
| Buttons | | Buttons | ||
|- | |- | ||
| <code>0</code> || None (Silent) || {{ | | <code>0</code> || None (Silent) || {{Sound|common/null.wav}} | ||
|- | |- | ||
| <code>1</code> || Big zap & Warmup || {{ | | <code>1</code> || Big zap & Warmup || {{Sound|buttons/button1.wav}} | ||
|- | |- | ||
| <code>2</code> || Access Denied || {{ | | <code>2</code> || Access Denied || {{Sound|buttons/button2.wav}} | ||
|- | |- | ||
| <code>3</code> || Access Granted || {{ | | <code>3</code> || Access Granted || {{Sound|buttons/button3.wav}} | ||
|- | |- | ||
| <code>4</code> || Quick Combolock || {{ | | <code>4</code> || Quick Combolock || {{Sound|buttons/button4.wav}} | ||
|- | |- | ||
| <code>5</code> || Power Deadbolt 1 || {{ | | <code>5</code> || Power Deadbolt 1 || {{Sound|buttons/button5.wav}} | ||
|- | |- | ||
| <code>6</code> || Power Deadbolt 2 || {{ | | <code>6</code> || Power Deadbolt 2 || {{Sound|buttons/button6.wav}} | ||
|- | |- | ||
| <code>7</code> || Plunger || buttons/button7.wav | | <code>7</code> || Plunger || buttons/button7.wav | ||
|- | |- | ||
| <code>8</code> || Small zap || {{ | | <code>8</code> || Small zap || {{Sound|buttons/button8.wav}} | ||
|- | |- | ||
| <code>9</code> || Keycard Sound || {{ | | <code>9</code> || Keycard Sound || {{Sound|buttons/button9.wav}} | ||
|- | |- | ||
| <code>10</code> || Buzz || {{ | | <code>10</code> || Buzz || {{Sound|buttons/button10.wav}} | ||
|- | |- | ||
| <code>11</code> || Buzz Off || buttons/button11.wav | | <code>11</code> || Buzz Off || buttons/button11.wav | ||
| Line 60: | Line 60: | ||
| <code>14</code> || Lightswitch || buttons/lightswitch2.wav | | <code>14</code> || Lightswitch || buttons/lightswitch2.wav | ||
|- | |- | ||
| <code>15</code> || small bleek || {{ | | <code>15</code> || small bleek || {{Sound|buttons/button15.wav}} | ||
|- | |- | ||
| <code>16</code> || small deny || {{ | | <code>16</code> || small deny || {{Sound|buttons/button16.wav}} | ||
|- | |- | ||
| <code>17</code> || small doop || {{ | | <code>17</code> || small doop || {{Sound|buttons/button17.wav}} | ||
|- | |- | ||
| <code>18</code> || small tech deny || {{ | | <code>18</code> || small tech deny || {{Sound|buttons/button18.wav}} | ||
|- | |- | ||
| <code>19</code> || click and combine screen fuzz || {{ | | <code>19</code> || click and combine screen fuzz || {{Sound|buttons/button19.wav}} | ||
|- | |- | ||
| <code>20</code> || roomy beep || buttons/button20.wav | | <code>20</code> || roomy beep || buttons/button20.wav | ||
| Line 74: | Line 74: | ||
| Levers | | Levers | ||
|- | |- | ||
| <code>21</code> || lever or wheel: turn + move sqeek || {{ | | <code>21</code> || lever or wheel: turn + move sqeek || {{Sound|buttons/lever1.wav}} | ||
|- | |- | ||
| <code>22</code> || lever or wheel: latch + release gas || {{ | | <code>22</code> || lever or wheel: latch + release gas || {{Sound|buttons/lever2.wav}} | ||
|- | |- | ||
| <code>23</code> || lever or wheel: ratchet + sqeek || {{ | | <code>23</code> || lever or wheel: ratchet + sqeek || {{Sound|buttons/lever3.wav}} | ||
|- | |- | ||
| <code>24</code> || lever or wheel: large ratchet || {{ | | <code>24</code> || lever or wheel: large ratchet || {{Sound|buttons/lever4.wav}} | ||
|- | |- | ||
| <code>25</code> || lever or wheel: clanky + gas release || {{ | | <code>25</code> || lever or wheel: clanky + gas release || {{Sound|buttons/lever5.wav}} | ||
|- | |- | ||
| <code>26</code> || lever or wheel: latch + large metal thud || {{ | | <code>26</code> || lever or wheel: latch + large metal thud || {{Sound|buttons/lever6.wav}} | ||
|- | |- | ||
| <code>27</code> || lever or wheel: smaller ratchet || {{ | | <code>27</code> || lever or wheel: smaller ratchet || {{Sound|buttons/lever7.wav}} | ||
|- | |- | ||
| <code>28</code> || lever or wheel: smaller lever move || {{ | | <code>28</code> || lever or wheel: smaller lever move || {{Sound|buttons/lever8.wav}} | ||
|- | |- | ||
| New buttons | | New buttons | ||
| Line 98: | Line 98: | ||
| <code>33</code> || tech blip || buttons/button23.wav | | <code>33</code> || tech blip || buttons/button23.wav | ||
|- | |- | ||
| <code>34</code> || clickbeepbeep open || {{ | | <code>34</code> || clickbeepbeep open || {{Sound|buttons/button24.wav}} | ||
|- | |- | ||
| <code>35</code> || small high blip || buttons/button12.wav | | <code>35</code> || small high blip || buttons/button12.wav | ||
| Line 104: | Line 104: | ||
| <code>36</code> || small tech fuzz blip || buttons/button13.wav | | <code>36</code> || small tech fuzz blip || buttons/button13.wav | ||
|- | |- | ||
| <code>37</code> || small click bleep (change to lightswitch) || {{ | | <code>37</code> || small click bleep (change to lightswitch) || {{Sound|buttons/button14.wav}} | ||
|- | |- | ||
| Combine Buttons | | Combine Buttons | ||
|- | |- | ||
| <code>40</code> || combine door lock - locked || {{ | | <code>40</code> || combine door lock - locked || {{Sound|buttons/combine_button_locked.wav}} | ||
|- | |- | ||
| <code>41</code> || combine blip growl || {{ | | <code>41</code> || combine blip growl || {{Sound|buttons/combine_button1.wav}} | ||
|- | |- | ||
| <code>42</code> || combine squick growl || {{ | | <code>42</code> || combine squick growl || {{Sound|buttons/combine_button2.wav}} | ||
|- | |- | ||
| <code>43</code> || combine whine purr || {{ | | <code>43</code> || combine whine purr || {{Sound|buttons/combine_button3.wav}} | ||
|- | |- | ||
| <code>44</code> || combine click talk || buttons/combine_button4.wav | | <code>44</code> || combine click talk || buttons/combine_button4.wav | ||
|- | |- | ||
| <code>45</code> || combine click growl fizz || {{ | | <code>45</code> || combine click growl fizz || {{Sound|buttons/combine_button5.wav}} | ||
|- | |- | ||
| <code>46</code> || combine click fizz (deny) || buttons/combine_button6.wav | | <code>46</code> || combine click fizz (deny) || buttons/combine_button6.wav | ||
|- | |- | ||
| <code>47</code> || combine click talker || {{ | | <code>47</code> || combine click talker || {{Sound|buttons/combine_button7.wav}} | ||
|} | |} | ||
{{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|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.}} | ||
| Line 129: | Line 129: | ||
! Value || Description || Default Sound | ! Value || Description || Default Sound | ||
|- | |- | ||
| <code>0</code> || None || {{ | | <code>0</code> || None || {{Sound|common/null.wav}} | ||
|- | |- | ||
| <code>2</code> || Access Denied || {{ | | <code>2</code> || Access Denied || {{Sound|buttons/button2.wav}} | ||
|- | |- | ||
| <code>8</code> || Small zap || {{ | | <code>8</code> || Small zap || {{Sound|buttons/button8.wav}} | ||
|- | |- | ||
| <code>10</code> || Buzz || {{ | | <code>10</code> || Buzz || {{Sound|buttons/button10.wav}} | ||
|- | |- | ||
| <code>11</code> || Buzz Off || buttons/button11.wav | | <code>11</code> || Buzz Off || buttons/button11.wav | ||
|- | |- | ||
| <code>12</code> || Latch Locked || {{ | | <code>12</code> || Latch Locked || {{Sound|doors/latchlocked2.wav}} | ||
|} | |} | ||
{{KV|Unlocked Sound|intn=unlocked_sound|choices|Sound played when the button is unlocked. {{confirm|doesn't seem to work?}}}} | {{KV|Unlocked Sound|intn=unlocked_sound|choices|Sound played when the button is unlocked. {{confirm|doesn't seem to work?}}}} | ||
| Line 145: | Line 145: | ||
! Value || Description || Default Sound | ! Value || Description || Default Sound | ||
|- | |- | ||
| <code>0</code> || None || {{ | | <code>0</code> || None || {{Sound|common/null.wav}} | ||
|- | |- | ||
| <code>1</code> || Big zap & Warmup || {{ | | <code>1</code> || Big zap & Warmup || {{Sound|buttons/button1.wav}} | ||
|- | |- | ||
| <code>3</code> || Access Granted || {{ | | <code>3</code> || Access Granted || {{Sound|buttons/button3.wav}} | ||
|- | |- | ||
| <code>4</code> || Quick Combolock || {{ | | <code>4</code> || Quick Combolock || {{Sound|buttons/button4.wav}} | ||
|- | |- | ||
| <code>5</code> || Power Deadbolt 1 || {{ | | <code>5</code> || Power Deadbolt 1 || {{Sound|buttons/button5.wav}} | ||
|- | |- | ||
| <code>6</code> || Power Deadbolt 2 || {{ | | <code>6</code> || Power Deadbolt 2 || {{Sound|buttons/button6.wav}} | ||
|- | |- | ||
| <code>7</code> || Plunger || buttons/button7.wav | | <code>7</code> || Plunger || buttons/button7.wav | ||
|- | |- | ||
| <code>8</code> || Small zap || {{ | | <code>8</code> || Small zap || {{Sound|buttons/button8.wav}} | ||
|- | |- | ||
| <code>9</code> || Keycard Sound || {{ | | <code>9</code> || Keycard Sound || {{Sound|buttons/button9.wav}} | ||
|- | |- | ||
| <code>10</code> || Buzz || {{ | | <code>10</code> || Buzz || {{Sound|buttons/button10.wav}} | ||
|- | |- | ||
| <code>13</code> || Latch Unlocked || {{ | | <code>13</code> || Latch Unlocked || {{Sound|doors/latchunlocked1.wav}} | ||
|- | |- | ||
| <code>14</code> || Lightswitch || {{ | | <code>14</code> || Lightswitch || {{Sound|buttons/lightswitch2.wav}} | ||
|} | |} | ||
{{KV|Locked Sentence|intn=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|choices|A sentence played when the player tries to use the button, and fails because it's locked.}} | ||
Revision as of 00:38, 28 March 2023
| func_button | |
|---|---|
| Type | Brush entity |
| Engine | |
| Availability | In all games |
Template:Entity 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.
Keyvalues
- Move Direction (Pitch Yaw Roll) (movedir) <angle>
- Specifies the direction of motion to move when the button is used.
- 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.
- Master (Obsolete) (master) <string>
- Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be pressed.
- Sounds (sounds) <choices>
- Make this button emit a sound when pressed. Template:ModernNote
Value Description Default Sound Buttons 0None (Silent) common/null.wav1Big zap & Warmup buttons/button1.wav2Access Denied buttons/button2.wav3Access Granted buttons/button3.wav4Quick Combolock buttons/button4.wav5Power Deadbolt 1 buttons/button5.wav6Power Deadbolt 2 buttons/button6.wav7Plunger buttons/button7.wav 8Small zap buttons/button8.wav9Keycard Sound buttons/button9.wav10Buzz buttons/button10.wav11Buzz Off buttons/button11.wav 12latch locked doors/latchlocked2.wav 13Latch Unlocked doors/latchunlocked1.wav 14Lightswitch buttons/lightswitch2.wav 15small bleek buttons/button15.wav16small deny buttons/button16.wav17small doop buttons/button17.wav18small tech deny buttons/button18.wav19click and combine screen fuzz buttons/button19.wav20roomy beep buttons/button20.wav Levers 21lever or wheel: turn + move sqeek buttons/lever1.wav22lever or wheel: latch + release gas buttons/lever2.wav23lever or wheel: ratchet + sqeek buttons/lever3.wav24lever or wheel: large ratchet buttons/lever4.wav25lever or wheel: clanky + gas release buttons/lever5.wav26lever or wheel: latch + large metal thud buttons/lever6.wav27lever or wheel: smaller ratchet buttons/lever7.wav28lever or wheel: smaller lever move buttons/lever8.wavNew buttons 31shock buzz buttons/button21.wav 32clickbeep buttons/button22.wav 33tech blip buttons/button23.wav 34clickbeepbeep open buttons/button24.wav35small high blip buttons/button12.wav 36small tech fuzz blip buttons/button13.wav 37small click bleep (change to lightswitch) buttons/button14.wavCombine Buttons 40combine door lock - locked buttons/combine_button_locked.wav41combine blip growl buttons/combine_button1.wav42combine squick growl buttons/combine_button2.wav43combine whine purr buttons/combine_button3.wav44combine click talk buttons/combine_button4.wav 45combine click growl fizz buttons/combine_button5.wav46combine click fizz (deny) buttons/combine_button6.wav 47combine click talker buttons/combine_button7.wav
- 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.
- Locked Sound (locked_sound) <choices>
- Sound played when the player tries to use the button, and fails because it's locked.
Value Description Default Sound 0None common/null.wav2Access Denied buttons/button2.wav8Small zap buttons/button8.wav10Buzz buttons/button10.wav11Buzz Off buttons/button11.wav 12Latch Locked doors/latchlocked2.wav
- Unlocked Sound (unlocked_sound) <choices>
- Sound played when the button is unlocked.
Confirm:doesn't seem to work?
Value Description Default Sound 0None common/null.wav1Big zap & Warmup buttons/button1.wav3Access Granted buttons/button3.wav4Quick Combolock buttons/button4.wav5Power Deadbolt 1 buttons/button5.wav6Power Deadbolt 2 buttons/button6.wav7Plunger buttons/button7.wav 8Small zap buttons/button8.wav9Keycard Sound buttons/button9.wav10Buzz buttons/button10.wav13Latch Unlocked doors/latchunlocked1.wav14Lightswitch buttons/lightswitch2.wav
- Locked Sentence (locked_sentence) <choices>
- A sentence played when the player tries to use the button, and fails because it's locked.
Value Description 0None 1Gen. Access Denied 2Security Lockout 3Blast Door 4Fire Door 5Chemical Door 6Radiation Door 7Gen. Containment 8Maintenance Door 9Broken Shut Door
- Unlocked Sentence (unlocked_sentence) <choices>
- A sentence played when the button is unlocked.
Value Description 0None 1Gen. Access Granted 2Security Disengaged 3Blast Door 4Fire Door 5Chemical Door 6Radiation Door 7Gen. Containment 8Maintenance area
- Glow Entity (glow) <targetname> (in all games since
) - The name of an entity that will get a +use glow for this button.
- Use Look-At Limit (min_use_angle) <string> (in all games since
) - 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).
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentnameortarget).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
Flags
- Don't move : [1]
- Toggle : [32]
- Touch Activates : [256]
- Damage Activates : [512]
- Use Activates : [1024]
- Starts locked : [2048]
- Sparks : [4096]
- Non-solid : [16384] Template:CSGO add Template:GMOD also
Inputs
- Lock
- Lock the button, preventing it from functioning.
- 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.
Outputs
- OnDamaged
- Fired when the button is damaged.
- OnPressed
- Fired when the button is pressed.
- OnUseLocked
- Fired when the button is used while locked.
- OnIn
- Fired when the button reaches the in/pressed position.
- OnOut
- Fired when the button reaches the out/released position.