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.
[2020-10-19. : 7:29 am]
C(a)HeK -- sraw531
sraw531 shouted: GGmano just fyi, might be a good idea in the future to link to the thread in the shoutbox when you reference a new thread
here it is - http://www.staredit.net/topic/18132/unread/#special
[2020-10-19. : 7:19 am]
sraw531 -- GGmano
GGmano shouted: i made a topic about it if anyone knows something about this please check the topic
just fyi, might be a good idea in the future to link to the thread in the shoutbox when you reference a new thread
[2020-10-19. : 4:46 am]
C(a)HeK -- SiberianTiger
SiberianTiger shouted: C(a)HeK yes correct it is a multiplayer map
Unfortunately, I don't have free time for multiplayer
[2020-10-18. : 10:06 pm]
SiberianTiger -- C(a)HeK
C(a)HeK shouted: GGmano I answered you as best I could
yes correct it is a multiplayer map
[2020-10-18. : 9:12 pm]
GGmano -- thanks c(a)hek
[2020-10-18. : 9:05 pm]
lil-Inferno -- mad AF
[2020-10-18. : 8:57 pm]
*KrayZee angrily uses a pen and fills in the circle for Joe Biden*
[2020-10-18. : 4:59 pm]
C(a)HeK -- GGmano
GGmano shouted: i made a topic about it if anyone knows something about this please check the topic
I answered you as best I could
[2020-10-18. : 2:01 pm]
GGmano -- i made a topic about it if anyone knows something about this please check the topic
[2020-10-18. : 2:00 pm]
GGmano -- hi all does anyone knows what difference save files does??
Please log in to shout.


Members Online: Roy, jun3hong