• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

A unit Is issued an order targeting an object

Level 9
Joined
Aug 26, 2016
Messages
204
Why this don't work???
 

Attachments

  • изображение_2025-09-01_195557135.png
    изображение_2025-09-01_195557135.png
    151.3 KB · Views: 42
Either the Order is not called "attack" or the (Ordered unit) is not a Vulcan Turret. It's safe to assume it's the Order since that's the easier of the two to mess up.

There's different Orders depending on how you activate the Attack ability, so you should check for one or the other:
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
      • (Issued order) Equal to (Order(attack))
      • (Issued order) Equal to (Order(smart))
Using the mouse will issue a "smart" Order. This applies to Move as well.

Remember that you can Display an (Issued order) in a Text Message to figure out what the game calls it.

 
Last edited:
  • TurretAtc
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(attack))
          • (Issued order) Equal to (Order(smart))
      • (Unit-type of (Ordered unit)) Equal to Vulcan Turret2
      • (Unit-type of (Triggering unit)) Equal to Vulcan Turret2
    • Actions
      • Unit - Order (Ordered unit) to Stop.
      • Unit - Order (Triggering unit) to Stop.
      • Unit - Kill (Ordered unit)
      • Unit - Kill (Triggering unit)
Turret is an NPC and it attacks itself and I can't track its attack order, I tried different things, even this...
 
Try it like this:
  • TurretAtc
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Vulcan Turret
        • Then - Actions
          • Game - Display to (All players) the text: 123123
        • Else - Actions
edit: of course this will only trigger when the attack lands, whereas with "unit is issued an order" it would trigger when the attack starts.
 
It seems to work, THANKS FOR THAT).
Try it like this:
  • TurretAtc
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Vulcan Turret
        • Then - Actions
          • Game - Display to (All players) the text: 123123
        • Else - Actions
edit: of course this will only trigger when the attack lands, whereas with "unit is issued an order" it would trigger when the attack starts.
 
There is also following event which detects when unit starts auto attacking some other unit, but it is an event for specific units only.
  • Unit - specific_unit Acquires a target
Still, if you don't have too many towers, this could be a viable solution as well.
For generic cases it is possible to add this event via other trigger using the "Trigger - Add new event" action, but you would probably need to periodically destroy the trigger those events were added to and rebuild it.
 
edit: of course this will only trigger when the attack lands, whereas with "unit is issued an order" it would trigger when the attack starts.
Actually, "A unit is attacked" occurs when the attack starts, not when it lands. It's the exact moment that a unit prepares to attack, like a step right before they've begun playing their attack animation.

Damage Events are the only reliable way to know that an attack actually landed. But often times you don't need that level of precision.

Also, issuing an Order in response to another Order often doesn't work. You can try something like this to fix it:
  • TurretAtc
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Vulcan Turret2
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(attack))
          • (Issued order) Equal to (Order(smart))
    • Actions
      • Unit - Pause (Triggering unit)
      • Unit - Order (Triggering unit) to Stop.
      • Unit - Unpause(Triggering unit)
This may have unforeseen consequences but it'll interrupt the issued order. You can also use the BlzPauseUnitEx() function which is likely ideal.

But this might not be the solution here, I just figured it was worth noting. I still don't understand what Nikita wants since he never fully explained... As far as I can remember a unit cannot autoattack itself. It can be Ordered to attack itself, though... maybe? In which case you can rely on Orders.
 
Last edited:
Actually, "A unit is attacked" occurs when the attack starts, not when it lands. It's the exact moment that a unit prepares to attack, before they've even begun playing their attack animation.

Damage Events are the only reliable way to know that an attack actually finished. But often times you don't need that level of precision.
Oh, cool, didn't know that.
 
Back
Top