Nuclide
Software Development Kit for id Technology
trigger_once Class Reference

About this class

Server-Entity: One-Time Use Trigger Volume.

QUAKED trigger_once (.5 .5 .5) ? CLIENTS NPCS PUSHABLES PHYSICS FRIENDLIES CLIENTSINVEHICLES EVERYTHING x x CLIENTSNOTINVEHICLES DEBRIS NPCSINVEHICLES NOBOTS

OVERVIEW

A trigger volume which works only once.

KEYS

  • "targetname" : Name
  • "target" : Target when triggered.
  • "killtarget" : Target to kill when triggered.
  • "delay" : Delay until target is triggered.
  • "StartDisabled" : Entity will have to be enabled in order to work when set to 1.

INPUTS

  • "Enable" : Enable the entity.
  • "Disable" : Disable the entity.
  • "Toggle" : Toggles between enabled/disabled states.

SPAWNFLAGS

  • TF_CLIENTS (1) : Clients can touch it.
  • TF_NPCS (2) : NPCs can touch it.
  • TF_PUSHABLE (4) : Pushables can touch it.
  • TF_PHYSICS (8) : NSPhysicsEntity based classes can touch it.
  • TF_FRIENDLIES (16) : Friendly NPCs can touch it.
  • TF_CLIENTSINVEHICLES (32) : Clients within vehicles can touch it.
  • TF_EVERYTHING (64) : Everything can touch it.
  • TF_CLIENTSNOTINVEHICLES (512) : Clients outside vehicles can touch it.
  • TF_DEBRIS (1024) : Debris can touch it.
  • TF_NPCSINVEHICLES (2048) : NPCs in vehicles can touch it.
  • TF_NOBOTS (4096) : Bots are never allowed to touch it.

SPAWNFLAGS (LEGACY)

These work when 'StartDisabled' is not set in the entity definition.

  • TM_MONSTERS (1) : Allow NPCs to activate this entity.
  • TM_NOCLIENTS (2) : Don't allow players to activate this entity.
  • TM_PUSHABLES (4) : Allow func_pushables to trigger this entity.

NOTES

If you want an entity like this that can be used more than once, see trigger_multiple.

TRIVIA

This entity was introduced in Quake (1996).

Inheritance diagram for trigger_once:
NSBrushTrigger

Public Member Functions

void trigger_once (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 Touch (entity)
 Called whenever we're touching another entity. 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...
 

Constructor & Destructor Documentation

◆ trigger_once()

void trigger_once::trigger_once ( void  )

Member Function Documentation

◆ Input()

void trigger_once::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 trigger_once::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 NSBrushTrigger.

◆ Restore()

void trigger_once::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 NSEntity.

◆ Save()

void trigger_once::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 NSEntity.

◆ Spawned()

void trigger_once::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 trigger_once::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 NSEntity.

◆ Touch()

void trigger_once::Touch ( entity  eToucher)
virtual

Called whenever we're touching another entity.

Reimplemented from NSTrigger.


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