Random environments paired with random sounds [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
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:

Random environments paired with random sounds [Solved]

Post by Marth8880 »

I have a map that I have implemented random skies/FX/lighting into, but I don't want them all to have the same sound ambiance. For my clear, moonlit region I want the Dagobah (or something of the sort) ambient sound stream to be loaded and for my rainy region I want the Kamino ambient sound stream to be loaded. The random skies work and stuff, and I have both regions properly placed and named, but both weather modes have Kamino's sound stream. How do I do this? ("GlobalAmb" is Dagobah's soundregion and "GlobalAmb-SR" is Kamino's soundregion)

Here is what I've got so far:

PI3g_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()


WeatherMode = math.random(1,2)
weather()

--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 weather()

if WeatherMode == 1 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")
DeactivateRegion("GlobalAmb-SR")
ActivateRegion("GlobalAmb")

elseif WeatherMode == 2 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")
DeactivateRegion("GlobalAmb")
ActivateRegion("GlobalAmb-SR")

end
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("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


ReadDataFile("sound\\kam.lvl;kam1gcw")
ReadDataFile("dc:sound\\dag.lvl;dag1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_luke_jedi",
"all_hover_combatspeeder")

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_bobafett",
"imp_hover_fightertank",
"imp_hover_speederbike",
"imp_walk_atst" )

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

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
engineer = { "all_inf_engineer",1,4},
sniper = { "all_inf_sniper",1,4},
officer = { "all_inf_officer",1,4},
special = { "all_inf_wookiee",1,4},

},
imp = {
team = IMP,
units = 20,
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},
},
}

SetHeroClass(ALL, "all_hero_luke_jedi")
SetHeroClass(IMP, "imp_hero_bobafett")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 3) -- 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", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 308)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_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("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\kam.lvl", "kam1")
OpenAudioStream("sound\\kam.lvl", "kam1")
OpenAudioStream("dc:sound\\dag.lvl", "dag1")
OpenAudioStream("dc:sound\\dag.lvl", "dag1")
-- 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, "all_kam_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_kam_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_kam_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_kam_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_kam_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_kam_amb_end", 2,1)

SetVictoryMusic(ALL, "all_kam_amb_victory")
SetDefeatMusic (ALL, "all_kam_amb_defeat")
SetVictoryMusic(IMP, "imp_kam_amb_victory")
SetDefeatMusic (IMP, "imp_kam_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
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end
Oh, and I would also prefer to have Dagobah's music stream loaded during the moonlit mode and vice versa.


EDIT:

Alright, so this is where I am at now:

PI3g_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()


WeatherMode = math.random(1,2)
weather()

--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 weather()

if WeatherMode == 1 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")

DeactivateRegion("GlobalAmb-SR")
ActivateRegion("GlobalAmb")

--ReadDataFile("dc:sound\\dag.lvl;dag1gcw")
OpenAudioStream("dc:sound\\dag.lvl", "dag1")
OpenAudioStream("dc:sound\\dag.lvl", "dag1")

elseif WeatherMode == 2 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")

DeactivateRegion("GlobalAmb")
ActivateRegion("GlobalAmb-SR")

--ReadDataFile("sound\\kam.lvl;kam1gcw")
OpenAudioStream("sound\\kam.lvl", "kam1")
OpenAudioStream("sound\\kam.lvl", "kam1")

end
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("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


ReadDataFile("sound\\kam.lvl;kam1gcw")
ReadDataFile("dc:sound\\dag.lvl;dag1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_luke_jedi",
"all_hover_combatspeeder")

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_bobafett",
"imp_hover_fightertank",
"imp_hover_speederbike",
"imp_walk_atst" )

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

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
engineer = { "all_inf_engineer",1,4},
sniper = { "all_inf_sniper",1,4},
officer = { "all_inf_officer",1,4},
special = { "all_inf_wookiee",1,4},

},
imp = {
team = IMP,
units = 20,
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},
},
}

SetHeroClass(ALL, "all_hero_luke_jedi")
SetHeroClass(IMP, "imp_hero_bobafett")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 3) -- 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", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 308)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_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("sound\\global.lvl", "gcw_music")
--OpenAudioStream("sound\\kam.lvl", "kam1")
--OpenAudioStream("sound\\kam.lvl", "kam1")
--OpenAudioStream("dc:sound\\dag.lvl", "dag1")
--OpenAudioStream("dc:sound\\dag.lvl", "dag1")
-- 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, "all_kam_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_kam_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_kam_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_kam_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_kam_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_kam_amb_end", 2,1)

SetVictoryMusic(ALL, "all_kam_amb_victory")
SetDefeatMusic (ALL, "all_kam_amb_defeat")
SetVictoryMusic(IMP, "imp_kam_amb_victory")
SetDefeatMusic (IMP, "imp_kam_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
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end
All of the sounds work now except for the ambient streams, and the music stream is Kamino's for both weather modes (obvious fix [probably]). HOWEVER, this does not happen with every single sound that is played, but occasionally I will hear a sound repeated about a second after it's played, but instead at double its original pitch; and not only that, but I will also hear random tears - or screeches - in the sound while I am playing, and they sound like pink noise at a high pitch which quickly shifts down to a low pitch, all in about one second. I'll upload a sample of what it kind of sounds like pretty soon.
Last edited by Marth8880 on Sat Jul 09, 2011 8:53 pm, edited 3 times in total.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Random environments paired with random sounds

Post by AQT »

Create two new layers in ZE (called them moon and rain, say), and set them up like the stock Dagobah where each was used for the X-Wing and gunship prop. But for your situation, move your sound regions into these two layers. GlobalAmb-SR should go in the rain layer, and GlobalAmb should go in the moon layer. After this is done, you will need to modified your script a bit. Remove the following line:

Code: Select all

ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest")
And your new randomizing function should look like this:

Code: Select all

function weather()

if WeatherMode == 1 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "moon")

elseif WeatherMode == 2 then 
ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "rain")

end
It would be best if you move the entire thing to where the previous line you deleted was at.
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: Random environments paired with random sounds

Post by Marth8880 »

OLD:
Hidden/Spoiler:
Done, but the ambient streams still do not show up except for the thunder.

PI3g_con.lua
[code]--
-- 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()


WeatherMode = math.random(1,2)
weather()

--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("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


ReadDataFile("sound\\kam.lvl;kam1gcw")
ReadDataFile("dc:sound\\dag.lvl;dag1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_luke_jedi",
"all_hover_combatspeeder")

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_bobafett",
"imp_hover_fightertank",
"imp_hover_speederbike",
"imp_walk_atst" )

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

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
engineer = { "all_inf_engineer",1,4},
sniper = { "all_inf_sniper",1,4},
officer = { "all_inf_officer",1,4},
special = { "all_inf_wookiee",1,4},

},
imp = {
team = IMP,
units = 20,
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},
},
}

SetHeroClass(ALL, "all_hero_luke_jedi")
SetHeroClass(IMP, "imp_hero_bobafett")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 3) -- 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", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 308)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest")

function weather()
if WeatherMode == 1 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "moon")

elseif WeatherMode == 2 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "rain")

end
end

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("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\kam.lvl", "kam1")
OpenAudioStream("sound\\kam.lvl", "kam1")
OpenAudioStream("dc:sound\\dag.lvl", "dag1")
OpenAudioStream("dc:sound\\dag.lvl", "dag1")
-- 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, "all_kam_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_kam_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_kam_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_kam_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_kam_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_kam_amb_end", 2,1)

SetVictoryMusic(ALL, "all_kam_amb_victory")
SetDefeatMusic (ALL, "all_kam_amb_defeat")
SetVictoryMusic(IMP, "imp_kam_amb_victory")
SetDefeatMusic (IMP, "imp_kam_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
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end[/code]


EDIT:

Now the music works even though it's only Kamino for both weather modes. But the ambient sound streams still refuse to work. This is what I have now:

PI3g_con.lua
[code]--
-- 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()


WeatherMode = math.random(1,2)
weather()

--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("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


ReadDataFile("dc:sound\\dag.lvl;dag1gcw")
ReadDataFile("sound\\kam.lvl;kam1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_luke_jedi",
"all_hover_combatspeeder")

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_bobafett",
"imp_hover_fightertank",
"imp_hover_speederbike",
"imp_walk_atst" )

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

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
engineer = { "all_inf_engineer",1,4},
sniper = { "all_inf_sniper",1,4},
officer = { "all_inf_officer",1,4},
special = { "all_inf_wookiee",1,4},

},
imp = {
team = IMP,
units = 20,
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},
},
}

SetHeroClass(ALL, "all_hero_luke_jedi")
SetHeroClass(IMP, "imp_hero_bobafett")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 3) -- 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", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 308)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest")

function weather()
if WeatherMode == 1 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "moon")

elseif WeatherMode == 2 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "rain")

end
end

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("sound\\global.lvl", "gcw_music")
OpenAudioStream("dc:sound\\dag.lvl", "dag1")
OpenAudioStream("dc:sound\\dag.lvl", "dag1")
OpenAudioStream("sound\\kam.lvl", "kam1")
OpenAudioStream("sound\\kam.lvl", "kam1")
-- 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, "all_dag_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_dag_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_dag_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_dag_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_dag_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_dag_amb_end", 2,1)

SetVictoryMusic(ALL, "all_dag_amb_victory")
SetDefeatMusic (ALL, "all_dag_amb_defeat")
SetVictoryMusic(IMP, "imp_dag_amb_victory")
SetDefeatMusic (IMP, "imp_dag_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
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end[/code]


EDIT 2:

I was just looking in Dagobah's REQ file after remembering that is something in there that lists the map's layers.

dag1.req
[code]ucft
{

REQN
{
"texture"
"dag1_map"
"bird"
"bird2"
"leaf"
"fish"
}

REQN
{
"texture"
"platform=ps2"
"water_specularmask_0"
"water_specularmask_1"
"water_specularmask_2"
"water_specularmask_3"
"water_specularmask_4"
"water_specularmask_5"
"water_specularmask_6"
"water_specularmask_7"
"water_specularmask_8"
"water_specularmask_9"
"water_specularmask_10"
"water_specularmask_11"
"water_specularmask_12"
"water_specularmask_13"
"water_specularmask_14"
"water_specularmask_15"
"water_specularmask_16"
"water_specularmask_17"
"water_specularmask_18"
"water_specularmask_19"
"water_specularmask_20"
"water_specularmask_21"
"water_specularmask_22"
"water_specularmask_23"
"water_specularmask_24"
"dag1_water"
}

REQN
{
"texture"
"platform=xbox"
"water_normalmap_0"
"water_normalmap_1"
"water_normalmap_2"
"water_normalmap_3"
"water_normalmap_4"
"water_normalmap_5"
"water_normalmap_6"
"water_normalmap_7"
"water_normalmap_8"
"water_normalmap_9"
"water_normalmap_10"
"water_normalmap_11"
"water_normalmap_12"
"water_normalmap_13"
"water_normalmap_14"
"water_normalmap_15"
}

REQN
{
"texture"
"platform=pc"
"water_bumpmap_0"
"water_bumpmap_1"
"water_bumpmap_2"
"water_bumpmap_3"
"water_bumpmap_4"
"water_bumpmap_5"
"water_bumpmap_6"
"water_bumpmap_7"
"water_bumpmap_8"
"water_bumpmap_9"
"water_bumpmap_10"
"water_bumpmap_11"
"water_bumpmap_12"
"water_bumpmap_13"
"water_bumpmap_14"
"water_bumpmap_15"

"water_normalmap_0"
"water_normalmap_1"
"water_normalmap_2"
"water_normalmap_3"
"water_normalmap_4"
"water_normalmap_5"
"water_normalmap_6"
"water_normalmap_7"
"water_normalmap_8"
"water_normalmap_9"
"water_normalmap_10"
"water_normalmap_11"
"water_normalmap_12"
"water_normalmap_13"
"water_normalmap_14"
"water_normalmap_15"

"water_specularmask_0"
"water_specularmask_1"
"water_specularmask_2"
"water_specularmask_3"
"water_specularmask_4"
"water_specularmask_5"
"water_specularmask_6"
"water_specularmask_7"
"water_specularmask_8"
"water_specularmask_9"
"water_specularmask_10"
"water_specularmask_11"
"water_specularmask_12"
"water_specularmask_13"
"water_specularmask_14"
"water_specularmask_15"
"water_specularmask_16"
"water_specularmask_17"
"water_specularmask_18"
"water_specularmask_19"
"water_specularmask_20"
"water_specularmask_21"
"water_specularmask_22"
"water_specularmask_23"
"water_specularmask_24"
"dag1_water"

}


REQN
{
"path"
"dag1"
}
REQN
{
"congraph"
"dag1"
}
REQN
{
"envfx"
"dag1"
}
REQN
{
"world"
"dag1"
"dag1_trees_01"
"dag1_SoundRegions"
"dag1_SoundSpaces"
"dag1_Rock_group"
"dag1_SoundEmitters"
}
REQN
{
"prop"
"dag1"
}
REQN
{
"boundary"
"dag1"
}
REQN
{
"config"
"dag1_mist"
"fireflies"
}

REQN
{
"lvl"
"dag1_ctf"
"dag1_conquest"
"dag1_cw"
"dag1_gcw"
"dag1_1flag"
}
}[/code]
So I did this to my REQ:

PI3.req
[code]ucft
{
REQN
{
"config"
}

REQN
{
"texture"
"PI3_map"
}
REQN
{
"texture"
"platform=pc"
"water_bumpmap_0"
"water_bumpmap_1"
"water_bumpmap_2"
"water_bumpmap_3"
"water_bumpmap_4"
"water_bumpmap_5"
"water_bumpmap_6"
"water_bumpmap_7"
"water_bumpmap_8"
"water_bumpmap_9"
"water_bumpmap_10"
"water_bumpmap_11"
"water_bumpmap_12"
"water_bumpmap_13"
"water_bumpmap_14"
"water_bumpmap_15"

"water_normalmap_0"
"water_normalmap_1"
"water_normalmap_2"
"water_normalmap_3"
"water_normalmap_4"
"water_normalmap_5"
"water_normalmap_6"
"water_normalmap_7"
"water_normalmap_8"
"water_normalmap_9"
"water_normalmap_10"
"water_normalmap_11"
"water_normalmap_12"
"water_normalmap_13"
"water_normalmap_14"
"water_normalmap_15"

"water_specularmask_0"
"water_specularmask_1"
"water_specularmask_2"
"water_specularmask_3"
"water_specularmask_4"
"water_specularmask_5"
"water_specularmask_6"
"water_specularmask_7"
"water_specularmask_8"
"water_specularmask_9"
"water_specularmask_10"
"water_specularmask_11"
"water_specularmask_12"
"water_specularmask_13"
"water_specularmask_14"
"water_specularmask_15"
"water_specularmask_16"
"water_specularmask_17"
"water_specularmask_18"
"water_specularmask_19"
"water_specularmask_20"
"water_specularmask_21"
"water_specularmask_22"
"water_specularmask_23"
"water_specularmask_24"

"nab2_water"

}
REQN
{
"path"
"PI3"
}
REQN
{
"congraph"
"PI3"
}
REQN
{
"world"
"PI3"
"moon"
"rain"
}
REQN
{
"prop"
"PI3"
}
REQN
{
"class"
"bluelight"
"redlight"
"greenlight"
"whitelight"
}
REQN
{
"config"
"flyerspray"
"walkerstomp"
"hailfire_wake"
}
REQN
{
"lvl"
"PI3_conquest"
"PI3_1flag"
}
}[/code]
But the sound streams are still not appearing.

Okay, so I found out that I did the layer stuff incorrectly because I forgot to do the game modes as well. I attempted to fix it but it still doesn't work; here is what I have now:


PI3g_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 random weather function
WeatherMode = math.random(1,2)
weather()

-- 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"}
cp10 = CommandPost:New{name = "cp10"}
cp11 = CommandPost:New{name = "cp11"}
cp12 = CommandPost:New{name = "cp12"}



-- 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:AddCommandPost(cp10)
conquest:AddCommandPost(cp11)
conquest:AddCommandPost(cp12)

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()

-- This loads our loadscreen
ReadDataFile("dc:Load\\common.lvl")
ReadDataFile("ingame.lvl")

-- This loads our weather variation
--ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")


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


--ReadDataFile("dc:sound\\kam.lvl;kam1gcw")
--ReadDataFile("dc:sound\\uta.lvl;uta1gcw")
ReadDataFile("dc:sound\\pi3.lvl;pi3gcw")
ReadDataFile("sound\\dag.lvl;dag1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_chewbacca",
"all_hover_combatspeeder")

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_bobafett",
"imp_hover_fightertank",
"imp_hover_speederbike",
"imp_walk_atst" )

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

SetupTeams{
all = {
team = ALL,
units = 27,
reinforcements = 200,
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
engineer = { "all_inf_engineer",1,4},
sniper = { "all_inf_sniper",1,4},
officer = { "all_inf_officer",1,4},
special = { "all_inf_wookiee",1,4},

},
imp = {
team = IMP,
units = 27,
reinforcements = 200,
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},
},
}

SetHeroClass(ALL, "all_hero_chewbacca")
SetHeroClass(IMP, "imp_hero_bobafett")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 3) -- 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", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 308)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)

-- This tells our random weather which environments and layers to load
function weather()
if WeatherMode == 1 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest")

elseif WeatherMode == 2 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "PI3_rain")

end
end


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("sound\\global.lvl", "gcw_music")
--OpenAudioStream("dc:sound\\kam.lvl", "kam1")
--OpenAudioStream("dc:sound\\uta.lvl", "uta1")
OpenAudioStream("dc:sound\\pi3.lvl", "pi3_ambiance")
OpenAudioStream("sound\\dag.lvl", "dag1")

-- 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, "all_dag_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_dag_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_dag_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_dag_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_dag_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_dag_amb_end", 2,1)

SetVictoryMusic(ALL, "all_dag_amb_victory")
SetDefeatMusic (ALL, "all_dag_amb_defeat")
SetVictoryMusic(IMP, "imp_dag_amb_victory")
SetDefeatMusic (IMP, "imp_dag_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.931925, -0.108715, 0.343641, 0.040088, -5.782282, 13.685349, 221.953949);
AddCameraShot(0.358358, -0.010894, -0.933090, -0.028365, -44.763466, 2.160791, 153.530457);
AddCameraShot(0.755659, -0.094642, 0.643067, 0.080541, 162.549301, 19.342003, 249.039520);
AddCameraShot(0.558064, -0.040028, -0.826708, -0.059298, -197.403259, 8.593826, 157.532486);
AddCameraShot(0.995680, -0.092814, 0.002568, 0.000239, -51.045925, 19.905941, 308.196655);
end
PI3.req
Hidden/Spoiler:
ucft
{
REQN
{
"config"
}

REQN
{
"texture"
"PI3_map"
}
REQN
{
"texture"
"platform=pc"
"water_bumpmap_0"
"water_bumpmap_1"
"water_bumpmap_2"
"water_bumpmap_3"
"water_bumpmap_4"
"water_bumpmap_5"
"water_bumpmap_6"
"water_bumpmap_7"
"water_bumpmap_8"
"water_bumpmap_9"
"water_bumpmap_10"
"water_bumpmap_11"
"water_bumpmap_12"
"water_bumpmap_13"
"water_bumpmap_14"
"water_bumpmap_15"

"water_normalmap_0"
"water_normalmap_1"
"water_normalmap_2"
"water_normalmap_3"
"water_normalmap_4"
"water_normalmap_5"
"water_normalmap_6"
"water_normalmap_7"
"water_normalmap_8"
"water_normalmap_9"
"water_normalmap_10"
"water_normalmap_11"
"water_normalmap_12"
"water_normalmap_13"
"water_normalmap_14"
"water_normalmap_15"

"water_specularmask_0"
"water_specularmask_1"
"water_specularmask_2"
"water_specularmask_3"
"water_specularmask_4"
"water_specularmask_5"
"water_specularmask_6"
"water_specularmask_7"
"water_specularmask_8"
"water_specularmask_9"
"water_specularmask_10"
"water_specularmask_11"
"water_specularmask_12"
"water_specularmask_13"
"water_specularmask_14"
"water_specularmask_15"
"water_specularmask_16"
"water_specularmask_17"
"water_specularmask_18"
"water_specularmask_19"
"water_specularmask_20"
"water_specularmask_21"
"water_specularmask_22"
"water_specularmask_23"
"water_specularmask_24"

"nab2_water"

}
REQN
{
"path"
"PI3"
}
REQN
{
"congraph"
"PI3"
}
REQN
{
"world"
"PI3"
}
REQN
{
"prop"
"PI3"
}
REQN
{
"class"
"bluelight"
"redlight"
"greenlight"
"whitelight"
}
REQN
{
"config"
"flyerspray"
"walkerstomp"
"hailfire_wake"
}
REQN
{
"lvl"
"PI3_conquest"
"PI3_moon"
"PI3_rain"
"PI3_1flag"
}
}
PI3.LDX
Hidden/Spoiler:
Version(1);
NextID(1);

Layer("[Base]", 0, 0)
{
Description("Base layer, always loaded");
}

Layer("conquest", 1, 0)
{
Description("Loaded in conquest mode");
}

Layer("1flag", 2, 0)
{
Description("Loaded in 1flag mode");
}

Layer("moon", 3, 0)
{
Description("");
}

Layer("rain", 4, 0)
{
Description("");
}


GameMode("Common")
{
Layer(0);
}

GameMode("conquest")
{
Layer(1);
}

GameMode("moon")
{
Layer(3);
}

GameMode("rain")
{
Layer(4);
}

GameMode("1flag")
{
Layer(2);
}
PI3.GRP
Hidden/Spoiler:
Version(1);
NextID(1);

Group("[Base]", 0, 8)
{
Layer("[Base]", 0);
Layer("conquest", 1);
Layer("1flag", 2);
Layer("moon", 3);
Layer("rain", 4);
}
PI3_rain.lyr
Hidden/Spoiler:
Version(3);
SaveType(0);

Camera("camera")
{
Rotation(1.000, 0.000, 0.000, 0.000);
Position(0.000, 0.000, 0.000);
FieldOfView(55.400);
NearPlane(1.000);
FarPlane(5000.000);
ZoomFactor(1.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(0.000, 0.000, 0.000, 1.000, 0.000, 0.000, 0.000);
Bookmark(137.595, 36.459, -146.877, 0.221, 0.011, -0.974, 0.049);
}
LightName("PI3_rain.LGT");
ControllerManager("StandardCtrlMgr");

WorldExtents()
{
Min(0.000000, 0.000000, 0.000000);
Max(0.000000, 0.000000, 0.000000);
}

NextSequence(-4713853);
PI3_rain.mrq
Hidden/Spoiler:
ucft
{
REQN
{
"congraph"
"PI3_rain"
}
REQN
{
"world"
"PI3_rain"
}
}
PI3_rain.RGN
Hidden/Spoiler:
Version(1);
RegionCount(1);

Region("soundstream pi3_amb_rain 1", 1)
{
Layer(4);
Position(-22.380564, -3.217844, -211.545959);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(250.000000, 250.000000, 250.000000);
Name("GlobalAmb-SR");
}
PI3.RGN
Hidden/Spoiler:
Version(1);
RegionCount(26);

Region("Health1", 2)
{
Position(124.015297, 9.040477, -240.984268);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Health1");
}

Region("Ammo1", 2)
{
Position(123.979149, 9.103020, -242.991287);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Ammo1");
}

Region("Ammo2", 2)
{
Position(100.072739, 7.776224, -230.951431);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(3.000000, 2.000000, 3.000000);
Name("Ammo2");
}

Region("Ammo3", 2)
{
Position(100.010658, 7.985182, -256.002228);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(3.000000, 2.000000, 3.000000);
Name("Ammo3");
}

Region("Health2", 2)
{
Position(120.033714, 9.025064, -113.996155);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Health2");
}

Region("Ammo4", 2)
{
Position(118.991264, 8.979271, -115.982597);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Ammo4");
}

Region("Ammo5", 2)
{
Position(19.939785, 0.426143, -259.081085);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Ammo5");
}

Region("Health3", 2)
{
Position(21.992468, 0.461156, -257.987823);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Health3");
}

Region("Ammo6", 2)
{
Position(84.111732, 8.842593, -312.023987);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Ammo6");
}

Region("Health4", 2)
{
Position(92.979706, 8.812325, -321.952667);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Health4");
}

Region("Health5", 2)
{
Position(-41.005859, 0.435314, -167.029083);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Health5");
}

Region("Ammo7", 2)
{
Position(-44.013657, 0.952733, -166.943314);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Ammo7");
}

Region("Health6", 2)
{
Position(-83.965782, 7.559142, -336.974915);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Health6");
}

Region("Ammo8", 2)
{
Position(-82.055450, 7.646738, -336.942810);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Ammo8");
}

Region("Ammo9", 2)
{
Position(-156.052948, 1.788918, -174.970322);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Ammo9");
}

Region("Health7", 2)
{
Position(-158.028503, 1.817975, -176.969864);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 2.000000, 2.000000);
Name("Health7");
}

Region("Ammo10", 2)
{
Position(-133.020050, 1.819299, -185.984192);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(3.000000, 2.000000, 3.000000);
Name("Ammo10");
}

Region("Ammo11", 2)
{
Position(-147.076889, 1.645143, -199.977295);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(3.000000, 2.000000, 3.000000);
Name("Ammo11");
}

Region("Ammo12", 2)
{
Position(108.770973, 10.038369, -182.991058);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(3.000000, 3.000000, 3.000000);
Name("Ammo12");
}

Region("Ammo13", 2)
{
Position(148.711349, 10.028840, -205.922485);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(2.000000, 3.000000, 2.000000);
Name("Ammo13");
}

Region("mapbounds", 0)
{
Position(-24.170927, 48.576385, -154.812744);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(350.000000, 350.000000, 350.000000);
Name("mapbounds");
}

Region("soundstream pi3_amb_crickets 1", 1)
{
Position(-22.380564, -3.217844, -211.545959);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(250.000000, 250.000000, 250.000000);
Name("GlobalAmb");
}

Region("soundstream pi3_amb_crickets-frogs1 1", 1)
{
Position(-45.765560, 5.159865, -210.954132);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(70.000000, 70.000000, 70.000000);
Name("LakeAmb1");
}

Region("soundstream pi3_amb_crickets-frogs 1", 1)
{
Position(10.212287, 1.688641, 54.567207);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(50.000000, 50.000000, 50.000000);
Name("LakeAmb2");
}

Region("soundstream pi3_amb_crickets-frogs 1.5", 1)
{
Position(-67.621628, 2.894984, 54.514290);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(50.000000, 50.000000, 50.000000);
Name("LakeAmb3");
}

Region("soundstream pi3_amb_crickets-frogs 1.5", 1)
{
Position(-154.196259, 0.835597, 69.830521);
Rotation(1.000000, 0.000000, 0.000000, 0.000000);
Size(50.000000, 50.000000, 50.000000);
Name("LakeAmb4");
}
Both the rain and the cricket sound stream are in my map's custom sound LVL. pi3_amb_crickets is the sound stream that should be playing during the moon variation and pi3_amb_rain is the sound stream that should be playing during the rain variation. In Zero Editor, the rain layer is called rain and the moon layer is called moon.


EDIT:

I found that when I comment out the random weather function and only load either of the weather variations, their sound stream works.

For example:

Changing this:

Code: Select all

-- This tells our random weather which environments and layers to load
	function weather()
		if WeatherMode == 1 then
			ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")
			ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "PI3_moon")
			
		elseif WeatherMode == 2 then 
			ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")
			ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "PI3_rain")
		
		end
	end
To this:

Code: Select all

ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "PI3_moon")
	-- This tells our random weather which environments and layers to load
	--function weather()
	--	if WeatherMode == 1 then
	--		ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")
	--		ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "PI3_moon")
	--		
	--	elseif WeatherMode == 2 then 
	--		ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")
	--		ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "PI3_rain")
	--	
	--	end
	--end
As well as only loading the moon variation's sky loads the moon variation, and its sound stream works, and vice versa with the rain variation; this proves that the random weather function only likes to load random weather and nothing else. What is a way around this?

EDIT2:

Okay, now the A.I. are not spawning.

EDIT3!!!!!!!!!!:

YES!, it works now! Thank you so much, AQT, you are a lifesaver!!!!!! It is completely my fault that it didn't work before; I didn't read your post quite right when you posted the new function's code.

Now that THAT is all out of the way, I put this in ScriptInit:
Hidden/Spoiler:
-- This defines the random weather function
WeatherMode = math.random(1,2)

-- This tells our random weather which environments and layers to load
if WeatherMode == 1 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "moon")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "PI3_moon")

elseif WeatherMode == 2 then
ReadDataFile("dc:PI3\\PI3_sky.lvl", "rain")
ReadDataFile("dc:PI3\\PI3.lvl", "PI3_conquest", "PI3_rain")

end
Post Reply