View Single Post
Old 12-13-10, 10:15 AM   #142
don1reed
Ace of the Deep
 
don1reed's Avatar
 
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,
__________________

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