func_rot_button
func_rot_button
is a brush entity available in all 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
|
Contents
Keyvalues
Master (Obsolete)(master)
<string>- 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>- 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:These sounds are for and .
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.
- 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.
Targetname:
- Name
(targetname)
<string> - The targetname that other entities refer to this entity by.
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.
Angles:
- 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.
EnableDisable:
- Start Disabled
(StartDisabled)
<boolean> - Stay dormant until activated (with the
Enable
input).
Flags
- [
1
] : Not solid
- [
2
] : Reverse Dir
- [
32
] : Toggle
- [
64
] : X Axis
- [
128
] : Y Axis
- [
256
] : Touch Activates
- [
512
] : Damage Activates
- [
1024
] : Use Activates
- [
2048
] : Starts lockedBug: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
Inputs
Base:
AddContext
<string>- Adds to the entity's list of response contexts. See Context.
AddOutput
<string>- Assigns a new keyvalue/output on this entity. For keyvalues, some rely on extra necessary code to be ran and won't work if its simply just changed through this input. There is a strict format that must be followed:
// Format of changing KeyValues: "AddOutput [key] [value]"
//// Raw text:
"OnUser1" "!self,AddOutput,targetname new_name"
// Format of adding an Output: "AddOutput {targetname}:{inputname}:{parameter}:{delay}:{max times to fire, -1 means infinite}"
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
// Arguments can be left blank, but the empty blank should still be contained.
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"
|
ClearContext
- Removes all contexts from this entity's list.
ClearParent
- Removes this entity from the the movement hierarchy, leaving it free to move independently.
FireUser1
toFireUser4
- Fires the respective
OnUser
outputs; see User Inputs and Outputs.
Kill
- Removes this entity and any entities parented to it from the world.
KillHierarchy
- Functions the same as
Kill
, although this entity and any entities parented to it are killed on the same frame, being marginally faster thanKill
input.
RemoveContext
<string>- Remove a context from this entity's list. The name should match the key of an existing context.
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.
DispatchResponse
<string> !FGD- Dispatches a response to the entity. See Response and Concept.
DispatchEffect
<string> (removed since ) !FGD- Dispatches a special effect from the entity's origin; See also List of Client Effects. Replaced by the particle system since .
RunScriptFile
<script> (in all games since ) (also in )- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode
<string> (in all games since ) (also in )- Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. Bug:In Hammer, using string arguments will corrupt the VMF file's structure, making the file unviewable for the next Hammer session.Fix:Remove the string argument manually with a text editor.
CallScriptFunction
<string> (in all games since ) (also in ) !FGD- Calls a VScript function defined in the scope of the receiving entity.
TerminateScriptScope
(only in ) !FGD- Destroys the script scope of the receving entity.
SetLocalOrigin
<coordinates> (in all games since ) !FGD- Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
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
Targetname:
OnUser1
toOnUser4
- These outputs each fire in response to the firing of the like-numbered
FireUser1
toFireUser4
Input; see User Inputs and 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.