View Single Post
Old 09-03-10, 08:44 PM   #5
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 28
Uploads: 3
Default

Quote:
Originally Posted by Vorkapitan View Post
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.
1) Crew speech can be added in .aix files (SH5 only, quite possible the preferred method since you can add variation and choose sounds depending on scenario) and/or via StateMachineClass (SH3/SH4, not sure about SH5), and I'm guessing some of it still is hardcoded too.
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).

Last edited by skwasjer; 09-03-10 at 09:07 PM.
skwasjer is offline   Reply With Quote