func_rot_button

From Valve Developer Community

Jump to: navigation, search

This is a brush entity available in all Source games.

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, defined in buttons.cpp.

Keyvalues

  • Targetname:

Name <string>
The targetname other entities refer to this entity by.
  • Parentname:

Parent <targetname>
Specifies the targetname of this entity's movement parent. Entities with parents move with their parent.
  • Origin:

Origin <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
  • Angles:

Pitch Yaw Roll (Y Z X) <angle>
This entity's angular orientation in the world.
  • Global:

Global Entity Name <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 global names matching entities in the previous map will have the previous map's state copied over to them.
  • 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

  • Targetname:

Kill
Removes this entity from the world.
KillHierarchy
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 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
  • Parentname:

SetParent <targetname>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <string>
Attach to a named attachment on the current parent. The entity will teleport so that the position of its root bone matches that of the attachment.
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 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

  • Targetname:

OnUser1 to OnUser4
Fired in response to the FireUser inputs; see User Inputs and Outputs.
OnKilled (New with Left 4 Dead)
Fired when the entity is killed and removed from the game.
  • OnDamaged
Fired when the button is damaged. (activator is the damage inflictor)
  • OnPressed
Fired when the button is pressed. (activator is the activator)
  • OnUseLocked
Fired when the button is used while locked. (activator is the activator)
  • OnIn
Fired when the button reaches the in/pressed position. (activator is the activator)
  • OnOut
Fired when the button reaches the out/released position. (activator is the activator)
Personal tools