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.
[10:41 am]
ManCubuS -- Seems like something's broken regarding the site then. Sadge...
[07:36 am]
Oh_Man -- have i ever told u guys my SC2 pro-gamer story
[2026-7-26. : 11:30 pm]
Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
[2026-7-26. : 3:34 pm]
ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
[2026-7-26. : 3:28 pm]
ManCubuS -- Even tried with imgur, doesn't attach.
[2026-7-26. : 3:14 pm]
ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
[2026-7-26. : 3:05 pm]
NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
[2026-7-26. : 11:15 am]
ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
[2026-7-23. : 6:40 am]
Oh_Man -- true
[2026-7-23. : 3:16 am]
RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
Please log in to shout.


Members Online: Symmetry