• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Units ordered Attack-Move try to attack unreachable buildings

Status
Not open for further replies.
Level 25
Joined
Feb 2, 2006
Messages
1,669
Hi,
I am working on small defense map in which the hostile Computer-controlled units Attack-Move the location of a gate to destroy it.
However, the units are trying to attack towers on the walls which they cannot reach until they destroy the gate, so they stop at the wall not getting up there.
I thought that Warcraft's path finding is smart enough that they don't stop but continue moving to the gate.
I also order them periodically since when the first gate is destroyed, the location changes to the next gate.
However, they still stop at certain parts of the wall and try to reach units on the wall which they can't reach!
How can I achieve that they ignore buildings/units on the wall if they are not reachable?
What's the standard solution for other defense maps where the units Attack-Move the target?
The units should attack other land units on their way which they can reach.
 

~El

Level 17
Joined
Jun 13, 2016
Messages
551
Does your gate unit have an attack?

A unit will prefer to attack a "threatening" target over "non-threatening" targets. A unit which does not attack typically does not get a lot of aggro, unless there are really no other units around. A common technique I've seen used is to give "blocking" units a small attack of 1-1, so that they aggro units which get close.
 
Level 25
Joined
Feb 2, 2006
Messages
1,669
Well, I gave the gate an attack now but they are still trying to attack units on the wall (see screenshot). It is not only for the buildings but also for regular units like archers.

Another problem is that they sometimes walk back to their training barracks when they cannot reach a point. I guess I can disable this behavior with:

  • Ignore AI Guard Position
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • AI - Ignore (Trained unit)'s guard position
and

  • Ignore All Guard Positions
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • AI - Ignore the guard positions of all (Picked player) units
or does it have something to do with fleeing or the creep guard range. Note that the player is not Neutral Hostile or Passive but a regular Computer-controlled player.
 

Attachments

  • WC3ScrnShot_122518_022012_01.png
    WC3ScrnShot_122518_022012_01.png
    3.5 MB · Views: 54
Status
Not open for further replies.
Top