Planeshift
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

NPC Class Reference

This object represents each NPC managed by this superclient. More...

#include <npc.h>

List of all members.

Classes

struct  Locate
 Structure to hold located positions. More...

Public Types

enum  {
  LOCATION_NONE = 0, LOCATION_POS = 1, LOCATION_SECTOR = 2, LOCATION_ANGLE = 4,
  LOCATION_WP = 8, LOCATION_RADIUS = 16, LOCATION_TARGET = 32, LOCATION_ALL = -1
}
typedef csHash< Locate
*, csString > 
LocateHash

Public Member Functions

void AddAutoMemorize (csString types)
 Add new types to the autoMemorize store.
void AddToHateList (gemNPCActor *attacker, float delta)
 Change the hate list value for an attacker.
void CheckPosition ()
void ClearState ()
 Clear the NPCs state.
bool ContainAutoMemorizeType (const csString &type)
 Check if the type is contained in the NPC autoMemorize store.
bool CopyLocate (csString source, csString destination, unsigned int flags)
 Copy locates.
bool Delete ()
 Remove this NPC from npc_definitions.
void Disable (bool disable=true)
void Dump ()
 Dump all information for one NPC to the console.
void DumpBehaviorList (csString &output)
 Dump all behaviors for npc.
void DumpControlled (csString &output)
 Dump the controlled npcs for npc.
void DumpDebugLog (csString &output)
 Dump the debug log for npc.
void DumpHateList (NPC *npc)
 Dump all hated entities for npc.
void DumpHateList (csString &output)
 Dump all hated entities for npc.
void DumpMemory (csString &output)
 Dump the memory for npc.
void DumpReactionList (csString &output)
 Dump all reactions for npc.
void DumpState (csString &output)
 Dump all state information for npc.
void GetActiveLocate (csVector3 &pos, iSector *&sector, float &rot)
 Get the NPCs current active locate.
void GetActiveLocate (Waypoint *&wp)
 Return the wp of the current active locate.
float GetActiveLocateRadius () const
 Get the radius of the last locate operatoins.
gemNPCActorGetActor ()
float GetAngularVelocity ()
 Return the angular velocity of this NPC.
NPCTypeGetBrain ()
csString GetBuffer (const csString &bufferName)
 Return a named buffer from the NPC.
Tribe::MemoryGetBufferMemory ()
 Retrive the current buffer memory of the npc.
Tribe::AssetGetBuildingSpot ()
 Get the stored building spot for this NPC.
BehaviorGetCurrentBehavior ()
uint8_t GetDRCounter (csTicks when, const csVector3 &pos, float yRot, iSector *sector, const csVector3 &vel, float angVel)
EID GetEID ()
 Return the entity ID if an entity exist else 0.
float GetEntityHate (gemNPCActor *entity)
 Retrive the hate this NPC has to a given entity.
int GetFallCounter ()
 Return the fall counter.
float GetHP ()
 Get the npc HP.
float GetHPRate () const
 Get the npc HPRate.
PerceptionGetLastPerception ()
psLinearMovementGetLinMove ()
float GetMana ()
 Get the npc Mana.
float GetManaRate () const
 Get the npc ManaRate.
float GetMaxHP () const
 Get the npc MaxHP.
float GetMaxMana () const
 Get the npc MaxMana.
float GetMaxMenStamina () const
 Get the npc MaxMenStamina.
float GetMaxPysStamina () const
 Get the npc MaxPysStamina.
float GetMenStamina ()
 Get the npc MenStamina.
float GetMenStaminaRate () const
 Get the npc MenStaminaRate.
gemNPCActorGetMostHated (float range, bool includeOutsideRegion, bool includeInvisible, bool includeInvincible, float *hate=NULL)
 Find the most hated entity within range of the NPC.
gemNPCActorGetMostHated (csVector3 &pos, iSector *sector, float range, LocationType *region, bool includeOutsideRegion, bool includeInvisible, bool includeInvincible, float *hate)
 Find the most hated entity within range of a given position.
iMovable * GetMovable ()
const char * GetName ()
gemNPCActorGetNearestActor (float range, csVector3 &destPosition, iSector *&destSector, float &destRange)
 Return the nearest actor within the given range.
gemNPCActorGetNearestDeadActor (float range)
gemNPCActorGetNearestNPC (float range, csVector3 &destPosition, iSector *&destSector, float &destRange)
 Return the nearest NPC within the given range.
gemNPCActorGetNearestPlayer (float range, csVector3 &destPosition, iSector *&destSector, float &destRange)
 Return the nearest player within the given range.
gemNPCActorGetNearestVisibleFriend (float range)
const char * GetOrigBrainType ()
gemNPCObjectGetOwner ()
const char * GetOwnerName ()
PID GetPID ()
float GetPysStamina ()
 Get the npc PysStamina.
float GetPysStaminaRate () const
 Get the npc PysStaminaRate.
psNPCRaceListMessage::NPCRaceInfo_tGetRaceInfo ()
 Get the npc race info.
LocationTypeGetRegion ()
csString & GetRegionName ()
float GetRunVelocity ()
 Return the run velocity for this NPC.
const csVector3 & GetSpawnPosition () const
 Return the position part of the spawn position.
iSector * GetSpawnSector () const
 Return the sector part of the spawn position.
gemNPCObjectGetTarget ()
TribeGetTribe ()
 Get the tribe this npc belongs to.
const csString & GetTribeMemberType () const
 Return the type/class for this NPC's tribe membership if any.
float GetVelocity ()
 Return the ?override? velocity for this NPC.
float GetWalkVelocity ()
 Return the walk velocity for this NPC.
bool HasAutoMemorizeTypes () const
 Check if the NPC has anything to automemorize.
void IncrementFallCounter ()
 Increment the fall counter.
csString Info (const csString &infoRequestSubCmd)
 Provide info about the NPC.
bool InsertCopy (PID use_char_id, PID ownerPID)
 Insert a new copy of NPC into npc_definitions.
bool IsAlive () const
bool IsDisabled ()
bool IsInsideRegion ()
 Check the inside region state of the npc.
bool IsInsideTribeHome ()
 Check the inside tribe home state of the npc.
void Load (const char *name, PID pid, NPCType *type, const char *region_name, int debugging, bool disabled, EventManager *eventmanager)
 Loads an NPC base information and his brain.
bool Load (iResultRow &row, csHash< NPCType *, const char * > &npctypes, EventManager *eventmanager, PID usePID)
 Loads an NPC from one row of sc_npc_definitions, it also loads the corresponding brain.
 NPC (psNPCClient *npcclient, NetworkManager *networkmanager, psWorld *world, iEngine *engine, iCollideSystem *cdsys)
void ReleaseControl (gemNPCActor *actor)
 Release control of another controlled entity.
void RemoveAutoMemorize (csString types)
 Remove types from the autoMemorize store.
void RemoveFromHateList (EID who)
 Remove a entity from the hate list.
void ReplaceBuffers (csString &result)
 Replace $NBUFFER[x] with values from the NPC buffer.
void ReplaceLocations (csString &result)
 Replace a location.
void ScopedTimerCallback (const ScopedTimer *timer)
 Callback for debug scope timers.
void SetActor (gemNPCActor *actor)
void SetAlive (bool a)
void SetBrain (NPCType *type)
 Sets a new brain (npctype) to this npc.
void SetBuffer (const csString &bufferName, const csString &value)
 Set/Update the value of a named buffer.
void SetBufferMemory (Tribe::Memory *memory)
 Set a new buffer memory for the NPC.
void SetBuildingSpot (Tribe::Asset *buildingSpot)
 Set a building spot for this NPC.
void SetDRCounter (uint8_t counter)
void SetInsideRegion (bool inside)
 Set the inside region state.
void SetInsideTribeHome (bool inside)
 Set the inside tribe home state.
void SetLastPerception (Perception *pcpt)
void SetLocate (const csString &destination, const NPC::Locate &locate)
 Set the NPCs locate.
void SetOwner (EID owner_EID)
 Sets the owner of this npc.
void SetTarget (gemNPCObject *t)
void SetTribe (Tribe *new_tribe)
 Set a new tribe for this npc.
void SetTribeMemberType (const char *tribeMemberType)
 Set the type/class for this npc in a tribe.
void StoreSpawnPosition ()
 Store the start position.
void TakeControl (gemNPCActor *actor)
 Take control of another entity.
void Tick ()
void TriggerEvent (Perception *pcpt, float maxRange=-1.0, csVector3 *basePos=NULL, iSector *baseSector=NULL, bool sameSector=false)
 Send a perception to this NPC.
void TriggerEvent (const char *pcpt)
 Send a perception to this NPC.
void UpdateControlled ()
 Update entities controlled by this NPC.
virtual ~NPC ()

Protected Types

typedef csHash< csString,
csString > 
BufferHash

Protected Member Functions

void Advance (csTicks when)
void TickPostProcess (csTicks when)
 Handle post tick processing.

Protected Attributes

LocateactiveLocate
 The current "Active" locate.
bool alive
float ang_vel
csArray< csString > autoMemorizeTypes
 Used to store what types of perceptions to memorize without changing behaviors.
NPCTypebrain
bool checked
csVector3 checkedPos
bool checkedResult
iSector * checkedSector
csArray< csWeakRef< gemNPCActor > > controlledActors
 Actors that are dragged/pushed around by this NPC.
bool disabled
uint8_t DRcounter
int fallCounter
HateList hatelist
Stat hp
bool insideRegion
 State variable for inside outside region checks.
bool insideTribeHome
 State variable for inside outside tribe home checks.
Perceptionlast_perception
csTicks last_update
float lastDrAngVel
bool lastDrMoving
csVector3 lastDrPosition
iSector * lastDrSector
csTicks lastDrTime
csVector3 lastDrVel
float lastDrYRot
Stat mana
Stat menStamina
iMovable * movable
csString name
gemNPCActornpcActor
NPCTypeoldbrain
 delete at checkpoint
csString origtype
 Name of NPCType for 'reload'.
EID owner_id
PID pid
Stat pysStamina
psNPCRaceListMessage::NPCRaceInfo_traceInfo
LocationTyperegion
 Cached pointer to the region.
csString region_name
 Region name as loaded from db.
float runVelocity
float scale
 Model scale value.
csVector3 spawnPosition
 The stored position that this NPC where spawned.
iSector * spawnSector
 The stored sector that this NPC where spawned.
LocateHash storedLocates
 List of stored locate locations.
EID target_id
Tribetribe
csString tribeMemberType
 What type/class is this NPC in the tribe.
csString type
float vel
float walkVelocity

Detailed Description

This object represents each NPC managed by this superclient.

Definition at line 126 of file npc.h.


Member Typedef Documentation

typedef csHash<csString,csString> NPC::BufferHash [protected]

Definition at line 157 of file npc.h.

typedef csHash<Locate*,csString> NPC::LocateHash

Definition at line 141 of file npc.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
LOCATION_NONE 
LOCATION_POS 
LOCATION_SECTOR 
LOCATION_ANGLE 
LOCATION_WP 
LOCATION_RADIUS 
LOCATION_TARGET 
LOCATION_ALL 

Definition at line 143 of file npc.h.


Constructor & Destructor Documentation

NPC::NPC ( psNPCClient npcclient,
NetworkManager networkmanager,
psWorld world,
iEngine *  engine,
iCollideSystem *  cdsys 
)
virtual NPC::~NPC ( ) [virtual]

Member Function Documentation

void NPC::AddAutoMemorize ( csString  types)

Add new types to the autoMemorize store.

They should be "," seperated.

void NPC::AddToHateList ( gemNPCActor attacker,
float  delta 
)

Change the hate list value for an attacker.

Parameters:
attackerThe entity that should be adjusted.
deltaThe change in hate to apply to the attacker.
void NPC::Advance ( csTicks  when) [protected]
void NPC::CheckPosition ( )
void NPC::ClearState ( )

Clear the NPCs state.

Brain, hatelist, etc. is cleared.

bool NPC::ContainAutoMemorizeType ( const csString &  type)

Check if the type is contained in the NPC autoMemorize store.

bool NPC::CopyLocate ( csString  source,
csString  destination,
unsigned int  flags 
)

Copy locates.

Typically used to take backups of "Active" locate.

bool NPC::Delete ( )

Remove this NPC from npc_definitions.

void NPC::Disable ( bool  disable = true)
void NPC::Dump ( )

Dump all information for one NPC to the console.

The main use of this fuction is the "print \<pid\>" npcclient console command.

void NPC::DumpBehaviorList ( csString &  output)

Dump all behaviors for npc.

void NPC::DumpControlled ( csString &  output)

Dump the controlled npcs for npc.

void NPC::DumpDebugLog ( csString &  output)

Dump the debug log for npc.

void NPC::DumpHateList ( NPC npc)

Dump all hated entities for npc.

Using debug prints at level 5.

void NPC::DumpHateList ( csString &  output)

Dump all hated entities for npc.

void NPC::DumpMemory ( csString &  output)

Dump the memory for npc.

void NPC::DumpReactionList ( csString &  output)

Dump all reactions for npc.

void NPC::DumpState ( csString &  output)

Dump all state information for npc.

void NPC::GetActiveLocate ( csVector3 &  pos,
iSector *&  sector,
float rot 
)

Get the NPCs current active locate.

void NPC::GetActiveLocate ( Waypoint *&  wp)

Return the wp of the current active locate.

Parameters:
wpwill be set with the wp currently in the active locate.
float NPC::GetActiveLocateRadius ( ) const

Get the radius of the last locate operatoins.

Returns:
The radius of the last locate
gemNPCActor* NPC::GetActor ( ) [inline]

Definition at line 289 of file npc.h.

float NPC::GetAngularVelocity ( )

Return the angular velocity of this NPC.

NPCType* NPC::GetBrain ( )
csString NPC::GetBuffer ( const csString &  bufferName)

Return a named buffer from the NPC.

Function used to get data from buffers containing information.

Parameters:
bufferNameThe buffer name.
Returns:
The content of the named buffer.
Tribe::Memory* NPC::GetBufferMemory ( ) [inline]

Retrive the current buffer memory of the npc.

Definition at line 843 of file npc.h.

Tribe::Asset* NPC::GetBuildingSpot ( )

Get the stored building spot for this NPC.

Behavior* NPC::GetCurrentBehavior ( )
uint8_t NPC::GetDRCounter ( csTicks  when,
const csVector3 &  pos,
float  yRot,
iSector *  sector,
const csVector3 &  vel,
float  angVel 
) [inline]

Definition at line 252 of file npc.h.

EID NPC::GetEID ( )

Return the entity ID if an entity exist else 0.

float NPC::GetEntityHate ( gemNPCActor entity)

Retrive the hate this NPC has to a given entity.

Parameters:
entityThe entity to check for hate.
Returns:
the hate value
int NPC::GetFallCounter ( ) [inline]

Return the fall counter.

Fall counter is used for debugging.

Definition at line 810 of file npc.h.

float NPC::GetHP ( )

Get the npc HP.

float NPC::GetHPRate ( ) const

Get the npc HPRate.

Perception* NPC::GetLastPerception ( ) [inline]

Definition at line 418 of file npc.h.

psLinearMovement* NPC::GetLinMove ( )
float NPC::GetMana ( )

Get the npc Mana.

float NPC::GetManaRate ( ) const

Get the npc ManaRate.

float NPC::GetMaxHP ( ) const

Get the npc MaxHP.

float NPC::GetMaxMana ( ) const

Get the npc MaxMana.

float NPC::GetMaxMenStamina ( ) const

Get the npc MaxMenStamina.

float NPC::GetMaxPysStamina ( ) const

Get the npc MaxPysStamina.

float NPC::GetMenStamina ( )

Get the npc MenStamina.

float NPC::GetMenStaminaRate ( ) const

Get the npc MenStaminaRate.

gemNPCActor* NPC::GetMostHated ( float  range,
bool  includeOutsideRegion,
bool  includeInvisible,
bool  includeInvincible,
float hate = NULL 
)

Find the most hated entity within range of the NPC.

Check the hate list and retrive most hated entity within range.

Parameters:
rangeThe range to search for hated entities.
includeOutsideRegionInclude enties outside region in the search.
includeInvisibleInclude invisible entities in the search.
includeInvincibleInclude invincible entities in the search.
hateIf diffrent from NULL, set upon return to the hate of the hated.
Returns:
The hated entity
gemNPCActor* NPC::GetMostHated ( csVector3 &  pos,
iSector *  sector,
float  range,
LocationType region,
bool  includeOutsideRegion,
bool  includeInvisible,
bool  includeInvincible,
float hate 
)

Find the most hated entity within range of a given position.

Check the hate list and retrive most hated entity within range.

Parameters:
posThe position
sectorThe sector of the position
rangeThe range to search for hated entities.
regionThe region to search for hated entities within.
includeOutsideRegionInclude enties outside region in the search.
includeInvisibleInclude invisible entities in the search.
includeInvincibleInclude invincible entities in the search.
hateIf diffrent from NULL, set upon return to the hate of the hated.
Returns:
The hated entity
iMovable* NPC::GetMovable ( ) [inline]

Definition at line 246 of file npc.h.

const char* NPC::GetName ( ) [inline]

Definition at line 293 of file npc.h.

gemNPCActor* NPC::GetNearestActor ( float  range,
csVector3 &  destPosition,
iSector *&  destSector,
float destRange 
)

Return the nearest actor within the given range.

Parameters:
rangeThe search range to look for players
destPositionReturn the position of the target
destSectorReturn the sector of the target
destRangeReturn the range to the target
Returns:
The actor of the nearest player or NPC or NULL if none within range
gemNPCActor* NPC::GetNearestDeadActor ( float  range)
gemNPCActor* NPC::GetNearestNPC ( float  range,
csVector3 &  destPosition,
iSector *&  destSector,
float destRange 
)

Return the nearest NPC within the given range.

Parameters:
rangeThe search range to look for players
destPositionReturn the position of the target
destSectorReturn the sector of the target
destRangeReturn the range to the target
Returns:
The actor of the nearest NPC or NULL if none within range
gemNPCActor* NPC::GetNearestPlayer ( float  range,
csVector3 &  destPosition,
iSector *&  destSector,
float destRange 
)

Return the nearest player within the given range.

Parameters:
rangeThe search range to look for players
destPositionReturn the position of the target
destSectorReturn the sector of the target
destRangeReturn the range to the target
Returns:
The actor of the nearest player or NULL if none within range
gemNPCActor* NPC::GetNearestVisibleFriend ( float  range)
const char* NPC::GetOrigBrainType ( ) [inline]

Definition at line 310 of file npc.h.

gemNPCObject* NPC::GetOwner ( )
const char* NPC::GetOwnerName ( )
PID NPC::GetPID ( ) [inline]

Definition at line 238 of file npc.h.

float NPC::GetPysStamina ( )

Get the npc PysStamina.

float NPC::GetPysStaminaRate ( ) const

Get the npc PysStaminaRate.

psNPCRaceListMessage::NPCRaceInfo_t* NPC::GetRaceInfo ( )

Get the npc race info.

LocationType* NPC::GetRegion ( )
csString& NPC::GetRegionName ( ) [inline]

Definition at line 536 of file npc.h.

float NPC::GetRunVelocity ( )

Return the run velocity for this NPC.

const csVector3& NPC::GetSpawnPosition ( ) const

Return the position part of the spawn position.

iSector* NPC::GetSpawnSector ( ) const

Return the sector part of the spawn position.

gemNPCObject* NPC::GetTarget ( )
Tribe* NPC::GetTribe ( )

Get the tribe this npc belongs to.

Returns:
Null if not part of a tribe
const csString& NPC::GetTribeMemberType ( ) const

Return the type/class for this NPC's tribe membership if any.

float NPC::GetVelocity ( )

Return the ?override? velocity for this NPC.

float NPC::GetWalkVelocity ( )

Return the walk velocity for this NPC.

bool NPC::HasAutoMemorizeTypes ( ) const [inline]

Check if the NPC has anything to automemorize.

Definition at line 612 of file npc.h.

void NPC::IncrementFallCounter ( ) [inline]

Increment the fall counter.

Fall counter is used for debugging.

Definition at line 800 of file npc.h.

csString NPC::Info ( const csString &  infoRequestSubCmd)

Provide info about the NPC.

This funcion is both used by the "/info" in the client and the "info <pid> npcclient console command.

bool NPC::InsertCopy ( PID  use_char_id,
PID  ownerPID 
)

Insert a new copy of NPC into npc_definitions.

bool NPC::IsAlive ( ) const [inline]

Definition at line 298 of file npc.h.

bool NPC::IsDisabled ( ) [inline]

Definition at line 303 of file npc.h.

bool NPC::IsInsideRegion ( ) [inline]

Check the inside region state of the npc.

Definition at line 546 of file npc.h.

bool NPC::IsInsideTribeHome ( ) [inline]

Check the inside tribe home state of the npc.

Definition at line 675 of file npc.h.

bool NPC::Load ( iResultRow &  row,
csHash< NPCType *, const char * > &  npctypes,
EventManager eventmanager,
PID  usePID 
)

Loads an NPC from one row of sc_npc_definitions, it also loads the corresponding brain.

Used at boot time

void NPC::Load ( const char *  name,
PID  pid,
NPCType type,
const char *  region_name,
int  debugging,
bool  disabled,
EventManager eventmanager 
)

Loads an NPC base information and his brain.

void NPC::ReleaseControl ( gemNPCActor actor)

Release control of another controlled entity.

void NPC::RemoveAutoMemorize ( csString  types)

Remove types from the autoMemorize store.

They should be "," seperated.

void NPC::RemoveFromHateList ( EID  who)

Remove a entity from the hate list.

void NPC::ReplaceBuffers ( csString &  result)

Replace $NBUFFER[x] with values from the NPC buffer.

Parameters:
resultString to replace buffers in.
void NPC::ReplaceLocations ( csString &  result)

Replace a location.

This replace $LOCATION[<location>.<attribute>].

void NPC::ScopedTimerCallback ( const ScopedTimer timer) [virtual]

Callback for debug scope timers.

Implements ScopedTimerCB.

void NPC::SetActor ( gemNPCActor actor)
void NPC::SetAlive ( bool  a)
void NPC::SetBrain ( NPCType type)

Sets a new brain (npctype) to this npc.

Parameters:
typeThe new type to assign to this npc.
void NPC::SetBuffer ( const csString &  bufferName,
const csString &  value 
)

Set/Update the value of a named buffer.

Parameters:
bufferNameThe buffer name.
valueThe value to put in the buffer.
void NPC::SetBufferMemory ( Tribe::Memory memory)

Set a new buffer memory for the NPC.

Parameters:
memoryThe new memory to store in the NPC.
void NPC::SetBuildingSpot ( Tribe::Asset buildingSpot)

Set a building spot for this NPC.

Parameters:
buildingSpotThe building spot to set.
void NPC::SetDRCounter ( uint8_t  counter) [inline]

Definition at line 263 of file npc.h.

void NPC::SetInsideRegion ( bool  inside) [inline]

Set the inside region state.

Keep track of last perception for inbound our, outbound

Definition at line 556 of file npc.h.

void NPC::SetInsideTribeHome ( bool  inside) [inline]

Set the inside tribe home state.

Keep track of last perception for inbound our, outbound

Definition at line 685 of file npc.h.

void NPC::SetLastPerception ( Perception pcpt)
void NPC::SetLocate ( const csString &  destination,
const NPC::Locate locate 
)

Set the NPCs locate.

void NPC::SetOwner ( EID  owner_EID)

Sets the owner of this npc.

The server will send us the owner of the entity connected to it so we can follow it's directions.

Parameters:
owner_EIDthe eid of the entity who owns this npc.
void NPC::SetTarget ( gemNPCObject t)
void NPC::SetTribe ( Tribe new_tribe)

Set a new tribe for this npc.

void NPC::SetTribeMemberType ( const char *  tribeMemberType)

Set the type/class for this npc in a tribe.

void NPC::StoreSpawnPosition ( )

Store the start position.

Store the current position as spawn position so that NPCs can locate spawn position.

void NPC::TakeControl ( gemNPCActor actor)

Take control of another entity.

void NPC::Tick ( )
void NPC::TickPostProcess ( csTicks  when) [protected]

Handle post tick processing.

void NPC::TriggerEvent ( Perception pcpt,
float  maxRange = -1.0,
csVector3 *  basePos = NULL,
iSector *  baseSector = NULL,
bool  sameSector = false 
)

Send a perception to this NPC.

This will send the perception to this npc. If the maxRange has been set to something greater than 0.0 a range check will be applied. Only if within the range from the base position and sector will this perception be triggered.

Parameters:
pcptPerception to be sent.
maxRangeIf greater then 0.0 then max range apply
basePosThe base position for range checks.
baseSectorThe base sector for range checks.
sameSectorOnly trigger if in same sector
void NPC::TriggerEvent ( const char *  pcpt)

Send a perception to this NPC.

Uses the above method, but acts as a wrapper. Receives only the name of the perception and uses default values for the rest of the arguments

void NPC::UpdateControlled ( )

Update entities controlled by this NPC.


Member Data Documentation

Locate* NPC::activeLocate [protected]

The current "Active" locate.

Definition at line 178 of file npc.h.

bool NPC::alive [protected]

Definition at line 189 of file npc.h.

float NPC::ang_vel [protected]

Definition at line 181 of file npc.h.

csArray<csString> NPC::autoMemorizeTypes [protected]

Used to store what types of perceptions to memorize without changing behaviors.

Definition at line 193 of file npc.h.

NPCType* NPC::brain [protected]

Definition at line 160 of file npc.h.

bool NPC::checked [protected]

Definition at line 215 of file npc.h.

csVector3 NPC::checkedPos [protected]

Definition at line 213 of file npc.h.

bool NPC::checkedResult [protected]

Definition at line 216 of file npc.h.

iSector* NPC::checkedSector [protected]

Definition at line 214 of file npc.h.

csArray< csWeakRef<gemNPCActor> > NPC::controlledActors [protected]

Actors that are dragged/pushed around by this NPC.

Definition at line 210 of file npc.h.

bool NPC::disabled [protected]

Definition at line 217 of file npc.h.

uint8_t NPC::DRcounter [protected]

Definition at line 169 of file npc.h.

int NPC::fallCounter [protected]

Definition at line 219 of file npc.h.

HateList NPC::hatelist [protected]

Definition at line 228 of file npc.h.

Stat NPC::hp [protected]

Definition at line 205 of file npc.h.

bool NPC::insideRegion [protected]

State variable for inside outside region checks.

Definition at line 187 of file npc.h.

bool NPC::insideTribeHome [protected]

State variable for inside outside tribe home checks.

Definition at line 197 of file npc.h.

Definition at line 188 of file npc.h.

csTicks NPC::last_update [protected]

Definition at line 165 of file npc.h.

float NPC::lastDrAngVel [protected]

Definition at line 176 of file npc.h.

bool NPC::lastDrMoving [protected]

Definition at line 173 of file npc.h.

csVector3 NPC::lastDrPosition [protected]

Definition at line 170 of file npc.h.

iSector* NPC::lastDrSector [protected]

Definition at line 171 of file npc.h.

csTicks NPC::lastDrTime [protected]

Definition at line 172 of file npc.h.

csVector3 NPC::lastDrVel [protected]

Definition at line 175 of file npc.h.

float NPC::lastDrYRot [protected]

Definition at line 174 of file npc.h.

Stat NPC::mana [protected]

Definition at line 206 of file npc.h.

Stat NPC::menStamina [protected]

Definition at line 208 of file npc.h.

iMovable* NPC::movable [protected]

Definition at line 167 of file npc.h.

csString NPC::name [protected]

Definition at line 164 of file npc.h.

gemNPCActor* NPC::npcActor [protected]

Definition at line 166 of file npc.h.

NPCType* NPC::oldbrain [protected]

delete at checkpoint

Definition at line 159 of file npc.h.

csString NPC::origtype [protected]

Name of NPCType for 'reload'.

Definition at line 161 of file npc.h.

EID NPC::owner_id [protected]

Definition at line 190 of file npc.h.

PID NPC::pid [protected]

Definition at line 163 of file npc.h.

Stat NPC::pysStamina [protected]

Definition at line 207 of file npc.h.

Definition at line 202 of file npc.h.

LocationType* NPC::region [protected]

Cached pointer to the region.

Definition at line 186 of file npc.h.

csString NPC::region_name [protected]

Region name as loaded from db.

Definition at line 185 of file npc.h.

float NPC::runVelocity [protected]

Definition at line 183 of file npc.h.

float NPC::scale [protected]

Model scale value.

Definition at line 184 of file npc.h.

csVector3 NPC::spawnPosition [protected]

The stored position that this NPC where spawned.

Definition at line 199 of file npc.h.

iSector* NPC::spawnSector [protected]

The stored sector that this NPC where spawned.

Definition at line 200 of file npc.h.

List of stored locate locations.

Definition at line 179 of file npc.h.

EID NPC::target_id [protected]

Definition at line 191 of file npc.h.

Tribe* NPC::tribe [protected]

Definition at line 195 of file npc.h.

csString NPC::tribeMemberType [protected]

What type/class is this NPC in the tribe.

Definition at line 196 of file npc.h.

csString NPC::type [protected]

Definition at line 162 of file npc.h.

float NPC::vel [protected]

Definition at line 181 of file npc.h.

float NPC::walkVelocity [protected]

Definition at line 182 of file npc.h.


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