Page 1 of 1

Cannot get music working [Solved]

Posted: Mon Dec 24, 2012 1:19 am
by Loopy53
EDIT: I now want to have music as well as the sound effect. the explosion works, music dont. I would want it to be setup like the rain on kamino, so I will post a pic of ZE.

Here are all the sound files along with the LUA

EAV.asfx
// ---Weapon Fire Start ---
effects\chemnade.wav -resample xbox 44100 pc 44100

EAVsfx.snd
Hidden/Spoiler:
SoundProperties()
{
Name("chemnade");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("chemnade", 1.0);
}
}
EAVsfx_music.snd
Hidden/Spoiler:
SoundStreamProperties()
{
Name("eav_stream");
Group("ambientenv");
Inherit("ambientfx_template");
Gain(10.25);
Stream("wind");
SegmentList()
{
Segment("wind", 1.0);
}
}
EAV_music.mus
Hidden/Spoiler:
Music()
{
Name("eav_stream");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(2.0);
SoundStream("eav_stream");
}
EAV_stream.stm
Streams\wind.wav wind -resample xbox 22050 pc 22050
EAVu.req
Hidden/Spoiler:
ucft
{
REQN
{
"bnk"
"align=2048"
"EAV"
}

REQN
{
"config"
"EAVsfx"
"EAVsfx_music"
}
}
EAV.req
Hidden/Spoiler:
ucft
{
REQN
{
"str"
"align=2048"
"EAV_stream"
}
REQN
{
"lvl"
"EAVu"
}

}
EAVucon.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

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

function ScriptPostLoad()


--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"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}
cp9 = CommandPost:New{name = "cp9"}


--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}

--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:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)

conquest:Start()

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- 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 ScriptInit()
ReadDataFile("dc:Load\\common.lvl")
ReadDataFile("ingame.lvl")



SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)


SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
SetMemoryPoolSize ("Soldier::Animation",200)
SetMemoryPoolSize("SoldierAnimation", 269)

ReadDataFile("dc:sound\\eav.lvl;eavu")
ReadDataFile("dc:sound\\tss.lvl;tssgcw")
ReadDataFile("dc:SIDE\\usa.lvl",
"usa_inf_rifleman",
"usa_inf_engineer",
"usa_inf_rocketeer",
"usa_inf_sniper")

ReadDataFile("dc:SIDE\\ter.lvl",
"ter_inf_rifleman",
"ter_inf_rocketeer",
"ter_inf_sniper",
"ter_inf_engineer")

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "usa_inf_rifleman",9, 25},
assault = { "usa_inf_rocketeer",1,4},
engineer = { "usa_inf_engineer",1,4},
sniper = { "usa_inf_sniper",1,4},
},
imp = {
team = IMP,
units = 20,
reinforcements = 150,
soldier = { "ter_inf_rifleman",9, 25},
assault = { "ter_inf_rocketeer",1,4},
engineer = { "ter_inf_engineer",1,4},
sniper = { "ter_inf_sniper",1,4},
},
}

-- Level Stats
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)

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("SoldierAnimation", 230)
SetMemoryPoolSize("MountedTurret", 32)
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:EAV\\EAV.lvl", "EAV_conquest")
SetDenseEnvironment("false")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "des_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("dc:sound\\eav.lvl", "eavu")
OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

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, "wind", 0,1)
-- SetAmbientMusic(ALL, 0.8, "wind", 1,1)
-- SetAmbientMusic(ALL, 0.2, "wind", 2,1)
SetAmbientMusic(IMP, 1.0, "wind", 0,1)
-- SetAmbientMusic(IMP, 0.8, "wind", 1,1)
-- SetAmbientMusic(IMP, 0.2, "wind", 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("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
AddCameraShot(0.923624, -0.176138, -0.334405, -0.063772, -127.047676, 22.428078, 342.742371);

end

Re: Cannot get sound effect working

Posted: Mon Dec 24, 2012 2:37 am
by Marth8880
Loopy53 wrote:SoundStreamProperties()
SoundProperties()
{
Name("chemnade");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("chemnade", 1.0);
}
}
Delete the red bit. Any sort of mistake or syntax error in a .snd file will render the entire file as "bad" and nothing will work.

Re: Cannot get sound effect working

Posted: Mon Dec 24, 2012 10:27 am
by Loopy53
EDIT: See first post, I cannot get music working now. sound fx works fine.

Re: Cannot get musicworking [help]

Posted: Wed Dec 26, 2012 5:13 am
by Marth8880
Replace

Code: Select all

OpenAudioStream("dc:sound\\eav.lvl", "eavu")
with

Code: Select all

OpenAudioStream("dc:sound\\eav.lvl", "EAV_stream")

Re: Cannot get musicworking [help]

Posted: Wed Dec 26, 2012 10:21 am
by Loopy53
thanks, will munge and try again.

EDIT:
Didnt work. Here are all the files again.
Hidden/Spoiler:
eav.req
ucft
{
REQN
{
"str"
"align=2048"
"EAV_stream"
}
REQN
{
"lvl"
"EAVu"
}
}
eavu.req
ucft
{
REQN
{
"bnk"
"align=2048"
"EAV"
}

REQN
{
"config"
"EAVsfx"
"EAVsfx_music"
}
}
eav_stream.stm
Streams\wind.wav wind -resample xbox 22050 pc 22050
eav_music.mus
Music()
{
Name("eav_stream");
Priority(0.0);
FadeInTime(1.0);
FadeOutTime(1.0);
MinPlaybackTime(20.0);
MinInactiveTime(2.0);
SoundStream("eav_stream");
}
eavsfx_music.snd
SoundStreamProperties()
{
Name("eav_stream");
Group("ambientenv");
Inherit("ambientfx_template");
Gain(10.25);
Stream("wind");
SegmentList()
{
Segment("wind", 1.0);
}
}
eavsfx
SoundProperties()
{
Name("chemnade");
Group("weapons");
Inherit("weapon_template");
SampleList()
{
Sample("chemnade", 1.0);
}
}
eav.asfx
// ---Weapon Fire Start ---
effects\chemnade.wav -resample xbox 44100 pc 44100
eavu_con.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

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

function ScriptPostLoad()


--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"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}
cp9 = CommandPost:New{name = "cp9"}


--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}

--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:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)

conquest:Start()

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- 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 ScriptInit()
ReadDataFile("dc:Load\\common.lvl")
ReadDataFile("ingame.lvl")



SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)


SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
SetMemoryPoolSize ("Soldier::Animation",200)
SetMemoryPoolSize("SoldierAnimation", 269)

ReadDataFile("dc:sound\\eav.lvl;eavu")
ReadDataFile("dc:sound\\tss.lvl;tssgcw")
ReadDataFile("dc:SIDE\\usa.lvl",
"usa_inf_rifleman",
"usa_inf_engineer",
"usa_inf_rocketeer",
"usa_inf_sniper")

ReadDataFile("dc:SIDE\\ter.lvl",
"ter_inf_rifleman",
"ter_inf_rocketeer",
"ter_inf_sniper",
"ter_inf_engineer")

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "usa_inf_rifleman",9, 25},
assault = { "usa_inf_rocketeer",1,4},
engineer = { "usa_inf_engineer",1,4},
sniper = { "usa_inf_sniper",1,4},
},
imp = {
team = IMP,
units = 20,
reinforcements = 150,
soldier = { "ter_inf_rifleman",9, 25},
assault = { "ter_inf_rocketeer",1,4},
engineer = { "ter_inf_engineer",1,4},
sniper = { "ter_inf_sniper",1,4},
},
}

-- Level Stats
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)

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("SoldierAnimation", 230)
SetMemoryPoolSize("MountedTurret", 32)
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:EAV\\EAV.lvl", "EAV_conquest")
SetDenseEnvironment("false")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "des_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("dc:sound\\eav.lvl", "eav_stream")
OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

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, "wind", 0,1)
-- SetAmbientMusic(ALL, 0.8, "wind", 1,1)
-- SetAmbientMusic(ALL, 0.2, "wind", 2,1)
SetAmbientMusic(IMP, 1.0, "wind", 0,1)
-- SetAmbientMusic(IMP, 0.8, "wind", 1,1)
-- SetAmbientMusic(IMP, 0.2, "wind", 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("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
AddCameraShot(0.923624, -0.176138, -0.334405, -0.063772, -127.047676, 22.428078, 342.742371);

end
I will try different things in ZE to get it to work. from wind to eav_stream first, then I will report back again.

Re: Cannot get musicworking [help]

Posted: Wed Dec 26, 2012 3:17 pm
by Marth8880
Remove

Code: Select all

OpenAudioStream("sound\\global.lvl", "gcw_music")
and make sure the capitalization in all of the file names are consistent and match.

Re: Cannot get musicworking [help]

Posted: Wed Dec 26, 2012 10:33 pm
by Loopy53
Thanks marth, but why you no on x-fire? Or am I just away when your on. Anyhow, I will try that and see if it works. What would I put in the region properties in ZE? Or do I even need one?

SOLVED! It works! w00T! I got it to work by checking caps and the likes along with looking at your examples.

Re: Cannot get musicworking [help]

Posted: Thu Dec 27, 2012 2:03 am
by Marth8880
re: Xfire, because I am on vacation and am away from any open wireless networks from usually 9am-10pm, and by 12am, I'm too tired to be online. Most of my posting here has been via my smart phone.