Allow to attack only "ancients"

Level 12
Joined
May 22, 2015
Messages
1,051
What have you tried so far? Try it with just "ancient" and nothing else.
 
Level 5
Joined
Jul 2, 2013
Messages
141
Haven't tried it, but I can tell you another method that will work for sure. Make a trigger and when a target is attacked, if it equals to unit type X(Ancient) or any other ancients, order the attacking unit to stop.
 
Level 7
Joined
Nov 19, 2015
Messages
283
Haven't tried it, but I can tell you another method that will work for sure. Make a trigger and when a target is attacked, if it equals to unit type X(Ancient) or any other ancients, order the attacking unit to stop.

I'm not a fan of those triggers because the units wills still try to attack the unit. Sometimes you get funny things happen. Usually better to not allow that unit to attack it in the first place.
 
Level 8
Joined
Jan 28, 2016
Messages
486
Hi ZiGoR, I think I know what you're problem is here.

I did some messing around with the editor and after a fair bit of testing, I got it to work. Well, sort of. The game engine seems to work funny when it comes to units with both attacks enabled. If Attack 1 is valid against the target (Eg: "Targets Allowed" = Ground, Organic, Etc.), then it will use that attack. Otherwise it will check if Attack 2 is valid (Eg: "Targets Allowed" = Air) and use that if possible. If both attacks cannot target the unit then obviously it won't. :at:

Also, this apparently happens to units that acquire the "Orb of X" type items/abilities (I remember reading about it somewhere here on The Hive IIRC) though I didn't test it out in the map below because I got lazy!! :ag: That and you're post was about targeting Ancients and stuff, so I didn't want to get off-topic like this post of mine.

So before I start rambling on, try the map and let me know what you think.
 

Attachments

  • Ancient Slayers.w3x
    21.8 KB · Views: 23
Top