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

Order Unit to stop via trigger does not stop them?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
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.
 
Level 25
Joined
Aug 13, 2011
Messages
739
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)
 
Level 12
Joined
May 20, 2009
Messages
822
Well, it's an old system. Probably horribly out-dated. But it doesn't keep the orders. Just try the first trigger I posted alone, without anything else in the map, or anything else in that trigger. It won't actually order the unit to stop.

(Or hell, maybe my Editor/WC3 is just horribly bugged...)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
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.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
Well when I used it the stop order was always issued before the main order which was why it never worked and fits the problem the topic creator describes perfectly.

I do admit I might have run it as an action and not a condition however (if that makes a difference).
 
Status
Not open for further replies.
Top