HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Motion Detection?

12-25-2006, 09:18 AM#1
ixmike88
Is there any way to check if a unit is moving, when it starts and when it stops?
12-25-2006, 10:14 AM#2
Fireeye
Did you even try to use 'search'?
This thread should answer your question.
12-25-2006, 09:50 PM#3
rulerofiron99
(sorry about this mess of trigger script, i am unable to open WE atm for some reason..)

Trigger:
Events:
Every 0.01 seconds //(or higher if its a very slow unit)
Conditions:
None
Actions:
Set tempPoint[1] - Position of (my unit)

If /then /else
Collapse If
real - distance between tempPoint[0] and tempPoint[1] is greater than 2.000 //(or whatever)
Collapse Then
set IsMoving = true
Collapse Else
set IsMoving = false
custom script: call RemoveLocation(udg_tempPoint[0])
custom script: call RemoveLocation(udg_tempPoint[1])
Set tempPoint[0] - Position of (my unit)

That should do the trick.

btw all ye wc3c vets, dont be too harsh on non-searchers