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

Auto-attack ORDER ID?

Status
Not open for further replies.
Level 8
Joined
Mar 26, 2009
Messages
301
I have a trigger which stops a certain unit from attacking other units under certain conditions. The main condition is:
  • (Issued order) Equal to (Order(attack))
which prevents attacks most of time. But the problem is; it does not cover the sitiuations where units auto-engage the nearby enemy units on their own. Is there a way to refer to "auto-attack" with an order id? If not, how do suggest that I proceed ?
Btw, as you can know, the event here is:
  • Unit - A unit Is issued an order targeting an object
You may suggest that I replace it with "Unit is attacked" but let me tell you that I've tried that and it is not a solution for me =)
If you ask "why?" answer is: my units has a really low attack animation points (0.100 - 0.150) and although "Unit is Attacked" trigger can prevent the attack, it does not prevent the attack animaton =) Addig "Animation - Reset Unit Animation" action is not a solution too, because couple of other triggers with same event will launch their actions anyway =)
If I can't solve this via order id thing, I will have to combine all "unit is attacked" triggers via if/then/else. (which I prefer not to because it will drop a bomb on my current orgazinational paradigm =))
 
Level 8
Joined
Mar 26, 2009
Messages
301
Well, "Unit is Ordered to Attack" stuff does not cover each attack made by "attacker". It only refers to (first) time when user manually right clicks on a enemy unit.
You can disable unit's attack with a custom spell based on the Silence if that helps.
Yes, I am already using that to disable attack (action trigger) =)

BTW: Unit is a turret, has similar animation to cannon towers of wc3. If I make this all with "Unit is attacked" and with the addition of reset animation thing. Turret will not actually attack or show full attack animation. But the barrel part of the model will spin around like crazy =D Like it is about to shoot something then saying "uhhh nevermind" =)) That's why I need to detect the time before attack starts.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Is there not an event which runs when a unit aquires a target? You just need to issue an interupt order so it loses the target and you should be done.

Be warned that target aquisition is very demanding in WC3 so doing this will lead to poor preformance with lots of units near valid targets to aquire.
 
Status
Not open for further replies.
Top