Nuclide
Software Development Kit for id Technology
logic_timer Class Reference

About this class

Server-Entity: Timer Trigger.

QUAKED logic_timer (1 0 0) (-8 -8 -8) (8 8 8) OSCILLATOR

OVERVIEW

Will trigger its outputs at fixed/random intervals, much like the entity random_trigger.

KEYS

  • "targetname" : Name
  • "UseRandomTime" : Boolean value that determines whether it's random, or fixed.
  • "LowerRandomBound" : The lower limit of a random trigger timer.
  • "UpperRandomBound" : The upper limit of a random trigger timer.
  • "RefireTime" : Fixed time in seconds. Only when UseRandomTime is set to 0.
  • "StartDisabled" : Boolean value that determines whether we should not start triggering at level start.

INPUTS

  • "Enable" - Enable the timer logic.
  • "Disable" - Disable the timer logic.
  • "Toggle" - Toggle between Enable/Disable.
  • "ResetTimer" - Resets the timer, and starts it.
  • "FireTimer" - Forcefully triggers the OnTimer outputs.
  • "RefireTime" - Sets a new firing time from the data field.
  • "LowerRandomBound" - Sets the lower limit of a random trigger timer from the data field.
  • "UpperRandomBound" - Sets the upper limit of a random trigger timer from the data field.
  • "AddToTimer" - Adds the number of seconds from the data field to the current timer.
  • "SubtractFromTimer" - Removes the number of seconds from the data field to the current timer.

OUTPUTS

  • "OnTimer" : Triggered when the map is loaded for any reason.
  • "OnTimerHigh" : Triggered only when a new game starts on this level.
  • "OnTimerLow" : Triggered when the map is loaded via save game.

SPAWNFLAGS

  • OSCILLATOR (1) : Instead of triggering the OnTimer output, will flip-flip between OnTimerHigh and OnTimerLow.

TRIVIA

This entity was introduced in Half-Life 2 (2004).

Inheritance diagram for logic_timer:
NSPointTrigger

Public Member Functions

void logic_timer (void)
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. More...
 
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 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 SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message. More...
 
nonvirtual void TimerEvent (void)
 
nonvirtual void TimerSetup (void)
 

Constructor & Destructor Documentation

◆ logic_timer()

void logic_timer::logic_timer ( void  )

Member Function Documentation

◆ Input()

void logic_timer::Input ( entity  eAct,
string  strInput,
string  strData 
)
virtual

Called when we are being prompted by another object/function with an input message.

Reimplemented from NSEntity.

◆ Respawn()

void logic_timer::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 NSPointTrigger.

◆ Restore()

void logic_timer::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 NSPointTrigger.

◆ Save()

void logic_timer::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 NSPointTrigger.

◆ Spawned()

void logic_timer::Spawned ( void  )
virtual

Called when the entity is fulled initialized.

Any spawn key/value info pairs have already been dealt with. So now we can make full decisions on the entity. Always make sure to call super::Spawned(); inside your method when overriding.

Reimplemented from NSEntity.

◆ SpawnKey()

void logic_timer::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 NSPointTrigger.

◆ TimerEvent()

void logic_timer::TimerEvent ( void  )

◆ TimerSetup()

void logic_timer::TimerSetup ( void  )

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