| 03-23-2006, 02:47 AM | #1 |
How can I detect when a unit moves? |
| 03-23-2006, 02:54 AM | #2 |
the most bullet proof way I know is a periodic timer and detecting the difference in distance between the last position and the current one. Of course if it is just a channeling spell you can use the 'Stops casting an ability' event |
| 03-23-2006, 02:58 AM | #3 |
Set PointA = current loc If x and y of PointA = x and y of PointB, then unit is not moving Set PointB = PointA That logic sets the current location of the unit, compares it to the previous location and then updates the previous location to the current location so the next time the script runs the "current" location is the true previous location. I think you'll need to store reals if you use this method and not the actual points. I'm sure there's a better way but I know this will work. |
| 03-23-2006, 02:59 AM | #4 |
| 03-23-2006, 04:37 AM | #5 | |
Quote:
EDIT:oops, found it, sorry. BUT is there a way to detect if a unit is casting a chaneling spell using conditions? |
| 03-23-2006, 09:36 AM | #6 |
Try the oder comparison - current order of unit. |
| 03-23-2006, 11:33 AM | #7 |
well the problem is that sometiemes unit move and they don't have any order |
| 03-23-2006, 11:39 AM | #8 |
Well, but if they're channeling a spell, wouldn't their order still be that of the spell? |
| 03-23-2006, 01:14 PM | #9 |
Yes, it would. |
