mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
feat: Add MovingAI pathing for NPCs without combatAI (#1509)
* remove goto * Update MovementAIComponent.cpp * convert to PathWaypoint Easier for usage with paths * add path parsing * ref removal, simplification of work * it works * Update MovementAIComponent.cpp * disable pathing for combat we just need it for npcs for now, combat ai can be done later * fixed stuttery enemies wow * start at ramped up speed * add pausing and resuming * Update MovementAIComponent.cpp * Update MovementAIComponent.h * Update CMakeLists.txt
This commit is contained in:
@@ -731,15 +731,21 @@ void Entity::Initialize() {
|
||||
// if we have a moving platform path, then we need a moving platform component
|
||||
if (path->pathType == PathType::MovingPlatform) {
|
||||
AddComponent<MovingPlatformComponent>(pathName);
|
||||
// else if we are a movement path
|
||||
} /*else if (path->pathType == PathType::Movement) {
|
||||
auto movementAIcomp = GetComponent<MovementAIComponent>();
|
||||
if (movementAIcomp){
|
||||
// TODO: set path in existing movementAIComp
|
||||
} else if (path->pathType == PathType::Movement) {
|
||||
auto movementAIcomponent = GetComponent<MovementAIComponent>();
|
||||
if (movementAIcomponent && combatAiId == 0) {
|
||||
movementAIcomponent->SetPath(pathName);
|
||||
} else {
|
||||
// TODO: create movementAIcomp and set path
|
||||
MovementAIInfo moveInfo = MovementAIInfo();
|
||||
moveInfo.movementType = "";
|
||||
moveInfo.wanderChance = 0;
|
||||
moveInfo.wanderRadius = 16;
|
||||
moveInfo.wanderSpeed = 2.5f;
|
||||
moveInfo.wanderDelayMax = 5;
|
||||
moveInfo.wanderDelayMin = 2;
|
||||
AddComponent<MovementAIComponent>(moveInfo);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
} else {
|
||||
// else we still need to setup moving platform if it has a moving platform comp but no path
|
||||
int32_t movingPlatformComponentId = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::MOVING_PLATFORM, -1);
|
||||
|
Reference in New Issue
Block a user