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.
[03:20 am]
Symmetry -- Dang I'm up to 155 minerals gambling really pays off guys
[2026-10-11. : 6:02 am]
Donald -- Samase
[2026-10-09. : 2:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[2026-10-09. : 2:47 am]
Symmetry -- I'll check it out this weekend!
[2026-10-09. : 2:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[2026-10-09. : 2:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[2026-10-09. : 1:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[2026-10-09. : 1:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[2026-10-09. : 1:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
Please log in to shout.


Members Online: emilyroberts, City, Roy