Page 1 of 1

How do .ssc scripts work?

Posted: Sun Jan 25, 2015 11:24 am
by one
We all know that sound parameters are stored in ssc scripts. But how do they work?
Let's take a piece of code in SoldierVoice.ssc as example:

Code: Select all

###################################
### Fire			###
###################################
newPatch
load @ROOT/Sound/@RTD/@Language/Fire.wav
dopplerOff
priority 11
minDistance 3
*** Distance Volume ***
beginEffect
	controlDestination Volume
	controlSource Distance
	envelope Ramp
	param 10
	param 55
	param 1
	param -1	
endEffect


###################################
### Medic			###
###################################
newPatch
load @ROOT/Sound/@RTD/@Language/Medic.wav
dopplerOff
priority 11
minDistance 3
*** Distance Volume ***
beginEffect
	controlDestination Volume
	controlSource Distance
	envelope Ramp
	param 10
	param 55
	param 1
	param -1	
endEffect
You press F6-F5 ingame and Medic.wav is played. Why? Why not Fire.wav? Or any other sound from SoldierVoice.ssc file? There isn't any mention of Medic.wav in game files (even in BF1942.exe) except SoldierVoice.ssc.
All sounds work like that. Engines, projectiles, etc. There are only paths to .ssc scripts, but there is no info about exact .wav file which should be played. The game decides what .wav file to play by itself. How?

Re: How do .ssc scripts work?

Posted: Sun Jan 25, 2015 6:46 pm
by Diamondback
You have to extract the sound.rfa to find those files, the file path mentioned in the SSC files points to those files. Depending on the soldier's language (Russian, German, American, British, etc), the correct sound file is chosen with the @Language command.

Re: How do .ssc scripts work?

Posted: Mon Jan 26, 2015 7:12 am
by one
Classical Modder wrote:You have to extract the sound.rfa to find those files, the file path mentioned in the SSC files points to those files. Depending on the soldier's language (Russian, German, American, British, etc), the correct sound file is chosen with the @Language command.
No, no, you don't understand what I mean.
Take any big .ssc script, there are many .wav sounds mentioned in it. For example, SoldierVoice.ssc. Where is it specified that when you press F6-F5, Medic.wav is played and not any other sound from SoldierVoice.ssc?
Or take SoldierRun.ssc - why SoRunMtl1.wav is played when player is running on the metal? Why not SoWaIce1.wav? Where is the relationship between SoRunMtl1.wav and Metal material?

Re: How do .ssc scripts work?

Posted: Mon Jan 26, 2015 10:43 am
by Swaffy
SSC files seem to have a hard-coded order they need to be in. So you can't move Fire callout to another part of the list.

You can probably just change the file name (Fire.wav) but you might break the game. Instead, keep the file names but change the file's audio content. So you can edit "Fire" to be a fart sound instead, for example.

Re: How do .ssc scripts work?

Posted: Mon Jan 26, 2015 6:25 pm
by Diamondback
For the F menu radio commands, I think they are placed in the order they are called as Swaffy pointed out. The ''Fire!'' command is F4 + F6 while the ''Medic'' command is F5 + F6 (not F6 + F5). So that could be your logical explanation.

The other part of what you're asking (the soldier walk scripts and so on) is probably hard coded as you said. It works hand in hand with the materialmap.raw file of your map as well as the specific Mat IDs that have been assigned to static objects and PCOs.

Re: How do .ssc scripts work?

Posted: Tue Jan 27, 2015 9:56 pm
by exe
In case you haven't seen it you can find a very good sound coding tutorial on this forum: viewtopic.php?f=43&t=1278

Re: How do .ssc scripts work?

Posted: Thu Jan 29, 2015 6:50 am
by one
Swaffy wrote:SSC files seem to have a hard-coded order they need to be in. So you can't move Fire callout to another part of the list.

You can probably just change the file name (Fire.wav) but you might break the game.
That's the exact thing I was asking about. Changing the order of sounds in SoldierVoice.ssc script changes sounds ingame. But their order in ssc scripts looks completely random (as in SoldierVoice for example, it has nothing to do with F commands order ingame). So it seems like their order in ssc scripts is hardcoded really. Thanks!
Classical Modder wrote: The ''Fire!'' command is F4 + F6 while the ''Medic'' command is F5 + F6 (not F6 + F5).
Nope, "Medic" is F6-F5, F5-F6 is "Negative" :)
Classical Modder wrote:The other part of what you're asking (the soldier walk scripts and so on) is probably hard coded as you said. It works hand in hand with the materialmap.raw file of your map as well as the specific Mat IDs that have been assigned to static objects and PCOs.
Yeah, thanks
exe wrote:In case you haven't seen it you can find a very good sound coding tutorial on this forum: viewtopic.php?f=43&t=1278
I use it sometimes, it's the onliest good article about ssc scripts