Nuclide
Software Development Kit for id Technology
func_train Class Reference

About this class

Server-Entity: Linear Moving Brush.

QUAKED func_train (0 .5 .8) ? WAIT x x NOT_SOLID

OVERVIEW

Moving platform following along path_corner entities, aka nodes. Most of its behaviour is controlled by the path_corner entities it passes over. See the entity definition for path_corner to find out more.

KEYS

  • "targetname" : Name
  • "target" : First node.
  • "killtarget" : Target to kill when triggered.
  • "dmg" : Damage to inflict upon a person blocking the way.
  • "snd_move" : Path to sound sample which plays when it's moving.
  • "snd_stop" : Path to sound sample which plays when it stops moving.

SPAWNFLAGS

  • WAIT (1) : Stop at each path_corner until we're triggered again.
  • NOT_SOLID (8) : Don't do collision testing against this entity.

NOTES

Upon level entry, the func_train will spawn right where its first path_corner node is. This is so you can light the func_train somewhere else - like a lonely box somewhere outside the playable area.

If no targetname is specified, the train will move on its own at map-launch.

Marking the func_train with the spawnflag NOT_SOLID will make entities not collide with the train. This is best used for things in the distance or for when lasers are following this train as a sort of guide.

TRIVIA

This entity was introduced in Quake (1996).

Inheritance diagram for func_train:
NSRenderableEntity

Public Member Functions

void func_train (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 Trigger (entity, triggermode_t)
 Called whenever we're legacy triggered by another object or function. More...
 
nonvirtual void SoundMove (void)
 
nonvirtual void SoundStop (void)
 
nonvirtual void AfterSpawn (void)
 
nonvirtual void PathNext (void)
 
nonvirtual void PathMove (void)
 
nonvirtual void PathDone (void)
 
virtual void Blocked (entity)
 Called whenever out movement is being blocked by an entity. More...
 

Constructor & Destructor Documentation

◆ func_train()

void func_train::func_train ( void  )

Member Function Documentation

◆ AfterSpawn()

void func_train::AfterSpawn ( void  )

◆ Blocked()

void func_train::Blocked ( entity  eBlocker)
virtual

Called whenever out movement is being blocked by an entity.

This is currently only relevant on entities that are of MOVETYPE_PUSH.

Reimplemented from NSTrigger.

◆ PathDone()

void func_train::PathDone ( void  )

◆ PathMove()

void func_train::PathMove ( void  )

◆ PathNext()

void func_train::PathNext ( void  )

◆ Respawn()

void func_train::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 func_train::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 NSRenderableEntity.

◆ Save()

void func_train::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 NSRenderableEntity.

◆ SoundMove()

void func_train::SoundMove ( void  )

◆ SoundStop()

void func_train::SoundStop ( void  )

◆ Spawned()

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

◆ Trigger()

void func_train::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: