Space Engineers

Space Engineers

Planetary compass + coordinates calculator
22 Comments
maklakovsb 22 Mar, 2020 @ 6:05am 
I checked two scripts in parallel - the author’s script and mine. Both scripts gave one result with a difference of one meter along the Z axis. The experiment was performed on March 21, 2020.
SpetS 7 Mar, 2019 @ 1:24am 
LCD display coordinates does not work in real time anymore
Fox paws#6758 29 Jan, 2018 @ 11:13am 
будет ли обновление?
Cardboard Overlord 29 Oct, 2017 @ 11:19am 
Thanks for realizing that Keen set the sun spinning in the wrong direction, and making this script point to Y- as north (the actual north in SE according to sun rotation. :)
CodyLabs 4 Sep, 2017 @ 9:12pm 
This is awesome! Thanks for this!
TokMor 23 Dec, 2016 @ 7:34pm 
One other thing I found, it looks like your longitude's axis is backwards from how earth's is defined relative to latitude. This will only affect you if you are trying to calculate the bearing you need to take in order to get from one lat/long coordinate to another (for example using the equation on this page http://www.movable-type.co.uk/scripts/latlong.html ). If you are, then multiply your longitude values by -1 as part of the formula and you'll be good to go.

This is a really awesome script, thank you for contributing it.
TokMor 22 Dec, 2016 @ 6:45pm 
I think on line 133 position 78 you spelled a variable wrong. Changing LaststPos to LastPos seems to boost accuracy dramatically. Please let me know if I've got this wrong though.
icecold951 9 Dec, 2016 @ 2:23pm 
It can't work on a static grid. It has to calibrate via movement in a straight line, then select option 2 and 3.
G43 mai waifu 8 Dec, 2016 @ 9:21pm 
seem don't work on a static grid.
icecold951 25 Jul, 2016 @ 5:22pm 
I've found a bug. It doesn't like having the programmable block named "Programable Block". The game keeps apending a number, upon loading of the game. Can this be fixed with a new block identifier?
Tallinu 6 Jan, 2016 @ 8:24am 
Thanks, I was a bit confused about what the Vector3D.Reject method was doing.

So it's figuring out which direction is the 'right' and using that to put the bearing in the proper quadrant when 'right' points into the north hemisphere...

It looks like the cross product of the forward and gravity vectors (in that order) gives a reliable 'right' too, with a little less testing. And I just stumbled across Atan2, which makes longitude easier...
Pennywise  [author] 6 Jan, 2016 @ 2:40am 
Left and down vectors are probably just checking your ship orientation. also, if you're flying "upside down", your coordinates must stay the same. Thats what i used up and left vectors for.
Tallinu 5 Jan, 2016 @ 10:55pm 
While comparing your code to some I was writing as a way of checking mine for mistakes, inaccuracies, and such, I noticed that my latitude calculation gives the same result with no dot product or "if > 0, negate" check, making it way shorter. If you're interested, the line I used is:

Math.Asin(GravNormal.GetDim(1));

where GravNormal is:

var GravNormal = Vector3D.Normalize(Remote.GetNaturalGravity());

I'm having a little trouble following the bearing calculations -- I'm not really sure what it's doing with the left/right/down vectors. I'll probably have to play around with debug output. Do you happen to know of any resources you could point me at that would describe how that's calculated, or did you just figure it all out on your own?
Pennywise  [author] 7 Dec, 2015 @ 10:52am 
i've made new loc-on func. As soon as I will debug it, i'll use it in AA AT rockets.
artiedee 3 Dec, 2015 @ 6:58am 
by the way pennywise looking forward to more releases from you, I kinda want to reapply ur script to a small fighter that can autlock ona ship in a dogfight, should be really interesting.
artiedee 3 Dec, 2015 @ 6:57am 
thanks guys!
Jab 2 Dec, 2015 @ 2:38pm 
Yeah using intersection is a good way. I used phi theta for orbiting mechanics.
Pennywise  [author] 2 Dec, 2015 @ 8:57am 
artiedee Я нахожу центр планеты по пересечению 2 векторов гравитации.
полюс -Y - это север
Y - юг
а дальше, по солнцу восток-запад.
artiedee 2 Dec, 2015 @ 3:04am 
Pennywise, spasibo za script!

Ti smog bi dat sovet etomy avtory?
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=562732034&tscn=1449036129

On toze hochet dobavit sistemy storon sveta, zapad, yug, sever. Ti smog bi skazat shto brat za tochky otsheta, shtobi vashi skripti vmeste rabotali?

Thanks.
Pennywise  [author] 25 Nov, 2015 @ 2:15pm 
До определенной точки показывает на полюс, но ее очень быстро проскакиваешь компас показывает на другое направление. В игре полюс - это не какое-то место, это очень мальнькая точка. Так что какой-то обширной магнитной аномалии на полюсах нет.
mibah 25 Nov, 2015 @ 1:17pm 
Мне вот интересно, а что будет показывать компас на полюсе планеты? Будет сходить с ума или что-нибудь другое.
Сам, к сожалению, проверить не могу, т.к на у меня планетах 5 фпс это уже много
Determined_Insurgent 20 Nov, 2015 @ 1:09pm 
Facinating work. I have been using many less reliable ways to determine direction. Thank you for taking the time to post this.