func_weight_button

From Source Entities
Jump to navigation Jump to search

Code classes:

func_weight_button is a brush entity present in all Source games. It's a brush which fires outputs depending on how much weight is pressing on it.

Despite P1.png and P2.png being the only games with FGD data for this entity, (suggesting it was used in Portal's development) it's not used as part of any button seen ingame. In P1.png, weighted buttons are created with triggers, props, and func_doors. In P2.png, the prop_floor_button entity is used.

Note: Held objects and Css.pngCsgo-small.pnghostages are considered weightless. Csgo-small.pngL4d2-small.pngPlayers are also weightless.

Bug: player entities will not be weighed correctly, and their effective weight on the button can change unpredictably as they move.

Bug: Physics objects may jiggle inexplicably when touching the brush. P2.pngPlayers will also move weirdly.

Keyvalues[edit | edit source]

Amount of weight (kg) required before this button activates (WeightToActivate) <float>
Self-explanatory. Tip: Use sv_massreport 1 to see the weights of objects ingame.
Shadows (Not in FGD) (vrad_brush_cast_shadows) <choices>
Determines if this entity will cast lightmap shadows.
  • 0: No shadows
  • 1: Cast shadows
Render Mode (rendermode) <choices>
A special rendering mode to use on this entity.
Render Amount/Transparency (renderamt) <integer>
Transparency amount, requires a Render Mode (rendermode) other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color channel filter to add to this entity's texture(s). Bug: P2.pngCsgo-small.pngBroken for brush entities.
Render FX (renderfx) <choices>
Preset appearance effects. Partially supported in Asw.png, completely non-functional in P2.pngCsgo-small.png. Bug: Sometimes functions incorrectly if changed with AddOutput, but is the only way to change effects other than making multiple versions of the object.
Minimum Light (_minlight) <float>
Minimum amount of light to hit this brush. 0 is none, 1 is "fullbright". Useful because the lightmaps will not update as the entity moves.
Render in Fast Reflections (drawinfastreflection) <boolean> (available in all games since P2.png)
Makes the entity be rendered in reflections from water materials using $reflectonlymarkedentities.

Inputs[edit | edit source]

Alpha <integer>
Sets Render Amount/Transparency (renderamt).
Color <color255>
Sets the Render Color (rendercolor).
EnableDrawInFastReflection  (available in all games since P2.png)
Sets Render in Fast Reflections to true.
DisableDrawInFastReflection  (available in all games since P2.png)
Sets Render in Fast Reflections to false.

Outputs[edit | edit source]

OnPressed
Fires when enough weight is on the button.
OnReleased
Fires when the button was pressed, but now weight has been removed.