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 03-01-10, 06:11 PM   #1
Sailor Steve
Eternal Patrol
 
Sailor Steve's Avatar
 
Join Date: Nov 2002
Location: High in the mountains of Utah
Posts: 50,369
Downloads: 745
Uploads: 249


Default

Quote:
Originally Posted by Drifter View Post
Why is this thread so dead? I mean, does no one here realize the potential for the ability to now script in SH5?!

This is BIG news. Wake up people!
The first post was made at 0342 hours, my time, which is central US. That would be 2242 in London, where people are going to bed.

Your post was made at 0755 my time, so people here were just getting up. The reason this thread was so dead was because everyone was asleep.
__________________
“Never do anything you can't take back.”
—Rocky Russo
Sailor Steve is offline   Reply With Quote
Old 03-03-10, 06:09 PM   #2
kapitan_zur_see
Commodore
 
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
Default

tools for modders right out of the box! big suprise indeed! can't wait to try them out

awesome news
__________________

kapitan_zur_see is offline   Reply With Quote
Old 03-14-10, 08:22 PM   #3
Vorkapitan
Samurai Navy
 
Join Date: May 2006
Posts: 594
Downloads: 1367
Uploads: 0
Default How to edit .py files

Hi Mates,

I'm trying to edit "Page Default Hud.py". What tools do I use?

I'm currently in the "menu editor" but can't find a reference to this file anywhere.

Thank you!
__________________
__________________________________________________ ________
__________________________________________________ ________



Joe
Vorkapitan is offline   Reply With Quote
Old 03-14-10, 09:01 PM   #4
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

You can edit the scripts via the Script editor. Run the game in a window, then right click on the title bar to start the editor (one of the menu items). Each time you save the script it is reloaded so it's easy to test...
skwasjer is offline   Reply With Quote
Old 03-14-10, 09:31 PM   #5
Vorkapitan
Samurai Navy
 
Join Date: May 2006
Posts: 594
Downloads: 1367
Uploads: 0
Default

Sywasjer,

I was trying do do this "Open up Silent Hunter 5\data\scripts\menu\Page Default Hud.py
Search for:
def SetMiniMap( boolvalue ):
Look down a few lines and change these values to True:
Code:
PageDefaultHud_MapGroup_ParallelCourseButton.Visib le = False
PageDefaultHud_MapGroup_InterceptCourseButton.Visi ble = FalseThat's it."

I can't find it/or the method to do it.
Thanks for the info.
__________________
__________________________________________________ ________
__________________________________________________ ________



Joe
Vorkapitan is offline   Reply With Quote
Old 03-15-10, 02:50 AM   #6
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default

I'm sorta lost.

I was looking to add a thing or two into the UI. As a alittle "test" for myself i was just gonna do something simple like put an image onto the TDC page, and i was gonna have it rotate with the scope. Well I THOUGHT it would be pretty easy, as i have the mod that enables the TDC dials (by DarkWraith).. and i could just look at how the bearing dial works by peeking in the files that came with the mod.

No Joy.

I've got the graphic showing in-game no problem using the menu editor. But looking through the files that came with the TDC mod.. i just dont see where the bearing dial's hand is tied to the scope anywhere. I've looked through the .ini files, i've looked at the relevant scripts.. and i just dont see it.

If i could figure this one example out, it would go a long way to understanding how the UI modding works.
__________________

Solution Solver 2.3.2 - Visual Targeting Tools & Aids
gutted is offline   Reply With Quote
Old 03-15-10, 10:07 AM   #7
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

Hi Gutted are you trying to port the AoB calculator into SH5. Nice good luck with it.

Being going over this thread trying to figure out how to mod stuff into the UI, but its all gone over my head.
Maybe someone like a Dev or TheDarkWraith (No1 in UI mods to date) could do up a bacic tutorial on say getting in a custom dial and tying it into the interface. Hint hint... Please

Last edited by reaper7; 03-15-10 at 10:44 AM.
reaper7 is offline   Reply With Quote
Old 03-15-10, 11:48 AM   #8
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default

I eventually intend to do that if i haven't given up on UI modding by then LOL.

Right now im just trying to figure it out, and see if i can get something spinning on the screen.
__________________

Solution Solver 2.3.2 - Visual Targeting Tools & Aids
gutted is offline   Reply With Quote
Old 03-15-10, 11:49 AM   #9
SteveTRM
Sailor man
 
Join Date: Mar 2007
Posts: 46
Downloads: 6
Uploads: 0
Default

These have obviously been left in by the devs - i personally dont think its a mistake by them - perhaps they where pissed with UBI soft aswell lol.

SH5 may have lots of bugs and many have moaned about its problems but to have access like this to a game is worth every penny i paid for it.

It has huge possiblities to the point where previous versions of Silent Hunter could be added to the game, i wonder how long it will be before some of the excellent modders here port over SH4 uboat missions lol

Perhaps SH5 will be the last in the series - but look what they have given us, all we need now is to get rid of the DRM!
SteveTRM is offline   Reply With Quote
Old 03-20-10, 05:41 PM   #10
java`s revenge
Ace of the Deep
 
Join Date: Jan 2007
Location: at periscope depth
Posts: 1,204
Downloads: 97
Uploads: 0
Default

I want to deepen me into modding. I want to make dutch navy ships.
Maybe this is the beginning.
__________________
java`s revenge is offline   Reply With Quote
Old 02-15-11, 03:42 PM   #11
chrysanthos
Grey Wolf
 
Join Date: Jan 2011
Location: greece
Posts: 820
Downloads: 488
Uploads: 0
Default

well i guess i have to wait until a playble battleship builds.....since i cant do it because no one helps:/
chrysanthos is offline   Reply With Quote
Old 03-25-11, 04:16 AM   #12
MiTon
Sparky
 
Join Date: Apr 2010
Location: Germany
Posts: 157
Downloads: 270
Uploads: 2
Problem triggering action with new button!

Hello!

I hope it's the right place to ask, but I've got a problem triggering an action from a new checkbox. Maybe someone can help?

Here the situation:

To toggle SpeechRecognition on/off I created a new checkbox with the MenuEditor.
Located above the PageDefaultHud_Feedback_BottomBar_ToggleAdvancedCk (NewUI)
It's showing ingame and I can click it.

The coressponding Lines in Page Default Hud.ini look like this:

Code:
[G0A I278]
Name=ToggleSpeechRecCk
Type=1033;Check box
ItemID=0xA1E0001
ParentID=0xA1E0000
Pos=253,-4,18,20
Zone= 255 46 18 20 0 1 0xA1E0000 0.952727 -0.29 0xA1E0001 -0.5 0.5 0 0
Materials=8
Display=2;Linear
Mat 0=data/menu/gui/layout/hud3.dds
Crop 0=0.178711,0.105469,0.0175781,0.0195313
Mat 1=data/menu/gui/layout/hud3.dds
Crop 1=0.178711,0.128906,0.0175781,0.0195313
Mat 2=data/menu/gui/layout/hud3.dds
Crop 2=0.178711,0.105469,0.0175781,0.0195313
Mat 3=data/menu/gui/layout/hud3.dds
Crop 3=0.178711,0.128906,0.0175781,0.0195313
Mat 4=data/menu/gui/layout/hud3.dds
Crop 4=0.178711,0.105469,0.0175781,0.0195313
Mat 5=data/menu/gui/layout/hud3.dds
Crop 5=0.178711,0.128906,0.0175781,0.0195313
Mat 6=data/menu/gui/layout/hud3.dds
Crop 6=0.178711,0.105469,0.0175781,0.0195313
Mat 7=data/menu/gui/layout/hud3.dds
Crop 7=0.178711,0.128906,0.0175781,0.0195313
MatFlags=0x9
TexFmt=0x0
Font=21
Text=0
TextPosFlags=0x2
TextOffsetY=8,8,8,8
TextFlags=0x0
CheckBoxWidth=0
StatesColors=0xCDBEB4FF, 0xCDBEB4FF, 0xCDBEB4FF, 0xCDBEB4FF
In Page Default Hud.py I added the these lines (the ... arent' there )

Code:
from SpeechRecognition import ToggleSpeechRecognitionOnOff

...

def PageDefaultHud_Feedback_BottomBar_ToggleSpeechRecCk_Clicked():
    ToggleSpeechRecognitionOnOff()

...

def InitializeScript():

....

PageDefaultHud_Feedback_BottomBar_ToggleSpeechRecCk.Clicked += PageDefaultHud_Feedback_BottomBar_ToggleSpeechRecCk_Clicked

...

def UnloadScript():

...

PageDefaultHud_Feedback_BottomBar_ToggleSpeechRecCk.Clicked -= PageDefaultHud_Feedback_BottomBar_ToggleSpeechRecCk_Clicked
Now I' getting namespace errors:


So what went wrong importing Speech Recognition.py???

Called from Speech Recognition.py the command is working like expected!

What's the minimum of code needed for a new button like this? What did I miss?

What would be needed if I wan't to add a new group?

Thanks in advance!

Greets

MiTon

Last edited by MiTon; 03-25-11 at 05:08 AM.
MiTon is offline   Reply With Quote
Old 03-25-11, 09:00 AM   #13
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

If SpeechRecognition hasn't been 'opened' yet then it isn't initialized/valid. You must initialize it first either by opening it or using the MakeSureIsLoaded function of the ScriptManager.

Last edited by TheDarkWraith; 03-25-11 at 09:13 AM.
TheDarkWraith is offline   Reply With Quote
Old 03-25-11, 12:35 PM   #14
MiTon
Sparky
 
Join Date: Apr 2010
Location: Germany
Posts: 157
Downloads: 270
Uploads: 2
Default

Thx for sharing your knowledge TDW!
It's realy appreciated!

Sorry for these dumb questions! Have been awake for over 30 hours, so concentration dropped quite low
But I think I'm making slow but steady progress understanding Python and SH5 internals


I may be misunderstanding, but since SpeechRecognition is started by the initScript it should be initialized from start, cause I can use it "out of the box".

See here:

Code:
def InitializeScript():
    if SHSpeechEngine.IsSupported:
        global speech
               
        Game.SubmarineCommands.CommandWasGiven += test_CommandGiven
        Game.SubmarineCommands.DelayedCommandWasGiven += test_DelayedCommandGiven

        try:
            
            if speech == None:
                speech = SHSpeechEngine("de-DE")
                speech.Confidence = 0.70 
                speech.OrderReceived += speech_OrderReceived
                speech.Start()
            
        except:
            pass
Ok. Open like this:
Code:
from SpeechRecognition import SpeechRecognition
SpeechRecognition.Visible = True
"MakeSureIsLoaded".
The name sounds promissing, already.

Will give it a try!


I have an other question related to the MenuEditor!

Under "Item text" you can find a dropdow list for localized strings, which seems to read menu.txt. I added my strings there but they don't show up in the dropdownlist?


Is there an other place to define those strings or do I have to set them through
Code:
SpeechRecognition_SpeechRecognitionSettings_ConfidenceLevelText.Text = "TEST"
?

Could be a strange bug since I'm having an other issue, as you can read in my post to NewUI:
http://www.subsim.com/radioroom/show...postcount=6956


Thx again!

Last edited by MiTon; 03-25-11 at 01:55 PM.
MiTon is offline   Reply With Quote
Old 04-04-11, 12:43 PM   #15
MiTon
Sparky
 
Join Date: Apr 2010
Location: Germany
Posts: 157
Downloads: 270
Uploads: 2
Default Way to make use of python standard API??

Hi there!

How can I import standard python modules? They don't seem to be available in the ScriptManager.
Is there a way?

For example, I'd like to use this:

Code:
import os.path
from os.path import abspath as abspath
If I have to build a custom dll, what IDE would you recommend? IronPython Studio, eclipse (pydev)?

regards


MiTon
MiTon 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 04:33 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.