![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#1 |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]()
Ok, heh...
Well, in the question you only asked for how to add a sound to a command. This in particular could be implemented via different ways, so I just threw in the approaches I could think of. Using script is probably the easiest, but it may not cover all the situations you want to implement, and as said is not 3D-aware. Code:
from game import Game from menu import Menu def sc_CommandWasGiven( e ): if e.CommandText == "Open_torpedo_tube": Menu.PlaySound( "<sdl-identifier>" ) # Needs an SDL-identifier f.ex.: torpedo.openTube. This is a generic message. elif e.CommandText == "Open_sel_torpedo_tube": Menu.PlaySound( "<sdl-identifier>" + ( e.Param1 + 1 ).ToString() ) # Needs an SDL-identifier f.ex.: torpedo.openTube1, torpedo.openTube2, etc. This is a message per tube index (Param1 is 0-based tube index). def InitializeScript(): Game.SubmarineCommands.CommandWasGiven += sc_CommandWasGiven def UnloadScript(): Game.SubmarineCommands.CommandWasGiven -= sc_CommandWasGiven
__________________
![]() SH5 mods: Speech Recognition for SH5 | Digital UI Clock Tutorials: [TEC] Import/export 3D models to/from game using S3D [TEC] How to work with the model viewer in S3D - VIDEO Last edited by skwasjer; 09-03-10 at 10:12 PM. |
![]() |
![]() |
![]() |
#2 |
Samurai Navy
![]() Join Date: May 2006
Posts: 594
Downloads: 1367
Uploads: 0
|
![]()
SKWASJER,
As you will see in the PM I sent, I was more definitive in what I was trying to accomplish. Your script will give me a base to start with...so thank you very much. ![]() ![]() ![]()
__________________
__________________________________________________ ________ __________________________________________________ ________ Joe ![]() ![]() |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|