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 12-12-10, 08:19 PM   #1
don1reed
Ace of the Deep
 
Join Date: Dec 2004
Location: Valhalla: Silent Generation
Posts: 1,149
Downloads: 910
Uploads: 0
Default

Howdy, TorpX.

When you open Python, does it ask your for the date and time of your game?
__________________
[SIGPIC][/SIGPIC]
During times of universal deceit, telling the truth becomes a revolutionary act.

~ George Orwell
don1reed is offline   Reply With Quote
Old 12-12-10, 09:10 PM   #2
TorpX
Silent Hunter
 
Join Date: Sep 2010
Posts: 3,975
Downloads: 153
Uploads: 11
Default

Quote:
Originally Posted by don1reed View Post
Howdy, TorpX.

When you open Python, does it ask your for the date and time of your game?
Yes, I click on the SH4toStellarium.py shortcut, it opens a window, I enter the date and time, them it closes. I think the problem must have something to do with configuring Stellarium.

Could someone who is using the 10.6.1 version of Stellarium post a copy of their startup.ssc file so I can see exactly what it is supposed to look like?

Last edited by TorpX; 12-12-10 at 10:09 PM.
TorpX is offline   Reply With Quote
Old 12-12-10, 09:19 PM   #3
don1reed
Ace of the Deep
 
Join Date: Dec 2004
Location: Valhalla: Silent Generation
Posts: 1,149
Downloads: 910
Uploads: 0
Default

I see.

Well, what should happen when you enter the date, then time, it should open stellarium automatically.

It's late here and I'm heading to bed for now. I'll be back in the a.m. and let you know what's tickin'

Don't dispair.

Later.
__________________
[SIGPIC][/SIGPIC]
During times of universal deceit, telling the truth becomes a revolutionary act.

~ George Orwell
don1reed is offline   Reply With Quote
Old 12-13-10, 10:15 AM   #4
don1reed
Ace of the Deep
 
Join Date: Dec 2004
Location: Valhalla: Silent Generation
Posts: 1,149
Downloads: 910
Uploads: 0
Default

G'Day TorpX

Lets try to fix this:

1) I use Python 2.6 and my dir looks like:
DLLs
Doc
include
Lib
libs
Scrips
tcl
Tools

2) The SH4toStellarium10-ssc script should be located in:
Python26\Tools\Scripts\ subdir. If not, put it there.

3) My SH4toStellarium10-ssc script looks like this:

# Change the directory on the next line to point to SaveData.map in your saved game directory.
savedgame = "C:\\Users\\Gamer\\My Documents\\SH4\\data\\cfg\\SaveGames\\00000006\\Sa veData.map"
# Set the Stellarium directory
stellocation = "C:\\Stellarium"

####### End Editable locations #########

# read savegame.
f=open(savedgame,'r')
content= f.read()
f.close()
# find lat & Lon in the file
start = content.find("Waypoint")
longst = content.find("Pt0=",start)
longnd = content.find(",",longst)
latnd = content.find(",",longnd+1)
# convert to dec deg
longitude = float(content[longst+4:longnd])/120000
latitude = float(content[longnd+1:latnd])/120000

# get date&time (input)
date = raw_input('GMT yyyy/mm/dd :')
time = raw_input('GMT hh:mm :')

# set the ocean label
if (-90 < longitude <= 30):
ocean = "Atlantic Ocean"
elif (30 < longitude <= 105):
ocean = "Indian Ocean"
elif (longitude <= -90 or longitude > 105):
ocean = "Pacific Ocean"

# Write startup script.
date = date.replace('/', ':')
longitude = str(longitude)
latitude = str(latitude)

stella=open(stellocation + "\\scripts\\sh4.ssc",'w')
stella.write("core.setDate(\""+date+"T"+time+":00\ ")\n")
stella.write("core.setObserverLocation("+longitude +", "+latitude+", 2, 0, \"SH4 Navigation Point, "+ ocean +"\", \"earth\")");
stella.close()

# now open stellarium and take your star sights
prog = "start /d \""+ stellocation +"\" stellarium.exe --startup-script sh4.ssc"
os.system(prog)
sys.exit()


4) The last paragraph in the script above tells Python to open up Stellarium.

5) Stellarium opens with whatever default info you have in the program. I use Stellarium 0.10.5. I then move my cursor to the lower left side of the screen and a pop-out menu appears. I select the "wrench and star" icon, which is the config window.

6) The Config Window opens and I select the "Scripts" icon located at the top of the focus window.

7) This opens a new focus window where I select the "sh4,ssc" script. Press the right pointing arrow at the bottom of the window.

8) It opens to the proper date and time of my game, showing all visible celestial bodies for the Lat/Long of my boat's position. Select your choice of objects (three stars for a good fix). Allow ~60° between bodies.


If you are diligent and pay close attention to detail, take a close gander at the SH4toStellarium10-ssc script. Very near the top of the script it shows that the Stellarium program is in the C:\ directory.
It says:
stellocation="C:\\Stellarium"

Make sure it's that way in your cpu too.

Let us know how it goes.

Cheers,
__________________
[SIGPIC][/SIGPIC]
During times of universal deceit, telling the truth becomes a revolutionary act.

~ George Orwell

Last edited by don1reed; 12-13-10 at 10:36 AM.
don1reed is offline   Reply With Quote
Old 12-13-10, 12:16 PM   #5
don1reed
Ace of the Deep
 
Join Date: Dec 2004
Location: Valhalla: Silent Generation
Posts: 1,149
Downloads: 910
Uploads: 0
Default

One small caveat, TorpX. I always do a "Save" then "Continue" with SH4 or SH3, (I use this system for both games), just to update my boat's true position whenever I prepare to take a sight.
__________________
[SIGPIC][/SIGPIC]
During times of universal deceit, telling the truth becomes a revolutionary act.

~ George Orwell
don1reed is offline   Reply With Quote
Old 12-14-10, 08:12 AM   #6
TorpX
Silent Hunter
 
Join Date: Sep 2010
Posts: 3,975
Downloads: 153
Uploads: 11
Trying to get this to work

I have edited the SH4toStellarium.py script to conform to what you posted. There were substantial changes.

I still can't get it to work.

There maybe multiple problems here. I tried to go by the instructions in the tutorial posted earlier in the thread, but have no idea about the Python "Windows extensions". Also, I am using Windows Vista, and the latest version of Stellarium. There maybe issues here.

Now, when I run the edited script, a window flashes on the screen and immediately closes. There is no input of date or time, Stellarium does not start, and no ssc file in Stellarium is written.
TorpX is offline   Reply With Quote
Old 12-14-10, 10:38 AM   #7
don1reed
Ace of the Deep
 
Join Date: Dec 2004
Location: Valhalla: Silent Generation
Posts: 1,149
Downloads: 910
Uploads: 0
Default

Hi, TorpX.

You understand, of course, that the script I posted in Post#142 is how it appears on my cpu. We need to see how it appears in your cpu.

When you get a chance, copy your script file and paste it here so we can take a look.

Cheers,
__________________
[SIGPIC][/SIGPIC]
During times of universal deceit, telling the truth becomes a revolutionary act.

~ George Orwell
don1reed is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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:59 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.