The Attack Manager component is the component that manages the attack behavior for attack entities.
When you’re creating a new map using the RTS Engine menu editor, this component is attached to an object called “AttackManager”.
- Range Types: This array allows you to define different attack range types for units only. Range types basically define the stopping distances when a unit moves towards a target unit/building to attack it, among other things:
- Code: Each range type must have a unique code. A unit with an attack component is assigned to a range type by entering this code in the general settings of its attack component.
- Unit/Building Stopping Distance: When moving towards a target unit/building, this field is the stopping distance for that movement.
- Move On Attack Offset: When a unit is allowed to move and attack at the same time, the value inputted in this field will be added to the attack range of the unit.
- Update Mvt Distance: If the distance between the attack target and the attack target’s initial position when the target was locked gets higher than this value then the unit will adjust its position and move towards the target’s new position.
- Movement Formation: Each range type can have its own movement formation when moving towards an attack target. The movement formation defines how units will pick their target positions when calculating the movement path. For more information about movement formations, check out the Movement Manager component.
- Enable Terrain Attack: Attack entities are able to launch attacks without having to specify a target (check the Require Target field of the Attack component) only if this field is enabled! If the faction entity launches an Attack Object for example as part of its attack, the player will have to specify the target position either by clicking on the “Attack Task” that appears on the task panel when the faction entity is selected and then with a left-mouse-click on the terrain.
- Terrain Attack Key: If terrain attack is enabled (above field), a key can be specified in this field to allow the player to make a terrain attack by pressing this key and right-mouse-clicking on the terrain.