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: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 ?]
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 ?]
 
 Note:Archived page history
Note:Archived page history
 Important:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.
Important:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.
		
	
|  (→Keyvalues:  added note about glow entity and turned previous note to using BUG template) |  (Removed redundant Otherlang. Collapsed tables. Added examples for min_use_angle and linked dot product. Used Template:Fl and intn parameter of Template:KV.) | ||
| Line 1: | Line 1: | ||
| {{ | {{lang|Func button}} | ||
| | | |||
| }} | |||
| {{Entity also in Source 2}} | {{Entity also in Source 2}} | ||
| {{base brush|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. | |||
| {{base brush|func_button}} 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. | ||
| {{bug|Do not lock while pressed; it will not return when unlocked.}} | {{bug|Do not lock while pressed; it will not return when unlocked.}} | ||
| Line 12: | Line 9: | ||
| ==Keyvalues== | ==Keyvalues== | ||
| {{KV|Move Direction (Pitch Yaw Roll)  | {{KV|Move Direction (Pitch Yaw Roll)|intn=movedir|angle|Specifies the direction of motion to move when the button is used.}} | ||
| {{KV|Speed  | {{KV|Speed|intn=speed|integer|The speed that the button moves, in units per second.}} | ||
| {{KV|Health (Obsolete)  | {{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.}} | ||
| {{KV|Lip  | {{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|Master (Obsolete)  | {{KV|Master (Obsolete)|intn=master|string|Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be pressed.}} | ||
| {{KV|Sounds  | {{KV|Sounds|intn=sounds|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=standard-table | :{| class="standard-table mw-collapsible mw-collapsed" | ||
| ! Value || Description || Default Sound | ! Value || Description || Default Sound | ||
| |- | |- | ||
| Line 117: | Line 114: | ||
| | <code>47</code> || combine click talker || buttons/combine_button7.wav | | <code>47</code> || combine click talker || buttons/combine_button7.wav | ||
| |} | |} | ||
| {{KV|Delay Before Reset (-1 stay)  | {{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|Locked Sound  | {{KV|Locked Sound|intn=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 mw-collapsible mw-collapsed" | ||
| ! Value || Description || Default Sound | ! Value || Description || Default Sound | ||
| |- | |- | ||
| Line 134: | Line 131: | ||
| | <code>12</code> || Latch Locked || doors/latchlocked2.wav | | <code>12</code> || Latch Locked || doors/latchlocked2.wav | ||
| |} | |} | ||
| {{KV|Unlocked Sound  | {{KV|Unlocked Sound|intn=unlocked_sound|choices|Sound played when the button is unlocked. {{confirm|doesn't seem to work?}}}} | ||
| :{| class=standard-table | :{| class="standard-table mw-collapsible mw-collapsed" | ||
| ! Value || Description || Default Sound | ! Value || Description || Default Sound | ||
| |- | |- | ||
| Line 162: | Line 159: | ||
| | <code>14</code> || Lightswitch || buttons/lightswitch2.wav | | <code>14</code> || Lightswitch || buttons/lightswitch2.wav | ||
| |} | |} | ||
| {{KV|Locked Sentence  | {{KV|Locked Sentence|intn=locked_sentence|choices|A sentence played when the player tries to use the button, and fails because it's locked.}} | ||
| :{| class=standard-table | :{| class="standard-table mw-collapsible mw-collapsed" | ||
| ! Value || Description | ! Value || Description | ||
| |- | |- | ||
| Line 186: | Line 183: | ||
| | <code>9</code> || Broken Shut Door | | <code>9</code> || Broken Shut Door | ||
| |} | |} | ||
| {{KV|Unlocked Sentence  | {{KV|Unlocked Sentence|intn=unlocked_sentence|choices|A sentence played when the button is unlocked.}} | ||
| :{| class=standard-table | :{| class="standard-table mw-collapsible mw-collapsed" | ||
| ! Value || Description | ! Value || Description | ||
| |- | |- | ||
| Line 208: | Line 205: | ||
| | <code>8</code> || Maintenance area | | <code>8</code> || Maintenance area | ||
| |} | |} | ||
| {{KV|Glow Entity  | {{KV|Glow Entity|intn=glow|targetname|since=L4D|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.}} | {{note|{{l4d2}} the "Hand Extend" animation will play when looking at Glow Entity.}} | ||
| {{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.}} | {{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.}} | ||
| {{KV|Use Look-At Limit  | {{KV|Use Look-At Limit|intn=min_use_angle|since=CSGO|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 visiblebrush|l4d=1}} | {{KV visiblebrush|l4d=1}} | ||
| {{KV BaseEntity|brush=1}} | {{KV BaseEntity|brush=1}} | ||
| ==Flags== | ==Flags== | ||
| {{fl|1|Don't move}} | |||
| {{fl|32|Toggle}} | |||
| {{fl|256|Touch Activates}} | |||
| {{fl|512|Damage Activates}} | |||
| {{fl|1024|Use Activates}} | |||
| {{fl|2048|Starts locked}} | |||
| {{fl|4096|Sparks}} | |||
| {{fl|16384|Non-solid}} {{CSGO add}} {{GMOD also}} | |||
| ==Inputs== | ==Inputs== | ||
Revision as of 19:32, 28 March 2022

This entity is also available as [[{{{1}}}|{{{1}}}]] for the Source 2 engine. 
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.
For an example of a func_button used to make a keypad, see the button_keypad prefab.
 Bug:Do not lock while pressed; it will not return when unlocked.  [todo tested in ?]
Bug:Do not lock while pressed; it will not return when unlocked.  [todo tested in ?]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.  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 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 forButtons.snd(followed by a number from the Value column in this table) inhl2/scripts/game_sounds_world.txtor your game's appropriate Soundscript file.
- 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 
- 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 - 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) <choices>
- Sound played when the button is unlocked.  Confirm:doesn't seem to work? Confirm:doesn't seem to work?
- 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) <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 (unlocked_sentence) <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 
- Glow Entity (glow)  <targetname> (in all games since  ) )
- The name of an entity that will get a +use glow for this button.
 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 ?]
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 ?]- 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).

This template (and its redirect) is  Deprecated. Its use is not recommended and its functionality may be compromised.
 Deprecated. Its use is not recommended and its functionality may be compromised.
Please use {{Brush rendering note}} instead.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.
 Deprecated. Its use is not recommended and its functionality may be compromised.
 Deprecated. Its use is not recommended and its functionality may be compromised.Please use {{Brush rendering note}} instead.
You can help our editors by replacing or deleting this template on the Pages that use this template. Once no more pages use this template, it should be Marked for deletion.
 Note:Archived page history
Note:Archived page history Important:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.
Important:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.
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.
- SetDamageFilter <targetname>
- Sets a filter for this entity for when it receives damage.
- EnableDamageForces
- Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).
- DisableDamageForces
- Prevents the entity from being pushed by damage done to it.
Todo: move/mention at proper place
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.



























