SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [Question] BdU Position Tracker (https://www.subsim.com/radioroom/showthread.php?t=186896)

aergistal 08-19-11 02:56 PM

[Question] BdU Position Tracker
 
Is it possible to send the sub's current position (in m) from Python to a webservice, when the send report or a custom button is pressed (along with an identifier, of course).

I was interested in making the server side coding for a widget that will allow to track our positions in the campaign.

TheDarkWraith 08-19-11 02:59 PM

Quote:

Originally Posted by aergistal (Post 1731691)
Is it possible to send the sub's current position (in m) from Python to a webservice, when the send report or a custom button is pressed (along with an identifier, of course).

I was interested in making the server side coding for a widget that will allow to track our positions in the campaign.

Sure can. One problem though: if you look at the map the game uses, the center of it is 0,0. Anything to the left is -, anything to the right is +. Anyhting above it is +, anything below it is -. Thus all coordinates are specified from game 0,0 (meters from game origin)

I could add some code to my UIs mod that would have it spit out the sub's position every x amount of time to a file. Then you could read that file.

aergistal 08-19-11 03:13 PM

Quote:

Originally Posted by TheDarkWraith (Post 1731694)
Sure can. One problem though: if you look at the map the game uses, the center of it is 0,0. Anything to the left is -, anything to the right is +. Anyhting above it is +, anything below it is -. Thus all coordinates are specified from game 0,0 (meters from game origin)

I could add some code to my UIs mod that would have it spit out the sub's position every x amount of time to a file. Then you could read that file.

The origin should be at the intersection of the ecuator with the prime meridian, if it works like in SH4. That positive and negative values are just the surface of the problem, since everything needs to be reprojected from SHs weird system to the one Google Maps uses. But I got that covered from SH4, where a real-time tracker didn't look possible.

Maybe the position could be uploaded along with a report generated from your journal tool, and when you click the sub on the map you would have an option to read it.

Do you think it would be interesting?

TheDarkWraith 08-19-11 03:16 PM

Quote:

Originally Posted by aergistal (Post 1731718)
The origin should be at the intersection of the ecuator with the prime meridian, if it works like in SH4. That positive and negative values are just the surface of the problem, since everything needs to be reprojected from SH5 weird system to the one Google Maps uses. But I got that covered from SH4, where a real-time tracker didn't look possible.

Maybe the position could be uploaded along with a report generated from your journal tool, and when you click the sub on the map you would have an option to read it.

Do you think it would be interesting?

You can verify the origin by opening the mission editor and seeing if that really is 0,0.

I already have functions defined for converting the meters from game origin to lat and long coordinates (then it's a simple matter of rearranging the digits to Google Earth specs).

Not following you on the position could be uploaded along with a report thing :hmmm:

aergistal 08-19-11 03:21 PM

Quote:

Originally Posted by TheDarkWraith (Post 1731723)
You can verify the origin by opening the mission editor and seeing if that really is 0,0.

I already have functions defined for converting the meters from game origin to lat and long coordinates (then it's a simple matter of rearranging the digits to Google Earth specs).

Be careful that it might cause errors. At first I used to do the conversion the easy way, but I noticed distortions when plotting the map doodles directly without reprojection (eg: circles will appear as ellipses)

Quote:

Originally Posted by TheDarkWraith (Post 1731723)
Not following you on the position could be uploaded along with a report thing :hmmm:

Click the COMSUBPAC Online link in my sig. That was what I was trying to do for SH4. But instead of a simple status it should display on demand the ship's journal.

TheDarkWraith 08-19-11 03:48 PM

Quote:

Originally Posted by aergistal (Post 1731728)
Be careful that it might cause errors. At first I used to do the conversion the easy way, but I noticed distortions when plotting the map doodles directly without reprojection (eg: circles will appear as ellipses)


Click the COMSUBPAC Online link in my sig. That was what I was trying to do for SH4. But instead of a simple status it should display on demand the ship's journal.

True, true. SH5 doesn't use a true projection map


All times are GMT -5. The time now is 10:34 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.