mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +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:
@@ -5,20 +5,19 @@
|
||||
void WblRobotCitizen::OnStartup(Entity* self) {
|
||||
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
// movementAIComponent->Resume();
|
||||
}
|
||||
|
||||
void WblRobotCitizen::OnUse(Entity* self, Entity* user) {
|
||||
// auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
// if (!movementAIComponent) movementAIComponent->Pause();
|
||||
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
if (movementAIComponent) movementAIComponent->Pause();
|
||||
auto face = NiQuaternion::LookAt(self->GetPosition(), user->GetPosition());
|
||||
self->SetRotation(face);
|
||||
auto timer = RenderComponent::PlayAnimation(self, "wave");
|
||||
auto timer = RenderComponent::PlayAnimation(self, "wave", 0.4f);
|
||||
self->AddTimer("animation time", timer);
|
||||
}
|
||||
|
||||
void WblRobotCitizen::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
// movementAIComponent->Resume();
|
||||
movementAIComponent->Resume();
|
||||
}
|
||||
|
Reference in New Issue
Block a user