1. Introduction[]
So, let's assume we know how to make objects in Fallout 2... weapons, in particular. To be honest, creating new weapons is not just making new graphics. At the least, it's that and its sounds. Of course, every aspect of the weapon should correspond to its particular sound (firing, reloading, etc.) This article describes how to accomplish that.
2. The practical part[]
What we need for this:
- acm2wav program (found in the files section of teamx.ru)
- regsnd program (found in the files section of teamx.ru)
- Any unpacked Dat files
- Any hex editor (WinHex, for example)
To start with a bit of theory: Let's talk about the most important sounds applicable to weapons in Fallout 2. These are two sounds for a single shot, two sounds for a burst and two sounds for reloading put together as a single set of sounds for a specific weapon (there are other sounds - for example, one for trying to fire with an empty magazine/clip). In one set of weapon sounds (6 parts - 2 single, 2 burst, and two reloading) there might be only one sound. Another thing is that one set of sounds might be used for several weapons. To specifically identify a set of sounds it is assigned a Sound ID. Also note that a specific set might be missing some sounds (burst-fire, reloading).
All sounds are found in "sound\sfx\
". The filename for a sound depends on its type (firing, reloading). The structure of the filename is:
The first two characters in the name indicate the type of sound:
WA - firing
WR - reloading
The third character indicates the Sound ID set of sounds used in the weapon's prototype (a sound identifier, representing it's number, which is recorded in the filename as an ASCII symbol). The game has already used values represented by the symbols '0-9', 'a-z', '!', '@', '#', '$'.
The fourth symbol depends on the type of sound. For weapons:
1 - single shot
2 - burst
For reloading either x or 1 can be used. We will 1 in the name as a standard.
Next in the name are three x's (xxx) in its sound number.
That's all in theory. Let's put it into practice. For example, we wanted to move some weapons from Fallout Tactics. We successfully created the necessary object with the correct graphics in Fallout 2 and now we have to transfer its sounds. Let's assume this weapon is the Spasm Neuro-Disruptor. Accordingly, we took the following files from Fallout Tactics:
- spasmreload.wav
- spasmsingle1.wav
- spasmsingle2.wav
- There is no burst fire mode
Let's agree that we decided to add a completely new set of sounds to Fallout 2 (with a new Sound ID).
Step 1[]
We take any Sound ID which is not already used in Fallout; for example, 0x25 (character '%').
Using SND2ACM we convert a WAV file to ACM format (for each file SND2ACM displays the number of samples (Input type: WAV "XXXXX" samples); remember this value). Next we rename them:
spasmsingle1.acm to wa%1xxx1.acm (WA because it's a single shot; Sound ID is %)
spasmsingle2.acm to wa%1xxx2.acm (WA because it's a single shot; Sound ID is %)
spasmreload.acm to wr%1xxx1.acm (WR because it's reloading; Sound ID is %)
Step 2[]
We put the created ACM files the appropriate folder (sound\sfx\). We also extract SNDLIST.LST from the dat files to there.
Now we need to register our files with the sounds in SNDLIST.LST
Every file here has the following structure:
Name of the ACM Block size of the unpacked data. Real size of the ACM file. Number (from step 2)
!!!Important!!! File descriptions in SNDLIST.LST must be sorted in ascending order. If you don't keep them in sequence sounds will not be played in the game!!!
So, given the previous considerations we start to record all three files. This can be done manually or automatically (recommended). For automatically registering all the files SNDLIST.LST the created ACM files need to be placed in the sound folder (sound\sfx\), and you also need the regsnd program (regsnd.exe). Now all that's needed is to run it. Everything is registered, and you can skip to Step 3. For the paranoid like me, consider the option of manually registering files. Let's look at an example.
We'll register the file wa%1xxx1.acm
Find where to record the file. Obviously, this is after WA$2XXX2.ACM and before WA01XXX1.ACM
Here's part of the file:
WA$2XXX1.ACM 69220 16661 1912 WA$2XXX2.ACM 67372 16324 1914 WA01XXX1.ACM 39988 8476 1916 WA01XXX2.ACM 36170 8051 1918
As a result of our insertions in the file we get:
WA$2XXX1.ACM 69220 16661 1912 WA$2XXX2.ACM 67372 16324 1914 wa%1xxx1.acm 64516 15988 1916 WA01XXX1.ACM 39988 8476 1916 WA01XXX2.ACM 36170 8051 1918
There are no blank lines in the file. Shown for illustration purposes only!
Let's consider the details!
- wa%1xxx1.acm - clearly, this is the file name.
- 15988 - this is the size of the ACM file (wa%1xxx1.acm).
- In order to get 64516 (size of the unpacked data in bytes) you must:
- To obtain the number for each file, multiply the number of samples by two (because 1 sample is 2 bytes). For wa%1xxx1.acm, there are 32258 samples, so the size of the data is 64516
- Next, note that since we inserted our files into the middle of SNDLIST.LST we have broken the numerical sequence (the last line). Now we need to fix it manually, namely to increase the number of each record that comes after the one we added in Step 2. I.e. our file becomes 1916, then next 1918 and so on.
- Finally, at the very beginning of SNDLIST.LST there is a number corresponding to the number of ACM files. For each new addition this number needs to increase. And now our file is registered. The same must be done with the remaining two files.
Step 3[]
Thus, all files have been prepared (present in the folder and defined). Now we should be able to get sounds attached to specific weapons. Open a Mapper from BIS and it will tell you... you will be quite wrong. The cause is that the mapper isn't able to see our newly created set of sounds. To be precise, it will not see the new name in the list. But it will see them all if we register the names by hand. To do so, open any hex-editor used to prototype weapons such as 00000011.pro
Change 0x79 to point to the SoundID of our weapon - 0x25 (i.e. '%' in hexadecimal notation).
That is all. The main problem in which sound files don't play is an error in hand-written files (wrong size or incorrect order (sorting)).