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 09-09-12, 02:15 AM   #1
dottore
Seaman
 
Join Date: Mar 2010
Location: Hungary
Posts: 32
Downloads: 138
Uploads: 0
Default 1. phase is done, but this is not the correct way...

Thank you CaliEs!

This will be very useful to refine the Stellarium options. Please note CaliEs' modifications one below to make the navigation more difficult.
-
Stellarium will show your ingame sky always as you execute, correct dates(read below).
Script is working, but read the information below. The script carries the navdata(your location, time) from mission files into the Stellarium's startup file automatically without user input.
You need to run the batch file, when you would like to see your sky in Stellarium.

If you feel lost, don't hesitate to contact me.

Download:
http://www.mediafire.com/?9swhqak15l9a502
Alt.download:
http://www.sendspace.com/file/i22sa1 (Click on below "Click here to start download from...")

Warning:
This is not the final scipt, because it needs user friendly modifications and using needless methods to get the navdata.

-

I don't know the game programming architecture so I need to study Ironpython to make navigational data pick the correct way from the game itself instead of using mission files and avoid text manipulation. So there will be an other script and this will be trashed.

The script is using brute string manipulations to make the job so I apologize.

It prints values, but don't need them. Their purpose is testing the success of data mine. It doesn't change any file in your install or in your user folder only grabbing data to the 2 txt files it creates.(date.txt, my.active.uboat.data.txt) If you want Backup your mission file, but the script only reads it.

Requirements:
Important install information:
You need to write your file paths, directory paths into the script before running it(don't use "find and replace" because script using \\ to describe paths). I marked the needed modifications. You need to do this only once except your mission file. If you go to a new patrol, you need to change it to point the new file.(This will be fixed later, to auto find your paths). If you make a new profile in the game, you have new folder, new mission file, so you must show the script the new file.

Needed applications:
Python 2.7 default paths in script: C:\Python27
Stellarium 0.11.4 or above (older Stellarium uses other language, so "no go!") default paths in script: C:\Program Files\Stellarium

Default path for .mis file:
C:\Users\This.is.your.name\Documents\SH5\data\User s\This.is.your.in.game.name\Campaign-This.is.your.date\CampaignMission.mis

Important changes in Stellarium config.ini:

Default path: C:\Users\This.is.your.name\AppData\Roaming\Stellar ium
Backup your config.ini.

Use your resolution from ingame in Stellarium, change the values:
[localization]
...
...
time_zone = GMT
.
Note: this is a req, without this your Stellarium will apply your GMT shift and mess up date.

[video]
...
...
screen_h = (Example: 1080)
screen_w = (Example: 1920)
.

You need the script and the python.exe in one folder, you run the whole with a batch file.

This is not difficult but not user-friendly. If you aligned everything you need only change your .mis file location occasionally.

I really much appreciate if you try this script and beta test for me. If this works to you I can step forward.

Last edited by dottore; 09-09-12 at 11:25 AM. Reason: corrections: links
dottore is offline   Reply With Quote
Old 09-09-12, 08:07 AM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

If not user-friendly then many people will not try/use it. That's just the way it is

I have no need for your idea as I have a working real navigation in my UIs mod (thus no need to test it). I do feel you are overcomplicating things. I would suggest you learn the game's architecture (what functions the scriptmanager exposes and how to use them) first. It will make things so much easier for you/everyone else

You'll also probably get a much better response/feedback if this was originally posted in the SH5 Mods forum.
TheDarkWraith is offline   Reply With Quote
Old 09-09-12, 08:14 AM   #3
dottore
Seaman
 
Join Date: Mar 2010
Location: Hungary
Posts: 32
Downloads: 138
Uploads: 0
Default

Yes, I know but invested too much time in it to trash out the whole thing. That's why I posted. I need time to learn game architecture.

Next time, I will post in the SH5 mods topic.
dottore is offline   Reply With Quote
Old 09-09-12, 08:26 AM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by dottore View Post
Yes, I know but invested too much time in it to trash out the whole thing. That's why I posted. I need time to learn game architecture.

Next time, I will post in the SH5 mods topic.
You can always ask a moderator to move your thread to another forum. Contact CCIP or Webster
TheDarkWraith is offline   Reply With Quote
Old 09-09-12, 08:30 AM   #5
dottore
Seaman
 
Join Date: Mar 2010
Location: Hungary
Posts: 32
Downloads: 138
Uploads: 0
Default

Thank you! I felt we misunderstood each other. I really like your Real Navigation, just hard to calculate position in game, the way it meant.

Mod: I started IronPython to make the new script .

First experience: Moon is a problem in game so I can see 1 hour shift of the Moon from GMT.

Last edited by dottore; 09-09-12 at 11:45 AM.
dottore is offline   Reply With Quote
Old 09-09-12, 07:13 PM   #6
CaliEs
Loader
 
Join Date: Oct 2011
Posts: 89
Downloads: 27
Uploads: 0
Default

Quote:
Originally Posted by dottore View Post
Error:
Code:
Traceback(most recent call last):
File "sacn.0.09.beta.py", line 13, in (module) MakeFile("my.active.uboat.data.txt')

File "sacn.0.09.beta.py", line 9, in (module) file = open(temp_path, 'w')

IOError: [Errno 2] No such file or directory 'C:\\Python27\\my.active.uboat.data.txt'
__________________
Dietrich von Carlewitz, 2nd Lt.
U-29
CaliEs is offline   Reply With Quote
Old 09-09-12, 07:48 PM   #7
dottore
Seaman
 
Join Date: Mar 2010
Location: Hungary
Posts: 32
Downloads: 138
Uploads: 0
Default

It works for me, PM sent.

Almost done with the newer script, that using the ingame scripts, so you don't need this.

Mod:
http://www.subsim.com/radioroom/show...&postcount=260

Last edited by dottore; 09-09-12 at 08:47 PM.
dottore is offline   Reply With Quote
Old 09-10-12, 06:55 AM   #8
CaliEs
Loader
 
Join Date: Oct 2011
Posts: 89
Downloads: 27
Uploads: 0
Default

Quote:
Originally Posted by dottore View Post
It works for me, PM sent.
def MakeFile(file_name):
"""
MakeFile(file_name): makes a file.
""" temp_path = 'C:\\Python27\\' + file_name
file = open(temp_path, 'w')
file.write('')
file.close()
print 'Execution completed.'
MakeFile('my.active.uboat.data.txt')



I dont understnd python but it seems that the command "MakeFile (file_name)" wasnot
doing anything.
That "makes a file" thingy looks weird for me. Is this a comment or something?
Installed python v2.7.2.
__________________
Dietrich von Carlewitz, 2nd Lt.
U-29
CaliEs is offline   Reply With Quote
Old 09-10-12, 07:38 AM   #9
dottore
Seaman
 
Join Date: Mar 2010
Location: Hungary
Posts: 32
Downloads: 138
Uploads: 0
Default

Yes it is a comment.

I think I found the problem. But in my file there is everything okay.

You need to hit the Enter at temp_path.
So:

"""
temp_path.............

Like there is in my progress code below.

Maybe when you edited the file you hit the backspace or something.

Mod: I didn't make troubleshooting, but maybe if you use other viewer than notepad that can confuse the indents. Python is a heavy indent dependent language. If you save it in an another format, maybe there could be a problem.

Important: I am ready with the new simpler script, but I'm waiting a help guide to run it correctly from game.

Last edited by dottore; 09-10-12 at 07:54 AM.
dottore is offline   Reply With Quote
Old 09-10-12, 09:26 AM   #10
CaliEs
Loader
 
Join Date: Oct 2011
Posts: 89
Downloads: 27
Uploads: 0
Default

Quote:
Originally Posted by dottore View Post

You need to hit the Enter at temp_path.
The program was terminated with an error message. There is no Wait-for-input for me.
What is the purpose of """ ?
__________________
Dietrich von Carlewitz, 2nd Lt.
U-29
CaliEs is offline   Reply With Quote
Old 09-10-12, 11:06 AM   #11
dottore
Seaman
 
Join Date: Mar 2010
Location: Hungary
Posts: 32
Downloads: 138
Uploads: 0
Default

You don't need to input anything after you run the *.bat file. If you made the changes that I marked in the script, the script will run without problem. If you don't make the changes, the script won't find the files.

""" is a comment sign for more lines than one for information to other users or remind for the programmer. The interpreter will leave alone these lines. They don't need to running the script. Example:

"""
Sea sells seashells on
the seashore.
"""

I marked the change requirements in the archived script, that you need to make before run.
This is your Campaignmission file's path, you need to use \\ instead of \ to separate folders. And your Stellarium's path also.

If you'd like I give you my msn and we solve this in 2 mins. If somebody had a problem too don't hesitate contact me and I fix for you in no time.

Mod: I sent PM with my MSN.

Last edited by dottore; 09-10-12 at 11:26 AM.
dottore is offline   Reply With Quote
Reply

Tags
bad weather, celestial navigation, position, script, stellarium


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 03:58 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.