Nuclide
Software Development Kit for id Technology (BETA)
ncActor Class Reference

About this class

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.

KEYS

  • "snd_stepladder" : Sound to play when climbing a ladder.
  • "snd_death" : Sound to play upon death.
  • "snd_fall" : Sound to play upon taking falldamage.
  • "snd_painSmall" : Sound to play when their health is still above 75%.
  • "snd_painMedium" : Sound to play when their health is still above 50%.
  • "snd_painLarge" : Sound to play when their health is still above 25%.
  • "snd_painHuge" : Sound to play when their health is below 25%.
  • "snd_landSoft" : Sound to play when landing from any height.
  • "snd_landHard" : Sound to play upon a fall, although not damaging.
  • "snd_hitArmor" : Sound to play when receiving damage and having some armor protection.
  • "snd_hitFlesh" : Sound to play when receiving damage and having no armor protection.
  • "snd_airGasp" : Sound to play when coming back up from under water.
  • "snd_noAir" : Sound to play when struggling to breathe under water.
  • "snd_teleportExit" : Sound to play when having exited a teleporter.
  • "snd_teleportStart" : Sound to play when having entered a teleporter.
  • "snd_burn" : Sound to play whenever incremental burn damage occurs.
  • "snd_healthtake" : Sound to play when receiving a health increase.
  • "snd_waterEnter" : Sound to play when entering water.
  • "snd_waterExit" : Sound to play when exiting water.
Inheritance diagram for ncActor:
ncSurfacePropEntity ncBot ncMonster npc_furniture ncClient monster_furniture ncSquadMonster ncSpectator ncTalkMonster ncPlayer ambient_generic monster_generic speaker

Public Member Functions

void ncActor (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 float GetStamina (void)
 
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 MaxAmmo (int)
 Returns whether the specified type is maxed out. 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 ncItem to the inventory. More...
 
nonvirtual bool RemoveItem (string)
 Removes a named ncItem from the inventory Returns false when impossible. More...
 
nonvirtual bool AddItem (ncItem)
 Adds the specified ncItem 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 (ncItem)
 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 (ncWeapon)
 Switches the entity to use the desired weapon. More...
 
nonvirtual void SwitchToBestWeapon (bool)
 
nonvirtual void LaunchProjectile (string, bool, float)
 
nonvirtual bool PlantCharge (string)
 
virtual ncWeapon SortWeaponChain (void)
 Returns the first weapon in the chain, while ensuring the inventory is sorted. More...
 
nonvirtual ncWeapon GetNextWeapon (void)
 Retrieve the 'next' weapon in the inventory, sorted by SortWeaponChain(). More...
 
nonvirtual ncWeapon GetPreviousWeapon (void)
 Retrieve the 'next' weapon in the inventory, sorted by SortWeaponChain(). More...
 
nonvirtual ncWeapon GetLastWeapon (void)
 Retrieve the 'last' weapon they had chosen. More...
 
virtual void AddedItemCallback (ncItem)
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
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 RestoreComplete (void)
 Called when the entity has been successfully restored from a savegame file. More...
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. More...
 
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 SelectNewSchedule (void)
 Overridable: Called regularily to select a new schedule to perform. More...
 
nonvirtual void PerformSchedule (string)
 Forces a named schedule to be performed. More...
 
nonvirtual bool IsPerforming (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...
 

Constructor & Destructor Documentation

◆ ncActor()

void ncActor::ncActor ( void  )

Member Function Documentation

◆ AddedItemCallback()

void ncActor::AddedItemCallback ( ncItem  itemAdded)
virtual

Reimplemented in ncBot.

◆ AddItem()

bool ncActor::AddItem ( ncItem  theItem)

Adds the specified ncItem to the inventory.

Returns false when impossible.

◆ CanCrouch() [1/2]

bool ncActor::CanCrouch ( void  )
virtual

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

Reimplemented in ncPlayer.

◆ CanCrouch() [2/2]

virtual bool ncActor::CanCrouch ( void  )
virtual

Returns if this class is capable of crouching.

Reimplemented in ncPlayer.

◆ CanLean()

bool ncActor::CanLean ( void  )
virtual

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

Reimplemented in ncPlayer.

◆ CanProne()

bool ncActor::CanProne ( void  )
virtual

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

Reimplemented in ncPlayer.

◆ CanSprint()

bool ncActor::CanSprint ( void  )
virtual

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

Reimplemented in ncPlayer.

◆ ChasePath()

void ncActor::ChasePath ( string  startPath)
virtual

When called, will start following a path_corner.

◆ CheckRoute()

void ncActor::CheckRoute ( void  )
virtual

Internal use only.

Called every frame to see our route progression.

Reimplemented in ncBot.

◆ CheckRoute_Path()

void ncActor::CheckRoute_Path ( void  )
virtual

Internal use only.

Called every frame to see our route progression.

◆ DebugDraw()

void ncActor::DebugDraw ( void  )
virtual

Reimplemented from ncEntity.

Reimplemented in ambient_generic.

◆ GetBackSpeed()

float ncActor::GetBackSpeed ( void  )
virtual

Overridable: Returns the desired maximum backwardss movement speed.

Reimplemented in ncBot, and ncClient.

◆ GetCurrentWeapon()

string ncActor::GetCurrentWeapon ( void  )

Returns the name of the current weapon.

E.g. "weapon_foobar"

◆ GetForwardSpeed()

float ncActor::GetForwardSpeed ( void  )
virtual

Overridable: Returns the desired maximum forward movement speed.

Reimplemented in ncBot, and ncClient.

◆ GetLastWeapon()

ncWeapon ncActor::GetLastWeapon ( void  )

Retrieve the 'last' weapon they had chosen.

If not valid, returns the next best.

◆ GetMoveSpeedScale()

float ncActor::GetMoveSpeedScale ( void  )

Returns the movement speed scale.

◆ GetNextWeapon()

ncWeapon ncActor::GetNextWeapon ( void  )

Retrieve the 'next' weapon in the inventory, sorted by SortWeaponChain().

◆ GetPreviousWeapon()

ncWeapon ncActor::GetPreviousWeapon ( void  )

Retrieve the 'next' weapon in the inventory, sorted by SortWeaponChain().

◆ GetReserveAmmo()

int ncActor::GetReserveAmmo ( int  ammoType)

Returns the amount of reserve ammo of a given type.

◆ GetRouteDirection()

vector ncActor::GetRouteDirection ( void  )

Returns the current movement direction.

◆ GetRouteMovevalues()

vector ncActor::GetRouteMovevalues ( void  )

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

◆ GetSideSpeed()

float ncActor::GetSideSpeed ( void  )
virtual

Overridable: Returns the desired maximum side movement speed.

Reimplemented in ncBot, and ncClient.

◆ GetStamina()

float ncActor::GetStamina ( void  )

◆ GiveAmmo()

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

Gives ammo up of a specified type.

Returns false when impossible.

◆ GiveItem()

bool ncActor::GiveItem ( string  itemName)

Adds a named ncItem to the inventory.

Returns false when impossible.

◆ HasAmmo()

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

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

◆ HasExactItem()

bool ncActor::HasExactItem ( ncItem  itemEntity)

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

◆ HasItem()

bool ncActor::HasItem ( string  itemName)

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

◆ Input()

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

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

Reimplemented from ncSurfacePropEntity.

Reimplemented in ambient_generic, ncPlayer, and ncMonster.

◆ IsCrouching()

bool ncActor::IsCrouching ( void  )

Returns true when the entity is ducked/crouching.

◆ IsLeaning()

bool ncActor::IsLeaning ( void  )

Returns true when the entity is leaning.

◆ IsPerforming()

bool ncActor::IsPerforming ( void  )

◆ IsProne()

bool ncActor::IsProne ( void  )

Returns true when the entity is ducked/crouching.

◆ IsSprinting()

bool ncActor::IsSprinting ( void  )

Returns true when the entity is running.

◆ IsStanding()

bool ncActor::IsStanding ( void  )

Returns true when the entity is standing, walking.

◆ LaunchProjectile()

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

◆ MaxAmmo()

bool ncActor::MaxAmmo ( int  ammoType)

Returns whether the specified type is maxed out.

◆ PerformSchedule()

void ncActor::PerformSchedule ( string  scheduleDecl)

Forces a named schedule to be performed.

◆ Physics_Run()

void ncActor::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 ncPlayer.

◆ PlantCharge()

bool ncActor::PlantCharge ( string  defName)

◆ RemoveAllItems()

bool ncActor::RemoveAllItems ( bool  ignoreWeapons)

Removes all items from the inventory.

Returns false when already empty.

◆ RemoveAllWeapons()

bool ncActor::RemoveAllWeapons ( void  )

Removes all weapons from the inventory.

Returns false when already clear.

◆ RemoveItem()

bool ncActor::RemoveItem ( string  itemName)

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

◆ Restore()

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

Reimplemented in ambient_generic, speaker, ncClient, ncPlayer, ncSpectator, ncMonster, ncSquadMonster, and ncTalkMonster.

◆ RestoreComplete()

void ncActor::RestoreComplete ( void  )
virtual

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

Reimplemented from ncIO.

◆ RouteClear()

void ncActor::RouteClear ( void  )
virtual

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

Reimplemented in ncBot.

◆ RouteEnded()

void ncActor::RouteEnded ( void  )
virtual

Called when the object is done moving to its destination.

Reimplemented in ncMonster.

◆ RouteToPosition()

void ncActor::RouteToPosition ( vector  destination)
virtual

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

◆ RouteToPositionDenyFlags()

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

Reimplemented in ambient_generic, speaker, ncClient, ncPlayer, ncSpectator, ncMonster, ncSquadMonster, and ncTalkMonster.

◆ SelectNewSchedule()

void ncActor::SelectNewSchedule ( void  )
virtual

Overridable: Called regularily to select a new schedule to perform.

◆ SetMoveSpeedScale()

void ncActor::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).

◆ SortWeaponChain()

ncWeapon ncActor::SortWeaponChain ( void  )
virtual

Returns the first weapon in the chain, while ensuring the inventory is sorted.

◆ Spawned()

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

Reimplemented in ambient_generic, speaker, ncPlayer, ncMonster, and ncSquadMonster.

◆ SpawnKey()

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

Reimplemented in monster_furniture, ambient_generic, speaker, ncMonster, ncSquadMonster, and ncTalkMonster.

◆ SwitchToBestWeapon()

void ncActor::SwitchToBestWeapon ( bool  ignoreActive)

◆ SwitchToExactWeapon()

void ncActor::SwitchToExactWeapon ( ncWeapon  item)

Switches the entity to use the desired weapon.

◆ SwitchToWeapon()

void ncActor::SwitchToWeapon ( string  weaponName)

Switches the entity to use the desired weapon.

◆ UseAmmo()

bool ncActor::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: