Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: mobcdmoc3 on February 09, 2013, 04:19:58 pm

Title: Sound.tbl VS .tbm
Post by: mobcdmoc3 on February 09, 2013, 04:19:58 pm
Alright, so I finally got around to adding some weapons to my campaign. However, the sound effect that's supposed to play along with it doesn't work with the .tbm file I've attached below. I believe I've isolated the problem to the .tbm file, since I can force the sound to play using the play-sound-from-file SEXP. The weapon table that uses the sound works (minus the sound).

Code: [Select]
#Game Sounds Start
$Name: 192 sound.ogg, 0, 0.80, 1, 2000, 3000
$Name: 193 smallexplosion1.ogg, 0, 0.80, 1, 500, 1000

#Game Sounds End

I looked at other mods to see what they did - It looks like they just outright replace the .tbl file with their own. When I tried adding the above entry to the appropriate section in the copied sound.tbl, I ended up generating 270 errors. I feel like I'm just missing something here. :nervous: Would anybody care to help me out?
Title: Re: Sound.tbl VS .tbm
Post by: mjn.mixael on February 09, 2013, 04:34:21 pm
Sounds tbms are quite new, so most mods probably just haven't used it yet.

The hard part is that the tbm has a different format than the old sounds.tbl. With the TBM, your entry should look like this.

Code: [Select]
$Name: SOMESTRING1
    +Filename: sound.ogg
    +Preload: no
    +Volume: 0.80
    +3D Sound:
        +Attenuation start: 2000
        +Attenuation end: 3000

$Name: SOMESTRING2
    +Filename: smallexplosion1.ogg
    +Preload: no
    +Volume: 0.80
    +3D Sound:
        +Attenuation start: 500
        +Attenuation end: 1000

With a tbm, you don't need to specify a number/sound index, you can just name the sound as a string and call it elsewhere with that.

Additional information about the sounds.tbl and sounds.tbm can be found on the Wiki. (http://www.hard-light.net/wiki/index.php/Sounds.tbl) Hope that helps.
Title: Re: Sound.tbl VS .tbm
Post by: mobcdmoc3 on February 09, 2013, 05:05:33 pm
That worked like a charm. Much thanks! :D