(SOLVED) Sound Munging Isssue (only stream sound)

Started by Red04SWBF, February 02, 2019, 08:42:02 AM

Previous topic - Next topic
February 02, 2019, 08:42:02 AM Last Edit: February 03, 2019, 04:31:29 AM by Red04 (CC-4398)
I recently started exploring sound modding in SWBF1. To start I looked at some related tutorials, more specifically the Psychofred documentation and I also downloaded a tutorial from Ginev that contains an example folder with some sounds inside. To put it into practice I have created a project called DataSnd1 of the same purpose, very similar to Ginev's, and I decided to start with what seemed to me easier: create a region in ZeroEditor, the necessary files in Sound\Worlds\Snd1, add the WAV sound stream files (both are at 44100 Hz) and finally make the necessary modifications according to the tutorials. Here's a screenshot of the region created in ZeroEditor where I should hear the ambient sound within this spherical space:

[spoiler][/spoiler]

I also modified the LUA missions, then I munge but when I tried the map I didn't hear the ambient sound. I tried to find out why it doesn't work, I think everything is OK. I've even changed the original sampling frequency to 44100 Hz believing that it would work fine.

Is it possible that I have neglected something? If someone can help me here I leave the code of the files that I've edited so far (.asfx is empty and not included in the main .req since in this test I haven't used any sound effect).

Common\Scripts\Snd1\Snd1a.lua (Mission LUA GCW)

[spoiler]--start header
function ScriptInit()
local ALL = 1
local IMP = 2
local ATT = 1
local DEF = 2
--end header
--start objectives
AddMissionObjective(IMP,"red", "level.Snd1.objectives.1");
AddMissionObjective(IMP,"orange", "level.Snd1.objectives.2");
AddMissionObjective(IMP,"orange", "level.Snd1.objectives.3");
AddMissionObjective(ALL,"red", "level.Snd1.objectives.1");
AddMissionObjective(ALL,"orange", "level.Snd1.objectives.2");
AddMissionObjective(ALL,"orange","level.Snd1.objectives.3");
--end objectives
--start soundlvl
ReadDataFile("DC:sound\\Snd1.lvl;Snd1gcw");
ReadDataFile("sound\\tat.lvl;tat1gcw");
--end soundlvl

-- Start sidelvls
ReadDataFile("SIDE\\all.lvl",
"all_inf_basicdesert",
"all_inf_lukeskywalker",
"all_inf_smuggler");
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_basic_tie",
"imp_inf_darthvader",
"imp_inf_dark_trooper");
--end sidelvls
--start loadouts
SetTeamName(ALL, "Alliance")
SetTeamIcon(ALL, "all_icon")
AddUnitClass(ALL, "all_inf_soldierdesert",10)
AddUnitClass(ALL, "all_inf_vanguard",1)
AddUnitClass(ALL, "all_inf_pilot",2)
AddUnitClass(ALL, "all_inf_marksman",2)
AddUnitClass(ALL, "all_inf_smuggler",1)
SetHeroClass(ALL, "all_inf_lukeskywalker")
SetTeamName(IMP, "Empire")
SetTeamIcon(IMP, "imp_icon")
AddUnitClass(IMP, "imp_inf_storm_trooper",10)
AddUnitClass(IMP, "imp_inf_shock_trooper",1)
AddUnitClass(IMP, "imp_inf_pilottie",2)
AddUnitClass(IMP, "imp_inf_scout_trooper",2)
AddUnitClass(IMP, "imp_inf_dark_trooper",1)
SetHeroClass(IMP, "imp_inf_darthvader")
--end loadouts
--start teamstats
SetUnitCount(ATT, 16)
SetReinforcementCount(ATT, 200)
SetUnitCount(DEF, 16)
SetReinforcementCount(DEF, 200)
--end teamstats
--start alliances
SetTeamAsFriend(ATT, 1)
SetTeamAsEnemy(ATT, 2)
SetTeamAsFriend(DEF, 2)
SetTeamAsEnemy(DEF, 1)
SetAttackingTeam(ATT);
--end alliances

--start memorypools
ClearWalkers()
AddWalkerType(0, 0)-- 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)
SetMemoryPoolSize("PowerupItem", 60)
SetMemoryPoolSize("EntityMine", 40)
--end memorypools
--start worldlvl
ReadDataFile("dc:Snd1\\Snd1.lvl")
--end worldlvl
--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay
--start flyheight
--end flyheight
--start ainotify
--end ainotify
--start stayinturrets
--end stayinturrets
--start denseenvironment
SetDenseEnvironment("false")
--end denseenvironment
--start birdsandfish
--end birdsandfish
--start deathregions
--end deathregions

--start soundconfig
OpenAudioStream("sound\\tat.lvl","tatgcw_music");
OpenAudioStream("sound\\Snd1.lvl","Snd1");
OpenAudioStream("sound\\Snd1.lvl","Snd1");
--OpenAudioStream("sound\\tat.lvl","tat1");
--OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\gcw.lvl","gcw_vo");
OpenAudioStream("sound\\gcw.lvl","gcw_tac_vo");
--OpenAudioStream("sound\\tat.lvl","tat1_emt");
OpenAudioStream("sound\\Snd1.lvl","Snd1_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_tat_amb_start",0,1);
SetAmbientMusic(ALL,0.99,"all_tat_amb_middle",1,1);
SetAmbientMusic(ALL,0.1,"all_tat_amb_end",2,1);
SetAmbientMusic(IMP,1.0,"imp_tat_amb_start",0,1);
SetAmbientMusic(IMP,0.99,"imp_tat_amb_middle",1,1);
SetAmbientMusic(IMP,0.1,"imp_tat_amb_end",2,1);
SetVictoryMusic(ALL,"all_tat_amb_victory");
SetDefeatMusic (ALL,"all_tat_amb_defeat");
SetVictoryMusic(IMP,"imp_tat_amb_victory");
SetDefeatMusic (IMP,"imp_tat_amb_defeat");
SetSoundEffect("ScopeDisplayZoomIn","binocularzoomin");
SetSoundEffect("ScopeDisplayZoomOut","binocularzoomout");
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");
SetPlanetaryBonusVoiceOver(IMP,IMP,0,"imp_bonus_imp_medical");
SetPlanetaryBonusVoiceOver(IMP,ALL,0,"imp_bonus_all_medical");
SetPlanetaryBonusVoiceOver(IMP,IMP,1,"");
SetPlanetaryBonusVoiceOver(IMP,ALL,1,"");
SetPlanetaryBonusVoiceOver(IMP,IMP,2,"imp_bonus_imp_sensors");
SetPlanetaryBonusVoiceOver(IMP,ALL,2,"imp_bonus_all_sensors");
SetPlanetaryBonusVoiceOver(IMP,IMP,3,"imp_bonus_imp_hero");
SetPlanetaryBonusVoiceOver(IMP,ALL,3,"imp_bonus_all_hero");
SetPlanetaryBonusVoiceOver(IMP,IMP,4,"imp_bonus_imp_reserves");
SetPlanetaryBonusVoiceOver(IMP,ALL,4,"imp_bonus_all_reserves");
SetPlanetaryBonusVoiceOver(IMP,IMP,5,"imp_bonus_imp_sabotage");--sabotage
SetPlanetaryBonusVoiceOver(IMP,ALL,5,"imp_bonus_all_sabotage");
SetPlanetaryBonusVoiceOver(IMP,IMP,6,"");
SetPlanetaryBonusVoiceOver(IMP,ALL,6,"");
SetPlanetaryBonusVoiceOver(IMP,IMP,7,"imp_bonus_imp_training");--advanced training
SetPlanetaryBonusVoiceOver(IMP,ALL,7,"imp_bonus_all_training");--advanced training
SetPlanetaryBonusVoiceOver(ALL,ALL,0,"all_bonus_all_medical");
SetPlanetaryBonusVoiceOver(ALL,IMP,0,"all_bonus_imp_medical");
SetPlanetaryBonusVoiceOver(ALL,ALL,1,"");
SetPlanetaryBonusVoiceOver(ALL,IMP,1,"");
SetPlanetaryBonusVoiceOver(ALL,ALL,2,"all_bonus_all_sensors");
SetPlanetaryBonusVoiceOver(ALL,IMP,2,"all_bonus_imp_sensors");
SetPlanetaryBonusVoiceOver(ALL,ALL,3,"all_bonus_all_hero");
SetPlanetaryBonusVoiceOver(ALL,IMP,3,"all_bonus_imp_hero");
SetPlanetaryBonusVoiceOver(ALL,ALL,4,"all_bonus_all_reserves");
SetPlanetaryBonusVoiceOver(ALL,IMP,4,"all_bonus_imp_reserves");
SetPlanetaryBonusVoiceOver(ALL,ALL,5,"all_bonus_all_sabotage");--sabotage
SetPlanetaryBonusVoiceOver(ALL,IMP,5,"all_bonus_imp_sabotage");
SetPlanetaryBonusVoiceOver(ALL,ALL,6,"");
SetPlanetaryBonusVoiceOver(ALL,IMP,6,"");
SetPlanetaryBonusVoiceOver(ALL,ALL,7,"all_bonus_all_training");--advanced training
SetPlanetaryBonusVoiceOver(ALL,IMP,7,"all_bonus_imp_training");--advanced training
--end soundconfig

--start activebonus
--end activebonus

--start camerashots
AddCameraShot(-0.404895, 0.000992, -0.914360, -0.002240, -85.539894, 20.536297, 141.699493);
AddCameraShot(0.040922, 0.004049, -0.994299, 0.098381, -139.729523, 17.546598, -34.360893);
AddCameraShot(-0.312360, 0.016223, -0.948547, -0.049263, -217.381485, 20.150953, 54.514324);
--end camerashots

--start footer
end
--end footer



[/spoiler]

Common\Scripts\Snd1\Snd1c.lua (Mission LUA CW)

[spoiler]--start header
function ScriptInit()
local CIS = 1
local REP = 2
local ATT = 1
local DEF = 2
--end header
--start objectives
AddMissionObjective(REP,"red", "level.Snd1.objectives.1");
AddMissionObjective(REP,"orange", "level.Snd1.objectives.2");
AddMissionObjective(REP,"orange", "level.Snd1.objectives.3");
AddMissionObjective(CIS,"red", "level.Snd1.objectives.1");
AddMissionObjective(CIS,"orange", "level.Snd1.objectives.2");
AddMissionObjective(CIS,"orange","level.Snd1.objectives.3");
--end objectives
--start soundlvl
ReadDataFile("DC:sound\\Snd1.lvl;Snd1cw");
ReadDataFile("sound\\tat.lvl;tat1cw");
--end soundlvl

-- Start sidelvls
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_basic",
"cis_inf_countdooku",
"cis_inf_droideka");
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_basic",
"rep_inf_macewindu",
"rep_inf_jet_trooper");
--end sidelvls
--start loadouts
SetTeamName(CIS, "CIS")
SetTeamIcon(CIS, "cis_icon")
AddUnitClass(CIS, "cis_inf_battledroid",10)
AddUnitClass(CIS, "cis_inf_assault",1)
AddUnitClass(CIS, "cis_inf_pilotdroid",2)
AddUnitClass(CIS, "cis_inf_assassindroid",2)
AddUnitClass(CIS, "cis_inf_droideka",1)
SetHeroClass(CIS, "cis_inf_countdooku")
SetTeamName(REP, "Republic")
SetTeamIcon(REP, "rep_icon")
AddUnitClass(REP, "rep_inf_clone_trooper",10)
AddUnitClass(REP, "rep_inf_arc_trooper",1)
AddUnitClass(REP, "rep_inf_clone_pilot",2)
AddUnitClass(REP, "rep_inf_clone_sharpshooter",2)
AddUnitClass(REP, "rep_inf_jet_trooper",1)
SetHeroClass(REP, "rep_inf_macewindu")
--end loadouts
--start teamstats
SetUnitCount(ATT, 16)
SetReinforcementCount(ATT, 200)
SetUnitCount(DEF, 16)
SetReinforcementCount(DEF, 200)
--end teamstats
--start alliances
SetTeamAsFriend(ATT, 1)
SetTeamAsEnemy(ATT, 2)
SetTeamAsFriend(DEF, 2)
SetTeamAsEnemy(DEF, 1)
SetAttackingTeam(ATT);
--end alliances

--start memorypools
ClearWalkers()
AddWalkerType(0, 4)-- special -> droidekas
AddWalkerType(1, 4)-- 1x2 (1 pair of legs)
AddWalkerType(2, 0)-- 2x2 (2 pairs of legs)
AddWalkerType(3, 0)-- 3x2 (3 pairs of legs)
SetMemoryPoolSize("PowerupItem", 60)
SetMemoryPoolSize("EntityMine", 40)
--end memorypools
--start worldlvl
ReadDataFile("dc:Snd1\\Snd1.lvl")
--end worldlvl
--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay
--start flyheight
--end flyheight
--start ainotify
--end ainotify
--start stayinturrets
--end stayinturrets
--start denseenvironment
SetDenseEnvironment("false")
--end denseenvironment
--start birdsandfish
--end birdsandfish
--start deathregions
--end deathregions

--start soundconfig
OpenAudioStream("sound\\tat.lvl","tatcw_music");
OpenAudioStream("sound\\Snd1.lvl","Snd1");
OpenAudioStream("sound\\Snd1.lvl","Snd1");
--OpenAudioStream("sound\\tat.lvl","tat1");
--OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\cw.lvl","cw_vo");
OpenAudioStream("sound\\cw.lvl","cw_tac_vo");
--OpenAudioStream("sound\\tat.lvl","tat1_emt");
OpenAudioStream("sound\\Snd1.lvl","Snd1_emt");
SetBleedingVoiceOver(CIS,CIS,"cis_off_com_report_us_overwhelmed",1);
SetBleedingVoiceOver(CIS,REP,"cis_off_com_report_enemy_losing",1);
SetBleedingVoiceOver(REP,CIS,"rep_off_com_report_enemy_losing",1);
SetBleedingVoiceOver(REP,REP,"rep_off_com_report_us_overwhelmed",1);
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1,1);
SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1,1);
SetOutOfBoundsVoiceOver(2,"Allleaving");
SetOutOfBoundsVoiceOver(1,"Impleaving");
SetAmbientMusic(CIS,1.0,"cis_tat_amb_start",0,1);
SetAmbientMusic(CIS,0.99,"cis_tat_amb_middle",1,1);
SetAmbientMusic(CIS,0.1,"cis_tat_amb_end",2,1);
SetAmbientMusic(REP,1.0,"rep_tat_amb_start",0,1);
SetAmbientMusic(REP,0.99,"rep_tat_amb_middle",1,1);
SetAmbientMusic(REP,0.1,"rep_tat_amb_end",2,1);
SetVictoryMusic(CIS,"cis_tat_amb_victory");
SetDefeatMusic (CIS,"cis_tat_amb_defeat");
SetVictoryMusic(REP,"rep_tat_amb_victory");
SetDefeatMusic (REP,"rep_tat_amb_defeat");
SetSoundEffect("ScopeDisplayZoomIn","binocularzoomin");
SetSoundEffect("ScopeDisplayZoomOut","binocularzoomout");
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");
SetPlanetaryBonusVoiceOver(REP,REP,0,"rep_bonus_rep_medical");
SetPlanetaryBonusVoiceOver(REP,CIS,0,"rep_bonus_cis_medical");
SetPlanetaryBonusVoiceOver(REP,REP,1,"");
SetPlanetaryBonusVoiceOver(REP,CIS,1,"");
SetPlanetaryBonusVoiceOver(REP,REP,2,"rep_bonus_rep_sensors");
SetPlanetaryBonusVoiceOver(REP,CIS,2,"rep_bonus_cis_sensors");
SetPlanetaryBonusVoiceOver(REP,REP,3,"rep_bonus_rep_hero");
SetPlanetaryBonusVoiceOver(REP,CIS,3,"rep_bonus_cis_hero");
SetPlanetaryBonusVoiceOver(REP,REP,4,"rep_bonus_rep_reserves");
SetPlanetaryBonusVoiceOver(REP,CIS,4,"rep_bonus_cis_reserves");
SetPlanetaryBonusVoiceOver(REP,REP,5,"rep_bonus_rep_sabotage");--sabotage
SetPlanetaryBonusVoiceOver(REP,CIS,5,"rep_bonus_cis_sabotage");
SetPlanetaryBonusVoiceOver(REP,REP,6,"");
SetPlanetaryBonusVoiceOver(REP,CIS,6,"");
SetPlanetaryBonusVoiceOver(REP,REP,7,"rep_bonus_rep_training");--advanced training
SetPlanetaryBonusVoiceOver(REP,CIS,7,"rep_bonus_cis_training");--advanced training
SetPlanetaryBonusVoiceOver(CIS,CIS,0,"cis_bonus_cis_medical");
SetPlanetaryBonusVoiceOver(CIS,REP,0,"cis_bonus_rep_medical");
SetPlanetaryBonusVoiceOver(CIS,CIS,1,"");
SetPlanetaryBonusVoiceOver(CIS,REP,1,"");
SetPlanetaryBonusVoiceOver(CIS,CIS,2,"cis_bonus_cis_sensors");
SetPlanetaryBonusVoiceOver(CIS,REP,2,"cis_bonus_rep_sensors");
SetPlanetaryBonusVoiceOver(CIS,CIS,3,"cis_bonus_cis_hero");
SetPlanetaryBonusVoiceOver(CIS,REP,3,"cis_bonus_rep_hero");
SetPlanetaryBonusVoiceOver(CIS,CIS,4,"cis_bonus_cis_reserves");
SetPlanetaryBonusVoiceOver(CIS,REP,4,"cis_bonus_rep_reserves");
SetPlanetaryBonusVoiceOver(CIS,CIS,5,"cis_bonus_cis_sabotage");--sabotage
SetPlanetaryBonusVoiceOver(CIS,REP,5,"cis_bonus_rep_sabotage");
SetPlanetaryBonusVoiceOver(CIS,CIS,6,"");
SetPlanetaryBonusVoiceOver(CIS,REP,6,"");
SetPlanetaryBonusVoiceOver(CIS,CIS,7,"cis_bonus_cis_training");--advanced training
SetPlanetaryBonusVoiceOver(CIS,REP,7,"cis_bonus_rep_training");--advanced training
--end soundconfig

--start activebonus
--end activebonus

--start camerashots
AddCameraShot(-0.404895, 0.000992, -0.914360, -0.002240, -85.539894, 20.536297, 141.699493);
AddCameraShot(0.040922, 0.004049, -0.994299, 0.098381, -139.729523, 17.546598, -34.360893);
AddCameraShot(-0.312360, 0.016223, -0.948547, -0.049263, -217.381485, 20.150953, 54.514324);
--end camerashots

--start footer
end
--end footer



[/spoiler]

Sound\Worlds\Snd1\Snd1.req (Main REQ Sound File)

[spoiler]ucft
{
    REQN
    {
        "str"
        "align=2048"
"Snd1"
        "Snd1_emt"
    }
    REQN
    {
        "lvl"
"snd1cw"
"snd1gcw"
    }

}
[/spoiler]

Sound\Worlds\Snd1\Snd1.st4

[spoiler]streams\amb_JediCouncil01_fnt.wav Snd1_amb_JediCouncil01
streams\amb_JediCouncil01_bck.wav
[/spoiler]

Sound\Worlds\Snd1\Snd1_emt.stm

[spoiler]streams\Amb_JediCouncil01_PL2.wav Snd1_amb_JediCouncil01[/spoiler]

Sound\Worlds\Snd1\Snd1cw.req

[spoiler]ucft
{
    REQN
    {
    "bnk"
    "align=2048"
    }

    REQN
    {
    "config"
"Sound_Prop_File_Referenced_Here"
    }
}
[/spoiler]

Sound\Worlds\Snd1\Snd1gcw.req

[spoiler]ucft
{
    REQN
    {
    "bnk"
    "align=2048"
    }

    REQN
    {
    "config"
"Sound_Prop_File_Referenced_Here"
    }
}
[/spoiler]

Sound\Worlds\Snd1\Sound_Prop_File_Referenced_Here.snd

[spoiler]SoundStreamProperties()
{
    Name("Snd1_amb_JediCouncil01");
    Group("ambientenv");
    Inherit("ambientfx_template");
    Stream("cor1");
Gain(0.8);
    SegmentList()
    {
        Segment("Snd1_amb_JediCouncil01", 1.0);
    }
}
[/spoiler]
AR Clan Discord: https://discord.gg/gmmSm5e | Star Wars: Battlefront - 20th Anniversary (2004-2024)

Is there a .stm file in your folder?
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)
--Endor: Imperial Base

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1

February 02, 2019, 10:38:21 AM #2 Last Edit: February 03, 2019, 04:31:42 AM by Red04 (CC-4398)
Quote from: Giftheck on February 02, 2019, 09:49:41 AM
Is there a .stm file in your folder?

I was going to create it but seeing the other project I thought it would work with .st4 only.

Edit: I've already added a .stm file (Snd1_emt.stm) w/ its properly attribution in Snd1.req and their sound (.st4 are supossed to be quadraphonic, 2 WAV's x each sound, while .stm are current stream, 1 WAV x sound). I made a modification to the source codes above including the new .stm file, but it still not work. I've also added a SoundRegion in ZeroEditor and I've moved here the region created before.

Edit 2: I've already found the wrong line!

SoundStreamProperties()
{
    Name("Snd1_amb_JediCouncil01");
    Group("ambientenv");
    Inherit("ambientfx_template");
    Stream("cor1"); -> Instead of "cor1" should be "Snd1" when loading sound streams in mission LUA
   Gain(0.8);
    SegmentList()
    {
        Segment("Snd1_amb_JediCouncil01", 1.0);
    }
}
AR Clan Discord: https://discord.gg/gmmSm5e | Star Wars: Battlefront - 20th Anniversary (2004-2024)