• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Speed Check

Status
Not open for further replies.
Level 2
Joined
Oct 11, 2008
Messages
11
Well i really can't find a trigger that will help me check if a unit is moving or not... I need some help cuz i'm searching it for hours and still cant find it... if you haven't understand what i want i will explain again...

I want a trigger that checks if a unit has stoped and its not moving.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Yeah
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set ImHere = (Position of MyUnit)
      • Wait 0.10 seconds
      • Set StillThere = (Position of MyUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between ImHere and StillThere) Greater than 0.00
        • Then - Actions
          • Floating Text - Create floating text that reads I'm moving at StillThere with Z offset blah blah...
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 0.26 seconds
        • Else - Actions
          • Floating Text - Create floating text that reads I've stopped at StillThere with Z offset blah blah..
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 0.26 seconds
      • Custom script: call RemoveLocation(udg_ImHere)
      • Custom script: call RemoveLocation(udg_StillThere)
There you go. Those floating texts are just for testing purposes, you can remove them.
 
Last edited:
Level 8
Joined
Mar 12, 2008
Messages
437
  • Stop
    • Events
      • Your Events
    • Conditions
      • (Current order of (YourUnit)) Equal to (Order(stop))
    • Actions
      • Your Actions
just put in your actions/events.

That is not going to work since there is a very numerous amount of order strings that guarantee that the unit is not moving, such as War Stomp, Hold Position, Avatar, etc.

Secondly, (not sure on this one) I don't think that stop has got any order string.
 
To define whether a unit is stopped, the best choice is the Maker's. The other option -which is less flexible and depends on what you want- is the order comparison:
((Current order of (Your unit)) Equal to <Empty String> -> This is when a unit stopped.
To place the "empty string", when you are about to add the order, just delete the default "stop" and leave it blank, pressing Ok afterwards.
 
That is not going to work since there is a very numerous amount of order strings that guarantee that the unit is not moving, such as War Stomp, Hold Position, Avatar, etc.

Secondly, (not sure on this one) I don't think that stop has got any order string.

then you have to put in an Or condition, with hold position, stop....
 
Level 8
Joined
Nov 9, 2008
Messages
502
You could also put in a continuous loop something that saves the unit's coordinates and checks if they have differed after a second or so...
 
Status
Not open for further replies.
Top