Below is my lua for reference.
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_DoFile("setup_teams")
-- Empire Attacking (attacker is always #1)
ALL = 2
IMP = 1
-- These variables do not change
ATT = 1
DEF = 2
---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptPostLoad()
DisableBarriers("conquestbar")
DisableBarriers("bombbar")
--force all the human players onto the attacking side
KillObject("CP7OBJ")
KillObject("shieldgen")
KillObject("CP7OBJ")
KillObject("hangarcp")
KillObject("enemyspawn")
KillObject("enemyspawn2")
KillObject("echoback2")
KillObject("echoback1")
KillObject("shield")
SetProperty("ship", "MaxHealth", 1e+37)
SetProperty("ship", "CurHealth", 1e+37)
SetProperty("ship2", "MaxHealth", 1e+37)
SetProperty("ship2", "CurHealth", 1e+37)
SetProperty("ship3", "MaxHealth", 1e+37)
SetProperty("ship3", "CurHealth", 1e+37)
-- SetProperty("echoback1", "MaxHealth", 1500)
-- SetProperty("echoback1", "CurHealth", 1500)
-- SetProperty("echoback2", "MaxHealth", 1500)
-- SetProperty("echoback2", "CurHealth", 1500)
hunt = ObjectiveTDM:New{teamATT = 1, teamDEF = 2, pointsPerKillATT = 1, pointsPerKillDEF = 3, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}
hunt.OnStart = function(self)
AddAIGoal(ATT, "Deathmatch", 1000)
AddAIGoal(DEF, "Deathmatch", 1000)
end
hunt:Start()
EnableSPHeroRules()
AddDeathRegion("deathregion")
AddDeathRegion("deathregion2")
end
function ScriptInit()
--tell the game to load our loading image
ReadDataFile("dc:Load\\common.lvl")
if(ScriptCB_GetPlatform() == "PS2") then
StealArtistHeap(1024*1024) -- steal 1MB from art heap
end
-- Designers, these two lines *MUST* be first.
--SetPS2ModelMemory(4500000)
SetPS2ModelMemory(3300000)
ReadDataFile("ingame.lvl")
-- Empire Attacking (attacker is always #1)
--local ALL = 2
--local IMP = 1
-- These variables do not change
--local ATT = 1
--local DEF = 2
--SetAttackingTeam(ATT)
SetMaxFlyHeight(70)
SetMaxPlayerFlyHeight(70)
SetGroundFlyerMap(1);
ReadDataFile("sound\\myg.lvl;myg1gcw")
ReadDataFile("dc:sound\\bne.lvl;bnegcw")
ReadDataFile("SIDE\\all.lvl",
"all_hero_chewbacca",
"all_hero_leia")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_hero_bobafett")
ReadDataFile("dc:SIDE\\trt.lvl",
"all_hero_lando",
"all_droid_r2d2",
"all_hero_bespin_luke")
SetupTeams{
all = {
team = ALL,
units = 4,
reinforcements = -1,
soldier = {"all_hero_leia",1},
assault = {"all_hero_chewbacca",1},
engineer = {"all_droid_r2d2",1},
sniper = {"all_hero_lando",1},
},
imp = {
team = IMP,
units = 20,
reinforcements = -1,
soldier = { "imp_inf_rifleman",9, 25},
},
}
SetHeroClass(ALL, "all_hero_bespin_luke")
SetHeroClass(IMP, "imp_hero_bobafett")
-- Level Stats
ClearWalkers()
SetMemoryPoolSize("EntityWalker", -2)
AddWalkerType(0, 0) -- 0 droidekas
AddWalkerType(1, 5) -- 6 atsts with 1 leg pairs each
AddWalkerType(2, 2) -- 2 atats with 2 leg pairs each
SetMemoryPoolSize("Aimer", 90)
SetMemoryPoolSize("AmmoCounter", 269)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("ConnectivityGraphFollower", 56)
SetMemoryPoolSize("EnergyBar", 269)
SetMemoryPoolSize("EntityCloth", 28)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntityLight", 225)
SetMemoryPoolSize("EntitySoundStatic", 16)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 54)
SetMemoryPoolSize("MountedTurret", 46)
SetMemoryPoolSize("Navigator", 63)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("OrdnanceTowCable", 40) -- !!!! need +4 extra for wrapped/fallen cables !!!!
SetMemoryPoolSize("PathFollower", 63)
SetMemoryPoolSize("PathNode", 268)
SetMemoryPoolSize("RedOmniLight", 240)
SetMemoryPoolSize("TreeGridStack", 329)
SetMemoryPoolSize("UnitController", 63)
SetMemoryPoolSize("UnitAgent", 63)
SetMemoryPoolSize("Weapon", 269)
ReadDataFile("dc:BNE\\bes3.lvl", "bes3_hunt")
--ReadDataFile("tan\\tan1.lvl", "tan1_obj")
SetSpawnDelay(10.0, 0.25)
SetDenseEnvironment("false")
SetDefenderSnipeRange(170)
AddDeathRegion("Death")
-- Sound
musicStream = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", musicStream)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", musicStream)
OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\myg.lvl", "myg1")
OpenAudioStream("sound\\myg.lvl", "myg1")
-- OpenAudioStream("sound\\myg.lvl", "myg1_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(1, "allleaving")
SetOutOfBoundsVoiceOver(2, "impleaving")
SetAmbientMusic(ALL, 1.0, "all_myg_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_myg_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2,"all_myg_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_myg_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_myg_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2,"imp_myg_amb_end", 2,1)
SetVictoryMusic(ALL, "all_myg_amb_victory")
SetDefeatMusic (ALL, "all_myg_amb_defeat")
SetVictoryMusic(IMP, "imp_myg_amb_victory")
SetDefeatMusic (IMP, "imp_myg_amb_defeat")
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
-- SetSoundEffect("BirdScatter", "birdsFlySeq1")
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")
--OpeningSateliteShot
AddCameraShot(0.921865, -0.017918, 0.387024, 0.007522, 172.437500, 20.310862, 81.282127);
AddCameraShot(0.918847, -0.080617, -0.384813, -0.033762, 201.526184, 19.137720, -170.633789);
AddCameraShot(-0.002652, 0.000168, -0.997998, -0.063191, 211.232025, 18.612904, -67.894081);
AddCameraShot(0.999362, -0.035613, 0.002799, 0.000100, 100.695435, 2.600187, -79.087349);
AddCameraShot(0.707493, -0.015773, -0.706369, -0.015748, 123.876793, 2.600187, 37.792404);
AddCameraShot(0.592626, -0.004746, -0.805438, -0.006450, 31.254845, 62.577957, -277.082336);
AddCameraShot(0.978340, -0.031134, 0.204547, 0.006509, 163.909683, 40.397472, -173.709442);
AddCameraShot(0.768637, -0.006156, 0.639635, 0.005123, 137.713455, 63.264198, -217.085419);
AddCameraShot(0.999664, -0.025620, -0.003855, -0.000099, 211.125641, 17.876221, -135.611267);
AddCameraShot(0.999795, -0.019432, -0.005753, -0.000112, 76.313194, 13.118959, 122.914833);
AddCameraShot(-0.384098, -0.012655, -0.922705, 0.030400, 47.151829, 1.577695, -15.288089);
end
[/code]
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_DoFile("setup_teams")
-- Empire Attacking (attacker is always #1)
ALL = 2
IMP = 1
-- These variables do not change
ATT = 1
DEF = 2
---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptPostLoad()
DisableBarriers("conquestbar")
DisableBarriers("bombbar")
--force all the human players onto the attacking side
KillObject("CP7OBJ")
KillObject("shieldgen")
KillObject("CP7OBJ")
KillObject("hangarcp")
KillObject("enemyspawn")
KillObject("enemyspawn2")
KillObject("echoback2")
KillObject("echoback1")
KillObject("shield")
SetProperty("ship", "MaxHealth", 1e+37)
SetProperty("ship", "CurHealth", 1e+37)
SetProperty("ship2", "MaxHealth", 1e+37)
SetProperty("ship2", "CurHealth", 1e+37)
SetProperty("ship3", "MaxHealth", 1e+37)
SetProperty("ship3", "CurHealth", 1e+37)
-- SetProperty("echoback1", "MaxHealth", 1500)
-- SetProperty("echoback1", "CurHealth", 1500)
-- SetProperty("echoback2", "MaxHealth", 1500)
-- SetProperty("echoback2", "CurHealth", 1500)
hunt = ObjectiveTDM:New{teamATT = 1, teamDEF = 2, pointsPerKillATT = 1, pointsPerKillDEF = 3, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}
hunt.OnStart = function(self)
AddAIGoal(ATT, "Deathmatch", 1000)
AddAIGoal(DEF, "Deathmatch", 1000)
end
hunt:Start()
EnableSPHeroRules()
AddDeathRegion("deathregion")
AddDeathRegion("deathregion2")
end
function ScriptInit()
--tell the game to load our loading image
ReadDataFile("dc:Load\\common.lvl")
if(ScriptCB_GetPlatform() == "PS2") then
StealArtistHeap(1024*1024) -- steal 1MB from art heap
end
-- Designers, these two lines *MUST* be first.
--SetPS2ModelMemory(4500000)
SetPS2ModelMemory(3300000)
ReadDataFile("ingame.lvl")
-- Empire Attacking (attacker is always #1)
--local ALL = 2
--local IMP = 1
-- These variables do not change
--local ATT = 1
--local DEF = 2
--SetAttackingTeam(ATT)
SetMaxFlyHeight(70)
SetMaxPlayerFlyHeight(70)
SetGroundFlyerMap(1);
ReadDataFile("sound\\myg.lvl;myg1gcw")
ReadDataFile("dc:sound\\bne.lvl;bnegcw")
ReadDataFile("SIDE\\all.lvl",
"all_hero_chewbacca",
"all_hero_leia")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_hero_bobafett")
ReadDataFile("dc:SIDE\\trt.lvl",
"all_hero_lando",
"all_droid_r2d2",
"all_hero_bespin_luke")
SetupTeams{
all = {
team = ALL,
units = 4,
reinforcements = -1,
soldier = {"all_hero_leia",1},
assault = {"all_hero_chewbacca",1},
engineer = {"all_droid_r2d2",1},
sniper = {"all_hero_lando",1},
},
imp = {
team = IMP,
units = 20,
reinforcements = -1,
soldier = { "imp_inf_rifleman",9, 25},
},
}
SetHeroClass(ALL, "all_hero_bespin_luke")
SetHeroClass(IMP, "imp_hero_bobafett")
-- Level Stats
ClearWalkers()
SetMemoryPoolSize("EntityWalker", -2)
AddWalkerType(0, 0) -- 0 droidekas
AddWalkerType(1, 5) -- 6 atsts with 1 leg pairs each
AddWalkerType(2, 2) -- 2 atats with 2 leg pairs each
SetMemoryPoolSize("Aimer", 90)
SetMemoryPoolSize("AmmoCounter", 269)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("ConnectivityGraphFollower", 56)
SetMemoryPoolSize("EnergyBar", 269)
SetMemoryPoolSize("EntityCloth", 28)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntityLight", 225)
SetMemoryPoolSize("EntitySoundStatic", 16)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 54)
SetMemoryPoolSize("MountedTurret", 46)
SetMemoryPoolSize("Navigator", 63)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("OrdnanceTowCable", 40) -- !!!! need +4 extra for wrapped/fallen cables !!!!
SetMemoryPoolSize("PathFollower", 63)
SetMemoryPoolSize("PathNode", 268)
SetMemoryPoolSize("RedOmniLight", 240)
SetMemoryPoolSize("TreeGridStack", 329)
SetMemoryPoolSize("UnitController", 63)
SetMemoryPoolSize("UnitAgent", 63)
SetMemoryPoolSize("Weapon", 269)
ReadDataFile("dc:BNE\\bes3.lvl", "bes3_hunt")
--ReadDataFile("tan\\tan1.lvl", "tan1_obj")
SetSpawnDelay(10.0, 0.25)
SetDenseEnvironment("false")
SetDefenderSnipeRange(170)
AddDeathRegion("Death")
-- Sound
musicStream = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", musicStream)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", musicStream)
OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\myg.lvl", "myg1")
OpenAudioStream("sound\\myg.lvl", "myg1")
-- OpenAudioStream("sound\\myg.lvl", "myg1_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(1, "allleaving")
SetOutOfBoundsVoiceOver(2, "impleaving")
SetAmbientMusic(ALL, 1.0, "all_myg_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_myg_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2,"all_myg_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_myg_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_myg_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2,"imp_myg_amb_end", 2,1)
SetVictoryMusic(ALL, "all_myg_amb_victory")
SetDefeatMusic (ALL, "all_myg_amb_defeat")
SetVictoryMusic(IMP, "imp_myg_amb_victory")
SetDefeatMusic (IMP, "imp_myg_amb_defeat")
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
-- SetSoundEffect("BirdScatter", "birdsFlySeq1")
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")
--OpeningSateliteShot
AddCameraShot(0.921865, -0.017918, 0.387024, 0.007522, 172.437500, 20.310862, 81.282127);
AddCameraShot(0.918847, -0.080617, -0.384813, -0.033762, 201.526184, 19.137720, -170.633789);
AddCameraShot(-0.002652, 0.000168, -0.997998, -0.063191, 211.232025, 18.612904, -67.894081);
AddCameraShot(0.999362, -0.035613, 0.002799, 0.000100, 100.695435, 2.600187, -79.087349);
AddCameraShot(0.707493, -0.015773, -0.706369, -0.015748, 123.876793, 2.600187, 37.792404);
AddCameraShot(0.592626, -0.004746, -0.805438, -0.006450, 31.254845, 62.577957, -277.082336);
AddCameraShot(0.978340, -0.031134, 0.204547, 0.006509, 163.909683, 40.397472, -173.709442);
AddCameraShot(0.768637, -0.006156, 0.639635, 0.005123, 137.713455, 63.264198, -217.085419);
AddCameraShot(0.999664, -0.025620, -0.003855, -0.000099, 211.125641, 17.876221, -135.611267);
AddCameraShot(0.999795, -0.019432, -0.005753, -0.000112, 76.313194, 13.118959, 122.914833);
AddCameraShot(-0.384098, -0.012655, -0.922705, 0.030400, 47.151829, 1.577695, -15.288089);
end
[/code]



