Nuclide
Software Development Kit for id Technology (BETA)

About this class

Shared-Entity: Brush Vehicle.

QUAKED func_vehicle (0 .5 .8) ? FUNCVEH_NOPITCH FUNCVEH_NOUSER x FUNCVEH_PASSABLE FUNCVEH_FWDRIVE FUNCVEH_RWDRIVE

OVERVIEW

Primitive brush-based vehicle entity.

KEYS

  • "targetname" : Name
  • "target" : Name of the first path_track/corner (See Notes)
  • "acceleration" : Acceleration multiplier
  • "speed" : Top-speed of the vehicle in q-units per second
  • "height" : Wheel-height in units
  • "width" : Width of the vehicle, used to calculate the wheels
  • "length" : Length of the vehicle, used to calculate the wheels
  • "bouncefactor" : Multiplier for the bouncyness of the vehicle
  • "skidspeed" : At which speed the vehicle starts skidding
  • "traction" : Multiplier for the traction affecting the vehicle
  • "breakfactor" : Multiplier for the breaking mechanics
  • "steerfactor" : Multiplier for the steering speed
  • "straightenfactor" : Multiplier for affecting the straightening mechanism
  • "gravitydir" : Normalized vector setting the direction of gravity

Unimplemented:

  • "sounds" : A sound-set to use
  • "volume" : Volume at which said sounds play at (from 0-10)
  • "dmg" : Damage inflicted upon entities when blocked

SPAWNFLAGS

  • FUNCVEH_NOPITCH (1) : Don't adjust the pitch angle of the vehicle, only point forward.
  • FUNCVEH_NOUSER (2) : Don't allow pressing "use" key/button to control it.
  • FUNCVEH_PASSABLE (4) : Don't do collision testing against this entity.
  • FUNCVEH_FWDRIVE (8) : Front wheel drive mode.
  • FUNCVEH_RWDRIVE (16) : Rear wheel drive mode.

NOTES

The vehicle's position is set via the 'target' key, which sets the first path_track/corner. The vehicle is then teleported to the 'target' but it stays at the same vertical position as originally placed.

The angle is calculated by aiming the 'target' path_track/corner entity to its own 'target' entity. So yes, you need two of these path_track/corner entities.

TRIVIA

This entity was introduced in Counter-Strike (2000).

Inheritance diagram for func_vehicle:
ncVehicle

Public Member Functions

void func_vehicle (void)
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. More...
 
virtual void Physics (void)
 
virtual void RunVehiclePhysics (void)
 
virtual void PlayerInput (void)
 
virtual void OnRemoveEntity (void)
 Handles what happens before the entity gets removed from the client game. More...
 
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)
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to ncIO::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 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 Realign (void)
 
virtual void OnPlayerUse (void)
 
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...
 

Constructor & Destructor Documentation

◆ func_vehicle()

void func_vehicle::func_vehicle ( void  )

Member Function Documentation

◆ EvaluateEntity()

void func_vehicle::EvaluateEntity ( void  )
virtual

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

Reimplemented from ncVehicle.

◆ OnPlayerUse()

void func_vehicle::OnPlayerUse ( void  )
virtual

◆ OnRemoveEntity()

void func_vehicle::OnRemoveEntity ( void  )
virtual

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

Reimplemented from ncIO.

◆ Physics()

void func_vehicle::Physics ( void  )
virtual

◆ PlayerInput()

void func_vehicle::PlayerInput ( void  )
virtual

Reimplemented from ncVehicle.

◆ PredictPostFrame()

void func_vehicle::PredictPostFrame ( void  )
virtual

Reimplemented from ncVehicle.

◆ PredictPreFrame()

void func_vehicle::PredictPreFrame ( void  )
virtual

Reimplemented from ncVehicle.

◆ Realign()

void func_vehicle::Realign ( void  )
virtual

◆ ReceiveEntity()

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

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

Reimplemented from ncVehicle.

◆ Respawn()

void func_vehicle::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 ncSurfacePropEntity.

◆ Restore()

void func_vehicle::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to ncIO::SpawnKey() but for save-game fields.

Whatever you write into file handles within your ncIO::Save() method needs to be read back in here.

Reimplemented from ncVehicle.

◆ RunVehiclePhysics()

void func_vehicle::RunVehiclePhysics ( void  )
virtual

◆ Save()

void func_vehicle::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the ncIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from ncVehicle.

◆ SendEntity()

float func_vehicle::SendEntity ( entity  ,
float   
)
virtual

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

Reimplemented from ncVehicle.

◆ Spawned()

void func_vehicle::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 ncSurfacePropEntity.

◆ SpawnKey()

void func_vehicle::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 ncIO.

Reimplemented from ncSurfacePropEntity.

◆ UpdateView()

void func_vehicle::UpdateView ( void  )
virtual

Reimplemented from ncVehicle.


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