Planeshift
LocateOperation Class Reference

Locate is a very powerful function which will find the nearest object of the named tag, within a range. More...

#include <npcoperations.h>

Public Member Functions

WaypointCalculateWaypoint (NPC *npc, csVector3 located_pos, iSector *located_sector, float located_range)
 Use -1 for located_range if range scheck sould be skipped. More...
 
virtual bool Load (iDocumentNode *node)
 
 LocateOperation ()
 
 LocateOperation (const LocateOperation *other)
 
virtual ScriptOperationMakeCopy ()
 
virtual OperationResult Run (NPC *npc, bool interrupted)
 
virtual ~LocateOperation ()
 
- Public Member Functions inherited from ScriptOperation
void AddRandomRange (csVector3 &dest, float radius, float margin=0.0)
 Move a point somwhere random within radius of the orignial point. More...
 
virtual OperationResult Advance (float timedelta, NPC *npc)
 
virtual bool AtInterruptedAngle (const csVector3 &pos, const iSector *sector, float angle)
 
virtual bool AtInterruptedAngle (NPC *npc)
 
virtual bool AtInterruptedPosition (const csVector3 &pos, const iSector *sector)
 
virtual bool AtInterruptedPosition (NPC *npc)
 
virtual bool CheckEndPointOk (NPC *npc, const csVector3 &myPos, iSector *mySector, const csVector3 &endPos, iSector *endSector)
 Check if the end point where ok. More...
 
virtual bool CheckMoveOk (NPC *npc, csVector3 oldPos, iSector *oldSector, const csVector3 &newPos, iSector *newSector, int resultFromExtrapolate)
 Check if the move where ok. More...
 
void CopyCheckMoveOk (ScriptOperation *source)
 Copy CheckMoveOk paramters from the source script. More...
 
virtual void Failure (NPC *npc)
 Called when the run operation return OPERATION_FAILED. More...
 
virtual float GetAngularVelocity (NPC *npc)
 
virtual const csString & GetCollisionPerception (NPC *npc)
 Return the Collision perception event name. More...
 
virtual const csString & GetFallingPerception (NPC *npc)
 Return the Falling perception event name. More...
 
virtual const csString & GetInBoundsPerception (NPC *npc)
 Return the In Bounds perception event name. More...
 
virtual const char * GetName () const
 
virtual const csString & GetOutOfBoundsPerception (NPC *npc)
 Return the Out of Bounds perception event name. More...
 
virtual State GetState () const
 
virtual float GetVelocity (NPC *npc)
 Return the velocity for the npc. More...
 
virtual void InterruptOperation (NPC *npc)
 
bool LoadCheckMoveOk (iDocumentNode *node)
 Load attributes for the CheckMoveOk check. More...
 
bool LoadVelocity (iDocumentNode *node)
 
 ScriptOperation (const char *sciptName)
 
 ScriptOperation (const ScriptOperation *other)
 
void SetAnimation (NPC *npc, const char *name)
 This function will set an animation for the NPC, the animation will play once. More...
 
void SetParent (Behavior *behavior)
 Set the parent behavior for this operation. More...
 
virtual void SetState (State state)
 
virtual ~ScriptOperation ()
 

Protected Attributes

csString destination
 Alternate destination instead of "Active" locate. More...
 
bool locateInvincible
 Locate invincible targets. More...
 
bool locateInvisible
 Locate invisible targets. More...
 
csString locateOutsideRegion
 Locate targets outside a region if a region exist. Default false. More...
 
csString object
 
bool random
 
float range
 
bool static_loc
 
bool staticLocated
 
NPC::Locate storedStaticLocated
 
- Protected Attributes inherited from ScriptOperation
float ang_vel
 Shared angular velocity, used by all that rotates. More...
 
bool checkTribeHome
 Set to true if the tribe home should be checked by CheckMoveOk. More...
 
csString collision
 Perception names to use for collision detected by CheckMoveOk. More...
 
int consecCollisions
 Shared by move functions. Used by CheckMoveOk to detect collisions. More...
 
csString failurePerception
 The Perception to fire when a operation return OPERATION_FAILED. More...
 
csString falling
 Perception names to use for fall detected by CheckMoveOk. More...
 
csString inBounds
 Perception names to use for in bounds detected by CheckMoveOk. More...
 
float interrupted_angle
 
csVector3 interrupted_position
 
iSector * interrupted_sector
 
csString name
 
csString outOfBounds
 Perception names to use for out of bounds detected by CheckMoveOk. More...
 
Behaviorparent
 
State state
 
float vel
 Shared linear velocity, used by all that moves. More...
 
VelSource velSource
 Source used for velocity. More...
 

Additional Inherited Members

- Public Types inherited from ScriptOperation
enum  OperationResult { OPERATION_NOT_COMPLETED, OPERATION_COMPLETED, OPERATION_FAILED }
 
enum  State { READY_TO_RUN, RUNNING, INTERRUPTED, COMPLETED }
 
enum  VelSource { VEL_DEFAULT, VEL_USER, VEL_WALK, VEL_RUN }
 
- Protected Member Functions inherited from ScriptOperation
int StartMoveTo (NPC *npc, const csVector3 &dest, iSector *sector, float vel, const char *action, float &angle)
 This function is used by MoveTo AND Navigate operations. More...
 
void TurnTo (NPC *npc, const csVector3 &dest, iSector *destsect, csVector3 &forward, float &angle)
 
- Static Protected Member Functions inherited from ScriptOperation
static void StopMovement (NPC *npc)
 Utility function used by many operation to stop movement of an NPC. More...
 

Detailed Description

Locate is a very powerful function which will find the nearest object of the named tag, within a range.

Definition at line 961 of file npcoperations.h.

Constructor & Destructor Documentation

LocateOperation::LocateOperation ( )
LocateOperation::LocateOperation ( const LocateOperation other)
virtual LocateOperation::~LocateOperation ( )
inlinevirtual

Definition at line 982 of file npcoperations.h.

Member Function Documentation

Waypoint* LocateOperation::CalculateWaypoint ( NPC npc,
csVector3  located_pos,
iSector *  located_sector,
float  located_range 
)

Use -1 for located_range if range scheck sould be skipped.

virtual bool LocateOperation::Load ( iDocumentNode *  node)
virtual

Reimplemented from ScriptOperation.

virtual ScriptOperation* LocateOperation::MakeCopy ( )
virtual

Implements ScriptOperation.

virtual OperationResult LocateOperation::Run ( NPC npc,
bool  interrupted 
)
virtual

Implements ScriptOperation.

Member Data Documentation

csString LocateOperation::destination
protected

Alternate destination instead of "Active" locate.

Definition at line 976 of file npcoperations.h.

bool LocateOperation::locateInvincible
protected

Locate invincible targets.

Definition at line 975 of file npcoperations.h.

bool LocateOperation::locateInvisible
protected

Locate invisible targets.

Definition at line 974 of file npcoperations.h.

csString LocateOperation::locateOutsideRegion
protected

Locate targets outside a region if a region exist. Default false.

Definition at line 973 of file npcoperations.h.

csString LocateOperation::object
protected

Definition at line 969 of file npcoperations.h.

bool LocateOperation::random
protected

Definition at line 972 of file npcoperations.h.

float LocateOperation::range
protected

Definition at line 970 of file npcoperations.h.

bool LocateOperation::static_loc
protected

Definition at line 971 of file npcoperations.h.

bool LocateOperation::staticLocated
protected

Definition at line 965 of file npcoperations.h.

NPC::Locate LocateOperation::storedStaticLocated
protected

Definition at line 966 of file npcoperations.h.


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