Nuclide
Software Development Kit for id Tech
func_tracktrain Class Reference
Inheritance diagram for func_tracktrain:
NSVehicle

Public Member Functions

void func_tracktrain (void)
 
virtual void PredictPreFrame (void)
 
virtual void PredictPostFrame (void)
 
virtual void ReceiveEntity (float, float)
 Client: Handles network updates from the server for the associated entity. More...
 
virtual void UpdateView (void)
 
nonvirtual void PathMoveForward (void)
 Call to move the tracktrain forward. More...
 
nonvirtual void PathMoveBack (void)
 Call to move the tracktrain backward. More...
 
nonvirtual void PathClear (void)
 Called when the current path is cleared, and a stop sound is played. More...
 
nonvirtual void PathDone (void)
 Called when the current path is cleared, and a stop sound is played. More...
 
nonvirtual bool IgnoresPitch (void)
 Returns if the train can pitch up/down. More...
 
nonvirtual path_track GetTrackNodeForward (void)
 Returns the track node (path_track) ahead of the train. More...
 
nonvirtual path_track GetTrackNodeBack (void)
 Returns the track node (path_track) back of the train. More...
 
nonvirtual vector GetPointBetweenNodes (float)
 Returns a 3d position between two nodes at the specified progression. More...
 
nonvirtual vector GetTrainPivotPoint (bool)
 
nonvirtual void RenderDebugInfo (void)
 
nonvirtual bool ControlCheck (entity)
 
virtual void Blocked (entity)
 Called whenever out movement is being blocked by an entity. More...
 
virtual void OnPlayerUse (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 TransitionComplete (void)
 Called when the entity has successfully completed a level transition. 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...
 
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 PlayerInput (void)
 

Detailed Description

QUAKED func_tracktrain (0 .5 .8) ? NOPITCH NOUSER NOTSOLID

OVERVIEW

An interactive train that moves along a series of path_track entities. It turns and can respond to user input. It does not necessarily have to.

KEYS

  • "targetname" : Name
  • "target" : First node to target.
  • "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

  • NOPITCH (1) : Stop at each path_track until we're triggered again.
  • NOUSER (2) : Train does not pivot up/down at all.
  • NOTSOLID (8) : Don't do collision testing against this entity.
  • FIXED (16) : Fixed orientation. Will not turn, only move.

NOTES

Upon level entry, the func_tracktrain will spawn right where its first path_track node is, as specified in target.

This is so you can light the func_tracktrain 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.

By default, any func_tracktrain can be interacted with by players. You can restrict the area in which the train can be used with a func_traincontrols entity. You can also set the NOUSER (2) spawnflag to disable it entirely.

TRIVIA

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

Constructor & Destructor Documentation

◆ func_tracktrain()

void func_tracktrain::func_tracktrain ( void  )

Member Function Documentation

◆ Blocked()

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

◆ ControlCheck()

bool func_tracktrain::ControlCheck ( entity  toCheck)

◆ EvaluateEntity()

void func_tracktrain::EvaluateEntity ( void  )
virtual

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

Reimplemented from NSVehicle.

◆ GetPointBetweenNodes()

vector func_tracktrain::GetPointBetweenNodes ( float  percentageValue)

Returns a 3d position between two nodes at the specified progression.

Value between 0.0f - 1.0f, 1.0 being closest to the next node heading forward.

◆ GetTrackNodeBack()

path_track func_tracktrain::GetTrackNodeBack ( void  )

Returns the track node (path_track) back of the train.

◆ GetTrackNodeForward()

path_track func_tracktrain::GetTrackNodeForward ( void  )

Returns the track node (path_track) ahead of the train.

◆ GetTrainPivotPoint()

vector func_tracktrain::GetTrainPivotPoint ( bool  drivingBackwards)

◆ IgnoresPitch()

bool func_tracktrain::IgnoresPitch ( void  )

Returns if the train can pitch up/down.

◆ OnPlayerUse()

void func_tracktrain::OnPlayerUse ( void  )
virtual

◆ PathClear()

void func_tracktrain::PathClear ( void  )

Called when the current path is cleared, and a stop sound is played.

◆ PathDone()

void func_tracktrain::PathDone ( void  )

Called when the current path is cleared, and a stop sound is played.

◆ PathMoveBack()

void func_tracktrain::PathMoveBack ( void  )

Call to move the tracktrain backward.

◆ PathMoveForward()

void func_tracktrain::PathMoveForward ( void  )

Call to move the tracktrain forward.

◆ PlayerInput()

void func_tracktrain::PlayerInput ( void  )
virtual

Reimplemented from NSVehicle.

◆ PredictPostFrame()

void func_tracktrain::PredictPostFrame ( void  )
virtual

Reimplemented from NSVehicle.

◆ PredictPreFrame()

void func_tracktrain::PredictPreFrame ( void  )
virtual

Reimplemented from NSVehicle.

◆ ReceiveEntity()

void func_tracktrain::ReceiveEntity ( float  flNew,
float  flChanged 
)
virtual

Client: Handles network updates from the server for the associated entity.

Reimplemented from NSVehicle.

◆ RenderDebugInfo()

void func_tracktrain::RenderDebugInfo ( void  )

◆ Respawn()

void func_tracktrain::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 NSSurfacePropEntity.

◆ Restore()

void func_tracktrain::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 NSVehicle.

◆ Save()

void func_tracktrain::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 NSVehicle.

◆ SendEntity()

float func_tracktrain::SendEntity ( entity  ,
float   
)
virtual

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

Reimplemented from NSVehicle.

◆ Spawned()

void func_tracktrain::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 NSSurfacePropEntity.

◆ SpawnKey()

void func_tracktrain::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 NSSurfacePropEntity.

◆ TransitionComplete()

void func_tracktrain::TransitionComplete ( void  )
virtual

Called when the entity has successfully completed a level transition.

Reimplemented from NSIO.

◆ Trigger()

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

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

Reimplemented from NSTrigger.

◆ UpdateView()

void func_tracktrain::UpdateView ( void  )
virtual

Reimplemented from NSVehicle.


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