[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("custom_fc_commands")
function ScriptPostLoad()
-- script test map for space to ground on mos eisley by anthony b
-- tat2g_s2g means space 2 ground
--This defines the CPs. These need to happen first
--SetProperty("FDL-2", "IsLocked", 1)
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}
--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(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:Start()
AddAIGoal(1, "conquest", 1000)
AddAIGoal(2, "conquest", 1000)
AddAIGoal(3, "conquest", 1000)
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()
-- Designers, these two lines *MUST* be first!
StealArtistHeap(1024 * 1024)
SetPS2ModelMemory(2097152 + 65536 * 10)
ReadDataFile("SIDE\\ingame.lvl")
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
--AddMissionObjective(IMP, "red", "level.tat2.objectives.1")
-- AddMissionObjective(IMP, "orange", "level.tat2.objectives.2")
--AddMissionObjective(ALL, "green", "level.tat2.objectives.1b")
-- AddMissionObjective(ALL, "orange", "level.tat2.objectives.3")
SetMaxFlyHeight(325) -- we need space between ships and ground
SetMaxPlayerFlyHeight(325)
ReadDataFile("sound\\tat.lvl;tat2gcw")
-- we need to call in fighters or hangars will be empty
-- pilots and marines too
ReadDataFile("SIDE\\all.lvl",
"all_fly_awing",
"all_fly_gunship_sc",
"all_fly_xwing_sc",
"all_fly_ywing_sc",
"all_inf_pilot",
"all_inf_marine",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee")
ReadDataFile("SIDE\\imp.lvl",
"imp_fly_tiebomber_sc",
"imp_fly_tiefighter_sc",
"imp_fly_tieinterceptor",
"imp_fly_trooptrans",
"imp_inf_pilot",
"imp_inf_marine",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper")
ReadDataFile("SIDE\\des.lvl",
"tat_inf_tuskenhunter",
"tat_inf_tuskenraider",
"tat_inf_jawa")
-- Jawas --------------------------
SetTeamName (3, "locals")
AddUnitClass (3, "tat_inf_tuskenhunter",4)
AddUnitClass (3, "tat_inf_tuskenraider",4)
AddUnitClass (3, "tat_inf_jawa",4)
SetUnitCount (3, 12)
SetTeamAsEnemy(3,ATT)
SetTeamAsEnemy(3,DEF)
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(DEF,3)
-----------------------------------
ReadDataFile("SIDE\\tur.lvl", -- need space guns
"tur_bldg_spa_all_beam",
"tur_bldg_spa_all_recoilless",
"tur_bldg_spa_all_chaingun",
"tur_bldg_spa_imp_beam",
"tur_bldg_spa_imp_recoilless",
"tur_bldg_spa_imp_chaingun",
"tur_bldg_chaingun_roof",
"tur_bldg_tat_barge",
"tur_bldg_laser")
SetupTeams{
all = {
team = ALL,
units = 50,
reinforcements = 250,
soldier = { "all_inf_rifleman",5,9},
assault = { "all_inf_rocketeer",5,9},
engineer = { "all_inf_engineer",5,9},
sniper = { "all_inf_sniper",5,9},
officer = { "all_inf_officer",5,9},
special = { "all_inf_wookiee",5,9},
marine = { "all_inf_marine",5,9},
pilot = { "all_inf_pilot",5,9},
},
imp = {
team = IMP,
units = 50,
reinforcements = 250,
soldier = { "imp_inf_rifleman",5,9},
assault = { "imp_inf_rocketeer",5,9},
engineer = { "imp_inf_engineer",5,9},
sniper = { "imp_inf_sniper",5,9},
officer = { "imp_inf_officer",5,9},
special = { "imp_inf_dark_trooper",5,9},
marine = { "imp_inf_marine",5,9},
pilot = { "imp_inf_pilot",5,9},
},
}
--AddUnitClass(ALL, "all_hero_hansolo_tat")
--AddUnitClass(IMP, "imp_hero_bobafett")
--AddUnitClass(ALL, "tat_inf_jawa")
--AddUnitClass(IMP, "tat_inf_jawa")
-- 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)
SetMemoryPoolSize("Aimer", 14)
-- we need room for ships
SetMemoryPoolSize("EntityFlyer",32)
SetMemoryPoolSize("CommandFlyer",4)
SetMemoryPoolSize("EntityRemoteTerminal",16) -- remote chairs
SetMemoryPoolSize("EntityCloth", 25)
--SetMemoryPoolSize("EntityFlyer", 6) -- to account for rocket upgrade
SetMemoryPoolSize("MountedTurret", 32) -- room for space cannons
SetMemoryPoolSize("Obstacle", 664)
SetMemoryPoolSize("PathNode", 384)
SetMemoryPoolSize("TreeGridStack", 500)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("TAT\\tat2.lvl", "tat2_con")
--awww yeah, space stuff
ReadDataFile("spa\\spa9.lvl", "spa9_Diet Dr. Pepper") --space tat 9
--ReadDataFile("spa\\spa9.lvl", "spa9_capitalships") -- object layer
--ReadDataFile("spa\\spa9.lvl") -- whole world spa9
--ReadDataFile("spa\\spa8.lvl", "spa8_Diet Dr. Pepper") --space hoth 8
SetDenseEnvironment("false")
SetWorldExtents(2000.0)
-- 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\\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, "all_tat_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_tat_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_tat_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_tat_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_tat_amb_end", 2,1)
SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("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")
SetAttackingTeam(ATT)
AddCameraShot(0.732291, -0.007608, -0.680912, -0.007074, 1.681833, 6.042514, 71.172432);
AddCameraShot(0.880830, -0.176249, 0.430862, 0.086213, 72.088852, 13.009782, 96.135429);
AddCameraShot(0.951425, -0.235086, -0.193006, -0.047690, 98.008606, 25.922222, 85.982498);
AddCameraShot(0.702385, -0.187812, 0.663271, 0.177353, 114.897949, 25.922222, 10.746059);
AddCameraShot(-0.141467, 0.044846, -0.942694, -0.298838, 97.121613, 25.922222, -65.803253);
AddCameraShot(-0.448951, 0.112747, -0.859719, -0.215904, 70.666542, 25.922222, -88.996330);
AddCameraShot(0.596313, -0.151264, 0.764169, 0.193843, 35.047939, 25.922222, -96.187553);
AddCameraShot(0.428975, -0.362181, -0.632304, -0.533851, -114.695259, 42.337784, -54.538460);
AddCameraShot(0.485286, -0.160731, -0.815869, -0.270223, -114.695259, 42.337784, -54.538460);
AddCameraShot(0.250177, -0.138466, -0.838399, -0.464031, -89.626076, 42.337784, -2.431808);
AddCameraShot(0.628286, -0.315611, 0.635421, 0.319195, -39.402264, 42.337784, 20.201601);
AddCameraShot(0.885964, -0.348802, -0.284377, -0.111958, -94.222435, 42.337784, 52.911922);
AddCameraShot(0.868043, -0.226361, -0.427586, -0.111502, -35.816402, 42.337784, 44.052761);
AddCameraShot(0.962938, -0.266344, -0.041009, -0.011343, 10.288770, 42.337784, 83.115334);
AddCameraShot(0.901188, -0.377287, 0.196792, 0.082388, 10.626176, 42.337784, 71.256241);
end[/code]