[Trigger] Even Issue no Action

Status
Not open for further replies.
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
 
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.
 
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

Status
Not open for further replies.
Back
Top