Stormworks: Build and Rescue

Stormworks: Build and Rescue

360 Degree Bearing from Compass Sensor
Anyone have a simple function i can use you convert the -.5 to .5 range from a compass sensor to 0 to 360 range for compass bearings?
< >
Showing 1-6 of 6 comments
Edward Snowcone Oct 1, 2018 @ 4:10pm 
nevermind, i figured it out :p

For anyone interested (yes i know its pretty bad):

((((x/-1)--.5)*(360))/(.5--.5))+0

slap this in a function, making x=compass sensor output. make sure that the blue arrow on the sensor faces north when the ship is spawned in!
dupa May 29, 2019 @ 4:10pm 
Heading = CompassReading * -360 % 360
Tajin May 30, 2019 @ 2:38am 
Originally posted by のヮの:
https://steamcommunity.com/sharedfiles/filedetails/?id=1446181826&searchtext=bearing
Check this logic out, maybe it has some functions.
It does.

But it is probably easier to look at this example if you only care about the compass logic:
https://steamcommunity.com/sharedfiles/filedetails/?id=1416319354
Ambishooter Jun 27, 2020 @ 11:53am 
Thank you so much for finding it out :)
((x/-1)+0.5)*360
I modified it so that when you place down the compass facing to the rear of you vehicle 0° Is north
I didn't really modify it xD I just took out the unnessecary parts
Last edited by Ambishooter; Jun 27, 2020 @ 11:54am
jseifert1978 Oct 14, 2020 @ 9:40am 
I found
(.5-x)*360
worked...

Just make sure you have the heading sensor pointing north... if the base arrow is pointing east and you place it following the arrow, 0 will represent east.

If you are in the new career, it won't tell you which way you are pointing, by the map icons. So, you'll have to get your bearings visually, if you don't know which way the base is pointing. Hopefully, they will fix this problem, at some point.
GrumpyOldMan Oct 14, 2020 @ 9:49am 
Originally posted by jseifert1978:
I found
(.5-x)*360
worked...

Just make sure you have the heading sensor pointing north... if the base arrow is pointing east and you place it following the arrow, 0 will represent east.

There's no heading when placing a compass sensor, this will be always relative to the vehicle and further to the workbench you're spawning it in.

Placing the compass facing the same way the direction arrow in the workbench does should work, using your formula.
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Oct 1, 2018 @ 3:42pm
Posts: 6