Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Fleeing on low HP or Motivation #24

@Leo-Dev-2004

Description

@Leo-Dev-2004

We need to add a flee functionality for the worker ally that on health less than 20.

  • They should either follow the player if not nearby the CORE or run towards the CORE where they can heal.
  • During that fleeing phase they need to **try to avoid enemies but stay near the CORE. ** so like a NavigationAgent obstacle with higher radius to avoid.
  • During fleeing the ally does not react to GOTO commands.
  • If no entity is detected and they are in the group "AttackingCore", they should walk SLOWLY towards the CORE. So you need a variable storing whether or not the enemy is currently walking towards the CORE or an entity to influence the walking speed.

Additionally we need the features:

  • Make the motivation increase by 1 every 10 seconds in the inner CORE circle until it reaches 5. Make the number 5 an export variable such that you can change it. The rest may only be increased by the commanders inputs.
  • Add a scene "MotivationNeeded" that has a collisionShape and an export variable for the radius of the shape and if an entity of the group entities collides with it (is in the radius) it is checked if their motivation is 0. If yes, they flee to the core like on low HP.
  • Also there are 2 other export boolean variables that control who flees on low motivation. (worker ally and combat ally). These variables should in the script also only affect the entities of the right type.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions