• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Order Unit to stop via trigger does not stop them?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
821
Very simple:

  • Untitled Trigger 002
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to Stop
This does not order the unit to stop. In the context, the point order is Move. If they're ordered to move, I want the unit to be immediately ordered to stop. That way, it's order is empty and it will acquire targets that come near it.

Removing the move ability will not work, because I still want the unit to be able to be ordered to move and hold position.
 
Order the unit to move to its current location. Turning the trigger off and then on after the actions prevents an infinite point order loop:
  • Events
    • Unit - A unit Is issued an order targeting a point
  • Conditions
  • Actions
    • Trigger - Turn off (This trigger)
    • Set TempPoint = (Position of (Triggering unit))
    • Unit - Order (Triggering unit) to Move To TempPoint
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Trigger - Turn on (This trigger)
 
The problem is because the event fires before the order is actually issued to the unit. This is a timeline of what goes on.

You order unit to move -> Unit issued order targeting point event fires -> Unit ordered to stop -> Unit Ordered to move

You need a 0 timeout timer to create a new thread after the "Unit Ordered to move" stage in response to the "Unit issued order targeting point event fires" stage.
 
Status
Not open for further replies.
Back
Top