Page 1 of 1

Adding a custom sound object to a Battlefield 1942 map

Posted: Mon Apr 04, 2011 12:35 pm
by fo0k
How to add custom sounds to battlefield 1942.

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
Save and close the file

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
Save and close the file

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
Save and close the file

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
Save and close the file



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
Save and close the file.


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:

Image


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:

Image


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

Image


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

Image


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

Image


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

Image



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.

Re: Adding a custom sound object to a Battlefield 1942 map

Posted: Thu Apr 21, 2011 4:16 pm
by Swaffy
Thankies.

I'll try it out.

Re: Adding a custom sound object to a Battlefield 1942 map

Posted: Sat Jul 09, 2016 9:15 pm
by iamsausage
I know this is old, but right away in Part 1 there's an unexplained instruction. The last line in Part one says "Open run.con with notepad and add the following text to the first line:" ... but it doesn't say where to find this file. Do you create it? If so, that instruction is missing.

Re: Adding a custom sound object to a Battlefield 1942 map

Posted: Sat Aug 20, 2016 8:53 am
by freddy
fo0k wrote:
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
Save and close the file

Re: Adding a custom sound object to a Battlefield 1942 map

Posted: Sat Aug 20, 2016 11:41 am
by fo0k
I almost replied to this but realised I have forgotten everything.

Re: Adding a custom sound object to a Battlefield 1942 map

Posted: Mon Sep 05, 2016 8:09 pm
by freddy
Ah yes, about the same here :) Right now im searching after an thread i wrote about collisions lol.

Re: Adding a custom sound object to a Battlefield 1942 map

Posted: Tue Nov 01, 2016 5:41 am
by Anthony817
freddy wrote:Ah yes, about the same here :) Right now im searching after an thread i wrote about collisions lol.
Hey, I tried to make a post about a BF2 mod I am making about the Korean war. Battlefield: Korea.

http://www.moddb.com/mods/battlefield-korea

It was never approved. I have no idea why...

Korean war uses a LOT of WW2 and WW1 equipment, as well as has choppers and jets. Korea was also a stalemate like WW1 and had a LOT of trenches. If you guys could PLEASE authorize my post it would mean so much to us.

Thanks, Anthony817

Re: Adding a custom sound object to a Battlefield 1942 map

Posted: Tue Dec 20, 2016 4:54 am
by GoodDayToDie!!
I can only imagine how yall feel!!

I am but a modest mapper that hasn't made a map in a year!
And here I am struggling to set up ED42!!

Long Live BF42!!


Cheers,