Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Detecting unit direction
[SOLVED] Detecting unit direction
This topic is locked. You can no longer write replies here.
Jul 18 2012, 2:27 am
By: Leeroy_Jenkins  

Jul 18 2012, 2:27 am Leeroy_Jenkins Post #1



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.

Jul 18 2012, 2:29 am Azrael Post #2



This might help.

http://www.staredit.net/topic/10362/

http://www.staredit.net/topic/14408/




Jul 18 2012, 8:14 am Vrael Post #3



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.

Jul 18 2012, 1:13 pm Sacrieur Post #4

Still Napping

You can use skewed locations, but using EUDs will be your easiest and safest method.



None.

Jul 19 2012, 6:44 am Leeroy_Jenkins Post #5



Quote from Vrael
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.

Jul 19 2012, 8:36 am LoveLess Post #6

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.

Jul 20 2012, 12:05 am Leeroy_Jenkins Post #7



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.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[03:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: Roy, Ultraviolet, RIVE