Log in

View Full Version : Adding audio to a command


Osmium Steele
03-13-12, 12:49 PM
I want to add .ogg files, which I will record myself, to the commands to fully raise and/or lower the attack and observation scopes.

I need to know how to connect the keystroke to the audio file in game.

I've located the proper keystrokes in commands_en, but am unsure what, if anything, to edit there.

Could someone please point this novice in the right direction?

Osmium Steele
03-14-12, 08:49 AM
That's what I was afraid of. :rotfl2:

Evidently it is more difficult than I had hoped.

Rubini
03-14-12, 10:02 AM
In SH5 the commands can have a line with a sound in the commands.cfg itself...an absent feature on sh3...but I guess that niobody have tried it yet.
So go on!
Here an example:

[Cmd66]
Name=Toggle_radio_messages
Contexts=1,15
Key0=0x4d,,"M"
Sound_0=ELO_Weapon,Mission_order <== seems that the sound needs to be on the sound\speech folder. You need to figure out the syntax first.

here another example with various sounds:

[Cmd192]
Name=Dive
Contexts=1
StringID=1030
Key0=0x44,,"D"
HasDelayedExecution=Yes
CommandClass=Depth
Sound_0=ELO_Helm,MC_CR_CHIEF_32,1030;Dive
Sound_1=ELO_Helm,MC_CR_CHIEF_34_A,7646;Deeper!
Sound_2=ELO_Helm,MC_CR_CHIEF_34_B,7647;Take Her Deeper
Sound_3=ELO_Helm,MC_CR_CHIEF_35,7648;Deeper Goddamit

Missing Name
03-14-12, 10:37 AM
My tinkering efforts have been for naught as well.


Sound_3=ELO_Helm,MC_CR_CHIEF_35,7648;Deeper Goddamit

That's an actual line?

Rubini
03-14-12, 11:25 AM
My tinkering efforts have been for naught as well.



That's an actual line?

From SH5 commands.cfg. As some new mod addtions on sh3 comes from sh4/sh5 i guess that could be a good idea to see if this also works on sh3.

Osmium Steele
03-14-12, 12:38 PM
Here's a sample of an SH3 command from command_en.
The example has a sound associate with it.

[Cmd432]
Name=Man_the_deck_and_flak_guns
Ctxt=1
MnID=0x3F2D0004
Str=2946

As you can see, there is no obvious sound file associated with it, but we all hear the command when the guns are manned.

Ctxt=1 means the command onlyexecutes within the unpaused game itself, not in the museum, for example.

Str=2946 is the text displayed when the command executes. Found in Data/Menu/en_menu file.

Which leaves MnID=0x3F2D0004.

MnID = menu item ID associated with this command. Unfortunately, I cannot find the menu file/folder to which the command points.

I've located the .DAT files which sync voices with the animations, but that is it.

The number looks like a hex address, but I am unable to even find that string anywhere.

I know I'm missing something obvious, but am currently lost. :damn:

Rubini
03-14-12, 01:42 PM
Here's a sample of an SH3 command from command_en.
The example has a sound associate with it.

[Cmd432]
Name=Man_the_deck_and_flak_guns
Ctxt=1
MnID=0x3F2D0004
Str=2946

As you can see, there is no obvious sound file associated with it, but we all hear the command when the guns are manned.

Ctxt=1 means the command onlyexecutes within the unpaused game itself, not in the museum, for example.

Str=2946 is the text displayed when the command executes. Found in Data/Menu/en_menu file.

Which leaves MnID=0x3F2D0004.

MnID = menu item ID associated with this command. Unfortunately, I cannot find the menu file/folder to which the command points.

I've located the .DAT files which sync voices with the animations, but that is it.

The number looks like a hex address, but I am unable to even find that string anywhere.

I know I'm missing something obvious, but am currently lost. :damn:

AFAIK the MnID isn't associated to sounds anyaway.

Madox58
03-14-12, 06:39 PM
The MnID is found in the menu_1024-768.ini

The voices played are controlled by the Phrases_whatever.dats as far as I remember.
:hmmm:

They may also connect to the actual anim files but I'm not home so can't check everything.
:nope:

Osmium Steele
03-15-12, 09:32 AM
AFAIK the MnID isn't associated to sounds anyaway.

Yeah. As Privateer points out, it points to the menu_1024-768.ini file which appears to control the gui animations. Button presses, switches thrown, etc.

The voices played are controlled by the Phrases_whatever.dats as far as I remember.

I thought so too, but Silent 3ditor lists them as Lip sync managers for the NPCs. Although, it may buried in there somewhere.

Many near misses, but no direct hits as yet. Keep shootin' guys! I'm loading as fast as I can! :salute:

The mechanism which tells the game "when X occurs play sound Y" remains elusive to my novice eye. I can see why they changed it for SH5.

makman94
03-15-12, 07:57 PM
..... it points to the menu_1024-768.ini file which appears to control the gui animations. Button presses, switches thrown, etc.
.....

hi Osmium Steele,

not only this , it also determines the area at which ,when you clic with your mouse, will 'activate' the command (otherwise you will have to use ONLY your keyboard buttons for executing the commands). now, if you can add a sound line and work...fine (just have to try it) .

ps: the allready existed commands that have sounds (but you don't see a sound line at the specific command entry) means ,afaik, that the sound is hardcoded attached to the command

Osmium Steele
03-16-12, 07:37 AM
The more I look, and the more I think on it, the more convinced I become that you are correct. I cannot think of any voice command that is not attached to an NPC, and I think it must be hardcoded.

Perhaps I am going about this the wrong way. Treat it more like an environmental sound, since my mod would simulate the kaleun's voice command, not another officer, it need not be attached to an npc.

I'll keep cogitating on it. Cdr. Shephard is calling me bad names for taking time out to check Subsim!

Cya Monday.

Anvart
03-16-12, 09:06 AM
You must not forget that the game has user commands and crew commands...
For sound of crew commands you can use StateMachineControl system and files like in ..\data\Sound\Speech\ folder and for mimic like in ..\data\Library\ folder (Phrases_Voice_*.dat files)...
For sound of user commands, IIRC, SH3 game has no special sound system, therefore you can try use ambient/environment sound system... as in Sh3.sdl file.
Raise periscope (and similar) is user command.
...
Example for UZO Officer StateMachineClass (crew command):

http://img846.imageshack.us/img846/9182/smctlmessage.jpg

Osmium Steele
03-16-12, 01:39 PM
Anvart, YOU are the man!

With your hint, I managed to locate the command strings for fully raising and lowering the scopes.

Believe it or not, it is located .cam files. For example:

c:\ubisoft\silenthunteriii\data\Interior\NSS_Uboat 7_CR.cam

It appears I will be able to append a new chunk to each command to play the proper .wav file.

Of course, I'll have to add the new chunk to every .cam file for every turm on every class of boat. :damn:

Now, the work begins in earnest. Cross your fingers!

Rubini
03-16-12, 01:47 PM
Good!:up:
Please Osmium, also add sounds to the snorkel up/down. itīs completely absent on Sh3 and an old request from comunity. A lot of ppl (me included) have tried to found a solution but never acheived. With this new Anvartīs tips is now easy to see that will be possible to do using the snorkel commands. I made a mod some years ago (IIRC "Snorkel for all") that adds fx&RWR to all snorkel and installations. it uses Anvarts state machine controls and then the sounds can be finally added! :up:

Osmium Steele
03-16-12, 02:38 PM
Good!:up:
Please Osmium, also add sounds to the snorkel up/down. itīs completely absent on Sh3 and an old request from comunity. A lot of ppl (me included) have tried to found a solution but never acheived. With this new Anvartīs tips is now easy to see that will be possible to do using the snorkel commands. I made a mod some years ago (IIRC "Snorkel for all") that adds fx&RWR to all snorkel and installations. it uses Anvarts state machine controls and then the sounds can be finally added! :up:

If it works, I currently see no reason it could not be added.

I ran into a bit of a snag, but all hope is not lost. I am unable to edit the actual chunk defining the raise/lower commands, but I can add a sister chunk alongside it under the parent. Hopefully that will do it.

Never having done this sort of thing before, I'm leery of making changes to my only instance of SH3/GWX. I have not setup another specifically for testing, though with JSGME's ability to roll back any change I make it should be OK. (famous last words :doh:)

I'll check back in Monday with a progress report. Commander Shephard and the Reapers are just is going to have to wait. :up:

Fubar2Niner
03-16-12, 05:03 PM
............... Commander Shephard and the Reapers are just is going to have to wait. :up:

LOL.............

I got the same dilemma. I need four hands, and two heads :haha:

Best regards.

Fubar2Niner

Rubini
03-17-12, 11:42 AM
You must not forget that the game has user commands and crew commands...
For sound of crew commands you can use StateMachineControl system and files like in ..\data\Sound\Speech\ folder and for mimic like in ..\data\Library\ folder (Phrases_Voice_*.dat files)...
For sound of user commands, IIRC, SH3 game has no special sound system, therefore you can try use ambient/environment sound system... as in Sh3.sdl file.
Raise periscope (and similar) is user command.
...
Example for UZO Officer StateMachineClass (crew command):

http://img846.imageshack.us/img846/9182/smctlmessage.jpg
Tried again with snorkel up/down sound issue. No dice. We have not a place to add sound to a commands on sh3 - seems that they are hardcoded at Sh3Sound.act.

The statemachine idea above didnīt worked probably because this is a player/user command as Anvart explained.

The idea to make something similar to SH5 on commands_xxx.cfg also didnīt work.:damn:

Perhaps Osmium can found a way.:hmmm:

Madox58
03-17-12, 02:36 PM
Look at the Bold and you'll see no hard code is involved.
Only the dsd file and the entry in the SH3.sdl file.

There is no entry in the SH3Sound.act file for it but it works!

Create the dsd for the snorkel just like the bold.dsd then edit the sdl to match.

You should get a sound only when you raise or lower it as it does not loop.
:hmmm:

Of course the spawning of the Bold might trigger the sound where the snork is always there so sound may not work.
If that's the case some trickery might work.

Rubini
03-17-12, 02:44 PM
Look at the Bold and you'll see no hard code is involved.
Only the dsd file and the entry in the SH3.sdl file.

There is no entry in the SH3Sound.act file for it but it works!

Create the dsd for the snorkel just like the bold.dsd then edit the sdl to match.

You should get a sound only when you raise or lower it as it does not loop.
:hmmm:

Of course the spawning of the Bold might trigger the sound where the snork is always there so sound may not work.
If that's the case some trickery might work.
Thanks by the input mate!
I already tried this one as my first try (well, 2 years ago, i always could did something wrong, itīs sh3 files...LOL!) but the problem is exactly what you thought at end...itīs always there, isnīt a sound attached to snorkel that we need, but a sound attached to a command.:hmmm:

@privateer: please donīt forget that S3D files for Sh5!:yep:

Madox58
03-17-12, 02:47 PM
Part of the trickery I was thinking of is to add the wpn_BoldLauncher controller.
Create a fake bold with the needed sounds and it should work everytime you raise or lower the snork.
:hmmm:

Got the S3D/SH5 files now.

Rubini
03-17-12, 02:52 PM
Part of the trickery I was thinking of is to add the wpn_BoldLauncher controller.
Create a fake bold with the needed sounds and it should work everytime you raise or lower the snork.
:hmmm:

Got the S3D/SH5 files now.

Thanks by the tip! Will try it now and report back!

Rubini
03-17-12, 03:42 PM
Yet not really tried it...Iīm mounting the file...but will not work...see...how it will only lunch an amunbold when press the Snorkel up or down? At first i canīt see how it will works...:hmmm:. The problems always remain because snorkel is always there, I tryed to attach it to a waterInteraction contoller attached to snorkel but it not work well.

Madox58
03-17-12, 04:16 PM
Check the Searchlite files for GWX.
The Air Raid Siren uses a roundabout way to work.
It's a Search lite and a Gun but goes through the particles.dat and dsd to get the sound.
:doh:

Round about way to do it, but it works great.

The same run around might work in this case.

Rubini
03-17-12, 04:28 PM
Check the Searchlite files for GWX.
The Air Raid Siren uses a roundabout way to work.
It's a Search lite and a Gun but goes through the particles.dat and dsd to get the sound.
:doh:

Round about way to do it, but it works great.

The same run around might work in this case.
Thanks again!
Finished the test run with bold and not work really. The idea above is based on generating a particle all time that a searchlitgh on harbours is started, then link this particle to a sound. But again the Snorkel "always there" problem will be a barrier. But will look at them anyway.:up:

@BTW: do you know where the snorkel annimation file is? Isnīt where it must be.:hmmm:

Madox58
03-17-12, 04:36 PM
It's not an animation as it's not in a dat or such.
It's an extensible object which is controlled by the act file.

A quick way to determine if an animation file exists...........
Change the base 3D model.
If the animated object is all screwed up?
There is an animation dat somewhere.
If it looks OK and still rotates or whatever?
It's hard coded somewhere.

Anvart
03-18-12, 08:19 AM
...
The statemachine idea above didnīt worked probably because this is a player/user command as Anvart explained.
...
First, as i understood, it's talk about commands/speech of crew... (look first post).
In this case, you should use StateMachineCtrl, as CMD_Rise_snorkel, CMD_Lower_snorkel are crew commands in CMD_Maneuver_officer section...
You must create a corresponding sound/speech and the corresponding phonemes (don't forget CH_speech.dat too), and you must paste the relevant events and playback of your messages into CH.dat and CH2.dat files (StateMachineClass --> GraphName chief_helsman/chief_helsman_type2).
IIRC, for example, see how it's done for Snorkel_depth command.
...
If you're talking about noise of snorkel motion... you have to do as it is done for periscope.
:haha: ... or i did not understood anything in posts of this thread...
...
Change the base 3D model.
If the animated object is all screwed up?
...
:03:
... not for object animation.
as, i think, for obj_Extensible objects, animation are hardcoded and it's object animation with controller parameters!
...
:D although, what we are talking... everything animation are hardcoded... we can only configure it through the parameters of controllers.

Rubini
03-18-12, 01:39 PM
First, as i understood, it's talk about commands/speech of crew...
In this case, you should use StateMachineCtrl, as CMD_Rise_snorkel, CMD_Lower_snorkel are crew commands in CMD_Maneuver_officer section...
You must create a corresponding sound/speech and the corresponding phonemes (don't forget CH_speech.dat too), and you must paste the relevant events and playback of your messages into CH.dat and CH2.dat files (StateMachineClass --> GraphName chief_helsman/chief_helsman_type2).
IIRC, for example, see how it's done for Snorkel_depth command.
...
If you're talking about noise of snorkel motion... you have to do as it is done for periscope.
:haha: ... or i did not understood anything in posts of this thread...

LOL!:DL Yes, what I want is a sound for snorkel motion up&down that must be really noiser on Real Life...and in SH3 we have just no sound.

Periscope motion have itīs sounds as you know. The idea is to add something similar for snorkel with some workaround as we are not able to add sounds to a command key on sh3.

Isnīt just a matter to add a sound on sh3.sdl because we have nothing to attach this sound to the snorkel movement. And the most important point is that the snorkel is always there, I have not any success (until now) do attached something to it (and then a sound) that works when you press up or down snorkel...Itīs realy trick!:damn:

Edit:The periscope movement sound is hardcode on Sh3Sound.act and then explicited on sh3.sdl. We have not this for snorkel!!

Rubini
03-18-12, 10:17 PM
WIP Update:
- I was able to create scripts (smart macros) for Sh3 using 3rd party softer...and the best "side effect" is that is a easy as a cake to add sounds for any key/mouse command using this same softer!!:o

Anvart
03-19-12, 01:57 AM
LOL!:DL ...
:D:yep:

Edit:The periscope movement sound is hardcode on Sh3Sound.act and then explicited on sh3.sdl. We have not this for snorkel!!
Is it your guess?
Unlike the periscope for snorkel you must use Interior or/and Submarine (for exterior) sound class/category...
:hmmm: I do not see anything that point to the periscope sound in Sh3Sound.act.
I was never interested in the sounds of SH3 ... but if in the last 7 years have been mod(s) with the addition of sound into game through Sh3.sdl, then it is possible..?
IIRC, it was done for new planes by russian community and here, too.

Osmium Steele
03-19-12, 09:21 AM
No joy as yet.

But I am sure learning a bunch by reading the give and take in this thread!

Still working on it.

I was able to create scripts (smart macros) for Sh3 using 3rd party softer

I'm trying to avoid that option as I was really hoping to modify the game to make it work. If I am unsuccessful, I'll go that route.

Rubini
03-19-12, 10:00 AM
:D:yep:

Is it your guess?
Unlike the periscope for snorkel you must use Interior or/and Submarine (for exterior) sound class/category...
:hmmm: I do not see anything that point to the periscope sound in Sh3Sound.act.
I was never interested in the sounds of SH3 ... but if in the last 7 years have been mod(s) with the addition of sound into game through Sh3.sdl, then it is possible..?
IIRC, it was done for new planes by russian community and here, too.
Find for "Menu.Periscope.Move" inside Sh3sound.act. itīs there. Also others periscope sounds are defined there.:03:

Anvart
03-19-12, 02:40 PM
Find for "Menu.Periscope.Move" inside Sh3sound.act. itīs there. Also others periscope sounds are defined there.:03:
:oops:
Sorry, Rubini... Yes it is.
... now i am not stay lazy and installed the program Search & Replace, and using the keyword "Periscop" found:
Menu.Periscope.RotClickUp
Menu.Periscope.RotClickDn
Menu.Periscope.RotClickTorp
Menu.Periscope.Move
Menu.Periscope.Chrono
Menu.Periscope.Fire
in Sh3sound.act.
Another program that i used did not see those strings...

Rubini
03-19-12, 03:18 PM
:oops:
Sorry, Rubini... Yes it is.
... now i am not stay lazy and installed the program Search & Replace, and using the keyword "Periscop" found:
Menu.Periscope.RotClickUp
Menu.Periscope.RotClickDn
Menu.Periscope.RotClickTorp
Menu.Periscope.Move
Menu.Periscope.Chrono
Menu.Periscope.Fire
in Sh3sound.act.
Another program that i used did not see those strings...

I use Search & Replace too, it's avery good tool.:up:

Osmium Steele
03-20-12, 07:33 AM
Note to self: Download "Search and Replace" when you get home. :yeah: