Custom sound effects not working [Solved]

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
Bucman55
Private
Posts: 37
Joined: Tue Jan 09, 2018 7:01 pm
Projects :: Playable Campaign Factions
Games I'm Playing :: Star Wars games
xbox live or psn: PSN: BucMan55
Location: Texas

Custom sound effects not working [Solved]

Post by Bucman55 »

I've been trying to get some custom sound effects onto the vanilla Naboo map but I can't seem to get them to work. I've looked at these tutorials ( http://www.gametoast.com/viewtopic.php?f=27&t=4750 / http://www.gametoast.com/viewtopic.php?f=27&t=6166 ) but they haven't really helped much. Could someone tell me what I'm doing wrong? All of my wav files are 352kbps.

REQ File:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"str"
"align=2048"
"pcf"

}
REQN
{
"lvl"
"pcfgcw"
"pcfcw"
}
}[/code]
ASFX File:
Hidden/Spoiler:
[code]effects\wpn_all_a280_blaster_fire.wav -resample xbox 22050 pc 22050
effects\wpn_all_elg3a_fire.wav -resample xbox 22050 pc 22050
effects\wpn_imp_dlt20a_fire.wav -resample xbox 22050 pc 22050
effects\wpn_imp_se14c_fire.wav -resample xbox 22050 pc 22050
effects\wpn_all_fettrifle_fire.wav -resample xbox 22050 pc 22050[/code]
Era REQ File:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"bnk"
"align=2048"
"pcfgcw"
}

REQN
{
"config"
"global_world"
"exp_obj"
"pcf"
"pcfgcw"
}
}[/code]
Era SND File:
Hidden/Spoiler:
[code]// ----- A280 Rifle Start -----------------------------------------

SoundProperties()
{
Name("all_weap_a280_fire");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("wpn_all_a280_blaster_fire", 1.0);
}
}

// ----- A280 Rifle End -------------------------------------------


// ----- Naboo Sniper Rifle Start -----------------------------------------

SoundProperties()
{
Name("nab_weap_sniper_rifle_fire");
Group("weapons");
Inherit("weapon_template");
Pitch(1.0);
PitchDev(0.05);
SampleList()
{
Sample("wpn_all_fettrifle_fire", 1.0);
}
}


// ----- Naboo Sniper Rifle End -------------------------------------------


// ----- ELG-3A Pistol Start -----------------------------------------

SoundProperties()
{
Name("all_weap_elg3a_fire");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("wpn_all_elg3a_fire", 1.0);
}
}

// ----- ELG-3A Pistol End -------------------------------------------


// ----- DLT-20A Sniper Rifle Start -----------------------------------------

SoundProperties()
{
Name("all_weap_dlt20a_fire");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("wpn_imp_dlt20a_fire", 1.0);
}
}

// ----- DLT-20A Sniper Rifle End -------------------------------------------


// ----- CR-2 Carbine Start -----------------------------------------

SoundProperties()
{
Name("all_weap_cr2_fire");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("wpn_imp_se14c_fire", 1.0);
}
}

// ----- CR-2 Carbine End -------------------------------------------[/code]
Mission Script:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
Conquest = ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

-- Empire Attacking (attacker is always #1)
ALL = 2
IMP = 1
-- These variables do not change
ATT = 1
DEF = 2

---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptPostLoad()
DisableBarriers("camveh")
DisableBarriers("turbar1")
DisableBarriers("turbar2")
DisableBarriers("turbar3")
DisableBarriers("cambar1")
DisableBarriers("cambar2")
DisableBarriers("cambar3")

SetMapNorthAngle(180, 1)


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "CP1"}
cp2 = CommandPost:New{name = "CP2"}
cp3 = CommandPost:New{name = "CP3"}
cp4 = CommandPost:New{name = "CP4"}
cp5 = CommandPost:New{name = "CP5"}
cp6 = CommandPost:New{name = "CP6"}

--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true,
defaultBleedRate = 0.1}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)

conquest:Start()
EnableSPHeroRules()

end

function ScriptInit()
StealArtistHeap(1800*1024)
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(2097152 + 65536 * 10)
ReadDataFile("ingame.lvl")






ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("dc:sound\\pcf.lvl;pcfgcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee")



ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_darthvader",
"imp_hover_fightertank")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser")

ReadDataFile("dc:SIDE\\thd.lvl",
"thd_inf_rifleman",
"thd_inf_rocketeer",
"thd_inf_engineer",
"thd_inf_sniper",
"thd_inf_officer",
"thd_hero_queen",
"all_hover_combatspeeder")

ReadDataFile("dc:SIDE\\jed.lvl",
"jed_guard")





-- set up teams
SetupTeams{
imp = {
team = IMP,
units = 32,
reinforcements = 150,
soldier = { "imp_inf_rifleman",9, 25},
assault = { "imp_inf_rocketeer",1, 4},
engineer = { "imp_inf_engineer",1, 4},
sniper = { "imp_inf_sniper",1, 4},
officer = {"imp_inf_officer",1, 4},
special = { "imp_inf_dark_trooper",1, 4},
}
}

SetupTeams{
all = {
team = ALL,
units = 32,
reinforcements = 150,
soldier = { "thd_inf_rifleman",9, 25},
assault = { "thd_inf_rocketeer",1, 4},
engineer = { "thd_inf_engineer",1, 4},
sniper = { "thd_inf_sniper",1, 4},
officer = {"thd_inf_officer",1, 4},
special = { "jed_guard",1, 2},
}
}



SetHeroClass(ALL, "thd_hero_queen")

SetHeroClass(IMP, "imp_hero_darthvader")


-- Level Stats
ClearWalkers()
AddWalkerType(1, 0) -- 0 atsts with 1 leg pairs each
local weaponCnt = 240
SetMemoryPoolSize("ClothData",50)
SetMemoryPoolSize("Aimer", 35)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 128)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 52)
SetMemoryPoolSize("EntityHover", 4)
SetMemoryPoolSize("EntitySoundStream", 1)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("MountedTurret", 17)
SetMemoryPoolSize("Navigator", 55)
SetMemoryPoolSize("Obstacle", 450)
SetMemoryPoolSize("PathNode", 100)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 8)
SetMemoryPoolSize("TreeGridStack", 325)
SetMemoryPoolSize("UnitAgent", 55)
SetMemoryPoolSize("UnitController", 55)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 6)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("NAB\\nab2.lvl","naboo2_Conquest")
SetDenseEnvironment("true")
--AddDeathRegion("Water")
AddDeathRegion("Waterfall")
--SetMaxFlyHeight(20)



-- Sound

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\nab.lvl", "nab2")
OpenAudioStream("sound\\nab.lvl", "nab2")
OpenAudioStream("sound\\nab.lvl", "nab2_emt")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "allleaving")
SetOutOfBoundsVoiceOver(1, "impleaving")

SetAmbientMusic(ALL, 1.0, "all_nab_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_nab_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2,"all_nab_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_nab_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_nab_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2,"imp_nab_amb_end", 2,1)

SetVictoryMusic(ALL, "all_nab_amb_victory")
SetDefeatMusic (ALL, "all_nab_amb_defeat")
SetVictoryMusic(IMP, "imp_nab_amb_victory")
SetDefeatMusic (IMP, "imp_nab_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")




-- Camera Stats
--Nab2 Theed
--Palace
AddCameraShot(0.038177, -0.005598, -0.988683, -0.144973, -0.985535, 18.617458, -123.316505);
AddCameraShot(0.993106, -0.109389, 0.041873, 0.004612, 6.576932, 24.040697, -25.576218);
AddCameraShot(0.851509, -0.170480, 0.486202, 0.097342, 158.767715, 22.913860, -0.438658);
AddCameraShot(0.957371, -0.129655, -0.255793, -0.034641, 136.933548, 20.207420, 99.608246);
AddCameraShot(0.930364, -0.206197, 0.295979, 0.065598, 102.191856, 22.665434, 92.389435);
AddCameraShot(0.997665, -0.068271, 0.002086, 0.000143, 88.042351, 13.869274, 93.643898);
AddCameraShot(0.968900, -0.100622, 0.224862, 0.023352, 4.245263, 13.869274, 97.208542);
AddCameraShot(0.007091, -0.000363, -0.998669, -0.051089, -1.309990, 16.247049, 15.925866);
AddCameraShot(-0.274816, 0.042768, -0.949121, -0.147705, -55.505108, 25.990822, 86.987534);
AddCameraShot(0.859651, -0.229225, 0.441156, 0.117634, -62.493008, 31.040747, 117.995369);
AddCameraShot(0.703838, -0.055939, 0.705928, 0.056106, -120.401054, 23.573559, -15.484946);
AddCameraShot(0.835474, -0.181318, -0.506954, -0.110021, -166.314774, 27.687098, -6.715797);
AddCameraShot(0.327573, -0.024828, -0.941798, -0.071382, -109.700180, 15.415476, -84.413605);
AddCameraShot(-0.400505, 0.030208, -0.913203, -0.068878, 82.372711, 15.415476, -42.439548);
end[/code]
PC_MungeLog:
Hidden/Spoiler:
soundflmunge.exe : Warning : Files line 2 and 3 reference the same source file c:\windows\media\chord.wav. wpn_all_a280_blaster_fire will alias wpn_all_elg3a_fire
- while munging C:\BF2_ModTools\data_PCF\Sound\worlds\pcf\pcfgcw.sfx
soundflmunge.exe : Warning : Files line 2 and 4 reference the same source file c:\windows\media\chord.wav. wpn_all_a280_blaster_fire will alias wpn_imp_dlt20a_fire
- while munging C:\BF2_ModTools\data_PCF\Sound\worlds\pcf\pcfgcw.sfx
soundflmunge.exe : Warning : Files line 2 and 5 reference the same source file c:\windows\media\chord.wav. wpn_all_a280_blaster_fire will alias wpn_imp_se14c_fire
- while munging C:\BF2_ModTools\data_PCF\Sound\worlds\pcf\pcfgcw.sfx
soundflmunge.exe : Warning : Files line 2 and 6 reference the same source file c:\windows\media\chord.wav. wpn_all_a280_blaster_fire will alias wpn_all_fettrifle_fire
- while munging C:\BF2_ModTools\data_PCF\Sound\worlds\pcf\pcfgcw.sfx
soundflmunge.exe : Error : Unable to open file C:\BF2_ModTools\data_PCF\Common\common\sound\..\..\sound\global\effects\ui_load_lp.wav - while munging C:\BF2_ModTools\data_PCF\Common\common\sound\global.sfx
soundflmunge.exe : Error : Unable to open file C:\BF2_ModTools\data_PCF\Common\common\sound\..\..\sound\global\effects\ui_load_lp.wav, format may be invalid - while munging C:\BF2_ModTools\data_PCF\Common\common\sound\global.sfx
soundflmunge.exe : Error : Unable to read file list C:\BF2_ModTools\data_PCF\Common\common\sound\global.sfx - while munging C:\BF2_ModTools\data_PCF\Common\common\sound\global.sfx
Last edited by Bucman55 on Thu Jan 18, 2018 11:47 pm, edited 2 times in total.
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Legacy

Re: Custom sound effects not working

Post by giftheck »

You don't need the SFX file, only the ASFX file. Ditch it.
Bucman55
Private
Posts: 37
Joined: Tue Jan 09, 2018 7:01 pm
Projects :: Playable Campaign Factions
Games I'm Playing :: Star Wars games
xbox live or psn: PSN: BucMan55
Location: Texas

Re: Custom sound effects not working

Post by Bucman55 »

ggctuk wrote:You don't need the SFX file, only the ASFX file. Ditch it.
Ditched, anything else you can see wrong with my setup?
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Legacy

Re: Custom sound effects not working

Post by giftheck »

Bucman55 wrote:
ggctuk wrote:You don't need the SFX file, only the ASFX file. Ditch it.
Ditched, anything else you can see wrong with my setup?
Nothing that springs immediately to mind - from here this looks like it should be working now but without seeing the sound folder setup I can't say.

As for my previous suggestion I might be mistaken but from what I remember the SFX is munged after the ASFX but it creates the same type of output file so it overwrites the ASFX bank file - for future reference an SFX file is only needed if you are calling stock sounds from the common.bnk file and I think it should be named something else to stop the munge from overwriting the custom SFX.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Custom sound effects not working

Post by Marth8880 »

There might be file name mismatches in your REQ files. What are the names of all your files?
Bucman55
Private
Posts: 37
Joined: Tue Jan 09, 2018 7:01 pm
Projects :: Playable Campaign Factions
Games I'm Playing :: Star Wars games
xbox live or psn: PSN: BucMan55
Location: Texas

Re: Custom sound effects not working

Post by Bucman55 »

Marth8880 wrote:There might be file name mismatches in your REQ files. What are the names of all your files?
The ASFX file is called "pcf" as is the REQ file. The Era REQ file in question is called "pcfgcw" as is the Era SND file.

Here's a screen snip of the folder:
Hidden/Spoiler:
Image
Raigiku
Private Third Class
Posts: 58
Joined: Mon Jun 05, 2017 5:14 pm
Projects :: Battlefront Redux
Games I'm Playing :: League of Legends
xbox live or psn: TheRaigiku
Location: Perú

Re: Custom sound effects not working

Post by Raigiku »

If you want only sound effects and not music have your files like this:
Hidden/Spoiler:
Image
Your .snd and .asfx are the same as mine but I found some differences in these files:
Hidden/Spoiler:
Image
Hidden/Spoiler:
Image
Also try to change this:
Hidden/Spoiler:
ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("dc:sound\\pcf.lvl;pcfgcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee")
to this:
Hidden/Spoiler:
ReadDataFile("dc:sound\\pcf.lvl;pcfgcw")
ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee")
Bucman55
Private
Posts: 37
Joined: Tue Jan 09, 2018 7:01 pm
Projects :: Playable Campaign Factions
Games I'm Playing :: Star Wars games
xbox live or psn: PSN: BucMan55
Location: Texas

Re: Custom sound effects not working

Post by Bucman55 »

Raigiku wrote:If you want only sound effects and not music have your files like this:
Hidden/Spoiler:
Image
Your .snd and .asfx are the same as mine but I found some differences in these files:
Hidden/Spoiler:
Image
Hidden/Spoiler:
Image
Also try to change this:
Hidden/Spoiler:
ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("dc:sound\\pcf.lvl;pcfgcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee")
to this:
Hidden/Spoiler:
ReadDataFile("dc:sound\\pcf.lvl;pcfgcw")
ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee")
Well that got my sound into the game, but it's fairly quiet. Any tips on how to make it louder in-game? I have Audacity but I don't think simply raising the volume is the answer.
Raigiku
Private Third Class
Posts: 58
Joined: Mon Jun 05, 2017 5:14 pm
Projects :: Battlefront Redux
Games I'm Playing :: League of Legends
xbox live or psn: TheRaigiku
Location: Perú

Re: Custom sound effects not working

Post by Raigiku »

Bucman55 wrote:
Raigiku wrote:If you want only sound effects and not music have your files like this:
Hidden/Spoiler:
Image
Your .snd and .asfx are the same as mine but I found some differences in these files:
Hidden/Spoiler:
Image
Hidden/Spoiler:
Image
Also try to change this:
Hidden/Spoiler:
ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("dc:sound\\pcf.lvl;pcfgcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee")
to this:
Hidden/Spoiler:
ReadDataFile("dc:sound\\pcf.lvl;pcfgcw")
ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_urban",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee")
Well that got my sound into the game, but it's fairly quiet. Any tips on how to make it louder in-game? I have Audacity but I don't think simply raising the volume is the answer.
I just amplify it until it sounds louder and it doesn't really loose that much quality.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Custom sound effects not working

Post by AQT »

Before you Amplify it, see if Normalizing helps first.
Bucman55
Private
Posts: 37
Joined: Tue Jan 09, 2018 7:01 pm
Projects :: Playable Campaign Factions
Games I'm Playing :: Star Wars games
xbox live or psn: PSN: BucMan55
Location: Texas

Re: Custom sound effects not working

Post by Bucman55 »

AQT wrote:Before you Amplify it, see if Normalizing helps first.
Tried both, amplifying a bit seemed to sound better. I guess we can call this solved now.
Post Reply