Sound refuses to work.

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Sound refuses to work.

Post by bobfinkl »

Ok, well I recently decided I had to add sound to my map, so I downloaded everything i needed followed Mav's adding custom sound tut (the old one that's supposed to use the bf1 modtools), and I end up with the sound refusing to work. I have my files in .wav format (352 Kbps, 16 bit, mono, PCM) in my renamed efx folder (downloaded the version Mav put up and renamed to kam since it wouldn't munge EFX), I have the fixed .bats for munging sound.

Here is my lua:
Hidden/Spoiler:
ReadDataFile("dc:sound\\kam.lvl;kamcw")
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_inf_ep3_marine",
"uta_fly_ride_gunship")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_ep2_rifleman",
"cis_inf_ep2_rocketeer",
"cis_inf_ep2_engineer",
"cis_inf_ep2_sniper",
"cis_inf_ep2_officer",
"cis_inf_ep2_jettrooper",
"cis_inf_ep2_pilot",
"cis_hover_aat",
"imp_fly_tieinterceptor")


ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_chaingun_tripod")

SetupTeams{
rep = {
team = REP,
units = 64,
reinforcements = -1,
soldier = { "rep_inf_ep3_rifleman",5, 55},
assault = { "rep_inf_ep3_rocketeer",1, 10},
engineer = { "rep_inf_ep3_engineer",1, 10},
sniper = { "rep_inf_ep3_sniper",1, 10},
officer = {"rep_inf_ep3_officer",1, 10},
special = { "rep_inf_ep3_jettrooper",1, 10},

},
cis = {
team = CIS,
units = 82,
reinforcements = -1,
soldier = { "cis_inf_ep2_rifleman",9, 55},
assault = { "cis_inf_ep2_rocketeer",1, 20},
engineer = { "cis_inf_ep2_engineer",1, 20},
sniper = { "cis_inf_ep2_sniper",1, 20},
officer = {"cis_inf_ep2_officer",1, 20},
special = { "cis_inf_ep2_jettrooper",1, 10},
}
}

SetHeroClass(CIS, "")
SetHeroClass(REP, "")

AddUnitClass(CIS, "cis_inf_ep2_pilot",3, 8)

SetTeamName(3, "cis")
AddUnitClass(3, "cis_inf_ep2_rifleman",20, 20)
AddUnitClass(3, "cis_inf_ep2_rocketeer",10, 10)
AddUnitClass(3, "cis_inf_ep2_officer",10, 10)
AddUnitClass(3, "cis_inf_ep2_engineer",10, 10)
SetUnitCount(3, 50)
SetReinforcementCount(3, -1)

SetTeamAsFriend(CIS, 3)
SetTeamAsFriend(3, CIS)
SetTeamAsEnemy(3, REP)
SetTeamAsEnemy(REP, 3)
ClearAIGoals(3)
AddAIGoal(3, "Deathmatch", 150)
AddAIGoal(3, "Conquest", 100)


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 52)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:CGW\\CFW.lvl", "CFW_conquest")
ReadDataFile("dc:CGW\\CFW.lvl", "CFW_conquest")
SetDenseEnvironment("false")




-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("dc:sound\\kam.lvl", "kamcw_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")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 0)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 0)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 0)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 0)

SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_kam_amb_start", 0,1);
SetAmbientMusic(REP, 0.99, "rep_kam_amb_middle", 1,1);
SetAmbientMusic(REP, 0.1,"rep_kam_amb_end", 2,1);
SetAmbientMusic(CIS, 1.0, "cis_kam_amb_start", 0,1);
SetAmbientMusic(CIS, 0.99, "cis_kam_amb_middle", 1,1);
SetAmbientMusic(CIS, 0.1,"cis_kam_amb_end", 2,1);

SetVictoryMusic(REP, "rep_kam_amb_victory")
SetDefeatMusic (REP, "all_tat_amb_defeat")
SetVictoryMusic(cIS, "cis_kam_amb_victory")
SetDefeatMusic (CIS, "imp_tat_amb_defeat")
My kam.req:
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"
"kamcw_music"
}
REQN
{
"lvl"
"kamcw"
}

}
My kamcw.req:
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
}

REQN
{
"config"
"kamcw_music_config"
"kamcw_music"
}
}
My kamcw_music_config.snd:
Hidden/Spoiler:
// ----- Republic Music -----

SoundStream()
{
Name("rep_kam_amb_start");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music"); //.stm file
SegmentList()
{
Segment("rep_kam_amb_start", 1.0);
}
}

SoundStream()
{
Name("rep_kam_amb_middle");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
CyclePlayback(1);
Stream("efxcw_music");
SegmentList()
{
Segment("rep_kam_amb_middle", 0.5);
Segment("rep_kam_amb_middle02", 0.5);
}
}

SoundStream()
{
Name("rep_kam_amb_end");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("rep_kam_amb_end", 1.0);
}
}

SoundStream()
{
Name("rep_kam_amb_victory");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("rep_kam_amb_victory", 1.0);
}
}



//----- CIS Music -----

SoundStream()
{
Name("cis_kam_amb_start");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("cis_kam_amb_start", 1.0);
}
}

SoundStream()
{
Name("cis_kam_amb_middle");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
CyclePlayback(1);
Stream("efxcw_music");
SegmentList()
{
Segment("cis_kam_amb_middle", 0.5);
Segment("cis_kam_amb_middle02", 0.5);
}
}

SoundStream()
{
Name("cis_kam_amb_end");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("cis_kam_amb_end", 1.0);
}
}

SoundStream()
{
Name("cis_kam_amb_victory");
Pitch(1.0);
PitchDev(0.0);
Gain(1.0);
GainDev(0.0);
ReverbGain(0.0);
Bus("ingamemusic");
Looping(0);
Pan(0.0);
Mode3D(0);
Stream("efxcw_music");
SegmentList()
{
Segment("cis_kam_amb_victory", 1.0);
}
}
The kamcw_music.mus file:
Hidden/Spoiler:
// ----- Republic Music -----

Music()
{
Name("rep_kam_amb_start");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(2.0);
SoundStream("rep_kam_amb_start");
}

Music()
{
Name("rep_kam_amb_middle");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(5.0);
SoundStream("rep_kam_amb_middle");
}

Music()
{
Name("rep_kam_amb_end");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(5.0);
SoundStream("rep_kam_amb_end");
}

Music()
{
Name("rep_kam_amb_victory");
Priority(1.0);
FadeInTime(0.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(5.0);
SoundStream("rep_kam_amb_victory");
}




// ----- CIS Music -----

Music()
{
Name("cis_kam_amb_start");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("cis_kam_amb_start");
}

Music()
{
Name("cis_kam_amb_middle");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("cis_kam_amb_middle");
}

Music()
{
Name("cis_kam_amb_end");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("cis_kam_amb_end");
}

Music()
{
Name("cis_kam_amb_victory");
Priority(1.0);
FadeInTime(0.0);
FadeOutTime(1.0);
MinPlaybackTime(5.0);
MinInactiveTime(5.0);
SoundStream("cis_kam_amb_victory");
}
And lastly my kamcw_music.stm file:
Hidden/Spoiler:
// ----- Ambient Bleed Music ----------
Streams\music1.wav cis_kam_amb_start
Streams\music2.wav cis_kam_amb_middle
Streams\music2.wav cis_kam_amb_middle02
Streams\music3.wav cis_kam_amb_end
Streams\music1.wav rep_kam_amb_start
Streams\music2.wav rep_kam_amb_middle
Streams\music2.wav rep_kam_amb_middle02
Streams\music3.wav rep_kam_amb_end
// ----- Ambient Vehicle Music ----------
//..\nab\Streams\cis_nab1_amb_veh01.wav cis_kam_amb_veh01
//..\nab\Streams\cis_nab1_amb_veh02.wav cis_kam_amb_veh02
//..\nab\Streams\cis_nab1_amb_veh03.wav cis_kam_amb_veh03
//..\nab\Streams\rep_nab1_amb_veh01.wav rep_kam_amb_veh01
//..\nab\Streams\rep_nab1_amb_veh02.wav rep_kam_amb_veh02
//..\nab\Streams\rep_nab1_amb_veh03.wav rep_kam_amb_veh03
// ----- Win Lose Music ----------
Streams\victory.wav rep_kam_amb_victory
Streams\victory.wav cis_kam_amb_victory
My error log has no errors that weren't in there before I tried to add sound.

Thanks for any help.
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Re: Sound refuses to work.

Post by Commander_Fett »

Did you use the swb1 or BF2 modtools for the sound? If you used bf2, did youmake sure to edit the 3 .bat files you need to change before munging it?
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Re: Sound refuses to work.

Post by bobfinkl »

Bf2, and yes I have all 3 files and everything named ABC was changed to CGW (my mods 3 letters).
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Sound refuses to work.

Post by Maveritchell »

What's the size of your sound .lvl file?
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Re: Sound refuses to work.

Post by bobfinkl »

It's 3.7 mb.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Sound refuses to work.

Post by Maveritchell »

And is your main music .req file the same name as the map folder it's munging in (i.e. is your map in data_KAM)? Make the main .req file = three-letter name of your map.
User avatar
bobfinkl
Rebel Colonel
Rebel Colonel
Posts: 593
Joined: Sun Jul 13, 2008 9:01 am
Projects :: Lots of unreleased stuff
Games I'm Playing :: Life
xbox live or psn: No gamertag set
Location: The quaint little city gametoast.

Re: Sound refuses to work.

Post by bobfinkl »

No, It wouldn't munge it when I named it the 3 letter name of my map, I'll go check the .bats and make sure they are munging CGW (3 letter name of my map) and try that again though.

EDIT: I've tried to search for ABC in the .bat's didn't find anything, but I tried munging again and it said it couldn't find the ABC folder.

EDIT2: It turns out that pressing ctrl+f then searching ABC didn't get everything, I managed to get rid of the mungelog error, but got another one and a new error in my error log:
Hidden/Spoiler:
Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #1 to `SetVictoryMusic' (number expected, got nil)
stack traceback:
[C]: in function `SetVictoryMusic'
(none): in function `ScriptInit'
Could it be since I'm using the same piece of music 2 times each, because my munge log seems to refer to that.
Hidden/Spoiler:
soundflmunge.exe : Warning : Files line 2 and 6 reference the same source file Streams\music1.wav. cis_kam_amb_start will alias rep_kam_amb_start
- while munging C:\BF2_ModTools\data_CGW\Sound\worlds\CGW\kamcw_music.stm
soundflmunge.exe : Warning : Files line 3 and 4 reference the same source file Streams\music2.wav. cis_kam_amb_middle will alias cis_kam_amb_middle02
- while munging C:\BF2_ModTools\data_CGW\Sound\worlds\CGW\kamcw_music.stm
soundflmunge.exe : Warning : Files line 3 and 7 reference the same source file Streams\music2.wav. cis_kam_amb_middle will alias rep_kam_amb_middle
- while munging C:\BF2_ModTools\data_CGW\Sound\worlds\CGW\kamcw_music.stm
soundflmunge.exe : Warning : Files line 3 and 8 reference the same source file Streams\music2.wav. cis_kam_amb_middle will alias rep_kam_amb_middle02
- while munging C:\BF2_ModTools\data_CGW\Sound\worlds\CGW\kamcw_music.stm
soundflmunge.exe : Warning : Files line 5 and 9 reference the same source file Streams\music3.wav. cis_kam_amb_end will alias rep_kam_amb_end
- while munging C:\BF2_ModTools\data_CGW\Sound\worlds\CGW\kamcw_music.stm
soundflmunge.exe : Warning : Files line 18 and 19 reference the same source file Streams\victory.wav. rep_kam_amb_victory will alias cis_kam_amb_victory
- while munging C:\BF2_ModTools\data_CGW\Sound\worlds\CGW\kamcw_music.stm
Post Reply