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

[Solved] Detectig order 'stop' and 'move'

Status
Not open for further replies.
Hey friends
I've just made an awsome discovery I'd like to share. I was once searching for how to detect if a unit is moving and I've even found a complex system on this site that tells you when (and wich) a unit is moving.

So I used this trigger:
  • Order test
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set sOrder[1] = (String((Current order of unit 0034 <gen>)))
      • Game - Display to (All players) the text: sOrder[1]
So when the current order of the unit was order(stop) then the string returned nothing, wich means 'stop' is actually '<Emty String>'.

When the unit was moving, it returned 'smart'. So order(move) is actually order(smart).

I really hope it help and you are welcome to give feedback :)
 
Level 25
Joined
Sep 26, 2009
Messages
2,373
Actually, no.
If you - the player or I think also via trigger - order unit to move somewhere, it will return its order as "move". If unit starts moving/attacking/running without any outside interaction (in other words, it moves by its AI), it will return "smart" order.

If you order unit to stop, it will stop.
Unit that does nothing has order (null) - or as you say, an empty string.
Stop order refers to when you order unit to stop => you tell it to stop its current order.
Unit which does nothing but stands still doesn't "stop", as that means it would do something (it would try to stop its current order) - hence why unit taht does nothing returns (null) order.
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
Its not the same.

"smart" is the order a unit gets when you "rightclick" somewhere. Depending on what you click (whats the target of the order) the unit will move there, attack the target or pick it up etc.

Order "move" however does exactly what it says, it makes the unit move to the target.

When a unit has no order "Get Current Order" function will return an empty string.
 
^They pretty much answered it. No.
I've even found a complex system on this site that tells you when (and wich) a unit is moving.
Which system is that?
When the unit was moving, it returned 'smart'. So order(move) is actually order(smart).
Have you tried that with everything?
 
Status
Not open for further replies.
Top