you could try the condition "Unit Ability Command State" with the 'Command' set to the Move ability and the 'State' set to Executing.
There's a data work-around where the units have an invis buff with the 'Not Moving' validator in the "Behavior: Validators (Disable)+". then set the invis buff to have a fast period that applies a second invis buff with a very short duration. Then you can set up your trigger conditions to check whether the unit has the second invis buff or not. The unit should have the buff so long as it is moving and losses the buff when it stops.
Alternatively, you could just use one behavior and use the trigger event 'Unit Behavior Changes' with change type, 'Deactivate' to detect when your "Move Detection Behavior" fires.
You can accomplish this with only triggers, if you like. You will need:
A boolean variable which is TRUE while the unit is moving and FALSE while the unit is still.
A point variable to be used in determining whether the unit is moving
A looping function which periodically checks the distance between the unit and its previous point. If > 0, the unit has moved since the last check; therefore, set the boolean to TRUE, else set it to FALSE.
Yeah that's why I prefer a point comparison. It's more literal than the somewhat arbitrary unit movespeed value. It will also detect triggered or forced movement.
I think the point Mille was trying to make is that bacas solution won't work whatsoever. A zealot has always movement speed (current) = 2.25, even when standing still.
I need to make a few triggers that involve the condition if a unit is moving or not moving.
I was looking through the conditions and i cant seem to find one that does this. I dont know if i'm blind or if there is a trick to it.
you could try the condition "Unit Ability Command State" with the 'Command' set to the Move ability and the 'State' set to Executing.
There's a data work-around where the units have an invis buff with the 'Not Moving' validator in the "Behavior: Validators (Disable)+". then set the invis buff to have a fast period that applies a second invis buff with a very short duration. Then you can set up your trigger conditions to check whether the unit has the second invis buff or not. The unit should have the buff so long as it is moving and losses the buff when it stops.
@baca25: Go
Alternatively, you could just use one behavior and use the trigger event 'Unit Behavior Changes' with change type, 'Deactivate' to detect when your "Move Detection Behavior" fires.
@PirateArcade | I make games | Ask me things on Discord
You can accomplish this with only triggers, if you like. You will need:
@BasharTeg: Go
use a real condition that compares reals. there should be current movespeed of unit
Thanks guys. What worked for me was under conditions: I used Unit Property. Current Movement Speed of unit > 0
A unit can stand still and at the same time have a movement speed > 0.
Uh....
condition - units current order = move action - stuffs
condition - unit is idle action - stuffs
@Mille25: Go
Yeah that's why I prefer a point comparison. It's more literal than the somewhat arbitrary unit movespeed value. It will also detect triggered or forced movement.
@BasharTeg: Go
I think the point Mille was trying to make is that bacas solution won't work whatsoever. A zealot has always movement speed (current) = 2.25, even when standing still.
@Elmaex: Go
i don't have the editor open but there is a condition that shows the current movement speed, not the default or maximum.
Movement speed is just a unit stat, it has nothing to do with the unit moving or not.
The ability command state check doesnt work either. Id advice using the data validator solution.
It may not work normally, but the method i came up with works great for the way I'm using it. Where i make a unit stop by setting its speed to 0.