Page 1 of 2

Mini-Tut on How to Add Custom Sounds to SWBF II Maps (FAQ)

Posted: Tue Jul 18, 2006 9:04 pm
by PR-0927
Anyways, before you read my tutorial, make sure you have read Rends' tutorial about adding sound. You need to have an understanding of how to add sound before adding custom .wav files.

Anyways, here is what you do:
*You can skip steps 1-7 if you have the Fixed and improved munge files installed*

1. Go to BF2_ModTools\data and open up soundmungedir.bat (right-click and choose Edit).

2. Find this line:

Code: Select all

@for /R %%A in (*.sfx) do @echo Munging %%~nA%%~xA & @soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ %CHECKDATE% -resample %CHECKID% noabort %SOUNDOPT% %BANKOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
3. Under that line, post this:

Code: Select all

@for /R %%A in (*.asfx) do @echo Munging %%~nA%%~xA & @soundflmunge -platform %4 -banklistinput %%A -bankoutput %MUNGEDIR%\ %CHECKDATE% -resample -checkid noabort %SOUNDOPT% 2>>%MUNGE_LOG% 1>>%SOUNDLOGOUT%
4. Save the file, and repeat the step for the file in your map folders (BF2_ModTools\data_MODID) as well, if you have made any before making the change in BF2_ModTools\data. Make sure you save any changed files.

5. Now, go to BF2_ModTools\data\_BUILD\Sound and edit the munge.bat file. Find this line:

Code: Select all

@for /R %%A in (*.sfx) do @set BANKLIST=!BANKLIST! %%A
6. Under it, paste this:

Code: Select all

@for /R %%A in (*.asfx) do @set BANKLIST=!BANKLIST! %%A
7. Make sure you save any changed files.

8. Now, go to BF2_ModTools\data_MODID\Sound\worlds\MODID\effects and put your .wav file(s) in it. The file(s) has/have to be in 352 kbps, 16 bit, mono, 22 kHz PCM mode.

9. Make a .asfx file with your MODID as the title. Put your files being referenced in it like so:

Code: Select all

effects\dc17_rifle.wav    -resample xbox 22050 pc 22050
10. Get a .snd file. Copy one from other sound folders and rename to whatever you would like. Mine is called swrcweapons.snd. In it (I will not teach you how to put stuff in it), mine says this for that above .wav:

Code: Select all

SoundProperties()
{
    Name("rifledc17");
    Group("weapons");
    Inherit("weapon_template");
    SampleList()
    {
        Sample("dc17_rifle", 1.0);
    }
}
11. In your MODIDgcw.req/MODIDcw.req for sound, list the name of your .asfx file under the "bnk" section. List the name of your .snd file under the "config" part.

12. Test the map, and make sure you reference the name of the sound in the weapon ODF or whatever. In my ODF file, look above, I used the "rifledc17" part as my fire sound for the weapon.


ENJOY!!

- Majin Revan

RE: Mini-Tutorial on How to Add Custom Sounds to SWBF II Map

Posted: Tue Jul 18, 2006 9:09 pm
by PR-0927
URGENT: Psych0fred posts this, because we are trying to see if my mehtod breaks other people's (and shipped) maps:
1) do your sound changes affect shipped lvls and mods using shipped sounds as is; and 2) if someone else has made sound changes do your sound changes break theirs if your map appears above or below theirs in the addon folder

That is what might go wrong. I suggest NOT making these changes until I give the go ahead.

- Majin Revan

Edit- Go ahead.

:)

- Majin Revan

Posted: Tue Jul 18, 2006 9:39 pm
by Vyse
It'd be great if you can getting it working. Then we can finally use a .mus and maybe get new spawn/death sounds from SWBF2! :D If were still limited to the effects and soundstreams I'll probably just use BFBuilder still.

Although the whole killing a whole map is verrry scary! :o

Is it working out that well have to edit each munge for every map we make.. or is there going to be some kind of new Vmunge like Pyscho Fred BFBuilder Pro?

Good Luck guys! :)

Posted: Tue Jul 18, 2006 9:51 pm
by PR-0927
Well, I am doing a test to see if the other maps are affected. Nothing else was so far. So far, half of the testing is complete, which is a 50% go-ahead to my tutorial. If the second half of the testing yields changes in other maps though, this method of adding custom .wavs is going to need some MAJOR changes.

EDIT
GOOD NEWS EVERYONE!! The tutorial is a go-ahead.

NO KNOWN PROBLEMS ARE CAUSED BY USING THIS METHOD.

Posted: Tue Jul 18, 2006 10:04 pm
by Vyse
BTW I've had my .wav's at 44mhz if you want better quality ;) (don't know if ya can tell the difference)

Posted: Wed Jul 19, 2006 12:34 am
by Karnage
8. Now, go to BF2_ModTools\data_MODID\Sound\worlds\MODID\effects and put your .wav file(s) in it. The file(s) has/have to be in 352 kbps, 16 bit, mono, 22 kHz PCM mode.
Im having trouble finding the MODID, NEW in my case, in that folder. Where is it?

Do I have to munge anything before the folder appears or what?

Posted: Wed Jul 19, 2006 12:35 am
by xwingguy
....MODID is the NEW

Posted: Wed Jul 19, 2006 12:36 am
by Karnage
Yes I know that much. But it's not in that folder, unless I have to create a folder myself.

Posted: Wed Jul 19, 2006 3:23 am
by maxloef
munging the gunship beam sounds now :D

do you still have to copy the sound LVl from the lvl ffolder to your addon folder??

EDIT: WORKED on the first try :P although the sound was a low volume :P

acurate sounds here i come :D

Posted: Wed Jul 19, 2006 5:46 am
by Karnage
Can someone help me here? The MODID folder, NEW, is not in the BF2_ModTools/data_NEW/Sound/worlds folder.

Posted: Wed Jul 19, 2006 11:25 am
by PR-0927
I'm sorry, Karnage, I just saw your question now. You must make a folder forit. I suggest copying that test folder or whatever and renaming it to yours.

Good to know it worked for you, maxloef. Yes, you do still have to manually copy that folder. And yes, I put that sound in my maps too, and yes, it was a bit quiet, but that is the fault of the .wav. Try increasing its volume using Sound Recorder, or something. Tell me if you have new sound files which are better than what you sent me yesterday. Today, later, we can talk again about accurate sounds and maybe you could send me some.

;)


- Majin Revan

Posted: Wed Jul 19, 2006 12:11 pm
by Leviathan
Off-topic : I am sufficiently glad to learn that one GameToast member has successfully got newly-imported Microsoft® WAVE files to work through a LucasArts® video-game like Star Wars Battlefront II, and since I assume the Instructions and Advices you have shared so far with GameToast members interested in learning how to aggregate their own Sound Files into this Entertainment Software could help many more persons, I prefer putting the current thread into a Sticky, in order to make sure that your Findings will be recognized and appreciated by a consequent Amount of Registered Users...

Posted: Wed Jul 19, 2006 12:13 pm
by Karnage
How do you change the background music, or do you know how to do that yet?

Posted: Wed Jul 19, 2006 12:29 pm
by Teancum
*UN-Stickied* --- Added to the FAQ (MISC section)

Posted: Wed Jul 19, 2006 4:43 pm
by Vyse
Karnage wrote:How do you change the background music, or do you know how to do that yet?
Use a .mus and reference it in your LUA (Check out how shipped worlds did it)

Posted: Wed Jul 19, 2006 10:33 pm
by Alpha
How do you check how the shipped worlds did it? I can't find LUA's for them.

edit: Nevermind


is this what you';re talking about in the LUA, Vyse?

OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")

Posted: Wed Jul 19, 2006 11:08 pm
by Vyse
Ya, that looks like the line. I've only done the .mus in BF1 in BF2 with the whole global.lvl thing looks like you have to have a seperate global folder in your sound folder.

Posted: Thu Jul 20, 2006 2:00 am
by Karnage
Vyse could you give a quick tutorial on how to add custom music because I have looked through the shipped world folders and the .mus and .st4 files and can't figure it out.

Posted: Thu Jul 20, 2006 6:20 pm
by Vyse
Well, don't know how to do it for BF2 but you reference the .mus in you .req for the era your doing. In the .mus is somthing like

Music()
{
Name("rep_cor_amb_start");
Priority(1.0);
FadeInTime(0.0);
FadeOutTime(1.5);
MinPlaybackTime(20.0);
MaxPlaybackTime(180.0);
MinInactiveTime(15.0);
SoundStream("rep_cor_amb_start");
}

The "rep_cor_amb_start" is reference the name you put under the music section of the LUA that looks like below. and the other part is referenceing the actual stream. .Mus work off of when your ticket (unit count) reaches a certain number, it switch different music.

SetAmbientMusic(ALL, 1.0, "all_tat_amb_start", 0,1)

Don't for get to readatafile your dc sound lvl

Example:

ReadDataFile("dc:sound\\hyrule.lvl;hyrulegcw")

hyrule.lvl being the mod id of your map and hyrulegcw is the .req in your sound fodler that references your .mus

and put this for the name of the .mus under the open streams part

OpenAudioStream("sound\\global.lvl", "your .mus name here")

Once again I have no clue what to do about the global.lvl. .Mus where loaded directly in BF1 not with a global.lvl....? :?

Posted: Thu Jul 20, 2006 6:52 pm
by Karnage
Thanks i'll try that out.