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 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 04-10-08, 04:26 PM   #1
don1reed
Ace of the Deep
 
Join Date: Dec 2004
Location: Valhalla: Silent Generation
Posts: 1,149
Downloads: 910
Uploads: 0
Default

Here's a copy of how I've got my version of Python setup to work with SH3. If anyone's interested, you'll have to change the directory to suit your system.

You'll note after ...\\career\\...I've inserted my name, but this is where you'll insert your skipper's name.

Also, after... \\0\\...I've inserted my save-gave name = "100" plus add the file extension *.map. Whatever you call your saved game, this is where to put it in the Python script.

You'll have to use the same name for each patrol or change this script to reflect whatever new name you decide to use.

Oh, and btw, I've named my script: SH3random.py and made a shortcut out of it for the desktop so I can easily click on to it while SH3 is running.

You can copy mine, make the necessary changes using Notepad or similar writing tool and whatever you name it don't forget to place the extension *.py at the end. Once you get your copy of Python you'll see where to place this script.

Cheers,


Quote:
#Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
#Type "copyright", "credits" or "license()" for more information.
#************************************************* ***************
#Personal firewall software may warn about the connection IDLE
#makes to its subprocess using this computer's internal loopback
#interface. This connection is not visible on any external
#interface and no data is sent to or received from the Internet.
#************************************************* ***************

#IDLE 1.2.2
#>>> #By Michael Jones, 01/01/2008.
#This program reads the latitude and longitude data for a
#sub in Silent Hunter IV and creates a startup script for
#Stellarium. This sets the Date, Time and Location of the
#sub in Stellarium, allowing players to use celestial navigation in the game.
#
#Modified by Castorp345 to include randomization, 03/24/2008.
import string
import random
random.seed()
#read savegame. Change the directory on the next line to point to SaveData.map in your saved game directory.
#NB you must have plotted waypoints in-game for this to work!
f=open("C:\\Documents and Settings\\Donald Reed\\My Documents\\SH3\\data\\cfg\\careers\\Don Reed\\0\\100.map",'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, wind speed, & boat speed (input)
date = raw_input('yyyy/mm/dd :')
time = raw_input('hh:mm :')
wind = float(raw_input('wind :'))
speed = float(raw_input('speed :'))
#perform randomization operations on location coordinates
wind1 = random.uniform(0,((wind + 1) * .0083125))
wind2 = random.uniform(0,((wind + 1) * .0083125))
speed1 = random.uniform(0,((speed + 1) * .0083125))
speed2 = random.uniform(0,((speed + 1) * .0083125))
longitude = longitude + wind1 - wind2 + speed1 - speed2
latitude = latitude + wind1 - wind2 + speed1 - speed2
#Write startup script. Change the next line to suit for your Stellarium startup script.
stella=open("C:\\Program Files\\Stellarium\\scripts\\startup.sts",'w')
stella.write("date utc "+date+"T"+time+":00\n")
stella.write("moveto lon "+str(longitude)+"\n")
stella.write("moveto lat "+str(latitude)+"\n")
stella.write("script action end\n")
stella.close()
#now open stellarium and take your star sights
__________________
[SIGPIC][/SIGPIC]
During times of universal deceit, telling the truth becomes a revolutionary act.

~ George Orwell

Last edited by don1reed; 04-10-08 at 04:49 PM.
don1reed is offline   Reply With Quote
Old 04-10-08, 07:06 PM   #2
jmr
Commander
 
Join Date: Sep 2004
Posts: 462
Downloads: 62
Uploads: 0
Default

Seems like aaronblood's Mobo would be the perfect tool to supplant the traditional ruler/paper method for celestial navigation. Just grab a snapshot of the SH nav map, paste it into Mobo, set the scale accordingly and you're good to go.

At least I think it would work OK.
jmr is offline   Reply With Quote
Old 04-10-08, 07:14 PM   #3
6SJ7GT
A-ganger
 
Join Date: Mar 2008
Location: Wi. USA
Posts: 71
Downloads: 10
Uploads: 1
Default

Don & all,
I don't have SH3, but hear my method works in SH3 also.

Here is a tutorial on a simplified method of celnav for the game. Thanks to Don for his help on this.

SH4 simplified celnav tutorial

Mike
6SJ7GT is offline   Reply With Quote
Old 04-10-08, 07:22 PM   #4
don1reed
Ace of the Deep
 
Join Date: Dec 2004
Location: Valhalla: Silent Generation
Posts: 1,149
Downloads: 910
Uploads: 0
Default

lol, I must have just missed you on the SH4 forum, Mike.

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

~ George Orwell
don1reed is offline   Reply With Quote
Old 04-10-08, 10:13 PM   #5
jmr
Commander
 
Join Date: Sep 2004
Posts: 462
Downloads: 62
Uploads: 0
Default

So when you have your position, how do you mark your location on the SH3 navmap if it doesn't have Lon/Lat markers?
jmr is offline   Reply With Quote
Old 04-11-08, 03:23 AM   #6
Pisces
Silent Hunter
 
Join Date: Dec 2004
Location: AN9771
Posts: 4,904
Downloads: 304
Uploads: 0
Default

Quote:
Originally Posted by jmr
So when you have your position, how do you mark your location on the SH3 navmap if it doesn't have Lon/Lat markers?
It does. Look at the edge of the map-view carefuly, and pan the view.
Pisces is offline   Reply With Quote
Old 04-11-08, 01:04 PM   #7
jmr
Commander
 
Join Date: Sep 2004
Posts: 462
Downloads: 62
Uploads: 0
Default

I'm going nuts here. I'm running GWX 2.0 and I'm not seeing Lon/Lat numbers on my chart in the F5 view.
jmr is offline   Reply With Quote
Old 04-12-08, 10:42 AM   #8
Gairith
Planesman
 
Join Date: May 2005
Location: Below . . .
Posts: 186
Downloads: 4
Uploads: 0
Default

I don't know if this will have any bearing, but check this thread post 1 and 4

http://www.subsim.com/radioroom/showthread.php?t=134939
__________________
"You can either watch things happen, make things happen, or wonder what the heck happened." Capt. Phil Harris

GWX 2.1 - SH3 Commander 3.2 - OLC Ubermod 2.4.2
-
DiD
Gairith 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 06:05 PM.


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.