1 #ifndef GAME_MWMECHANICS_AIWANDER_H
2 #define GAME_MWMECHANICS_AIWANDER_H
8 #include "../mwworld/timestamp.hpp"
25 struct AiWanderStorage;
37 AiWander(
int distance,
int duration,
int timeOfDay,
const std::vector<unsigned char>& idle,
bool repeat);
void SetCurrentNodeToClosestAllowedNode(osg::Vec3f npcPos, AiWanderStorage &storage)
Definition: aiwander.cpp:896
Definition: aiwander.hpp:60
bool mRepeat
Definition: aiwander.hpp:103
virtual void fastForward(const MWWorld::Ptr &actor, AiState &state)
Simulates the passing of time.
Definition: aiwander.cpp:776
std::vector< unsigned char > mIdle
Definition: aiwander.hpp:102
void trimAllowedNodes(std::vector< ESM::Pathgrid::Point > &nodes, const PathFinder &pathfinder)
Definition: aiwander.cpp:682
Definition: aiwander.hpp:64
bool isPackageCompleted(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:318
void AddNonPathGridAllowedPoints(osg::Vec3f npcPos, const ESM::Pathgrid *pathGrid, int pointIndex, AiWanderStorage &storage)
Definition: aiwander.cpp:869
void playIdleDialogueRandomly(const MWWorld::Ptr &actor)
Definition: aiwander.cpp:547
osg::Vec3f mInitialActorPosition
Definition: aiwander.hpp:108
Definition: aiwander.hpp:66
bool checkIdle(const MWWorld::Ptr &actor, unsigned short idleSelect)
Definition: aiwander.cpp:733
void ToWorldCoordinates(ESM::Pathgrid::Point &point, const ESM::Cell *cell)
convert point from local (i.e. cell) to world coordinates
Definition: aiwander.cpp:677
Definition: pathfinding.hpp:33
Definition: aiwander.hpp:58
void init()
Definition: aiwander.cpp:122
void playGreetingIfPlayerGetsTooClose(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:577
This class holds the variables AiWander needs which are deleted if the package becomes inactive...
Definition: aiwander.cpp:54
Base class for AI packages.
Definition: aipackage.hpp:32
void onWalkingStatePerFrameActions(const MWWorld::Ptr &actor, float duration, AiWanderStorage &storage, ESM::Position &pos)
Definition: aiwander.cpp:473
short unsigned getRandomIdle()
Definition: aiwander.cpp:755
void getAllowedNodes(const MWWorld::Ptr &actor, const ESM::Cell *cell, AiWanderStorage &storage)
Definition: aiwander.cpp:808
bool mHasReturnPosition
Definition: aiwander.hpp:105
void stopWalking(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:713
void wanderNearStart(const MWWorld::Ptr &actor, AiWanderStorage &storage, int wanderDistance)
Definition: aiwander.cpp:355
int mDuration
Definition: aiwander.hpp:99
Definition: character.hpp:145
virtual bool execute(const MWWorld::Ptr &actor, CharacterController &characterController, AiState &state, float duration)
Definition: aiwander.cpp:190
Definition: aiwander.hpp:118
void returnToStartLocation(const MWWorld::Ptr &actor, AiWanderStorage &storage, ESM::Position &pos)
Definition: aiwander.cpp:333
void setReturnPosition(const osg::Vec3f &position)
Set the position to return to for a stationary (non-wandering) actor.
Definition: aiwander.cpp:746
Definition: aisequence.hpp:66
Definition: aiwander.hpp:119
void setPathToAnAllowedNode(const MWWorld::Ptr &actor, AiWanderStorage &storage, const ESM::Position &actorPos)
Definition: aiwander.cpp:646
bool reactionTimeActions(const MWWorld::Ptr &actor, AiWanderStorage &storage, const MWWorld::CellStore *¤tCell, bool cellChange, ESM::Position &pos, float duration)
Definition: aiwander.cpp:230
Definition: aiwander.hpp:67
void turnActorToFacePlayer(const osg::Vec3f &actorPosition, const osg::Vec3f &playerPosition, AiWanderStorage &storage)
Definition: aiwander.cpp:637
void completeManualWalking(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:407
Mutable state of a cell.
Definition: cellstore.hpp:53
int mDistance
Definition: aiwander.hpp:98
bool destinationIsAtWater(const MWWorld::Ptr &actor, const osg::Vec3f &destination)
Definition: aiwander.cpp:392
GroupIndex
Definition: aiwander.hpp:116
virtual AiPackage * clone() const
Clones the package.
Definition: aiwander.cpp:135
int mTimeOfDay
Definition: aiwander.hpp:101
bool mStoredInitialActorPosition
Definition: aiwander.hpp:109
void onIdleStatePerFrameActions(const MWWorld::Ptr &actor, float duration, AiWanderStorage &storage)
Definition: aiwander.cpp:439
void evadeObstacles(const MWWorld::Ptr &actor, AiWanderStorage &storage, float duration, ESM::Position &pos)
Definition: aiwander.cpp:517
float distance(const ESM::Pathgrid::Point &point, float x, float y, float z)
Definition: pathfinding.cpp:69
WanderState
Definition: aiwander.hpp:63
Definition: loadpgrd.hpp:16
Definition: loadcell.hpp:64
Definition: aiwander.hpp:65
void AddPointBetweenPathGridPoints(const ESM::Pathgrid::Point &start, const ESM::Pathgrid::Point &end, AiWanderStorage &storage)
Definition: aiwander.cpp:881
void onChooseActionStatePerFrameActions(const MWWorld::Ptr &actor, AiWanderStorage &storage)
Definition: aiwander.cpp:490
GreetingState
Definition: aiwander.hpp:57
Definition: aisequence.hpp:148
static const std::string sIdleSelectToGroupName[GroupIndex_MaxIdle-GroupIndex_MinIdle+1]
lookup table for converting idleSelect value to groupName
Definition: aiwander.hpp:132
osg::Vec3f mReturnPosition
Definition: aiwander.hpp:107
static int OffsetToPreventOvercrowding()
Definition: aiwander.cpp:803
virtual int getTypeId() const
Definition: aiwander.cpp:708
Definition: aiwander.hpp:59
Causes the Actor to wander within a specified range.
Definition: aiwander.hpp:28
bool getRepeat() const
Return true if this package should repeat. Currently only used for Wander packages.
Definition: aiwander.cpp:312
AiWander(int distance, int duration, int timeOfDay, const std::vector< unsigned char > &idle, bool repeat)
Constructor.
Definition: aiwander.cpp:114
void doPerFrameActionsForState(const MWWorld::Ptr &actor, float duration, AiWanderStorage &storage, ESM::Position &pos)
Definition: aiwander.cpp:413
bool destinationThroughGround(const osg::Vec3f &startPoint, const osg::Vec3f &destination)
Definition: aiwander.cpp:402
Definition: loadpgrd.hpp:30
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual void writeState(ESM::AiSequence::AiSequence &sequence) const
Definition: aiwander.cpp:914
bool playIdle(const MWWorld::Ptr &actor, unsigned short idleSelect)
Definition: aiwander.cpp:719
float mRemainingDuration
Definition: aiwander.hpp:100