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 02-15-11, 03:42 PM   #1
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   #2
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   #3
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 02-24-13, 01:32 AM   #4
busman
Nub
 
Join Date: Jul 2008
Posts: 2
Downloads: 231
Uploads: 0
Default

cool
busman is offline   Reply With Quote
Old 04-02-15, 04:23 AM   #5
eka
Swabbie
 
Join Date: Mar 2015
Location: Paris
Posts: 13
Downloads: 32
Uploads: 0
Default

I am not able to see images (also with right mouse button).
is it my problem or thread pb?

thx
eka is offline   Reply With Quote
Old 02-23-17, 07:44 AM   #6
Shiklgroober
Watch
 
Join Date: Jan 2017
Posts: 20
Downloads: 33
Uploads: 0
Default Editor Goblin

Hello! I delve into the Goblin editor. I am trying to make changes to the object, for example in the Deck Gun. I can not understand how all the same to edit objects (Deck gun) Goblin in the editor? Like the editor works for me. I configure it as mentioned in earlier posts. Loading the main image - Submarin.GR2, then merge, - further file from Object- Gun- ... sim. Well, and then how ...? Gun rotates all. Further, it is impossible to change anything in detail. It may be necessary detail for its changes in export Max3D? Thank you!
Shiklgroober is offline   Reply With Quote
Old 10-16-19, 04:46 AM   #7
u crank
Old enough to know better
 
u crank's Avatar
 
Join Date: Dec 2011
Location: Prince Edward Island
Posts: 11,562
Downloads: 136
Uploads: 0


Default

Reported as spam. ^
__________________

“Two possibilities exist: either we are alone in the Universe or we are not. Both are equally terrifying.”

― Arthur C. Clarke




u crank is online   Reply With Quote
Old 10-16-19, 05:00 AM   #8
Jimbuna
Chief of the Boat
 
Jimbuna's Avatar
 
Join Date: Feb 2006
Location: 250 metres below the surface
Posts: 181,344
Downloads: 63
Uploads: 13


Default

Quote:
Originally Posted by u crank View Post
Reported as spam. ^
Good catch, I've sent them back to Hanoi
__________________
Wise men speak because they have something to say; Fools because they have to say something.
Oh my God, not again!!


GWX3.0 Download Page - Donation/instant access to GWX (Help SubSim)
Jimbuna is offline   Reply With Quote
Old 01-24-20, 03:54 AM   #9
Aktungbby
Gefallen Engel U-666
 
Aktungbby's Avatar
 
Join Date: Jul 2013
Location: On a tilted, overheated, overpopulated spinning mudball on Collision course with Andromeda Galaxy
Posts: 27,909
Downloads: 22
Uploads: 0


Default REPORTED AS SPAM

^
__________________

"Only two things are infinite; The Universe and human squirrelyness; and I'm not too sure about the Universe"
Aktungbby is offline   Reply With Quote
Old 03-21-10, 02:14 PM   #10
ERPP8
Commodore
 
Join Date: Dec 2009
Location: My House
Posts: 608
Downloads: 161
Uploads: 0
Default

oh my god, this is awesome!!!!!
I never knew how to use the mission editor!!!!!!!!!!!!
ERPP8 is offline   Reply With Quote
Old 03-21-10, 03:42 PM   #11
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Some new Source Code for NWN2 was released yesterday.
It includes Source Code concerning GR2 files.
Incase your nterested here's the link.
http://nwn2forums.bioware.com/forums...forum=119&sp=0

Also.
There is an exporter for EVE that exports to obj file format.
On testing it only the first mesh is exported.
However it does come with the Source Code.
Here's the link
http://dl.eve-files.com/media/0801/evegr2toobj.2.zip
You may need to replace the older granny2.dll with the one in the SH5 folder.
Or error messages about wrong version popup.

Last edited by Madox58; 03-21-10 at 04:49 PM.
  Reply With Quote
Old 03-21-10, 04:47 PM   #12
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default New Page in Editor

Ok, I have been trying to create a new Page into the editor with not much luck, and need some advice.

I have created a Copy basically of the TDC page and Called it Page TDC2 in the editor as a test.
This creates the relevant ini page in the Pages Folder (Page TDC2.ini). Ok.

I then Create a new script called Page TDC2.py
And edit it like the following : (My tabs are not showing up in the scripts when I paste them into forum)

def InitializeScript():
pass
def StartGame():
pass
def EndGame():
pass
def UnloadScript():
pass

Now as I want the Periscope to bring this page up in the game I edit the Page attack periscope.py file like this:

#Page attack periscope.py
from menu import *
def InitializeScript():
Menu.PageActivated += Menu_PageActivated
Menu.PageDeactivated += Menu_PageDeactivated
def StartGame():
pass
def Menu_PageActivated( page ):
if page == Pageattackperiscope:
from PageTDC2 import PageTDC2
PageTDC2.Visible = True
def Menu_PageDeactivated( page ):
if page == Pageattackperiscope:
from PageTDC2 import PageTDC2
PageTDC2.Visible = False
def UnloadScript():
Menu.PageActivated -= Menu_PageActivated
Menu.PageDeactivated -= Menu_PageDeactivated
def EndGame():
pass

These are placed into the correct folders and the game is launched.
Game loads ok, but when I activate the periscope the game freezes with the following script error.



Can anyone tell me what I'm doing wrong. I've no scripting experience but this appears to be the method as shown earlier in this thread.
The no module named TDC2 is baffling me, how do you create a module?
reaper7 is offline   Reply With Quote
Old 03-21-10, 05:48 PM   #13
Woodybcn
Watch
 
Join Date: Feb 2010
Location: Barcelona, SPAIN
Posts: 27
Downloads: 38
Uploads: 0
Default

Please, I've been sailing a few days on SH5 but I haven't heard any song from the radio because I don't know how it works! Please, let me know what button I must press.

Thank you.
__________________
https://flic.kr/p/BzjrTv
My new toy!
Woodybcn is offline   Reply With Quote
Old 03-21-10, 06:33 PM   #14
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by reaper7 View Post
Ok, I have been trying to create a new Page into the editor with not much luck, and need some advice.

I have created a Copy basically of the TDC page and Called it Page TDC2 in the editor as a test.
This creates the relevant ini page in the Pages Folder (Page TDC2.ini). Ok.

I then Create a new script called Page TDC2.py
And edit it like the following : (My tabs are not showing up in the scripts when I paste them into forum)

def InitializeScript():
pass
def StartGame():
pass
def EndGame():
pass
def UnloadScript():
pass

Now as I want the Periscope to bring this page up in the game I edit the Page attack periscope.py file like this:

#Page attack periscope.py
from menu import *
def InitializeScript():
Menu.PageActivated += Menu_PageActivated
Menu.PageDeactivated += Menu_PageDeactivated
def StartGame():
pass
def Menu_PageActivated( page ):
if page == Pageattackperiscope:
from PageTDC2 import PageTDC2
PageTDC2.Visible = True
def Menu_PageDeactivated( page ):
if page == Pageattackperiscope:
from PageTDC2 import PageTDC2
PageTDC2.Visible = False
def UnloadScript():
Menu.PageActivated -= Menu_PageActivated
Menu.PageDeactivated -= Menu_PageDeactivated
def EndGame():
pass

These are placed into the correct folders and the game is launched.
Game loads ok, but when I activate the periscope the game freezes with the following script error.



Can anyone tell me what I'm doing wrong. I've no scripting experience but this appears to be the method as shown earlier in this thread.
The no module named TDC2 is baffling me, how do you create a module?
I see what you're trying to do and it won't work. The C++ code only allows dials on pages that already had dials on them. Sure you can add a dial to Page Default Hud but when you try to tie it to the the dial in the file dials.cfg it won't work. The game will not update the dial. It will be just a static bitmap. If you want to do TDC stuff then you have to keep the dials on PageTDC or use another page that already has dials on them.

Last edited by TheDarkWraith; 03-21-10 at 07:07 PM.
TheDarkWraith is offline   Reply With Quote
Old 03-21-10, 07:48 PM   #15
Heretic
Commodore
 
Join Date: Mar 2005
Location: Nebraska
Posts: 617
Downloads: 240
Uploads: 2


Default

Hey DarkWraith, given what you've seen so far, what do you think the prospect of passing sim data to the AI scripts is? The menu stuff seemingly has all the depth, course, etc, info. There are python files that look to be an interface to the AI scripting in scripts folder. If that were possible, many cool things could be done.
Heretic 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 01:07 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.