Author Topic: The sounds.tbl myth  (Read 2115 times)

0 Members and 1 Guest are viewing this topic.

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
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.
« Last Edit: April 06, 2002, 01:02:47 pm by 448 »
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline an0n

  • Banned again
  • 211
  • Emo Hunter
    • http://nodewar.penguinbomb.com/forum
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.
"I.....don't.....CARE!!!!!" ---- an0n
"an0n's right. He's crazy, an asshole, not to be trusted, rarely to be taken seriously, and never to be allowed near your mother. But, he's got a knack for being right. In the worst possible way he can find." ---- Yuppygoat
~-=~!@!~=-~ : Nodewar.com

 

Offline LtNarol

  • Biased Banshee
  • 211
    • http://www.3dap.com/hlp/hosted/the158th
thats quite an experiment there Sesquipedalian, very useful indeed

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
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. ;)
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
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?

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
THAT is true. The 41st shield icon won't show up in-game. :(
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline LtNarol

  • Biased Banshee
  • 211
    • http://www.3dap.com/hlp/hosted/the158th
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....

 

Offline delta_7890

  • Your Node Is Mine
  • 28
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).
~Delta

 

Offline LtNarol

  • Biased Banshee
  • 211
    • http://www.3dap.com/hlp/hosted/the158th
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

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
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.
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline Black Sheep

  • Wannabe Composer
  • 28
Hey...that are great news...thx for the info...:cool:
"Something is rotten in the state of Denmark"
-Hamlet rulez

 

Offline aldo_14

  • Gunnery Control
  • 213
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.

  

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
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:
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill