Some time ago, there was a request for
"advanced" sound effects which would allow to specify multiple sound files for a single sound.tbl entry. I even wrote an implementation of that feature but for some reason it never got merged and that was a good thing. The code was so horribly written that I refuse to even look at it now. So, now I decided that it may be a good time to revisit that problem but with a better solution than the one I used originally.
Test builds are available here:
http://swc.fs2downloads.com/builds/test/soundSets/Even if you are not a modder who might use this feature you can still try the builds above to test if the normal sound playback still works.
If you are a modder who might use this feature then you will need some documentation on how this new feature works. The new sound set syntax is based on the existing
SCP syntax so if you already use this then it should be easy to use this new feature. Other than the feature described in the original thread, these sound sets do not use a separate section in the sounds table and can be used in all sections documented in the sounds.tbl wiki page.
You start your sound entry as usual with
$Name to give your sound a name. Then you can add as many sounds as you like with separate
+Entry parameters (but there has to be at least one entry):
$Name: TestSet
+Entry: L_Sidearm.wav
+Entry: L_Scalpel.wav
+Entry: L_Flail2.wav
+Entry: L_Prom_R.wav
+Entry: L_Prom_S.wav
This is a complete sound entry that will use the default values for all entries but you probably want to change those. Every option listed here must come in the exact sequence they are listed here but you can omit an option and it will use a default value.
+Cycle type: This specified how the next entry of the various sound entries is selected. Possible values are
sequential and
random. These types do exactly what their names suggest. The first uses the sounds sequentially one after another and the second type selects a random sound entry every time the sound is played. The way the sequential mode works at the moment is that one sound entry only has a single global index counter so if two sources use the same sound effect then the first source will use sound 1, the second will use sound 2 and if source one wants to play the sound again it will use sound 3 of the list.
+Preload: Same as with the usual SCP syntax
+Volume: Specifies the volume of the sound but now this accepts a range of possible values from which a random value will be chosen every time the sound is played. The syntax is a list of floating point numbers like this:
+Volume: (0.4 0.6)
This will cause the sound to use 40% to 60% volume.
+3D Sound,
+Priority,
+Limit: Same as with the usual SCP syntax.
+Pitch: This is another new addition to the sound sets which lets you specify the pitch of the sound. This is also a random range like volume:
+Pitch: (0.5 2.0)
The values must be greater than zero and 1.0 will use the original sound without changing the pitch. What these values mean is quite technical so I would suggest trying different values and checking how they sound like.
Here is an example of a full sound set table:
#Game Sounds Start
$Name: TestSet
+Entry: L_Sidearm.wav
+Entry: L_Scalpel.wav
+Entry: L_Flail2.wav
+Entry: L_Prom_R.wav
+Entry: L_Prom_S.wav
+Cycle type: sequential
+Preload: False
+Volume: (0.4 0.6)
+3D Sound:
+Attenuation start: 50
+Attenuation end: 400
+Priority: Medium-Low
+Limit: 8
+Pitch: (0.5 2.0)
#Game Sounds End
Let me know if you find any bugs or if the existing behavior should be changed in any way. The current implementation and table syntax is not set in stone so if you have a suggestion for how this could be improved please let me know here.