How do .ssc scripts work?

Ask questions, discuss ideas, get answers
Post Reply
User avatar
one
Posts: 50
Joined: Thu Sep 15, 2011 4:14 pm

How do .ssc scripts work?

Post 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?
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: How do .ssc scripts work?

Post 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.
See my Strasbourg map project here.
User avatar
one
Posts: 50
Joined: Thu Sep 15, 2011 4:14 pm

Re: How do .ssc scripts work?

Post 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?
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: How do .ssc scripts work?

Post 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.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: How do .ssc scripts work?

Post 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.
See my Strasbourg map project here.
exe
Posts: 60
Joined: Wed Feb 08, 2012 10:04 pm

Re: How do .ssc scripts work?

Post 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
User avatar
one
Posts: 50
Joined: Thu Sep 15, 2011 4:14 pm

Re: How do .ssc scripts work?

Post 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
Post Reply