func_weight_button
Code classes:
CWeightButton
CBaseEntity
(all ents)
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 and 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 , weighted buttons are created with triggers, props, and func_door
s. In , the prop_floor_button
entity is used.
Note: Held objects and hostages are considered weightless. Players 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. Players 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: Broken for brush entities.
- Render FX
(renderfx)
<choices>
- Preset appearance effects. Partially supported in , completely non-functional in . 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 ) - 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 )
- Sets Render in Fast Reflections to true.
- DisableDrawInFastReflection (available in all games since )
- 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.