Nuclide
Software Development Kit for id Tech
NSActor Class Reference

This entity class represents an object with choreographed/free-form movement. More...

#include <NSNavAI.h>

Inheritance diagram for NSActor:
NSSurfacePropEntity NSBot NSMonster NSClient NSSquadMonster monster_furniture NSClientSpectator NSTalkMonster NSClientPlayer ambient_generic monster_generic speaker

Public Member Functions

void NSActor (void)
 
virtual bool CanSprint (void)
 Overridable: Returns whether the client can sprint, with the command +sprint. More...
 
virtual bool CanProne (void)
 Overridable: Returns whether the client can prone, with the commands +prone and goprone. More...
 
virtual bool CanCrouch (void)
 Overridable: Returns whether the client can crouch, with the commands +crouch and gocrouch. More...
 
virtual bool CanLean (void)
 Overridable: Returns whether the client can lean, with the commands +leanleft and +leanright. More...
 
virtual float GetForwardSpeed (void)
 Overridable: Returns the desired maximum forward movement speed. More...
 
virtual float GetSideSpeed (void)
 Overridable: Returns the desired maximum side movement speed. More...
 
virtual float GetBackSpeed (void)
 Overridable: Returns the desired maximum backwardss movement speed. More...
 
nonvirtual bool IsCrouching (void)
 Returns true when the entity is ducked/crouching. More...
 
nonvirtual bool IsProne (void)
 Returns true when the entity is ducked/crouching. More...
 
nonvirtual bool IsStanding (void)
 Returns true when the entity is standing, walking. More...
 
nonvirtual bool IsSprinting (void)
 Returns true when the entity is running. More...
 
nonvirtual bool IsLeaning (void)
 Returns true when the entity is leaning. More...
 
nonvirtual bool GiveAmmo (int, int)
 Gives ammo up of a specified type. More...
 
nonvirtual bool UseAmmo (int, int)
 Uses ammo up of a specified type. More...
 
nonvirtual bool HasAmmo (int, int)
 Returns whether or not the entity has enough of the specified ammo and type. More...
 
nonvirtual int GetReserveAmmo (int)
 Returns the amount of reserve ammo of a given type. More...
 
nonvirtual bool GiveItem (string)
 Adds a named NSItem to the inventory. More...
 
nonvirtual bool RemoveItem (string)
 Removes a named NSItem from the inventory Returns false when impossible. More...
 
nonvirtual bool AddItem (NSItem)
 Adds the specified NSItem to the inventory. More...
 
nonvirtual bool HasItem (string)
 Returns true or false depending on if the entity has the named item. More...
 
nonvirtual bool HasExactItem (NSItem)
 Returns true or false depending on if the entity has the exact item. More...
 
nonvirtual bool RemoveAllItems (bool)
 Removes all items from the inventory. More...
 
nonvirtual bool RemoveAllWeapons (void)
 Removes all weapons from the inventory. More...
 
nonvirtual string GetCurrentWeapon (void)
 Returns the name of the current weapon. More...
 
nonvirtual void SwitchToWeapon (string)
 Switches the entity to use the desired weapon. More...
 
nonvirtual void SwitchToExactWeapon (NSWeapon)
 Switches the entity to use the desired weapon. More...
 
nonvirtual void LaunchProjectile (string, bool, float)
 
nonvirtual bool PlantCharge (string)
 
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 RestoreComplete (void)
 Called when the entity has been successfully restored from a savegame file. More...
 
virtual void DebugDraw (void)
 
virtual bool CanCrouch (void)
 Returns if this class is capable of crouching. More...
 
nonvirtual vector GetRouteMovevalues (void)
 Returns the current movement values in a single vector (x = fwd, y = rt, y = up) More...
 
nonvirtual vector GetRouteDirection (void)
 Returns the current movement direction. More...
 
nonvirtual void SetMoveSpeedScale (float)
 Sets the scale on the movement before physics are run. More...
 
nonvirtual float GetMoveSpeedScale (void)
 Returns the movement speed scale. More...
 
virtual void RouteEnded (void)
 Called when the object is done moving to its destination. More...
 
virtual void RouteClear (void)
 When called, will wipe any memory of an ongoing route. More...
 
virtual void CheckRoute (void)
 Internal use only. More...
 
virtual void RouteToPosition (vector)
 When called, will plot a route to a given world coordinate and start moving. More...
 
virtual void RouteToPositionDenyFlags (vector, int)
 When called, will plot a route to a given world coordinate and start moving, ignoring any links that contain the given link flags. More...
 
virtual void ChasePath (string startPath)
 When called, will start following a path_corner. More...
 
virtual void CheckRoute_Path (void)
 Internal use only. More...
 
virtual void Physics_Run (void)
 Overridable: Called when the entity is ready to move. More...
 

Detailed Description

This entity class represents an object with choreographed/free-form movement.

It knows how to deal with waypoint based nodes and possibly other types of pathfinding in the future.

Constructor & Destructor Documentation

◆ NSActor()

void NSActor::NSActor ( void  )

Member Function Documentation

◆ AddItem()

bool NSActor::AddItem ( NSItem  theItem)

Adds the specified NSItem to the inventory.

Returns false when impossible.

◆ CanCrouch() [1/2]

bool NSActor::CanCrouch ( void  )
virtual

Overridable: Returns whether the client can crouch, with the commands +crouch and gocrouch.

Reimplemented in NSClientPlayer.

◆ CanCrouch() [2/2]

virtual bool NSActor::CanCrouch ( void  )
virtual

Returns if this class is capable of crouching.

Reimplemented in NSClientPlayer.

◆ CanLean()

bool NSActor::CanLean ( void  )
virtual

Overridable: Returns whether the client can lean, with the commands +leanleft and +leanright.

Reimplemented in NSClientPlayer.

◆ CanProne()

bool NSActor::CanProne ( void  )
virtual

Overridable: Returns whether the client can prone, with the commands +prone and goprone.

Reimplemented in NSClientPlayer.

◆ CanSprint()

bool NSActor::CanSprint ( void  )
virtual

Overridable: Returns whether the client can sprint, with the command +sprint.

Reimplemented in NSClientPlayer.

◆ ChasePath()

void NSActor::ChasePath ( string  startPath)
virtual

When called, will start following a path_corner.

◆ CheckRoute()

void NSActor::CheckRoute ( void  )
virtual

Internal use only.

Called every frame to see our route progression.

Reimplemented in NSBot.

◆ CheckRoute_Path()

void NSActor::CheckRoute_Path ( void  )
virtual

Internal use only.

Called every frame to see our route progression.

◆ DebugDraw()

void NSActor::DebugDraw ( void  )
virtual

Reimplemented from NSEntity.

Reimplemented in ambient_generic.

◆ GetBackSpeed()

float NSActor::GetBackSpeed ( void  )
virtual

Overridable: Returns the desired maximum backwardss movement speed.

Reimplemented in NSBot, and NSClient.

◆ GetCurrentWeapon()

string NSActor::GetCurrentWeapon ( void  )

Returns the name of the current weapon.

E.g. "weapon_foobar"

◆ GetForwardSpeed()

float NSActor::GetForwardSpeed ( void  )
virtual

Overridable: Returns the desired maximum forward movement speed.

Reimplemented in NSBot, and NSClient.

◆ GetMoveSpeedScale()

float NSActor::GetMoveSpeedScale ( void  )

Returns the movement speed scale.

◆ GetReserveAmmo()

int NSActor::GetReserveAmmo ( int  ammoType)

Returns the amount of reserve ammo of a given type.

◆ GetRouteDirection()

vector NSActor::GetRouteDirection ( void  )

Returns the current movement direction.

◆ GetRouteMovevalues()

vector NSActor::GetRouteMovevalues ( void  )

Returns the current movement values in a single vector (x = fwd, y = rt, y = up)

◆ GetSideSpeed()

float NSActor::GetSideSpeed ( void  )
virtual

Overridable: Returns the desired maximum side movement speed.

Reimplemented in NSBot, and NSClient.

◆ GiveAmmo()

bool NSActor::GiveAmmo ( int  ammoType,
int  ammoAmount 
)

Gives ammo up of a specified type.

Returns false when impossible.

◆ GiveItem()

bool NSActor::GiveItem ( string  itemName)

Adds a named NSItem to the inventory.

Returns false when impossible.

◆ HasAmmo()

bool NSActor::HasAmmo ( int  ammoType,
int  ammoAmount 
)

Returns whether or not the entity has enough of the specified ammo and type.

◆ HasExactItem()

bool NSActor::HasExactItem ( NSItem  itemEntity)

Returns true or false depending on if the entity has the exact item.

◆ HasItem()

bool NSActor::HasItem ( string  itemName)

Returns true or false depending on if the entity has the named item.

◆ IsCrouching()

bool NSActor::IsCrouching ( void  )

Returns true when the entity is ducked/crouching.

◆ IsLeaning()

bool NSActor::IsLeaning ( void  )

Returns true when the entity is leaning.

◆ IsProne()

bool NSActor::IsProne ( void  )

Returns true when the entity is ducked/crouching.

◆ IsSprinting()

bool NSActor::IsSprinting ( void  )

Returns true when the entity is running.

◆ IsStanding()

bool NSActor::IsStanding ( void  )

Returns true when the entity is standing, walking.

◆ LaunchProjectile()

void NSActor::LaunchProjectile ( string  defName,
bool  thrown,
float  timeOfs 
)

◆ Physics_Run()

void NSActor::Physics_Run ( void  )
virtual

Overridable: Called when the entity is ready to move.

When overridden, will no longer move until super function is called, or physics is handled within.

Reimplemented in NSClientPlayer.

◆ PlantCharge()

bool NSActor::PlantCharge ( string  defName)

◆ RemoveAllItems()

bool NSActor::RemoveAllItems ( bool  ignoreWeapons)

Removes all items from the inventory.

Returns false when already empty.

◆ RemoveAllWeapons()

bool NSActor::RemoveAllWeapons ( void  )

Removes all weapons from the inventory.

Returns false when already clear.

◆ RemoveItem()

bool NSActor::RemoveItem ( string  itemName)

Removes a named NSItem from the inventory Returns false when impossible.

◆ Restore()

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

Reimplemented in ambient_generic, speaker, NSClient, NSClientPlayer, NSClientSpectator, NSMonster, NSSquadMonster, and NSTalkMonster.

◆ RestoreComplete()

void NSActor::RestoreComplete ( void  )
virtual

Called when the entity has been successfully restored from a savegame file.

Reimplemented from NSIO.

◆ RouteClear()

void NSActor::RouteClear ( void  )
virtual

When called, will wipe any memory of an ongoing route.

Reimplemented in NSBot.

◆ RouteEnded()

void NSActor::RouteEnded ( void  )
virtual

Called when the object is done moving to its destination.

Reimplemented in NSMonster.

◆ RouteToPosition()

void NSActor::RouteToPosition ( vector  destination)
virtual

When called, will plot a route to a given world coordinate and start moving.

◆ RouteToPositionDenyFlags()

void NSActor::RouteToPositionDenyFlags ( vector  destination,
int  denylinkflags 
)
virtual

When called, will plot a route to a given world coordinate and start moving, ignoring any links that contain the given link flags.

◆ Save()

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

Reimplemented in ambient_generic, speaker, NSClient, NSClientPlayer, NSClientSpectator, NSMonster, NSSquadMonster, and NSTalkMonster.

◆ SetMoveSpeedScale()

void NSActor::SetMoveSpeedScale ( float  newValue)

Sets the scale on the movement before physics are run.

This is used to simulate walking. 0 is treated as 1 (no change).

◆ SwitchToExactWeapon()

void NSActor::SwitchToExactWeapon ( NSWeapon  item)

Switches the entity to use the desired weapon.

◆ SwitchToWeapon()

void NSActor::SwitchToWeapon ( string  weaponName)

Switches the entity to use the desired weapon.

◆ UseAmmo()

bool NSActor::UseAmmo ( int  ammoType,
int  ammoAmount 
)

Uses ammo up of a specified type.

Returns false when impossible.


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