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

func_rot_button

From Valve Developer Community
(Redirected from CRotButton)
Jump to navigation Jump to search

func_rot_button is a brush entity available in all Source Source games. It is a rotating version of func_button. When used, it rotates to a pressed position instead of sliding to one.

class hierarchy
CRotButton defined in buttons.cpp
CBaseButton
CBaseToggle
CBaseEntity


Keyvalues

Master (Obsolete) (master) <string> Obsolete
Deprecated.
Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be used.
Speed (speed) <integer>
The speed that the button rotates, in degrees per second.
Health (Obsolete) (health) <integer> Obsolete
Deprecated.
Legacy method of specifying whether or not the button can be shot to activate it. Use the 'Damage Activates' spawnflag instead.
Sounds (sounds) <choices>
Sound when pressed
  • 0: None (Silent)
  • 21: Squeaky
  • 22: Squeaky Pneumatic
  • 23: Ratchet Groan
  • 24: Clean Ratchet
  • 25: Gas Clunk
Note.pngNote:These sounds are for Half-Life 2 and Counter-Strike: Source.

For other games, you need to check the sounds declared in scripts/game_sounds_world.txt.
Choose a sound declared with a name like "Buttons.sndXX" (where XX is a number), AND be sure that the sound file exists in the vpk.

Then deactivate smartedit, and put the number (XX) as value.
Delay Before Reset (-1 stay) (wait) <integer>
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. If the value is set to -1, the button never returns.
Distance (deg) (distance) <integer>
The amount, in degrees, that the button should rotate when it's pressed.
Minimum Light Level (_minlight) <string>
The minimum level of ambient light that hits this brush.
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

Parentname:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.

Origin:

Origin (X Y Z) (origin) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Pitch Yaw Roll (Y Z X) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Global:
Global Entity Name (globalname) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Flags

Not solid : [1]
Reverse Dir : [2]
Toggle : [32]
X Axis : [64]
Y Axis : [128]
Touch Activates : [256]
Damage Activates : [512]
Use Activates : [1024]
Starts locked : [2048]

Icon-Bug.pngBug:Does not work. You will need to send the Lock input to this entity again, or manually set m_bLocked to true in VScript. Fixed in Garry's Mod  [todo tested in?]

Inputs

Parentname:
SetParent <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.
Button:
Lock
Lock the button, preventing it from functioning.
Unlock
Unlock the button, allowing it to function.
Press
Activate the button as if it was pressed.
PressIn
Activate the button as if it was pressed, sending it to the bottom position.
PressOut
Unpress the button, sending it to the top position.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

Button:
OnDamaged
Fired when the button is damaged.
OnPressed
Fired when the button is pressed.
OnUseLocked
Fired when the button is used while locked.
OnIn
Fired when the button reaches the in/pressed position.
OnOut
Fired when the button reaches the out/released position.

See also