• 🏆 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] Even Issue no Action

Status
Not open for further replies.
Level 25
Joined
Sep 26, 2009
Messages
2,378
I am not sure if there is any way to reliably detect that. When unit is not doing anything, it literally has no order (empty string). However when unit moves in to auto attack (due to enemy unit being close) it also has no order.
So you have no order for two states (attacking and idle). I have no idea how to differentiate those two states
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
You can catch idle units using the "stand down" order.

Have a periodic event that loops through units, checking if their current order is equal to "stand down".

  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Picked unit)) Equal to (Order(stand down))
            • Then - Actions
              • Unit - Order (Picked unit) to Attack-Move To (Center of (Playable map area))
            • Else - Actions
(I know it leaks)
 
The order has to be one word: 'standdown' but testing this on my own I can't get them to move either.

I check for idle units in my map in a different way though, not sure if this will help in your case. If you have a trigger that specifically tells the unit to cast an ability it will become idle afterwards, so what you can do is detect the unit casting the ability and add it to a unit group (it will probably work too if you have a 'unit is attacked' event). Then you have a periodic trigger that pick the units in that unit group, orders them to move and then clear all units from that unit group.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
I don't think it has to be one word. I have a working trigger in my map using "stand down". Unless it works for some other reason that I'm overlooking...

Edit:
Yep, just tested it again, it 100% works.
  • Untitled Trigger 001
    • Events
      • Time - Every 4.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Picked unit)) Equal to (Order(stand down))
            • Then - Actions
              • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by (200.00, 0.00))
            • Else - Actions
 

Attachments

  • Idle Units.w3m
    16.6 KB · Views: 8
Status
Not open for further replies.
Top