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 > Silent Hunter 4: Wolves of the Pacific
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 10-05-20, 09:27 PM   #1
Capt Codetrucker
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default SH4 Stopped Saving "SaveData.map" Data For Stellarium

Hello,


The title tells it all. I have no idea why, but it is impossible to use the "SHtoStellarium" script to copy my SH4 time and position to Stellarium.

The below spoiler contains some extensive information which may help.

 


Capt Codetrucker (Bullhide009)Yesterday at 8:47 PM
Well, I'm not sure what happened, but the script stopped working. I am getting this error...

Traceback (most recent call last):
File "C:\Users\cjw\Desktop\SH4toStellarium.py", line 37, in <module>
longitude = float(content[longst+4:longnd])/120000
ValueError: could not convert string to float: 'ark]\nPointsNb=0\n\n[Ruler]\nPointsNb=0\n\n[Range]\nPointsNb=0\n\n[Angle]\nPointsNb=0\n\n[Waypoint]\nPointsNb=0\n\n[KGSelector]\nPointsNb=0'

This happened when I performed a fresh install of SH3 and SH4.

Does this look familiar? Any ideas?
Capt Codetrucker (Bullhide009)Yesterday at 9:45 PM
FMI - Am I supposed to post technical requests here or on the Subsim forum?
October 5, 2020
Capt Codetrucker (Bullhide009)Today at 7:10 AM


SUCCESS! I have overcome the fails, but only by going back to the raw script in the doc. I never was able to ferret out the culprit code, but since my present customized script works I am going to enjoy it for awhile. Thanks for all the help.
Capt Codetrucker (Bullhide009)Today at 7:31 PM


FAILURE! After getting a number of successful SH4 to Stellarium exports, I am now having the same error as the 3rd post above this one. The error Traceback is the same, "ValueError: could not convert string to float:" I have determined the error comes from the fact SH4 is not producing a good "SaveData.map" file, but I have no idea why?
Any ideas?

UPDATE: Verified the failure is due to SH4 producing an erroneous SaveData.map file. There is no data in the sections of the file, so the script is attempting to read in only the structure of the file and not the data which should be there. For some reason I have been able to get SH4 to produce the needed data and then it fails. No rhyme or reason yet.





Thank you in advance for the assistance.
  Reply With Quote
Old 10-06-20, 06:48 AM   #2
propbeanie
CTD - it's not just a job
 
propbeanie's Avatar
 
Join Date: May 2016
Location: One hour from Music City USA!
Posts: 9,749
Downloads: 439
Uploads: 2


Default

With some of the older SH tools, you had to have the utility in the Save folder for it to properly find and gather the needed data. I'm sure a custom script could point the app to the proper location, but is it using your script still?
__________________

"...and bollocks to the naysayer/s" - Jimbuna
propbeanie is offline   Reply With Quote
Old 10-06-20, 12:11 PM   #3
Pisces
Silent Hunter
 
Join Date: Dec 2004
Location: AN9771
Posts: 4,892
Downloads: 300
Uploads: 0
Default

For debugging purpose I would add statements (or let the debugger show the contents of variables) that show what "content[longst+4:longnd]" or just longst and longnd contain. Something in this expression does not allow it to become a float. I'm too unfamiliar with Python to know what that could be, just familiar enough in general with such languages that it always helps to check the intermediate conversion steps.
__________________
My site downloads: https://ricojansen.nl/downloads
Pisces is offline   Reply With Quote
Old 10-07-20, 12:42 AM   #4
Capt Codetrucker
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

@propbeanie - My laptop crashed several hours ago, so I am having to start from scratch. I was using the script and it produced as file, but since the correct numerical data was not produced the script threw errors because the data it did read was alphanumeric which the script could not digest.

@Pisces - That is a good idea. Thanks.




The problem is not the script. It works well if I feed it valid data manually. The culprit is SH4 itself. The SaveData.map files is not being populated. The framework is there, but no data, like my position is saved.



I will report back.
  Reply With Quote
Old 10-07-20, 09:17 AM   #5
propbeanie
CTD - it's not just a job
 
propbeanie's Avatar
 
Join Date: May 2016
Location: One hour from Music City USA!
Posts: 9,749
Downloads: 439
Uploads: 2


Default

I have a SaveData.map in some of my "more involved" saves, and this is all it has:
[Mark]
PointsNb=0

[Ruler]
PointsNb=0

[Range]
PointsNb=0

[Angle]
PointsNb=0

[Waypoint]
PointsNb=2
Pt0=14383529.11,1699511.52,-2.97
Pt1=13184944.00,1465757.00,0.00

[KGSelector]
PointsNb=0
Near as I can tell, there is no "CurrentLocation", or whatever the game would call it. It does record the Waypoint locations, beginning the numbering at "zero". I'm not certain if that is long, lat, heading, or what for the Waypoints. Now, some of the Saves I have that do not have Waypoints or marks, etc., the SaveData.map is not present. I wonder if the py script has error catching for if the file does not exist yet? Also, since SH4 saves a lot of its data in txt files, the numerical characters would be string. Python does have a type-cast, doesn't it? Such that you can do a "string-to-float"?
__________________

"...and bollocks to the naysayer/s" - Jimbuna
propbeanie is offline   Reply With Quote
Old 10-07-20, 11:04 AM   #6
Pisces
Silent Hunter
 
Join Date: Dec 2004
Location: AN9771
Posts: 4,892
Downloads: 300
Uploads: 0
Default

In that case, place a waypoint and save. Pt0 should be the location of the sub at time of the save.
__________________
My site downloads: https://ricojansen.nl/downloads
Pisces 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 05:10 PM.


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