Func rot button

From Valve Developer Community

This Brush-based Entity is available in all Source Games.

Table of contents

Entity description

A brush entity that is designed to be used for a rotating player-usable button. When used by the player, it rotates to a pressed position.

In code it is represented by class CRotButton (http://doxygen.page.needed/class_c_rot_button.html), defined in buttons.cpp (http://doxygen.page.needed/buttons_8cpp-source.html).

Keyvalues

Defines the name that other entities refer to this entity by.
  • hammerid [Episode Two Update]
<integer readonly> This id is used for debugging purposes in Hammer.
Specifies the targetname of this entity's Parent in a movement hierarchy. Child entities move with their Parent.
  • origin
<origin> The position of this entity's center in the world. Rotating entities rotate around their origin.
Pitch Yaw Roll (Y Z X)
This entity's angular orientation in the world (also used for angular effect entities).
  • 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.
  • master
<string> Legacy support: The name of a master entity. If the master hasn't been activated, this button cannot be used.
  • speed
<integer> The speed that the button rotates, in degrees per second.
  • health
<integer> Legacy method of specifying whether or not the button can be shot to activate it. Use the 'Damage Activates' spawnflag instead.
  • sounds
<choices> Sounds.
Literal value Description
0 None (Silent)
21 Squeaky
22 Squeaky Pneumatic
23 Ratchet Groan
24 Clean Ratchet
25 Gas Clunk
  • 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
<integer> The amount, in degrees, that the button should rotate when it's pressed.
  • _minlight
<string> The minimum level of ambient light that hits this brush.

Flags

  • 1 : Not solid - This button does not collide with anything.
  • 2 : Reverse Dir - This button rotates in the opposite direction.
  • 32 : Toggle - This button toggles between pressed and released.
  • 64 : X Axis - This button rotates on the X axis.
  • 128 : Y Axis - This button rotates on the Y axis.
  • 256 : Touch Activates - Collision with this button triggers it.
  • 512 : Damage Activates - Damage to this button triggers it.
  • 1024 : Use Activates - Using +use on this button triggers it.
  • 2048 : Starts locked - This button spawns locked - This means it cannot be pressed.

Inputs

  • Kill
Removes this entity from the world.
Removes this entity and all its children from the world.
  • AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>
Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
Changes the entity's parent in the movement hierarchy.
Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the Parent's Origin and Angles at the time it is attached.
Removes this entity from its current movement hierarchy.
  • 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.

Outputs

Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
!activator = activator
  • OnDamaged
Fired when the button is damaged.
!activator = damage inflictor
  • OnPressed
Fired when the button is pressed.
!activator = activator
  • OnUseLocked
Fired when the button is used while locked.
!activator = activator
  • OnIn
Fired when the button reaches the in/pressed position.
!activator = activator
  • OnOut
Fired when the button reaches the out/released position.
!activator = activator