[GUIDE] Adding your own sound effects

The place to discuss scripting and game modifications for X³: Reunion.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13126
Joined: Sat, 9. Nov 02, 11:45
x4

[GUIDE] Adding your own sound effects

Post by Xenon_Slayer »

After my first day of modding stuff I have looked around at the sound files. In the 3.cat there is a folder called "s" which holds all the sound effects. They range from about 1 to 1200 with loads of gaps in between.

They are all listed in 4.cat as types/sounds. In this file they are all split up into pools of sounds.
The pools look like this:

// pool 000
0;6;
210;128;NULL;0;0;0;0;
50;100;NULL;0;0;0;0; // 1 SND_LED
180;155;NULL;0;0;0;0; // 2 SND_MSGDA
180;115;NULL;0;0;0;0; // 3 SND_REPAIRED
180;155;NULL;0;0;0;0; // 4 SND_DAMAGEMADE
180;100;NULL;0;0;0;0; // 5 SND_WORD

This is pool 000. These organise all sound files for 0001-0099.

"0;6;" Shows it is pool 000 and there are 6 entries.
"100;26;"Shows this is pool 100 and there are 26 entries.

Currently (1.2.1) there are pools ranging from 000 to 1200. There currently are no pools between 200-700. Im guessing these are free spaces for us.

Adding the sound effect
It seems the WAV files used by Egosoft are a bit different to the WAV files created by the "Sound recorder" in windows. You will need to splice one of your sounds over an existing egosoft sound.
Take the sound effect you want and make sure is is WAV format. There are many free programs to convert it from other formats. Extract one of the WAV files from the Egosoft folder.

Open the Egosoft file with the sound recorder and play the file to the end. Go to edit and select "Delete before current possiton". This will clear the file. Select Edit/insert file... and select your file.

Save the new WAV file with a new name for the moment. You will then need to add it to a slot in the Sound.txt file.

If we all use different mods then it shouldnt matter about clashes. Only if we want to run two of the same mods at the same time, there can be no clashes allowed.

Extract "types/sounds.pck" into a txt file. Open it and scroll down to the bottom of the 100 pool. Add the following lines.

// pool 200 my custom sounds
200;1;
150;225;SFX_AUTOFREE;0;0;0;0; // 200

If you want to add more than one sound change the line "200;1;". Remember, the final number in that line shows how many sounds are in this pool. So if you want 50 sounds in that pool you will need "200;50;".

Additional files will need to be listed like this...
150;225;SFX_AUTOFREE;0;0;0;0; // 200
150;225;SFX_AUTOFREE;0;0;0;0; // 201
150;225;SFX_AUTOFREE;0;0;0;0; // 202
e.t.c.

Rename that WAV file you created and call it 200.wav and add it to a mod under the folder s. Compress and add the sound.txt to the mod aswell under the folder types.
You should then have:
"s\200.WAV" and "types\Sounds.pck"

Currently the only way to hear the sound is to load up the script editor and use the audio command "Play sample <Var/num>".
Use it to play the sound 200 in your mod. It should come through nice and clear.

As for the other numbers such as "150;225;SFX_AUTOFREE;0;0;0;0; // 202" the official instructions are:

// priority;
// volume;
// flags;
// pitch variation range min; (percentage of one octave, 100=octave up, -100=octave down)
// pitch variation range max;
// volume variation; (percentage)
// min distance; (at what distance and how fast sound volume falls off)

Lets see what some of you can do with this :) .
Last edited by Xenon_Slayer on Wed, 7. Jun 06, 14:53, edited 1 time in total.
Come watch me on Twitch where I occasionally play several of the X games
Brodie
Posts: 760
Joined: Tue, 10. Feb 04, 00:10
x4

Post by Brodie »

:?: :?: :o :?: :?: I'm soooo out of my depth here

Fancy a go as converting the 2 sound files I have so I can send them to Cycrow to put into the script he has made for me??
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13126
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer »

How far did you get? Did you find a WAV file in the s folder? What did you do with it?
Come watch me on Twitch where I occasionally play several of the X games
Brodie
Posts: 760
Joined: Tue, 10. Feb 04, 00:10
x4

Post by Brodie »

I found the WAV files in the CAT03 S folder, but couldnt open them with Sound Recorder.
Even if I could overlay my sound file on top of the Station Rumble that would be great, but...alas...im clueless :o
Trigg004
Posts: 263
Joined: Sat, 18. Feb 06, 04:24
x3

Post by Trigg004 »

what sound recorder program you using?
Brodie
Posts: 760
Joined: Tue, 10. Feb 04, 00:10
x4

Post by Brodie »

I have a few:
- Microsoft Sound Recorder - A built in sound utility that comes with XP its in the Accesories/Enterainment folder
- MP3 Wav Converter
- Audacity
Trigg004
Posts: 263
Joined: Sat, 18. Feb 06, 04:24
x3

Post by Trigg004 »

I rather would help you instead of doing my own sounds because it takes forever with pitch and speed, and radio effect, etc. But Im not sure what format the X3 sounds use, you could try and find out what formet they use, errr...of course im still a noob on this forum, and im only doing this because Brad is smart and im not and hes helping me :P

But um...hmmmm, Im not sure if X3 uses Mp3 sounds or not, im not all into the X3 programming yet so im not sure what X3 has and what is does not have so yeah, this could take a few days or weeks to figure out it with some testing. hmmmmm...I use completely different Sound editors, paid for by Me at compu smart *STRAIGHT UP!* but errr...have u tried converting it to like a different format instead of MP3? :roll:

If you don't get my drift........ask me.

I have to delay my Military Comm Chatter, Its summer and i want to kinda enjoy it, so i can't get it done before summer, so maybe in summer or after :roll:

Anyway almost went off topic totaly so yeah....

Trigg

*EDIT*
I also used to use Audacity, i suggest Wavepad, i think it works a little better, but Audacity is easy to use :roll:

meh...
Brodie
Posts: 760
Joined: Tue, 10. Feb 04, 00:10
x4

Post by Brodie »

Cool thanks i'll give it a try

I've tried to use a few different formats: WAV, PCM and MP3....none work

Return to “X³: Reunion - Scripts and Modding”