Hi guys, I need a really precise way to detect movement direction. I want to have a marine that is moving, and I want it to be able to "jump", so I need to know which direction it is moving at the instant the player jumps so the marine can jump in that direction. I was thinking maybe inverted location centering or something? I'll do EUDS as last resort. Any help appreciated!
None.
How precise?
I have an 8-way jump in my map using only mobile grids, it essentially places a grid like such:
-X-
XMX
-X-
where M is your marine and X is a location, then it detects which location the unit moves into. (For diagonals, it checks to see if the unit is in 2 of the locations, then executes that action before it checks each of the 4 solo locations).
if you need more than an 8-way jump you could use a mobile grid like so:
XYXYX
YXXXY
XXMXX
YXXXY
XYXYX
where you would center a special size location on each "Y" in addition to the 4 locations above in order to detect those extra directions. If you need more precision than this, I think you'll need to use Azrael's suggestion of EUDs. I don't know how "precise" you needed so I figure I'd suggest this anyway.
None.
You can use
skewed locations, but using EUDs will be your easiest and safest method.
None.
How precise?
I have an 8-way jump in my map using only mobile grids, it essentially places a grid like such:
-X-
XMX
-X-
where M is your marine and X is a location, then it detects which location the unit moves into. (For diagonals, it checks to see if the unit is in 2 of the locations, then executes that action before it checks each of the 4 solo locations).
if you need more than an 8-way jump you could use a mobile grid like so:
XYXYX
YXXXY
XXMXX
YXXXY
XYXYX
where you would center a special size location on each "Y" in addition to the 4 locations above in order to detect those extra directions. If you need more precision than this, I think you'll need to use Azrael's suggestion of EUDs. I don't know how "precise" you needed so I figure I'd suggest this anyway.
Hmm. This seems like it might be a viable option. Would you mind uploading your map that has this?
None.
Let me show you how to hump without making love.
Using EUDs to detect not only the direction a unit is facing, but also if it is moving or not, makes this cake.
None.
Yeah but as I will need a mobile grid for the player to actually jump, I might as well use the same grid to detect direction.
None.