• 🏆 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!

[General] Enemy attack priority change when/while you attack your own units

Status
Not open for further replies.
Level 12
Joined
Nov 3, 2013
Messages
989
I noticed that units attacking their own units lose priority, enemy units who had the attacking unit as their acquired target change target (even if they're standing right next to each other and other targets are farther away).

This became painfully obvious when I were testing a bit in single player and the enemy units begun attacking any nearby buildings (buildings with no attack and priority 1) as soon as I wanted to remove (kill) one of my buildings.

I made a new test map with a row of farms and two units, a ranged unit owned by myself on one side and an enemy footman on the other.

As soon as I ordered my rifleman to attack one of the farms the footman would attack the nearest farm, even if he were standing next to the rifleman.

Note that I had revealed the entire map to make sure that it didn't have to do with losing vision of the rifleman.

I tried to 'fix' it by making the attacking unit damage enemy units through trigger each time it's attacking but it didn't help.

  • Aggro
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacking unit)) Not equal to Player 11 (Dark Green)
      • (Owner of (Attacking unit)) Not equal to Player 12 (Brown)
      • (Triggering player) Not equal to Player 11 (Dark Green)
      • (Triggering player) Not equal to Player 12 (Brown)
    • Actions
      • Game - Display to (All players) the text: (Name of (Triggering player))
      • Game - Display to (All players) the text: (Name of (Attacking unit))
      • Game - Display to (All players) the text: (Name of (Triggering unit))
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Attacking unit) to damage (Picked unit), dealing 1.00 damage of attack type Spells and damage type Normal
          • Game - Display to (All players) the text: ((Name of (Owner of (Picked unit))) + ( + (Name of (Picked unit))))
In multiplayer it might not be that important since there would be more builder units and it's unlikely that they all would be attacking their own buildings/units at the same time (unless they know about this and do it intentionally).
Still it could be used as a way to make the enemy AI focus the other players, after all you don't have to complete the attack, spamming attack and interrupting the order to guarantee that you're the last person to be attacked would basically be cheating...

update: Now I've also tried adding multishot to also attack enemies when you're attacking your own units, they still changed targets as soon as I attacked one of my buildings regardless.
 
Last edited:
Level 12
Joined
May 9, 2009
Messages
735
This looks interesting, I tested it out myself and I think it is not as much to do with units switching targeting to the attacked unit as much as it is them simply losing priority of it and switching to 'better' targets nearby. Maybe good to save your hero in sticky situations.
 
Level 12
Joined
Nov 3, 2013
Messages
989
This looks interesting, I tested it out myself and I think it is not as much to do with units switching targeting to the attacked unit as much as it is them simply losing priority of it and switching to 'better' targets nearby.

Which is precisely what I said already, I never implied that they would target the same unit that you attack, but rather first best.
the enemy units begun attacking any nearby buildings

If it's not clear what I'm asking is if someone know how I'd make it so that even when my 20 priority unit attacks an allied unit enemy units won't give it lower priority than units with low priority and no attacks.

As long as you leave openings for the enemy computer units to reach your unit then they're not supposed to destroy buildings...
 
Status
Not open for further replies.
Top