SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 08-19-11, 02:56 PM   #1
aergistal
Chief
 
Join Date: May 2010
Location: France
Posts: 326
Downloads: 23
Uploads: 1
Default [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.
aergistal is offline   Reply With Quote
Old 08-19-11, 02:59 PM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by aergistal View Post
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.
TheDarkWraith is offline   Reply With Quote
Old 08-19-11, 03:13 PM   #3
aergistal
Chief
 
Join Date: May 2010
Location: France
Posts: 326
Downloads: 23
Uploads: 1
Default

Quote:
Originally Posted by TheDarkWraith View Post
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?
aergistal is offline   Reply With Quote
Old 08-19-11, 03:16 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by aergistal View Post
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
TheDarkWraith is offline   Reply With Quote
Old 08-19-11, 03:21 PM   #5
aergistal
Chief
 
Join Date: May 2010
Location: France
Posts: 326
Downloads: 23
Uploads: 1
Default

Quote:
Originally Posted by TheDarkWraith View Post
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 View Post
Not following you on the position could be uploaded along with a report thing
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.
aergistal is offline   Reply With Quote
Old 08-19-11, 03:48 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by aergistal View Post
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
TheDarkWraith is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:19 AM.


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.