prop_button

From Valve Developer Community
Jump to: navigation, search
edit
Class hierarchy
CPropButton
CBaseAnimating
CBaseEntity
portal2/prop_button.cpp
The pillar style button

prop_button is a point 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

Name (targetname) <string>
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
Solid ([todo internal name (i)]) <boolean> !FGD
Makes the button non-solid to objects and the player. It can still be pressed like normal.
CBaseAnimating

Studiomodel:

Skin (skin) <integer>
Some models have multiple skins. This value selects from the index, starting with 0.
Tip.pngTip:Hammer's model browser automatically updates this value if you use it to view different skins.
Model Scale (modelscale) <float> (in all games since Alien Swarm) (also in Source 2013)
A multiplier for the size of the model.
Tip.pngTip:In Hammer++ Hammer++ with a prop selected in 3D view, hold Ctrl and scroll the mouse wheel to change the modelscale in increments of 0.5. Holding Shift will scale it in smaller increments of 0.05.
Bodygroup (body / SetBodyGroup) <integer>
Some models have multiple submodels. This value selects from the index, starting with 0. May be overridden by animations and/or game code.
Note.pngNote:If both body and SetBodyGroup are present (even if set to 0), body will be prioritized.
Lighting Origin (lightingorigin) <targetname>
Select an entity (not info_lighting!) from which to sample lighting instead of the entity's origin or $illumposition.

Shadow:

Disable Shadows (disableshadows) <boolean>
Prevents the entity from creating cheap render-to-texture shadows, or lightmap shadows if the entity is a prop_static. Does not affect shadow mapping.
Disable Receiving Shadows (disablereceiveshadows) <boolean>
Prevent the entity from receiving dynamic shadows on itself.
Shadow Cast Distance (shadowcastdist) <integer> !FGD
Sets how far the entity casts dynamic shadows. 0 means default distance from the shadow_control entity.
Disable Shadow Depth (disableshadowdepth) <boolean> (in all games since Portal 2)
Used to disable rendering into shadow depth (for projected textures) for this entity.
Disable flashlight (disableflashlight) <boolean> (in all games since Portal 2)
Used to disable projected texture lighting and shadows on this entity.
Projected Texture Cache (shadowdepthnocache) <integer choices> (in all games since Portal 2)
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
Choices
  • 0 : Default
  • 1 : No cache - render every frame
  • 2 : Cache it - render only once
Render in Fast Reflections (drawinfastreflection) <boolean> (in all games since Portal 2)
If enabled, this entity will render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.

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