Nuclide
Software Development Kit for id Tech
ambient_generic Class Reference

Shared-Entity: Sound/Sentence Emitter. More...

Inheritance diagram for ambient_generic:
NSTalkMonster

Public Member Functions

void ambient_generic (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 SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. 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 EvaluateEntity (void)
 Run each tic after physics are run to determine if we need to send updates over the network. More...
 
virtual float SendEntity (entity, float)
 Called by the engine whenever we need to send a client an update about this entity. More...
 
virtual void UseNormal (entity, triggermode_t)
 
virtual void UseLoop (entity, triggermode_t)
 
virtual void Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message. More...
 
virtual void DebugDraw (void)
 
virtual void OnRemoveEntity (void)
 Handles what happens before the entity gets removed from the client game. More...
 

Detailed Description

Shared-Entity: Sound/Sentence Emitter.

QUAKED ambient_generic (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) AS_ARADIUS AS_SRADIUS AS_MRADIUS AS_LRADIUS AS_SILENT AS_NOTTOGGLED

OVERVIEW

Plays a sound sample of whatever format the engine is configured to support.

KEYS

  • "targetname" : Name
  • "target" : Target when triggered.
  • "killtarget" : Target to kill when triggered.
  • "message" : Sound file to play, or sentences.txt entry if prefixed with a '!'
  • "volume" : Playback volume from 0.0 to 1.0 (default)
  • "pitch" : Playback pitch, default is 100.

SPAWNFLAGS

  • AS_ARADIUS (1) : Plays the sound everywhere. Heard by everyone.
  • AS_SRADIUS (2) : Small playback radius.
  • AS_MRADIUS (4) : Medium playback radius.
  • AS_LRADIUS (8) : Large playback radius.
  • AS_SILENT (16) : Start silent, trigger to make it play!
  • AS_NOTTOGGLED (32) : Don't toggle playback. When triggered, only play the sample once.

NOTES

If you want it to loop, you have to give the file itself a loop flag.

TRIVIA

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

Constructor & Destructor Documentation

◆ ambient_generic()

void ambient_generic::ambient_generic ( void  )

Member Function Documentation

◆ DebugDraw()

void ambient_generic::DebugDraw ( void  )
virtual

Reimplemented from NSActor.

◆ EvaluateEntity()

void ambient_generic::EvaluateEntity ( void  )
virtual

Run each tic after physics are run to determine if we need to send updates over the network.

Reimplemented from NSMonster.

◆ Input()

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

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

Reimplemented from NSMonster.

◆ OnRemoveEntity()

void ambient_generic::OnRemoveEntity ( void  )
virtual

Handles what happens before the entity gets removed from the client game.

Reimplemented from NSEntity.

◆ Respawn()

void ambient_generic::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 NSTalkMonster.

◆ Restore()

void ambient_generic::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 NSTalkMonster.

◆ Save()

void ambient_generic::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 NSTalkMonster.

◆ SendEntity()

float ambient_generic::SendEntity ( entity  ,
float   
)
virtual

Called by the engine whenever we need to send a client an update about this entity.

Reimplemented from NSTalkMonster.

◆ Spawned()

void ambient_generic::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 NSSquadMonster.

◆ SpawnKey()

void ambient_generic::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 NSTalkMonster.

◆ UseLoop()

void ambient_generic::UseLoop ( entity  act,
triggermode_t  state 
)
virtual

◆ UseNormal()

void ambient_generic::UseNormal ( entity  act,
triggermode_t  state 
)
virtual

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