|
| 1 | +ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\master.lvl") |
| 2 | +RandomSide = math.random(1,4) |
| 3 | + |
| 4 | +isModMap = 1 |
| 5 | +-- |
| 6 | +-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved. |
| 7 | +-- |
| 8 | + |
| 9 | +ScriptCB_DoFile("ME5_Master") |
| 10 | +ScriptCB_DoFile("ME5_setup_teams") |
| 11 | +ScriptCB_DoFile("ME5_ObjectiveConquest") |
| 12 | + |
| 13 | +-- Map-specific data fields |
| 14 | +mapSize = sm -- The size of the map. Used for determining unit counts. |
| 15 | +EnvironmentType = 2 -- The map's biome (essentially). Used for determining which camo textures to load. |
| 16 | +onlineSideVar = SSVxGTH -- The side variation to use in online matches. |
| 17 | +onlineHeroSSV = shep_engineer -- The SSV hero to use in online matches. |
| 18 | +onlineHeroGTH = gethprime_me2 -- The GTH hero to use in online matches. |
| 19 | +onlineHeroCOL = colgeneral -- The COL hero to use in online matches. |
| 20 | +onlineHeroEVG = gethprime_me3 -- The EVG hero to use in online matches. |
| 21 | + |
| 22 | +-- Randomize the teams' starting spawns |
| 23 | +if not ScriptCB_InMultiplayer() then |
| 24 | + CIS = math.random(1,2) |
| 25 | + REP = (3 - CIS) |
| 26 | +else |
| 27 | + REP = 1 |
| 28 | + CIS = 2 |
| 29 | +end |
| 30 | + |
| 31 | +HuskTeam = 3 |
| 32 | + |
| 33 | +ATT = 1 |
| 34 | +DEF = 2 |
| 35 | + |
| 36 | + |
| 37 | +function SSVxGTH_PostLoad() |
| 38 | + if not ScriptCB_InMultiplayer() then |
| 39 | + DecideSSVHeroClass() |
| 40 | + DecideGTHHeroClass() |
| 41 | + if ME5_AIHeroes == 0 then |
| 42 | + SetHeroClass(REP, SSVHeroClass) |
| 43 | + SetHeroClass(CIS, GTHHeroClass) |
| 44 | + elseif ME5_AIHeroes == 1 then |
| 45 | + herosupport = AIHeroSupport:New{AIATTHeroHealth = 3000, AIDEFHeroHealth = 3000, gameMode = "NonConquest",} |
| 46 | + herosupport:SetHeroClass(REP, SSVHeroClass) |
| 47 | + herosupport:SetHeroClass(CIS, GTHHeroClass) |
| 48 | + herosupport:AddSpawnCP("cp1","cp1_spawn") |
| 49 | + herosupport:AddSpawnCP("cp2","cp2_spawn") |
| 50 | + herosupport:AddSpawnCP("cp3","cp3_spawn") |
| 51 | + herosupport:AddSpawnCP("cp4","cp4_spawn") |
| 52 | + herosupport:Start() |
| 53 | + end |
| 54 | + end |
| 55 | +end |
| 56 | + |
| 57 | +function SSVxCOL_PostLoad() |
| 58 | + if not ScriptCB_InMultiplayer() then |
| 59 | + DecideSSVHeroClass() |
| 60 | + DecideCOLHeroClass() |
| 61 | + if ME5_AIHeroes == 0 then |
| 62 | + SetHeroClass(REP, SSVHeroClass) |
| 63 | + SetHeroClass(CIS, COLHeroClass) |
| 64 | + elseif ME5_AIHeroes == 1 then |
| 65 | + herosupport = AIHeroSupport:New{AIATTHeroHealth = 3000, AIDEFHeroHealth = 3000, gameMode = "NonConquest",} |
| 66 | + herosupport:SetHeroClass(REP, SSVHeroClass) |
| 67 | + herosupport:SetHeroClass(CIS, COLHeroClass) |
| 68 | + herosupport:AddSpawnCP("cp1","cp1_spawn") |
| 69 | + herosupport:AddSpawnCP("cp2","cp2_spawn") |
| 70 | + herosupport:AddSpawnCP("cp3","cp3_spawn") |
| 71 | + herosupport:AddSpawnCP("cp4","cp4_spawn") |
| 72 | + herosupport:Start() |
| 73 | + end |
| 74 | + end |
| 75 | +end |
| 76 | + |
| 77 | +function EVGxGTH_PostLoad() |
| 78 | + if not ScriptCB_InMultiplayer() then |
| 79 | + DecideEVGHeroClass() |
| 80 | + DecideGTHHeroClass() |
| 81 | + if ME5_AIHeroes == 0 then |
| 82 | + SetHeroClass(REP, EVGHeroClass) |
| 83 | + SetHeroClass(CIS, GTHHeroClass) |
| 84 | + elseif ME5_AIHeroes == 1 then |
| 85 | + herosupport = AIHeroSupport:New{AIATTHeroHealth = 3000, AIDEFHeroHealth = 3000, gameMode = "NonConquest",} |
| 86 | + herosupport:SetHeroClass(REP, EVGHeroClass) |
| 87 | + herosupport:SetHeroClass(CIS, GTHHeroClass) |
| 88 | + herosupport:AddSpawnCP("cp1","cp1_spawn") |
| 89 | + herosupport:AddSpawnCP("cp2","cp2_spawn") |
| 90 | + herosupport:AddSpawnCP("cp3","cp3_spawn") |
| 91 | + herosupport:AddSpawnCP("cp4","cp4_spawn") |
| 92 | + herosupport:Start() |
| 93 | + end |
| 94 | + end |
| 95 | +end |
| 96 | + |
| 97 | +function EVGxCOL_PostLoad() |
| 98 | + if not ScriptCB_InMultiplayer() then |
| 99 | + DecideEVGHeroClass() |
| 100 | + DecideCOLHeroClass() |
| 101 | + if ME5_AIHeroes == 0 then |
| 102 | + SetHeroClass(REP, EVGHeroClass) |
| 103 | + SetHeroClass(CIS, COLHeroClass) |
| 104 | + elseif ME5_AIHeroes == 1 then |
| 105 | + herosupport = AIHeroSupport:New{AIATTHeroHealth = 3000, AIDEFHeroHealth = 3000, gameMode = "NonConquest",} |
| 106 | + herosupport:SetHeroClass(REP, EVGHeroClass) |
| 107 | + herosupport:SetHeroClass(CIS, COLHeroClass) |
| 108 | + herosupport:AddSpawnCP("cp1","cp1_spawn") |
| 109 | + herosupport:AddSpawnCP("cp2","cp2_spawn") |
| 110 | + herosupport:AddSpawnCP("cp3","cp3_spawn") |
| 111 | + herosupport:AddSpawnCP("cp4","cp4_spawn") |
| 112 | + herosupport:Start() |
| 113 | + end |
| 114 | + end |
| 115 | +end |
| 116 | + |
| 117 | +function ScriptPostLoad() |
| 118 | + |
| 119 | + |
| 120 | + --This defines the CPs. These need to happen first |
| 121 | + cp1 = CommandPost:New{name = "cp1"} |
| 122 | + cp2 = CommandPost:New{name = "cp2"} |
| 123 | + cp3 = CommandPost:New{name = "cp3"} |
| 124 | + cp4 = CommandPost:New{name = "cp4"} |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + --This sets up the actual objective. This needs to happen after cp's are defined |
| 129 | + conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, |
| 130 | + textATT = "game.modes.con", |
| 131 | + textDEF = "game.modes.con2", |
| 132 | + multiplayerRules = true} |
| 133 | + |
| 134 | + --This adds the CPs to the objective. This needs to happen after the objective is set up |
| 135 | + conquest:AddCommandPost(cp1) |
| 136 | + conquest:AddCommandPost(cp2) |
| 137 | + conquest:AddCommandPost(cp3) |
| 138 | + conquest:AddCommandPost(cp4) |
| 139 | + |
| 140 | + -- Set up husk spawns |
| 141 | + SetProperty("cp1", "AllyPath", "cp1_spawn") |
| 142 | + SetProperty("cp2", "AllyPath", "cp2_spawn") |
| 143 | + SetProperty("cp3", "AllyPath", "cp3_spawn") |
| 144 | + SetProperty("cp4", "AllyPath", "cp4_spawn") |
| 145 | + |
| 146 | + -- Set up goals |
| 147 | + ClearAIGoals(1) |
| 148 | + ClearAIGoals(2) |
| 149 | + AddAIGoal(1, "Conquest", 100) |
| 150 | + AddAIGoal(2, "Conquest", 100) |
| 151 | + AddAIGoal(HuskTeam, "Deathmatch", 100) |
| 152 | + |
| 153 | + if not ScriptCB_InMultiplayer() then |
| 154 | + if ME5_SideVar == 0 then |
| 155 | + if RandomSide == 1 then |
| 156 | + SSVxGTH_PostLoad() |
| 157 | + elseif RandomSide == 2 then |
| 158 | + SSVxCOL_PostLoad() |
| 159 | + elseif RandomSide == 3 then |
| 160 | + EVGxGTH_PostLoad() |
| 161 | + elseif RandomSide == 4 then |
| 162 | + EVGxCOL_PostLoad() |
| 163 | + end |
| 164 | + elseif ME5_SideVar == 1 then |
| 165 | + SSVxGTH_PostLoad() |
| 166 | + elseif ME5_SideVar == 2 then |
| 167 | + SSVxCOL_PostLoad() |
| 168 | + elseif ME5_SideVar == 3 then |
| 169 | + EVGxGTH_PostLoad() |
| 170 | + elseif ME5_SideVar == 4 then |
| 171 | + EVGxCOL_PostLoad() |
| 172 | + end |
| 173 | + else |
| 174 | + SSVxGTH_PostLoad() |
| 175 | + end |
| 176 | + |
| 177 | + conquest:Start() |
| 178 | + |
| 179 | + EnableSPHeroRules() |
| 180 | + |
| 181 | + end |
| 182 | + |
| 183 | + |
| 184 | +--------------------------------------------------------------------------- |
| 185 | +-- FUNCTION: ScriptInit |
| 186 | +-- PURPOSE: This function is only run once |
| 187 | +-- INPUT: |
| 188 | +-- OUTPUT: |
| 189 | +-- NOTES: The name, 'ScriptInit' is a chosen convention, and each |
| 190 | +-- mission script must contain a version of this function, as |
| 191 | +-- it is called from C to start the mission. |
| 192 | +--------------------------------------------------------------------------- |
| 193 | +function ScriptInit() |
| 194 | + -- Load our loadscreen |
| 195 | + ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\Load\\t4e.lvl") |
| 196 | + |
| 197 | + SetMemoryPoolSize("ParticleTransformer::ColorTrans", 2367) |
| 198 | + SetMemoryPoolSize("ParticleTransformer::PositionTr", 1380) |
| 199 | + SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1533) |
| 200 | + |
| 201 | + -- Perform various pre-game operations |
| 202 | + PreLoadStuff() |
| 203 | + |
| 204 | + SetMaxFlyHeight(30) |
| 205 | + SetMaxPlayerFlyHeight(30) |
| 206 | + AISnipeSuitabilityDist(35) |
| 207 | + SetAttackerSnipeRange(45) |
| 208 | + SetDefenderSnipeRange(70) |
| 209 | + |
| 210 | + -- Load the turrets |
| 211 | + ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\SIDE\\me5tur.lvl", |
| 212 | + "tur_bldg_mturret", |
| 213 | + "tur_bldg_laser") |
| 214 | + |
| 215 | + -- Load and set up the sides based on RandomSide |
| 216 | + Init_SideSetup() |
| 217 | + |
| 218 | + -- Load our map-specific sound lvl |
| 219 | + ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\sound\\SFL_T4E_Streaming.lvl") |
| 220 | + |
| 221 | + -- Level Stats |
| 222 | + -- ClearWalkers() |
| 223 | + AddWalkerType(0, 0) -- special -> droidekas |
| 224 | + AddWalkerType(1, 0) -- 1x2 (1 pair of legs) |
| 225 | + AddWalkerType(2, 0) -- 2x2 (2 pairs of legs) |
| 226 | + AddWalkerType(3, 0) -- 3x2 (3 pairs of legs) |
| 227 | + local weaponCnt = 1024 |
| 228 | + SetMemoryPoolSize("Aimer", 75) |
| 229 | + SetMemoryPoolSize("AmmoCounter", weaponCnt) |
| 230 | + SetMemoryPoolSize("BaseHint", 1024) |
| 231 | + SetMemoryPoolSize("EnergyBar", weaponCnt) |
| 232 | + SetMemoryPoolSize("EntityCloth", 32) |
| 233 | + SetMemoryPoolSize("EntityFlyer", 32) |
| 234 | + SetMemoryPoolSize("EntityHover", 32) |
| 235 | + SetMemoryPoolSize("EntityLight", 200) |
| 236 | + SetMemoryPoolSize("EntitySoundStream", 4) |
| 237 | + SetMemoryPoolSize("EntitySoundStatic", 32) |
| 238 | + SetMemoryPoolSize("FlagItem", 512) -- Need to account for shield pickups |
| 239 | + SetMemoryPoolSize("MountedTurret", 32) |
| 240 | + SetMemoryPoolSize("Navigator", 128) |
| 241 | + SetMemoryPoolSize("Obstacle", 1024) |
| 242 | + SetMemoryPoolSize("PathNode", 1024) |
| 243 | + SetMemoryPoolSize("SoldierAnimation", 417) |
| 244 | + SetMemoryPoolSize("SoundSpaceRegion", 64) |
| 245 | + SetMemoryPoolSize("TreeGridStack", 1024) |
| 246 | + SetMemoryPoolSize("UnitAgent", 128) |
| 247 | + SetMemoryPoolSize("UnitController", 128) |
| 248 | + SetMemoryPoolSize("Weapon", weaponCnt) |
| 249 | + |
| 250 | + SetSpawnDelay(10.0, 0.25) |
| 251 | + ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\ME5\\T4E.lvl", "T4E_conquest") |
| 252 | + SetDenseEnvironment("false") |
| 253 | + |
| 254 | + |
| 255 | + -- Sound Stats |
| 256 | + |
| 257 | + -- Open our map-specific ambient sound streams |
| 258 | + OpenAudioStream("..\\..\\addon\\ME5\\data\\_LVL_PC\\Sound\\SFL_T4E_Streaming.lvl", "T4E_ambiance") |
| 259 | + |
| 260 | + -- Set up music stuff |
| 261 | + if not ScriptCB_InMultiplayer() then |
| 262 | + if ME5_SideVar == 0 then |
| 263 | + if RandomSide == 1 then |
| 264 | + Music06() |
| 265 | + elseif RandomSide == 2 then |
| 266 | + Music02() |
| 267 | + elseif RandomSide == 3 then |
| 268 | + Music06() |
| 269 | + elseif RandomSide == 4 then |
| 270 | + Music09() |
| 271 | + end |
| 272 | + elseif ME5_SideVar == 1 then |
| 273 | + Music06() |
| 274 | + elseif ME5_SideVar == 2 then |
| 275 | + Music02() |
| 276 | + elseif ME5_SideVar == 3 then |
| 277 | + Music06() |
| 278 | + elseif ME5_SideVar == 4 then |
| 279 | + Music09() |
| 280 | + end |
| 281 | + else |
| 282 | + Music06() |
| 283 | + end |
| 284 | + |
| 285 | + -- Set up common sound stuff |
| 286 | + SoundFX() |
| 287 | + |
| 288 | + -- Camera Stats |
| 289 | + AddCameraShot(-0.370814, 0.035046, -0.923929, -0.087320, -71.966255, 23.668301, 27.930090); |
| 290 | + AddCameraShot(0.991073, 0.002392, 0.133299, -0.000322, 84.069084, 23.668301, -95.802574); |
| 291 | + |
| 292 | + -- Perform various post-load operations |
| 293 | + PostLoadStuff() |
| 294 | +end |
0 commit comments