diff --git a/Engine/source/T3D/AI/AIController.h b/Engine/source/T3D/AI/AIController.h index 8d780c362..db13b6ee4 100644 --- a/Engine/source/T3D/AI/AIController.h +++ b/Engine/source/T3D/AI/AIController.h @@ -126,7 +126,7 @@ class AIControllerData : public SimDataBlock { public: - AIControllerData() {}; + AIControllerData() { mMoveTolerance = 0.25; mFollowTolerance = 1.0; mAttackRadius = 2.0; mMoveStuckTolerance = 0.01f; mMoveStuckTestDelay = 30;}; ~AIControllerData() {}; static void initPersistFields(); diff --git a/Engine/source/T3D/AI/AINavigation.cpp b/Engine/source/T3D/AI/AINavigation.cpp index 18efeb3da..ed0fce56f 100644 --- a/Engine/source/T3D/AI/AINavigation.cpp +++ b/Engine/source/T3D/AI/AINavigation.cpp @@ -257,3 +257,19 @@ void AINavigation::clearPath() // Reset path data. mPathData = PathData(); } + +DefineEngineMethod(AIController, setMoveDestination, void, (Point3F goal, bool slowDown), (true), + "@brief Tells the AI to move to the location provided\n\n" + + "@param goal Coordinates in world space representing location to move to.\n" + "@param slowDown A boolean value. If set to true, the bot will slow down " + "when it gets within 5-meters of its move destination. If false, the bot " + "will stop abruptly when it reaches the move destination. By default, this is true.\n\n" + + "@note Upon reaching a move destination, the bot will clear its move destination and " + "calls to getMoveDestination will return \"0 0 0\"." + + "@see getMoveDestination()\n") +{ + object->getNav()->setMoveDestination(goal, slowDown); +} diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index cd32ea024..4552e5618 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -2287,6 +2287,7 @@ bool Player::getAIMove(Move* move) if (mAIController) { mAIController->getAIMove(move); //actual result + return true; } return false;