PDA

View Full Version : [Question] BdU Position Tracker


aergistal
08-19-11, 02:56 PM
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
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
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
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
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)


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
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