Prepare your music files: You will need four music files (unless you're doing an assault-type map, in which case you only need two). These music files need to be formatted as .wav files - traditionally in 352 kbps, 16 bit, mono, 22 kHz PCM mode, but this is not required.
They need to be called "Music1.wav" (this is your "beginning ambient track, or your entire mix if you're doing an assault map), "Music2.wav" (this is your "middle" ambient track - unnecessary if you're doing an assault map), "Music3.wav" (this is your "end" ambient track - unnecessary if you're doing an assault map), and "victory.wav" (this is your "victory" track - plays on mission accomplished).
Note that if you're doing an assault map (and as such only have one track - which you will, because assault maps only read one ambient music file per side) when you finish Step 3, before you munge, you need to do the following:
Open the "efxcw_music.stm" file. Edit every reference to "Music2" and "Music3" to "Music1." That'll make sure the munge doesn't try and compile files that don't exist.
Set up the map:
1) Download the BF1 Modtools. I can't make custom ambient music munge in the BF2 tools, even with the fixed munge.bat and soundmungedir.bat (+etc.).
2) Create a new world. For the purpose of this tutorial we'll call it "EFX"
3) Go to the newly munged "EFX" folder, continue to the "Sound" folder and then into the "worlds" folder. (C:\Lucasarts\BFBuilder\DataEFX\Sound\worlds). Place the "EFX" folder that you can download at the end of this tut in there (overwriting previous files).
4) Munge the world (in BFBuilder) and leave it alone for now.
5) Now open up the .lua file of the BF2 map you want to edit. Find where the .lua says:
Code: Select all
ReadDataFile("sound\\tat.lvl;tat2gcw")
Code: Select all
ReadDataFile("dc:sound\\efx.lvl;efxcw")
Code: Select all
OpenAudioStream("sound\\global.lvl", "gcw_music")
Code: Select all
OpenAudioStream("dc:sound\\efx.lvl", "efxcw_music")
Code: Select all
SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)
Code: Select all
SetAmbientMusic(ALL, 1.0, "rep_kam_amb_start", 0,1);
SetAmbientMusic(ALL, 0.99, "rep_kam_amb_middle", 1,1);
SetAmbientMusic(ALL, 0.1,"rep_kam_amb_end", 2,1);
SetAmbientMusic(IMP, 1.0, "cis_kam_amb_start", 0,1);
SetAmbientMusic(IMP, 0.99, "cis_kam_amb_middle", 1,1);
SetAmbientMusic(IMP, 0.1,"cis_kam_amb_end", 2,1);
SetVictoryMusic(ALL, "rep_kam_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "cis_kam_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")
Code: Select all
SetAmbientMusic(ALL, 1.0, "rep_kam_amb_start", 0,1);
--SetAmbientMusic(ALL, 0.99, "rep_kam_amb_middle", 1,1);
--SetAmbientMusic(ALL, 0.1,"rep_kam_amb_end", 2,1);
SetAmbientMusic(IMP, 1.0, "cis_kam_amb_start", 0,1);
--SetAmbientMusic(IMP, 0.99, "cis_kam_amb_middle", 1,1);
--SetAmbientMusic(IMP, 0.1,"cis_kam_amb_end", 2,1);
SetVictoryMusic(ALL, "rep_kam_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "cis_kam_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")
9) Go back to the BFBuilder folder. Go to its "AddOn" directory. Go to "AddOn\EFX\Data\_lvl_pc\sound" and copy the efx.lvl you find in there.
10) Go to your "C:\Program Files\LucasArts\Star Wars Battlefront II\GameData\addon" folder (BF2 addons) and open your mapname (MODID) folder. Continue to "Star Wars Battlefront II\GameData\addon\MODID\data\_LVL_PC". Create a "sound" folder. In that folder, paste the efx.lvl you copied earlier.
11) Run your map (no further munging necessary).
---
Important! Download the following file, it contains the "EFX" folder you need for this tut:
MediaFire