Targetware: Customizing Sound Effects
Special Requirements for Gun Sounds
Gun sounds are a little different from other sound effects, because of the speed at which they must be repeated. Each gun must have it's own custom sound effect, or it will sound strange when fired. It is not hard to make custom gun sound effects, it is merely a question of matching the gun's Rate of Fire (ROF), as specified in its physics file, with the length of the sound clip.
The first thing you need to know when making a sound file for a gun is the Rate of Fire. To find it, locate the physics file for the gun. Most likely, this can be found in /mymod/data/planes/_guns/. Let's say, for example, we are going to make a new sound for the .50 caliber machine gun in the F4U-1. We look in the F4U-1's ACM file, and we learn that the gun file in question is "us_50cal_m2.acm". Find that file in the "data/planes/_guns/" directory, and open it with a text editor. The first few lines should look something like this:
|
|
type = gun
size = 0.1, 1.0, 0.1
ammo_mass = 131.7
mass = 30.75
rof = 800
diameter = 12.7
duration = 2
num_types = 8
|
The Rate of Fire can be found in the "rof = 800" line. Having confirmed the ROF, the next step is to find the proper sound clip length in seconds, by dividing 60 by the ROF. In this case, 0.075 seconds. This is how long your sound file should be for one round's worth of firing, from start to finish. If you have a sample prepared, and it's not long enough, you can simply add silence to the end of the sound, and it will sound acceptable in-game. If your sound sample is too long, you'll have to clip it, or use a different sample. If the length of your sound doesn't match the weapon's ROF, it will sound clipped, distorted, or otherwise imperfect.
|