Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Sesquipedalian on April 06, 2002, 01:00:02 pm

Title: The sounds.tbl myth
Post by: Sesquipedalian on April 06, 2002, 01:00:02 pm
Anyone who has ever found a need to hack their sounds.tbl will recognise this:

Code: [Select]
;                     I M P O R T A N T
;  **********************************************************
;  *                                                        *
;  ====>  DO NOT MODIFY THE ORDER OF THE LISTED SOUNDS <====*
;  *                                                        *
;  **********************************************************
;                     I M P O R T A N T
;
;  If a sound entry appears in this file, there is a hook into the game to
;  play the sound.  This file can only be modified to change *existing* sounds.
;  Talk to a programmer if you want to add brand new sounds.  Adding a line to
;  this file will not make your sound appear in the game, it will more than
;  likely break something.


Today I discovered that this is not exactly true.  

Until today, my tried and true method of adding sounds to the game was to use one of the 10 empty slots marked as 162 through 172 in the #Game Sounds section.  This worked fine, with no problems.  But I got curious this morning...

The last sound in the standard sounds.tbl for the #Game Sounds section is number 191.  So I put in a new line, marked as number 192, referenced to a custom sound file in data\sounds\8b22k.  Then, on a beam weapon I have made up, I set its warmup sound to 192 in its weapons.tbl entry.  When the beam fired in mission, it played the custom sound.

So basically, one can add sounds to the table, so long as the new sounds are referenced by another table such as weapons.tbl or ships.tbl.  For example, one can set custom engine sounds for ships in the ships.tbl, and custom weapons sounds in the weapons.tbl as I have done.

Many of the sounds in the table are not referenced in another table, so I'm guessing the information regarding their use is hardcoded and can't be messed with like this.  Therefore, one should not change the order of sounds already in the table; one can only add new ones.
Title: The sounds.tbl myth
Post by: an0n on April 06, 2002, 01:16:48 pm
I bet you used to stick forks in sockets as a kid just to see if your mom was telling the truth.

It might be that you can add a few but too many will kill everything. They allow some extra space to make sure that they could add one or two things if something came up late in production.
Title: The sounds.tbl myth
Post by: LtNarol on April 06, 2002, 01:24:41 pm
thats quite an experiment there Sesquipedalian, very useful indeed
Title: The sounds.tbl myth
Post by: Sesquipedalian on April 06, 2002, 02:05:40 pm
Quote
Originally posted by an0n
I bet you used to stick forks in sockets as a kid just to see if your mom was telling the truth.

It might be that you can add a few but too many will kill everything. They allow some extra space to make sure that they could add one or two things if something came up late in production.


Nope, I listened to her.  But in this case, it was just a few characters in a text file, which meant that if it didn't work, fixing it would just be a matter of deleting them and launching Freespace again.  That's the beauty of table files: one can do just about anything to them without a permanent effect. :D

I haven't looked for a limit yet. I only discovered this a few hours ago. ;)
Title: The sounds.tbl myth
Post by: CP5670 on April 06, 2002, 04:23:33 pm
Hey, that's pretty neat. There are probably enough empty slots in the file for new additions, but it's nice to know that new sounds can be added in as well. ;)

I remember someone complaining about the limit in the hud.tbl file; is this limit another false description or a true limit?
Title: The sounds.tbl myth
Post by: Galemp on April 06, 2002, 04:37:18 pm
THAT is true. The 41st shield icon won't show up in-game. :(
Title: The sounds.tbl myth
Post by: LtNarol on April 06, 2002, 04:40:15 pm
Quote
Originally posted by GalacticEmperor
THAT is true. The 41st shield icon won't show up in-game. :(
*curses* not enough shield icons for my fighters....
Title: The sounds.tbl myth
Post by: delta_7890 on April 06, 2002, 05:11:00 pm
Wouldn't it just be better for campaigns that use 40+ shield icon-carrying ships to use a standard shield icon for all ships?  I never saw the purpose of each ship having its own icon anyways (other than that it looks cool).
Title: The sounds.tbl myth
Post by: LtNarol on April 06, 2002, 05:27:33 pm
Quote
Originally posted by delta_7890
Wouldn't it just be better for campaigns that use 40+ shield icon-carrying ships to use a standard shield icon for all ships?  I never saw the purpose of each ship having its own icon anyways (other than that it looks cool).
it looks cool, thats the whole point, and it makes it easier to identify what you have targeted
Title: The sounds.tbl myth
Post by: mikhael on April 06, 2002, 11:34:45 pm
Quote
Originally posted by an0n
I bet you used to stick forks in sockets as a kid just to see if your mom was telling the truth.


Mom never said anything about forks and sockets. I did stick a hair pin in an outlet and bite down on it when I was four. And when I was five. And six. um... and eight.

I  have no idea. Its probably better if you just don't ask.
Title: The sounds.tbl myth
Post by: Black Sheep on April 07, 2002, 04:53:00 am
Hey...that are great news...thx for the info...:cool:
Title: The sounds.tbl myth
Post by: aldo_14 on April 09, 2002, 03:41:08 am
Quote
Originally posted by an0n
I bet you used to stick forks in sockets as a kid just to see if your mom was telling the truth.

It might be that you can add a few but too many will kill everything. They allow some extra space to make sure that they could add one or two things if something came up late in production.


they'll probably be some space leftover.... Fs2 was written in C, and IIRC all memory needs to be allocated by the programmer directly - so some leeway will have been made, for the same reasons as ships.tbl can be larger than the one :V: made.

Probably the limits on HUD.tbl are already known, hence the docs.

I'd imagine 200 sounds would be supported - that seems a nice round number.
Title: The sounds.tbl myth
Post by: Sandwich on April 16, 2002, 04:55:37 pm
Quote
Originally posted by aldo_14
I'd imagine 200 sounds would be supported - that seems a nice round number.


Silly person - look at what you're alking about! Programming and computer limits! 200 ain't a round computer number by any standards!

More like 256. :D :lol: