Nuclide
Software Development Kit for id Technology
momentary_rot_button Class Reference

About this class

Server-Entity: Momentary Rotating Door/Lever/Valve.

QUAKED momentary_rot_button (0 .5 .8) ? MRBFL_DOORHACK MRBFL_NOTUSE x x MRBFL_AUTORETURN x MRBFL_XAXIS MRBFL_YAXIS

OVERVIEW

Dyanmic button/wheel/lever that moves back into its original position when not in use. It affects momentary_door.

KEYS

  • "targetname" : Name
  • "distance" : Maximum distance it'll turn until it stops.
  • "speed" : Speed at which it rotates/turns.
  • "returnspeed" : Speed at which it returns to its original position.

SPAWNFLAGS

  • MRBFL_DOORHACK (1) : This entity will move along with another momentary_rot_button of the same name.
  • MRBFL_NOTUSE (2) : Don't allow interaction via "use" key/button.
  • MRBFL_AUTORETURN (16) : Rotate back to its original state when not being used.
  • MRBFL_XAXIS (64) : Rotate along the X-axis.
  • MRBFL_YAXIS (128) : Rotate along the Y-axis.

TRIVIA

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

Inheritance diagram for momentary_rot_button:
NSMomentary

Public Member Functions

void momentary_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 NSIO::SpawnKey but for save-game fields. More...
 
virtual void OnPlayerUse (void)
 
virtual void OnPlayerUnUse (void)
 
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 SetMovementDirection (void)
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void MovementDone (void)
 
virtual void MovementStateChanged (void)
 Called whenever the movement state changes. More...
 
virtual float GetProgress (void)
 Returns the progress of the momentary, which is a value between 0.0 and 1.0. More...
 

Constructor & Destructor Documentation

◆ momentary_rot_button()

void momentary_rot_button::momentary_rot_button ( void  )

Member Function Documentation

◆ GetProgress()

float momentary_rot_button::GetProgress ( void  )
virtual

Returns the progress of the momentary, which is a value between 0.0 and 1.0.

Reimplemented from NSMomentary.

◆ MovementDone()

void momentary_rot_button::MovementDone ( void  )
virtual

◆ MovementStateChanged()

void momentary_rot_button::MovementStateChanged ( void  )
virtual

Called whenever the movement state changes.

Reimplemented from NSMomentary.

◆ OnPlayerUnUse()

void momentary_rot_button::OnPlayerUnUse ( void  )
virtual

◆ OnPlayerUse()

void momentary_rot_button::OnPlayerUse ( void  )
virtual

◆ Respawn()

void momentary_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 NSRenderableEntity.

◆ Restore()

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

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

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

Reimplemented from NSMomentary.

◆ Save()

void momentary_rot_button::Save ( float  handle)
virtual

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

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

Reimplemented from NSMomentary.

◆ SetMovementDirection()

void momentary_rot_button::SetMovementDirection ( void  )
virtual

◆ SpawnKey()

void momentary_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 NSRenderableEntity.


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