momentary_rot_button

From Source Entities
Jump to navigation Jump to search

Code classes:

momentary_rot_button is a brush entity present in all Source games. It's a brush that continues to rotate as the player holds down +use.

Flags[edit | edit source]

  • 1: Not Solid
  • 32: Toggle (Disable Auto Return) - Prevents the entity from automatically returning back to its un-rotated position when left alone.
  • 1024: Use Activates - Allows the player to activate the entity. (Otherwise, it will only move by inputs.)
  • 8192: Jiggle when used while locked

Keyvalues[edit | edit source]

Speed (deg/sec) (speed) <float>
The amount, in degrees, that the wheel turns per second.
Sounds (sounds) <choices>
Make this button emit a sound when pressed. Note: The list below was made for Half-Life 2. All games support this keyvalue, but some don't have a number of these sound files. To edit these sounds, look for Buttons.snd (followed by a number from the Value column in this table) in hl2/scripts/game_sounds_world.txt or your game's appropriate soundscript file.
Value Description Default Sound
0 None common/null.wav
1 Big zap & Warmup buttons/button1.wav
2 Access Denied buttons/button2.wav
3 Access Granted buttons/button3.wav
4 Quick Combolock buttons/button4.wav
5 Power Deadbolt 1 buttons/button5.wav
6 Power Deadbolt 2 buttons/button6.wav
7 Plunger buttons/button7.wav
8 Small zap buttons/button8.wav
9 Keycard Sound buttons/button9.wav
21 Squeaky buttons/lever1.wav
22 Squeaky Pneumatic buttons/lever2.wav
23 Ratchet Groan buttons/lever3.wav
24 Clean Ratchet buttons/lever4.wav
25 Gas Clunk buttons/lever5.wav
Auto-return speed (returnspeed) <float>
If Toggle is not checked, how fast the wheel rotates back to its original angle when left alone.
Start Position (startposition) <float>
A number between 0.0 and 1.0 which represents the wheel's position when it spawns. 0 means its un-rotated position, 1 means the fully rotated position.
Start Direction (startdirection) <choices>
Which way the wheel turns.
  • -1: Forward
  • 1: Backward
Solid BSP (solidbsp) <bool>
How the engine processes this entity's solidity. Try changing this to BSP if players move oddly while touching the brush.
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]

SetPosition <float>
Rotates the wheel to a position. Parameter is a number between 0.0 (un-rotated position) and 1.0 (rotated position).
SetPositionImmediately <float>
Teleports the wheel to a position. Parameter is a number between 0.0 (un-rotated position) and 1.0 (rotated position).
_DisableUpdateTarget (Not in FGD)
Makes Position quit firing.
_EnableUpdateTarget (Not in FGD)
Makes Position fire again.
Enable (Not in FGD)
Allows the player to activate the entity. (Otherwise, it will only move by inputs.) Functions independently from Use Activates. The entity sends this input to itself when jiggling.
Disable (Not in FGD)
Disallows the player from activating the entity.
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]

Position <float>
Fires when the position of the wheel changes. Automatically puts the wheel's position from 0.0 to 1.0 as the input parameter, unless overridden by the mapper.
OnUnpressed
Fires when the player quits holding their use key.
OnFullyClosed
Fires when the entity reaches its fully rotated position.
OnFullyOpen
Fires when the entity reaches its un-rotated position.
OnReachedPosition
Fires when the entity reaches a position specified by SetPosition or either of its "end" positions.