Prop button: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Keyvalues: reorganized)
 
(19 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{tabsBar|main=prop_button}}
{{CD|CPropButton|base=CBaseAnimating|file1=portal2/prop_button.cpp}}
[[File:prop_button.png|thumb|100px|The pillar style button]]
[[File:prop_button.png|thumb|100px|The pillar style button]]
 
{{this is a|model entity|name=prop_button|game=Portal 2}}  
{{portal2 point|prop_button}} It is a pillar style button. It acts the same as the [[func_button]] brush and is used as a player activated entity which triggers events in the game.
It is a pillar style button. It acts the same as the [[func_button]] brush and is used as a player activated entity which triggers events in the game. For Old Aperture maps, use [[prop_under_button]].


==Keyvalues==
==Keyvalues==
{{KV|Delay Before Reset|float|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.}}
{{studio rendering note|model, sequence, solid, fademindist, fademaxdist, fadescale}}
{{KV|Play timer sound?|boolean|If set, this button will play timer sounds while button is depressed. This allows fast reset by default - use Prevent fast reset to stop this.}}
{{KV Targetname}}
{{KV|Prevent fast reset?|boolean|Buttons that are timer's allow you to reset early - use this to make the button stick for the entire duration.}}
{{KV|Delay Before Reset|intn=Delay|float|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.}}
{{KV|Skin|choices|Affects the pillar skin. Same as a prop entity's Skin KV. }}
{{KV|Play timer sound?|intn=istimer|boolean|If set, this button will play timer sounds while button is depressed. This allows fast reset by default - use Prevent fast reset to stop this.}}
{{KV|Prevent fast reset?|intn=preventfastreset|boolean|Buttons that are timer's allow you to reset early - use this to make the button stick for the entire duration.}}
{{KV|Skin|intn=skin|choices|Affects the pillar skin. Same as a prop entity's Skin KV. }}
:* 0 : Clean
:* 0 : Clean
:* 1 : Rusted
:* 1 : Rusted
{{KV Angles}}
{{KV Targetname}}
{{KV Parentname}}


==Inputs==
==Inputs==
{{IO|Press|Cause the button to be pressed.}}
{{I|Press|Cause the button to be pressed.}}
{{IO|Lock|Locks the button.}}
{{I|Lock|Locks the button.}}
{{IO|UnLock|UnLocks the button.}}
{{I|UnLock|UnLocks the button.}}
{{IO|CancelPress|Causes the button to reset quietly and without firing OnButtonReset outputs.}}
{{I|CancelPress|Causes the button to reset quietly and without firing OnButtonReset outputs.}}
{{I Targetname}}
{{I Parentname}}


==Outputs==
==Outputs==
{{IO|OnPressed|Called when the button has been pressed.}}
{{O|OnPressed|Called when the button has been pressed.}}
{{IO|OnPressedBlue|Called in Coop when the button has been pressed by the Blue player.}}
{{O|OnPressedBlue|Called in Coop when the button has been pressed by the Blue player.}}
{{IO|OnPressedOrange|Called in Coop when the button has been pressed by the Orange player.}}
{{O|OnPressedOrange|Called in Coop when the button has been pressed by the Orange player.}}
{{IO|OnButtonReset|Called when the button has reset after being pressed.}}
{{O|OnButtonReset|Called when the button has reset after being pressed.}}
{{O Targetname}}


== See also ==
== See also ==
*[[Button (Portal 2)]]
*[[Button (Portal 2)]]
*[[Portal 2 Level Creation]]
*[[Portal 2 Level Creation]]
*[[Env_instructor_hint]]
[[Category:Prop entities|button]]

Latest revision as of 15:21, 1 September 2025

edit
C++ Class hierarchy
CPropButton
CBaseAnimating
CBaseEntity
C++ portal2/prop_button.cpp
The pillar style button

prop_button is a model entity available in Portal 2 Portal 2. It is a pillar style button. It acts the same as the func_button brush and is used as a player activated entity which triggers events in the game. For Old Aperture maps, use prop_under_button.

Keyvalues

Note.pngNote: See Model entity/Generic Keyvalues, Inputs and Outputs for keyvalues and inputs that affect model rendering.
Note that the following keyvalues are unavailable due to being overridden by game code:
model, sequence, solid, fademindist, fademaxdist, fadescale
It may still be possible to use their associated inputs or AddOutput them.
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

Delay Before Reset (Delay) <float>
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.
Play timer sound? (istimer) <boolean>
If set, this button will play timer sounds while button is depressed. This allows fast reset by default - use Prevent fast reset to stop this.
Prevent fast reset? (preventfastreset) <boolean>
Buttons that are timer's allow you to reset early - use this to make the button stick for the entire duration.
Skin (skin) <choices>
Affects the pillar skin. Same as a prop entity's Skin KV.
  • 0 : Clean
  • 1 : Rusted

Inputs

Press
Cause the button to be pressed.
Lock
Locks the button.
UnLock
UnLocks the button.
CancelPress
Causes the button to reset quietly and without firing OnButtonReset outputs.

Outputs

OnPressed
Called when the button has been pressed.
OnPressedBlue
Called in Coop when the button has been pressed by the Blue player.
OnPressedOrange
Called in Coop when the button has been pressed by the Orange player.
OnButtonReset
Called when the button has reset after being pressed.

See also