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?
< >
1-6 / 6 のコメントを表示
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 2019年5月29日 16時10分 
Heading = CompassReading * -360 % 360
Tajin 2019年5月30日 2時38分 
のヮの の投稿を引用:
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
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
最近の変更はAmbishooterが行いました; 2020年6月27日 11時54分
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.
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.
< >
1-6 / 6 のコメントを表示
ページ毎: 1530 50

投稿日: 2018年10月1日 15時42分
投稿数: 6