This article's documentation is for anything that uses the Source engine. Click here for more information.

Func weight button: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: fixing template case.)
(Added FGD Code)
 
(13 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{wrongtitle|title=func_weight_button}}
{{LanguageBar}}
==Entity Description==
{{Ent not in fgd|none|except={{portal}}{{portal2}}}}
'Button' which activates after a specified amount of weight is touching it.
{{CD|CWeightButton|file1=weight_button.cpp}}
==Keyvalues==
{{this is a|brush entity|name=func_weight_button|except=Source SDK Base 2006}} It is a 'Button' which activates after a specified amount of weight is touching it.
*{{KV Targetname}}
 
*{{KV Parentname}}
== Keyvalues ==
*{{KV RenderFields}}
{{KV Targetname}}
*'''WeightToActivate'''
{{KV|Amount of weight required before this button activates.|intn=WeightToActivate|float|Amount of weight required before this button activates.}}
: <float> Stress to activate
 
==Inputs==
== Outputs ==
*{{I Targetname}}
{{O|OnPressed|ac-is-this=1|Fired when the button is touching enough weight.}}
*{{I Parentname}}
{{O|OnReleased|ac-is-this=1|Fired when the button was pressed, but weight was removed.}}
*{{I RenderFields}}
 
==Outputs==
== FGD Code ==
*{{O Targetname}}
<pre>@SolidClass base(Targetname) = func_weight_button : "A button which activates after a specified amount of weight is applied"
*'''OnPressed'''
[
: Fired when activated
WeightToActivate(float) : "Amount of weight required before this button activates."
*'''OnReleased'''
 
: Fired when deactivated
//Outputs
[[Category:Half-Life 2: Episode One Entities]][[Category:Portal Entities]]
output OnPressed(void) : "Fired when the button is touching enough weight."
output OnReleased(void) : "Fired when the button was pressed, but weight was removed."
]</pre>

Latest revision as of 10:18, 13 June 2025

English (en)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the FGD by default, except in PortalPortal 2.
See below for instructions on making it available.
C++ Class hierarchy
CWeightButton
CBaseEntity
C++ weight_button.cpp

func_weight_button is a brush entity available in all Source Source games except Source SDK Base 2006 Source SDK Base 2006. It is a 'Button' which activates after a specified amount of weight is touching it.

Keyvalues

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

Amount of weight required before this button activates. (WeightToActivate) <float>
Amount of weight required before this button activates.

Outputs

OnPressed
!activator = !caller = this entity
Fired when the button is touching enough weight.
OnReleased
!activator = !caller = this entity
Fired when the button was pressed, but weight was removed.

FGD Code

@SolidClass base(Targetname) = func_weight_button : "A button which activates after a specified amount of weight is applied"
[
	WeightToActivate(float) 	: "Amount of weight required before this button activates."

	//Outputs
	output OnPressed(void)		: "Fired when the button is touching enough weight."
	output OnReleased(void)		: "Fired when the button was pressed, but weight was removed."
]