![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#1 |
Samurai Navy
![]() Join Date: May 2006
Posts: 594
Downloads: 1367
Uploads: 0
|
How do I trigger sounds etc.?
Ok Mates,
I searched everything on "sound" but am at a loss as to what/how to do sound triggers... ist. What triggers a sound?...I see text like "tube 1 flooding" but there is no sound triggered for it (there is a sound wav for it.) 2nd. Is there a way to trigger this sound based on a menu switch? 3rd. if there is no sound for this, is there a way to "add" a sound? 4th. Can this be done via a script? I need all the help I can get. ![]() ![]() ![]() ![]() ![]() Thank you.
__________________
__________________________________________________ ________ __________________________________________________ ________ Joe ![]() ![]() |
![]() |
![]() |
![]() |
#2 |
Admiral
![]() Join Date: Apr 2005
Location: Australia:- Sydney
Posts: 2,049
Downloads: 68
Uploads: 0
|
![]()
I'll will be watching this Thread closely as I too am curious about this.....example; you hear the periscope going up down mechanically whilst inside, however; standing out in the conning tower if the scopes go up/down you hear nothing
![]() Bump:- ![]() |
![]() |
![]() |
![]() |
#3 |
Samurai Navy
![]() Join Date: May 2006
Posts: 594
Downloads: 1367
Uploads: 0
|
![]()
Venatore,
When I did a search on all of Subsim radio room forums, I thought I saw an explanation of the problem you are describing. I'm not sure that it will help.
__________________
__________________________________________________ ________ __________________________________________________ ________ Joe ![]() ![]() |
![]() |
![]() |
![]() |
#4 |
Admiral
![]() Join Date: Apr 2005
Location: Australia:- Sydney
Posts: 2,049
Downloads: 68
Uploads: 0
|
![]()
Vorkapitan,
Hey matey, it was in discussions within my mod thread. I'm as keen as you are to find out the mystery of the triggers for sound ![]() Bump ![]() |
![]() |
![]() |
![]() |
#5 | |
The Old Man
![]() Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
|
![]() Quote:
2/3) Yes, of course: <Button>.OnClickSoundName = "<SDL-identifier>" (to override default button sound) or Menu.PlaySound("<SDL-identifier>") 4) Yes, (see 2/3) but when called from script it is not 3D aware, meaning if you order it from the bridge, it will be as loud as if you were in the torpedo room. This is fine for crew speech (check SubmarineCommandsWrapper.CommandWasGiven-event for the handler to use in such scenario's), but not for location specific sounds. I have not looked into SH5 to closely, but in SH4, the technique for events like this (since it lacks a script engine), is to trigger them from StateMachineClass controller. You will first need to put an aud node where you want the sound to be heared in the DAT-file, and add the associated SoundInfo controller for it (DSD). And of course add an SDL-sound entry (toggling 3D to make it location aware, 2D for a global sound). Then, in the StateMachineClass controller (can build it from scratch for this purpose alone, but can also reuse the generic sub StateMachineClass DAT-file) you add a handler for the Open/Close tube SH-command, and trigger the sound from there (by calling the node label using PlayAnim or PlaySound, i don't remember).
__________________
![]() 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 09:07 PM. |
|
![]() |
![]() |
![]() |
#6 |
Samurai Navy
![]() Join Date: May 2006
Posts: 594
Downloads: 1367
Uploads: 0
|
![]()
SKWASJER,
Thank you very much for the detailed info, now if someone could explain what you said.... ![]() Thanks again for the quick response. ![]()
__________________
__________________________________________________ ________ __________________________________________________ ________ Joe ![]() ![]() |
![]() |
![]() |
![]() |
#7 |
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. |
![]() |
![]() |
![]() |
#8 |
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 ![]() ![]() |
![]() |
![]() |
![]() |
|
|