Tools required: Winrfa, notepad and Audacity (link provided)
Difficulty level: intermediate
Estimated time: ~10 minutes
*This tutorial assumes you do not currently have custom objects in your map. just skip these parts of the tutorial if you have already got a custom object.
Download and install this: audacity-win-1.2.6.exe
It's a good, free, tiny wav/mp3 file editor and will spit out bf ready files with a few clicks.
Part 1
Extract you map rfa to a folder on your desktop
First up, if you haven't already; remember to add the 'run objects/objects' line to the bottom of your init.con
Next, in the same directory as your init.con, make a new folder called objects and another called sounds.
In the objects folder make a new txt file called objects.txt but rename the file extension to .con (objects.con)
Open run.con with notepad and add the following text to the first line:
Code: Select all
run mycustomsound/run
Stay in the objects folder and make a new folder called mycustomsound.
Within this new mycustomsound folder you need to make a few more new con files (like with the run.con above).
Make a new con file called objects.con then open it with notepad and paste in the following:
Code: Select all
ObjectTemplate.create simpleobject mycustomsound
ObjectTemplate.geometry nothing
ObjectTemplate.setHasCollisionPhysics 0
objectTemplate.loadSoundScript Sounds/mycustomsound.ssc
Make a new con file called geometries.con and then open it with notepad and paste in the following:
Code: Select all
GeometryTemplate.create StandardMesh nothing
GeometryTemplate.file nothing
Make a new con file called run.con and then open it with notepad and paste in the following:
Code: Select all
run objects
run geometries
now make a new folder within the mycustomsoundfolder called sounds.
Open this folder and make a new txt file called mycustomsound.txt but rename the file extension to ssc (mycustomsound.ssc)
Open this ssc file with note pad and paste in the following:
Code: Select all
newPatch
############
### Near ###
############
load sound/myaudio.wav
loop
minDistance 350
dopplerOff
randomStartPitch 0 / 0
Volume 1
priority 1
*** Distance Volume ***
beginEffect
controlDestination Volume
controlSource Distance
envelope Ramp
param 0
param 300
param 1
param -1
endEffect
Part 2
Now we have setup everything within battlefield to use the custom sound and its time to make our sound with Audacity.
Open Audacity and then either file/open the mp3 you want or just drag an mp3 into audacity
We need to make a couple of changes to the file format so it will be ready for bf1942
First we need to change the sample format to 16bit. So click on the myaudio drop down and change to 16bit as shown below:

Next we need to change the project rate to 22050khz. So click on the project rate box at the bottom and change this as shown below:

Now we need to convert the track from stereo to mono. So firstly split the stereo track as shown below:

you will see that it splits the file into two separate left and right channels:

Now click the myaudio dropdown for both channels and change them BOTH to mono as shown below:

Now your file is ready to be exported so just click File/Export as WAV.
You should see the following Warning.
Just click ok and then you should save the file in your sounds folder that we made at the beginning. (The sounds folder that is in the same main maps directory as your init.con)
Make sure you call the file myaudio.wav

Part 3
Now you just need to place the sound into your map.
The easiest way to do this is to place something else in the map (like a bush.. or something recognisable.)
Then you can either maually edit your staticobjects.con or edit it from within Battlecraft (by pressing F11 when you have the map open)
Find the bush you placed (should be the last thing in the file..) and rename it to 'mycustomsound'
Now when you load your map you should have some audio.
The audio will be located near to where you placed your object. You can then make adjustments to volume and the distance the sound wil be heard from its location in the mycustomsound.scc file.