Nuclide
Software Development Kit for id Tech
game_counter Class Reference
Inheritance diagram for game_counter:
NSPointTrigger

Public Member Functions

void game_counter (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 Trigger (entity, triggermode_t)
 Called whenever we're legacy triggered by another object or function. 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...
 
nonvirtual int GetCount (void)
 
nonvirtual void SetCount (int)
 

Detailed Description

QUAKED game_counter (0 .5 .8) (-8 -8 -8) (8 8 8) GMCNT_REMOVE GMCNT_RESET

OVERVIEW

This entity counts the number of times it has been triggered and activates its target when it reaches a specified number.

KEYS

  • "targetname" : Name
  • "target" : Target when triggered.
  • "master" : Master entity (optional)
  • "killtarget" : Target to kill when triggered.
  • "health" : Number of times the entity has to be triggered.
  • "frags" : Starting value of this game_counter.

SPAWNFLAGS

  • GMCNT_REMOVE (1) : Remove permanently once it fired its target.
  • GMCNT_RESET (2) : Reset internal counter to starting value once it fired its target.

TRIVIA

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

Constructor & Destructor Documentation

◆ game_counter()

void game_counter::game_counter ( void  )

Member Function Documentation

◆ GetCount()

int game_counter::GetCount ( void  )

◆ Respawn()

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

◆ Save()

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

◆ SetCount()

void game_counter::SetCount ( int  value)

◆ SpawnKey()

void game_counter::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.

◆ Trigger()

void game_counter::Trigger ( entity  act,
triggermode_t  state 
)
virtual

Called whenever we're legacy triggered by another object or function.

Reimplemented from NSTrigger.


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