Func button: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: Automated text replacement (-\{\|\r +{| class=standard-table))
(Cleanup)
Line 1: Line 1:
{{wrongtitle|title=func_button}}
{{base brush|func_button}} It is designed to be used for a player-usable button. When used by the player, it moves to a pressed position.
{{base_brush}}
 
== Entity description==
A [[Entity#Brush_entities|brush entity]] that's designed to be used for a player-usable button. When used by the player, it moves to a pressed position.
{{brushmodel}}
{{brushmodel}}
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.


== Keyvalues ==
== Keyvalues ==
* {{KV Targetname}}
{{KV|Move Direction (Pitch Yaw Roll)|angle|Specifies the direction of motion to move when the button is used.}}
* {{KV Parentname}}
{{KV|Speed|integer|The speed that the button moves, in inches per second.}}
* {{KV Origin}}
{{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 RenderFields}}
{{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.}}
* '''movedir'''
{{KV|Master (Obsolete)|string|Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be pressed.}}
: <angle> Specifies the direction of motion to move when the button is used.
{{KV|Sounds|choices}}
* '''speed'''
: <integer> The speed that the button moves, in inches per second.
* '''health'''
: <integer> Legacy method of specifying whether or not the button can be shot to activate it. Use the 'Damage Activates' spawnflag instead.
* '''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. Use a negative value to make it go further.
* '''sounds'''
: <choices>
:{| class=standard-table
:{| class=standard-table
! Literal Value || Description
! Value || Description
|-
|-
| 0 || None (Silent)
| <code>0</code> || None (Silent)
|-
|-
| 1 || Big zap & Warmup
| <code>1</code> || Big zap & Warmup
|-
|-
| 2 || Access Denied
| <code>2</code> || Access Denied
|-
|-
| 3 || Access Granted
| <code>3</code> || Access Granted
|-
|-
| 4 || Quick Combolock
| <code>4</code> || Quick Combolock
|-
|-
| 5 || Power Deadbolt 1
| <code>5</code> || Power Deadbolt 1
|-
|-
| 6 || Power Deadbolt 2
| <code>6</code> || Power Deadbolt 2
|-
|-
| 7 || Plunger*
| <code>7</code> || Plunger
|-
|-
| 8 || Small zap
| <code>8</code> || Small zap
|-
|-
| 9 || Keycard Sound
| <code>9</code> || Keycard Sound
|-
|-
| 10 || Buzz
| <code>10</code> || Buzz
|-
|-
| 11 || Buzz Off*
| <code>11</code> || Buzz Off
|-
|-
| 12 || latch locked
| <code>12</code> || latch locked
|-
|-
| 13 || Latch Unlocked
| <code>13</code> || Latch Unlocked
|-
|-
| 14 || Lightswitch
| <code>14</code> || Lightswitch
|-
|-
| 15 || small bleek
| <code>15</code> || small bleek
|-
|-
| 16 || small deny
| <code>16</code> || small deny
|-
|-
| 17 || small doop
| <code>17</code> || small doop
|-
|-
| 18 || small tech deny
| <code>18</code> || small tech deny
|-
|-
| 19 || click and combine screen fuzz
| <code>19</code> || click and combine screen fuzz
|-
|-
| 20 || roomy beep*
| <code>20</code> || roomy beep
|-
|-
| 21 || lever or wheel: turn + move sqeek
| <code>21</code> || lever or wheel: turn + move sqeek
|-
|-
| 22 || lever or wheel: latch + release gas
| <code>22</code> || lever or wheel: latch + release gas
|-
|-
| 23 || lever or wheel: ratchet + sqeek
| <code>23</code> || lever or wheel: ratchet + sqeek
|-
|-
| 24 || lever or wheel: large ratchet
| <code>24</code> || lever or wheel: large ratchet
|-
|-
| 25 || lever or wheel: clanky + gas release
| <code>25</code> || lever or wheel: clanky + gas release
|-
|-
| 26 || lever or wheel: latch + large metal thud
| <code>26</code> || lever or wheel: latch + large metal thud
|-
|-
| 27 || lever or wheel: smaller ratchet
| <code>27</code> || lever or wheel: smaller ratchet
|-
|-
| 28 || lever or wheel: smaller lever move
| <code>28</code> || lever or wheel: smaller lever move
|-
|-
| 31 || shock buzz*
| <code>31</code> || shock buzz
|-
|-
| 32 || clickbeep*
| <code>32</code> || clickbeep
|-
|-
| 33 || tech blip*
| <code>33</code> || tech blip
|-
|-
| 34 || clickbeepbeep open
| <code>34</code> || clickbeepbeep open
|-
|-
| 35 || small high blip*
| <code>35</code> || small high blip
|-
|-
| 36 || small tech fuzz blip*
| <code>36</code> || small tech fuzz blip
|-
|-
| 37 || small click bleep (change to lightswitch)
| <code>37</code> || small click bleep (change to lightswitch)
|-
|-
| 40 || combine door lock - locked
| <code>40</code> || combine door lock - locked
|-
|-
| 41 || combine blip growl
| <code>41</code> || combine blip growl
|-
|-
| 42 || combine squick growl
| <code>42</code> || combine squick growl
|-
|-
| 43 || combine whine purr
| <code>43</code> || combine whine purr
|-
|-
| 44 || combine click talk*
| <code>44</code> || combine click talk
|-
|-
| 45 || combine click growl fizz
| <code>45</code> || combine click growl fizz
|-
|-
| 46 || combine click fizz (deny)*
| <code>46</code> || combine click fizz (deny)
|-
|-
| 47 || combine click talker
| <code>47</code> || combine click talker
|}
|}
:{{Note|The samples marked with an asterisk (*) are missing and therefore doesn't play in-game.}}
{{KV|Delay Before Reset (-1 stay)|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.}}
* '''wait'''
{{KV|Locked Sound|choices|Sound played when the player tries to use the button, and fails because it's locked.}}
: <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'''
: <choices> Sound played when the player tries to use the button, and fails because it's locked.
:{| class=standard-table
:{| class=standard-table
! Literal Value || Description
! Value || Description
|-
|-
| 0 || None
| <code>0</code> || None
|-
|-
| 2 || Access Denied
| <code>2</code> || Access Denied
|-
|-
| 8 || Small zap
| <code>8</code> || Small zap
|-
|-
| 10 || Buzz
| <code>10</code> || Buzz
|-
|-
| 11 || Buzz Off
| <code>11</code> || Buzz Off
|-
|-
| 12 || Latch Locked
| <code>12</code> || Latch Locked
|}
|}
* '''unlocked_sound'''
{{KV|Unlocked Sound|choices|Sound played when the button is unlocked.}}
: <choices> Sound played when the button is unlocked.
:{| class=standard-table
:{| class=standard-table
! Literal Value || Description
! Value || Description
|-
|-
| 0 || None
| <code>0</code> || None
|-
|-
| 1 || Big zap & Warmup
| <code>1</code> || Big zap & Warmup
|-
|-
| 3 || Access Granted
| <code>3</code> || Access Granted
|-
|-
| 4 || Quick Combolock
| <code>4</code> || Quick Combolock
|-
|-
| 5 || Power Deadbolt 1
| <code>5</code> || Power Deadbolt 1
|-
|-
| 6 || Power Deadbolt 2
| <code>6</code> || Power Deadbolt 2
|-
|-
| 7 || Plunger
| <code>7</code> || Plunger
|-
|-
| 8 || Small zap
| <code>8</code> || Small zap
|-
|-
| 9 || Keycard Sound
| <code>9</code> || Keycard Sound
|-
|-
| 10 || Buzz
| <code>10</code> || Buzz
|-
|-
| 13 || Latch Unlocked
| <code>13</code> || Latch Unlocked
|-
|-
| 14 || Lightswitch
| <code>14</code> || Lightswitch
|}
|}
* '''locked_sentence'''
{{KV|Locked Sentence|choices|A sentence played when the player tries to use the button, and fails because it's locked.}}
: <choices> A sentence played when the player tries to use the button, and fails because it's locked.
:{| class=standard-table
:{| class=standard-table
! Literal Value || Description
! Value || Description
|-
|-
| 0 || None
| <code>0</code> || None
|-
|-
| 1 || Gen. Access Denied
| <code>1</code> || Gen. Access Denied
|-
|-
| 2 || Security Lockout
| <code>2</code> || Security Lockout
|-
|-
| 3 || Blast Door
| <code>3</code> || Blast Door
|-
|-
| 4 || Fire Door
| <code>4</code> || Fire Door
|-
|-
| 5 || Chemical Door
| <code>5</code> || Chemical Door
|-
|-
| 6 || Radiation Door
| <code>6</code> || Radiation Door
|-
|-
| 7 || Gen. Containment
| <code>7</code> || Gen. Containment
|-
|-
| 8 || Maintenance Door
| <code>8</code> || Maintenance Door
|-
|-
| 9 || Broken Shut Door
| <code>9</code> || Broken Shut Door
|}
|}
* '''unlocked_sentence'''
{{KV|Unlocked Sentence|choices|A sentence played when the button is unlocked.}}
: <choices> A sentence played when the button is unlocked.
:{| class=standard-table
:{| class=standard-table
! Literal Value || Description
! Value || Description
|-
|-
| 0 || None
| <code>0</code> || None
|-
|-
| 1 || Gen. Access Granted
| <code>1</code> || Gen. Access Granted
|-
|-
| 2 || Security Disengaged
| <code>2</code> || Security Disengaged
|-
|-
| 3 || Blast Door
| <code>3</code> || Blast Door
|-
|-
| 4 || Fire Door
| <code>4</code> || Fire Door
|-
|-
| 5 || Chemical Door
| <code>5</code> || Chemical Door
|-
|-
| 6 || Radiation Door
| <code>6</code> || Radiation Door
|-
|-
| 7 || Gen. Containment
| <code>7</code> || Gen. Containment
|-
|-
| 8 || Maintenance area
| <code>8</code> || Maintenance area
|}
|}
* '''_minlight'''
{{KV|Minimum Light Level|string|The minimum level of ambient light that hits this brush.}}
: <float> The minimum level of ambient light that hits this brush.
{{KV Targetname}}
{{KV Parentname}}
{{KV Origin}}
{{KV RenderFields}}
{{KV DamageFilter}}


== Flags ==
== Flags ==
* 1 : Don't move - This button will not move when pressed.
* 1 : Don't move
* 32 : Toggle - The button toggles between pressed and released.
* 32 : Toggle
* 256 : Touch Activates - Collision with this button will trigger it.
* 256 : Touch Activates
* 512 : Damage Activates - Damage to this button will trigger it.
* 512 : Damage Activates
* 1024 : Use Activates - Using +use '''(Default: E)''' on this button will trigger it.
* 1024 : Use Activates
* 2048 : Starts locked -  This button spawns locked - This means it cannot be pressed.
* 2048 : Starts locked
* 4096 : Sparks - This button emits sparks when triggered.
* 4096 : Sparks


== Inputs ==
== Inputs ==
* {{I Targetname}}
{{I Targetname}}
* {{I RenderFields}}
{{I Parentname}}
* {{I Parentname}}
{{I RenderFields}}
* {{I Button}}
{{I DamageFilter}}
{{I Button}}


== Outputs ==
== Outputs ==
* {{O Targetname}}
{{O Targetname}}
* {{O Button}}
{{O Button}}


== See also ==
== See also ==
* [[func_rot_button]]
* [[func_rot_button]]
* [[momentary_rot_button]]
* [[momentary_rot_button]]

Revision as of 07:47, 24 July 2011

Template:Base brush It is designed to be used for a player-usable button. When used by the player, it moves to a pressed position. Template:Brushmodel For an example of a func_button used to make a keypad, see the button_keypad prefab.

Keyvalues

Move Direction (Pitch Yaw Roll) ([todo internal name (i)]) <angle>
Specifies the direction of motion to move when the button is used.
Speed ([todo internal name (i)]) <integer>
The speed that the button moves, in inches per second.
Health (Obsolete) ([todo internal name (i)]) <integer>
Legacy method of specifying whether or not the button can be shot to activate it. Use the 'Damage Activates' spawnflag instead.
Lip ([todo internal name (i)]) <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) ([todo internal name (i)]) <string>
Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be pressed.
Sounds ([todo internal name (i)]) <choices>
Value Description
0 None (Silent)
1 Big zap & Warmup
2 Access Denied
3 Access Granted
4 Quick Combolock
5 Power Deadbolt 1
6 Power Deadbolt 2
7 Plunger
8 Small zap
9 Keycard Sound
10 Buzz
11 Buzz Off
12 latch locked
13 Latch Unlocked
14 Lightswitch
15 small bleek
16 small deny
17 small doop
18 small tech deny
19 click and combine screen fuzz
20 roomy beep
21 lever or wheel: turn + move sqeek
22 lever or wheel: latch + release gas
23 lever or wheel: ratchet + sqeek
24 lever or wheel: large ratchet
25 lever or wheel: clanky + gas release
26 lever or wheel: latch + large metal thud
27 lever or wheel: smaller ratchet
28 lever or wheel: smaller lever move
31 shock buzz
32 clickbeep
33 tech blip
34 clickbeepbeep open
35 small high blip
36 small tech fuzz blip
37 small click bleep (change to lightswitch)
40 combine door lock - locked
41 combine blip growl
42 combine squick growl
43 combine whine purr
44 combine click talk
45 combine click growl fizz
46 combine click fizz (deny)
47 combine click talker
Delay Before Reset (-1 stay) ([todo internal name (i)]) <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 ([todo internal name (i)]) <choices>
Sound played when the player tries to use the button, and fails because it's locked.
Value Description
0 None
2 Access Denied
8 Small zap
10 Buzz
11 Buzz Off
12 Latch Locked
Unlocked Sound ([todo internal name (i)]) <choices>
Sound played when the button is unlocked.
Value Description
0 None
1 Big zap & Warmup
3 Access Granted
4 Quick Combolock
5 Power Deadbolt 1
6 Power Deadbolt 2
7 Plunger
8 Small zap
9 Keycard Sound
10 Buzz
13 Latch Unlocked
14 Lightswitch
Locked Sentence ([todo internal name (i)]) <choices>
A sentence played when the player tries to use the button, and fails because it's locked.
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 ([todo internal name (i)]) <choices>
A sentence played when the button is unlocked.
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
Minimum Light Level ([todo internal name (i)]) <string>
The minimum level of ambient light that hits this brush.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Parentname:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.

Origin:

Origin (X Y Z) (origin) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.

RenderFields:


Render Mode (rendermode) <byte choices>
Set a non-standard rendering mode on this entity.
Render Modes
  • 0: Normal
  • 1: Color
  • 2: Texture
  • 3: Glow
  • 4: Solid/Alphatest Obsolete
  • 5: Additive
  • 6: Removed, does nothing Obsolete
  • 7: Additive Fractional Frame
  • 8: Alpha Add
  • 9: World Space Glow
  • 10: Don't Render
Render FX (renderfx) <byte choices>
Various somewhat legacy alpha effects. See render effects.
Render Amount / Transparency (renderamt) <byte>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.

DamageFilter:

Damage Filter (damagefilter) <targetname>
Name of the filter_damage_type entity that controls which entities can damage us.


Flags

  • 1 : Don't move
  • 32 : Toggle
  • 256 : Touch Activates
  • 512 : Damage Activates
  • 1024 : Use Activates
  • 2048 : Starts locked
  • 4096 : Sparks

Inputs

Parentname:
SetParent <stringRedirectInput/string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <stringRedirectInput/string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <stringRedirectInput/string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.

RenderFields:

Alpha <integer 0–255>
Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its rendermode set to a number other than 0.
Color <color255RedirectInput/color32>
Sets an RGB color for the entity.

DamageFilter:

SetDamageFilter <stringRedirectInput/string>
Sets the entity to use as damage filter. Pass in an empty string (no parameter) to clear the damage filter.
Button:
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

Button:
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.

See also