Nuclide
Software Development Kit for id Tech
func_rot_button Class Reference
Inheritance diagram for func_rot_button:
NSSurfacePropEntity

Public Member Functions

void func_rot_button (void)
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to ::SpawnKey but for save-game fields. More...
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void Respawn (void)
 Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state. More...
 
virtual void Touch (entity)
 Called whenever we're touching another entity. More...
 
virtual void Death (void)
 Called when the health is equal or below 0. More...
 
virtual void OnPlayerUse (void)
 
nonvirtual void ArrivedClosed (void)
 
nonvirtual void ArrivedOpened (void)
 
nonvirtual void TriggerTargets (void)
 
nonvirtual void Rotate (vector, void())
 
nonvirtual void TurnToggle (void)
 

Detailed Description

QUAKED func_rot_button (0 .5 .8) ? NONSOLID REVERSE x x x NOAUTORETURN XAXIS YAXIS TOUCHABLE

OVERVIEW

A button that rotates along a pivot point. Used for valves, spigots and alike.

KEYS

  • "targetname" : Name
  • "target" : Name of the entity to trigger when opened
  • "speed" : How fast the button turns when activated.
  • "health" : If non-zero, the button must be damaged to turn.
  • "wait" : Time until the button turns back. A value of -1 makes it stay static.
  • "distance" : Distance in degrees the button will rotate.

SPAWNFLAGS

  • NONSOLID (1) : Button won't have collision.
  • REVERSE (2) : Rotates counter-clockwise.
  • NOAUTORETURN (32) : Will not return by itself.
  • XAXIS (64) : Rotate along the X-axis.
  • YAXIS (128) : Rotate along the Y-axis.

NOTES

Please include an origin brush so that a pivot point will be defined.

TRIVIA

This entity was introduced in Half-Life (1998).

Constructor & Destructor Documentation

◆ func_rot_button()

void func_rot_button::func_rot_button ( void  )

Member Function Documentation

◆ ArrivedClosed()

void func_rot_button::ArrivedClosed ( void  )

◆ ArrivedOpened()

void func_rot_button::ArrivedOpened ( void  )

◆ Death()

void func_rot_button::Death ( void  )
virtual

Called when the health is equal or below 0.

Reimplemented from NSSurfacePropEntity.

◆ OnPlayerUse()

void func_rot_button::OnPlayerUse ( void  )
virtual

◆ Respawn()

void func_rot_button::Respawn ( void  )
virtual

Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state.

Reimplemented from NSSurfacePropEntity.

◆ Restore()

void func_rot_button::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to ::SpawnKey but for save-game fields.

Whatever you write into file handles within your ::Save() method needs to be read back in here.

Reimplemented from NSSurfacePropEntity.

◆ Rotate()

void func_rot_button::Rotate ( vector  ,
void()   
)

◆ Save()

void func_rot_button::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the ::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from NSSurfacePropEntity.

◆ SpawnKey()

void func_rot_button::SpawnKey ( string  strKey,
string  strValue 
)
virtual

This method handles entity key/value pairs on map load.

You can easily convert the strValue parameter using the ReadFloat etc. methods that are part of NSIO.

Reimplemented from NSSurfacePropEntity.

◆ Touch()

void func_rot_button::Touch ( entity  eToucher)
virtual

Called whenever we're touching another entity.

Reimplemented from NSTrigger.

◆ TriggerTargets()

void func_rot_button::TriggerTargets ( void  )

◆ TurnToggle()

void func_rot_button::TurnToggle ( void  )

The documentation for this class was generated from the following file: