I have a few campaigns for a map of mine (Maloss). They both worked fine for a while, however now they load fine (ie no crash, units appear their......except the map doesn't appear.
So far I've tried -
-removing the random sky stuff (no effect - except sky dissapears)
-removing the AI Ambushes (no effect)
-removing extra teams (no effect)
-load sky after everything else (no effect)
Anyway any help would be handy.
Script (have two, this is the simpler one)
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- load the gametype script
ScriptCB_DoFile("MultiObjectiveContainer")
ScriptCB_DoFile("ObjectiveAssault")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("ObjectiveGoto")
ScriptCB_DoFile("ObjectiveCTF")
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_DoFile("Ambush")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("DSrandom")
ScriptCB_DoFile("DSrandom3")
ScriptCB_DoFile("DSLegion")
ScriptCB_DoFile("AIHeroSupport")
-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;
function ScriptPostLoad()
obj1ran = math.random(1, 2)
obj2ran = math.random(1, 2)
obj3ran = math.random(1, 2)
randenemyweak = math.random(1, 2)
randenemymedi = math.random(1, 3)
WeatherMode = math.random(1,6)
weak()
medi()
weather()
SetProperty("cp2", "CaptureRegion", "")
SetProperty("cp1", "Team", 2)
SetProperty("cp2", "Team", 2)
SetProperty("cp3", "Team", 2)
SetProperty("cp8", "Team", 2)
SetProperty("cp5", "Team", 2)
SetProperty("cp6", "Team", 2)
SetProperty("cp7", "Team", 2)
SetAIDifficulty(0, 2, "hard")
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, true)
ScriptCB_SetGameRules("campaign")
onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
if obj1ran == 1 then
Obj1a()
elseif obj1ran == 2 then
Obj1b()
end
if obj2ran == 1 then
Obj2a()
elseif obj2ran == 2 then
Obj2b()
end
if obj3ran == 1 then
Obj3a()
elseif obj3ran == 2 then
Obj3b()
end
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)
ShowMessageText("hunter.intro", ATT)
end
end)
function Obj1a()
Objective1 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "mer.obj1.kill", popupText = "mer.obj1.kill_p"}
Dclass = TargetType:New{classname = enemyweak, killLimit = 12}
Objective1:AddTarget(Dclass)
Objective1.OnStart = function(self)
MapAddClassMarker(enemyweak, "hud_objective_icon_circle", 2.5, ATT, "GREEN", true)
Objective1.Dclass_cpGoal1 = AddAIGoal(ATT, "Defend", 100, "cp3")
Objective1.Dclass_cpGoal2 = AddAIGoal(DEF, "Defend", 100, "cp3")
end
Objective1.OnComplete = function(self)
MapRemoveClassMarker(enemyweak)
DeleteAIGoal(Objective1.Dclass_cpGoal1)
DeleteAIGoal(Objective1.Dclass_cpGoal2)
end
end
function Obj1b()
Objective1CP = CommandPost:New{name = "cp3"}
Objective1 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "mer.obj1.con", popupText = "mer.obj1.con_p", AIGoalWeight = 0}
Objective1:AddCommandPost(Objective1CP)
Objective1.OnStart = function(self)
AICanCaptureCP("cp3", ATT, false)
AICanCaptureCP("cp3", DEF, true)
att_obj1_aigoal = AddAIGoal(ATT, "Defend", 50, "cp3")
def_obj1_aigoal = AddAIGoal(DEF, "Defend", 50, "cp3")
att_obj1_aigoal2 = AddAIGoal(ATT, "Deathmatch", 100)
def_obj1_aigoal2 = AddAIGoal(DEF, "Deathmatch", 100)
end
Objective1.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj1_aigoal)
DeleteAIGoal(att_obj1_aigoal2)
DeleteAIGoal(def_obj1_aigoal)
DeleteAIGoal(def_obj1_aigoal2)
SetProperty("cp3", "Team", 1)
SetProperty("cp3", "CaptureRegion", "")
end
end
function Obj2a()
Objective2 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "mer.obj2.kill", popupText = "mer.obj2.kill_p"}
Dclass = TargetType:New{classname = enemymedi, killLimit = 8}
Objective2:AddTarget(Dclass)
Objective2.OnStart = function(self)
--Ambush("survivor", 12, 3)
MapAddClassMarker(enemymedi, "hud_objective_icon_circle", 4.5, ATT, "GREEN", true)
Objective2.Dclass_cpGoal2 = AddAIGoal(ATT, "Defend", 100, "cp5")
Objective2.Dclass_cpGoal2 = AddAIGoal(DEF, "Defend", 100, "cp5")
end
Objective2.OnComplete = function(self)
MapRemoveClassMarker(enemymedi)
DeleteAIGoal(Objective2.Dclass_cpGoal2)
DeleteAIGoal(Objective2.Dclass_cpGoal2)
end
end
function Obj2b()
Objective2CP = CommandPost:New{name = "cp5"}
Objective2C2 = CommandPost:New{name = "cp7"}
Objective2 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "mer.obj2.con", popupText = "mer.obj2.con_p", AIGoalWeight = 0}
Objective2:AddCommandPost(Objective2CP)
Objective2:AddCommandPost(Objective2C2)
Objective2.OnStart = function(self)
--Ambush("survivor", 6, 3)
AICanCaptureCP("cp5", ATT, false)
AICanCaptureCP("cp5", DEF, true)
AICanCaptureCP("cp7", ATT, false)
AICanCaptureCP("cp7", DEF, true)
att_obj2_aigoal = AddAIGoal(ATT, "Defend", 50, "cp3")
def_obj2_aigoal = AddAIGoal(DEF, "Defend", 50, "cp3")
att_obj2_aigoal2 = AddAIGoal(ATT, "Deathmatch", 200)
def_obj2_aigoal2 = AddAIGoal(DEF, "Deathmatch", 200)
end
Objective2.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj2_aigoal)
DeleteAIGoal(att_obj2_aigoal2)
DeleteAIGoal(def_obj2_aigoal)
DeleteAIGoal(def_obj2_aigoal2)
SetProperty("cp5", "Team", 1)
SetProperty("cp5", "CaptureRegion", "")
SetProperty("cp7", "Team", 1)
SetProperty("cp7", "CaptureRegion", "")
end
end
function Obj3a()
Objective3 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "mer.obj1.kill", popupText = "mer.obj1.kill_p"}
Dclass = TargetType:New{classname = auxSep, killLimit = 6}
Objective3:AddTarget(Dclass)
Objective3.OnStart = function(self)
--Ambush("survivor", 8, 3)
MapAddClassMarker(auxSep, "hud_objective_icon_circle", 2.5, ATT, "GREEN", true)
end
Objective3.OnComplete = function(self)
MapRemoveClassMarker(auxSep)
end
end
function Obj3b()
Objective3CP = CommandPost:New{name = "cp2"}
Objective3 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "mer.obj2.con", popupText = "mer.obj2.con_p", AIGoalWeight = 0, timeLimit = 100, timeLimitWinningTeam = ATT}
Objective3:AddCommandPost(Objective3CP)
Objective3.OnStart = function(self)
--Ambush("survivor", 6, 3)
--Ambush("survivor", 4, 4)
AICanCaptureCP("cp2", ATT, false)
AICanCaptureCP("cp2", DEF, true)
att_obj3_aigoal = AddAIGoal(ATT, "Defend", 150, "cp2")
def_obj3_aigoal = AddAIGoal(DEF, "Defend", 150, "cp2")
att_obj3_aigoal2 = AddAIGoal(ATT, "Deathmatch", 200)
def_obj3_aigoal2 = AddAIGoal(DEF, "Deathmatch", 200)
end
Objective3.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj3_aigoal)
DeleteAIGoal(att_obj3_aigoal2)
DeleteAIGoal(def_obj3_aigoal)
DeleteAIGoal(def_obj3_aigoal2)
SetProperty("cp2", "Team", 1)
SetProperty("cp2", "CaptureRegion", "")
end
end
end
function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 3)
StartTimer(beginobjectivestimer)
end
function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:AddObjectiveSet(Objective2)
objectiveSequence:AddObjectiveSet(Objective3)
objectiveSequence:Start()
end
function weak()
if randenemyweak == 1 then
enemyweak = "cis_inf_trooper"
elseif randenemyweak == 2 then
enemyweak = "cis_inf_rocketeer"
end
end
function medi()
if randenemymedi == 1 then
enemymedi = "cis_inf_super"
elseif randenemymedi == 2 then
enemymedi = "cis_inf_officer"
elseif randenemymedi == 2 then
enemymedi = "cis_inf_pilot"
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("dc:Load\\common.lvl")
if not ScriptCB_InMultiplayer() then
DecideLegion(1, 1, 1, 1)
DecideUnits(1, 1, 1, 4, 4, 2, 2, 1, 1)
SepUnits1(1, 1, 1)
elseif ScriptCB_InMultiplayer() then
herostrSep = "rep_hero_cloakedanakin"
supportstrSep = "cis_inf_super_r"
herostrRep = "rep_hero_rai"
supportstrRep = "merc_plain"
auxSep = "cis_inf_droideka"
clonelegion = "..\\..\\addon\\FAI\\data\\_LVL_PC\\SIDE\\91st.lvl"
baseRep = "rep_inf_ep3_comm"
eliteRep = "rep_inf_s_unique91"
end
SetMaxFlyHeight(60)
SetMaxPlayerFlyHeight (60)
SetMemoryPoolSize("SoldierAnimation", 1000)
SetMemoryPoolSize ("ClothData",90)
SetMemoryPoolSize ("Combo",200) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",2400) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",2550) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",2550) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",2000) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",20000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",200) -- should be ~1x #combo -- should be ~1x #combo
ReadDataFile("ingame.lvl")
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\SIDE\\dark.lvl",
"fel_hero_rancor")
ReadDataFile("dc:SIDE\\repu2.lvl",
baseRep,
"rep_inf_ep3_rifleman",
"rep_inf_ep3_medic",
"rep_inf_ep3_hev",
"rep_inf_ep3_commander2",
"rep_inf_ep3_delta",
"rep_inf_ep3_jettrooper",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_commander",
"rep_inf_ep3_sniper",
"merc_plain",
"rep_inf_ep3_nader",
"rep_inf_ep3_officer",
"rep_walk_atxt")
ReadDataFile(clonelegion,
"rep_inf_s_rifleman",
"rep_inf_s_jettrooper",
"rep_inf_s_rocketeer",
"rep_inf_s_engineer",
"rep_inf_s_sniper",
eliteRep,
"rep_inf_s_medic",
"rep_inf_s_commander",
"rep_inf_s_commander2",
"rep_inf_s_hev",
"rep_inf_s_officer")
ReadDataFile("dc:SIDE\\ciss.lvl",
"cis_inf_rocketeer",
"cis_inf_pilot",
"cis_inf_sniper",
"cis_inf_officer",
auxSep,
supportstrSep,
"cis_hover_aat",
"cis_inf_super",
"cis_inf_superf",
"cis_inf_trooper")
ReadDataFile("dc:SIDE\\hero.lvl",
herostrRep,
herostrSep)
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof")
SetupTeams{
rep = {
team = REP,
units = 0,
reinforcements = 5,
soldier = { herostrRep,12, 25},
-- turret = { "rep_bldg_defensegridturret"},
},
cis = {
team = CIS,
units = 23,
reinforcements = 250,
soldier = { "CIS_inf_trooper",6, 17},
assault = { "CIS_inf_rocketeer",6, 17},
-- -- turret = { "cis_bldg_defensegridturret"},
},
}
SetTeamName(3, "CIS")
AddUnitClass(3, enemymedi, 12,12)
SetUnitCount(3, 32)
AddAIGoal(3, "Deathmatch", 1000)
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)
SetTeamAsFriend(3,DEF)
SetTeamAsFriend(DEF,3)
SetTeamName(4, "CIS")
AddUnitClass(4, auxSep, 25,25)
SetUnitCount(4, 25)
AddAIGoal(4, "Deathmatch", 1000)
SetTeamAsEnemy(ATT,4)
SetTeamAsEnemy(4,ATT)
SetTeamAsFriend(4,DEF)
SetTeamAsFriend(DEF,4)
SetTeamAsFriend(3,4)
SetTeamAsFriend(4,3)
-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:FAI\\FAI.lvl", "FAI_conquest")
SetDenseEnvironment("false")
-- Sound
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)
voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)
OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")
SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)
SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")
SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)
SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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")
--OpeningSateliteShot
AddCameraShot(0.908386, -0.209095, -0.352873, -0.081226, -45.922508, -19.114113, 77.022636);
AddCameraShot(-0.481173, 0.024248, -0.875181, -0.044103, 14.767292, -30.602322, -144.506851);
AddCameraShot(0.999914, -0.012495, -0.004416, -0.000055, 1.143253, -33.602314, -76.884430);
AddCameraShot(0.839161, 0.012048, -0.543698, 0.007806, 19.152437, -49.802273, 24.337317);
AddCameraShot(0.467324, 0.006709, -0.883972, 0.012691, 11.825212, -49.802273, -7.000720);
AddCameraShot(0.861797, 0.001786, -0.507253, 0.001051, -11.986043, -59.702248, 23.263165);
AddCameraShot(0.628546, -0.042609, -0.774831, -0.052525, 20.429928, -48.302277, 9.771714);
AddCameraShot(0.765213, -0.051873, 0.640215, 0.043400, 57.692474, -48.302277, 16.540724);
AddCameraShot(0.264032, -0.015285, -0.962782, -0.055734, -16.681797, -42.902290, 129.553268);
AddCameraShot(-0.382320, 0.022132, -0.922222, -0.053386, 20.670977, -42.902290, 135.513001);
end
function weather()
if WeatherMode == 1 then
ReadDataFile("dc:FAI\\sky.lvl", "darkrain")
elseif WeatherMode == 2 then
ReadDataFile("dc:FAI\\sky.lvl", "greyrain")
elseif WeatherMode == 3 then
ReadDataFile("dc:FAI\\sky.lvl", "duskrain")
elseif WeatherMode == 4 then
ReadDataFile("dc:FAI\\sky.lvl", "darkclear")
elseif WeatherMode == 5 then
ReadDataFile("dc:FAI\\sky.lvl", "greyclear")
elseif WeatherMode == 6 then
ReadDataFile("dc:FAI\\sky.lvl", "duskclear")
end
end
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- load the gametype script
ScriptCB_DoFile("MultiObjectiveContainer")
ScriptCB_DoFile("ObjectiveAssault")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("ObjectiveGoto")
ScriptCB_DoFile("ObjectiveCTF")
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_DoFile("Ambush")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("DSrandom")
ScriptCB_DoFile("DSrandom3")
ScriptCB_DoFile("DSLegion")
ScriptCB_DoFile("AIHeroSupport")
-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;
function ScriptPostLoad()
obj1ran = math.random(1, 2)
obj2ran = math.random(1, 2)
obj3ran = math.random(1, 2)
randenemyweak = math.random(1, 2)
randenemymedi = math.random(1, 3)
WeatherMode = math.random(1,6)
weak()
medi()
weather()
SetProperty("cp2", "CaptureRegion", "")
SetProperty("cp1", "Team", 2)
SetProperty("cp2", "Team", 2)
SetProperty("cp3", "Team", 2)
SetProperty("cp8", "Team", 2)
SetProperty("cp5", "Team", 2)
SetProperty("cp6", "Team", 2)
SetProperty("cp7", "Team", 2)
SetAIDifficulty(0, 2, "hard")
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, true)
ScriptCB_SetGameRules("campaign")
onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
if obj1ran == 1 then
Obj1a()
elseif obj1ran == 2 then
Obj1b()
end
if obj2ran == 1 then
Obj2a()
elseif obj2ran == 2 then
Obj2b()
end
if obj3ran == 1 then
Obj3a()
elseif obj3ran == 2 then
Obj3b()
end
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)
ShowMessageText("hunter.intro", ATT)
end
end)
function Obj1a()
Objective1 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "mer.obj1.kill", popupText = "mer.obj1.kill_p"}
Dclass = TargetType:New{classname = enemyweak, killLimit = 12}
Objective1:AddTarget(Dclass)
Objective1.OnStart = function(self)
MapAddClassMarker(enemyweak, "hud_objective_icon_circle", 2.5, ATT, "GREEN", true)
Objective1.Dclass_cpGoal1 = AddAIGoal(ATT, "Defend", 100, "cp3")
Objective1.Dclass_cpGoal2 = AddAIGoal(DEF, "Defend", 100, "cp3")
end
Objective1.OnComplete = function(self)
MapRemoveClassMarker(enemyweak)
DeleteAIGoal(Objective1.Dclass_cpGoal1)
DeleteAIGoal(Objective1.Dclass_cpGoal2)
end
end
function Obj1b()
Objective1CP = CommandPost:New{name = "cp3"}
Objective1 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "mer.obj1.con", popupText = "mer.obj1.con_p", AIGoalWeight = 0}
Objective1:AddCommandPost(Objective1CP)
Objective1.OnStart = function(self)
AICanCaptureCP("cp3", ATT, false)
AICanCaptureCP("cp3", DEF, true)
att_obj1_aigoal = AddAIGoal(ATT, "Defend", 50, "cp3")
def_obj1_aigoal = AddAIGoal(DEF, "Defend", 50, "cp3")
att_obj1_aigoal2 = AddAIGoal(ATT, "Deathmatch", 100)
def_obj1_aigoal2 = AddAIGoal(DEF, "Deathmatch", 100)
end
Objective1.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj1_aigoal)
DeleteAIGoal(att_obj1_aigoal2)
DeleteAIGoal(def_obj1_aigoal)
DeleteAIGoal(def_obj1_aigoal2)
SetProperty("cp3", "Team", 1)
SetProperty("cp3", "CaptureRegion", "")
end
end
function Obj2a()
Objective2 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "mer.obj2.kill", popupText = "mer.obj2.kill_p"}
Dclass = TargetType:New{classname = enemymedi, killLimit = 8}
Objective2:AddTarget(Dclass)
Objective2.OnStart = function(self)
--Ambush("survivor", 12, 3)
MapAddClassMarker(enemymedi, "hud_objective_icon_circle", 4.5, ATT, "GREEN", true)
Objective2.Dclass_cpGoal2 = AddAIGoal(ATT, "Defend", 100, "cp5")
Objective2.Dclass_cpGoal2 = AddAIGoal(DEF, "Defend", 100, "cp5")
end
Objective2.OnComplete = function(self)
MapRemoveClassMarker(enemymedi)
DeleteAIGoal(Objective2.Dclass_cpGoal2)
DeleteAIGoal(Objective2.Dclass_cpGoal2)
end
end
function Obj2b()
Objective2CP = CommandPost:New{name = "cp5"}
Objective2C2 = CommandPost:New{name = "cp7"}
Objective2 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "mer.obj2.con", popupText = "mer.obj2.con_p", AIGoalWeight = 0}
Objective2:AddCommandPost(Objective2CP)
Objective2:AddCommandPost(Objective2C2)
Objective2.OnStart = function(self)
--Ambush("survivor", 6, 3)
AICanCaptureCP("cp5", ATT, false)
AICanCaptureCP("cp5", DEF, true)
AICanCaptureCP("cp7", ATT, false)
AICanCaptureCP("cp7", DEF, true)
att_obj2_aigoal = AddAIGoal(ATT, "Defend", 50, "cp3")
def_obj2_aigoal = AddAIGoal(DEF, "Defend", 50, "cp3")
att_obj2_aigoal2 = AddAIGoal(ATT, "Deathmatch", 200)
def_obj2_aigoal2 = AddAIGoal(DEF, "Deathmatch", 200)
end
Objective2.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj2_aigoal)
DeleteAIGoal(att_obj2_aigoal2)
DeleteAIGoal(def_obj2_aigoal)
DeleteAIGoal(def_obj2_aigoal2)
SetProperty("cp5", "Team", 1)
SetProperty("cp5", "CaptureRegion", "")
SetProperty("cp7", "Team", 1)
SetProperty("cp7", "CaptureRegion", "")
end
end
function Obj3a()
Objective3 = ObjectiveAssault:New{teamATT = ATT, teamDEF = DEF,
text = "mer.obj1.kill", popupText = "mer.obj1.kill_p"}
Dclass = TargetType:New{classname = auxSep, killLimit = 6}
Objective3:AddTarget(Dclass)
Objective3.OnStart = function(self)
--Ambush("survivor", 8, 3)
MapAddClassMarker(auxSep, "hud_objective_icon_circle", 2.5, ATT, "GREEN", true)
end
Objective3.OnComplete = function(self)
MapRemoveClassMarker(auxSep)
end
end
function Obj3b()
Objective3CP = CommandPost:New{name = "cp2"}
Objective3 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "mer.obj2.con", popupText = "mer.obj2.con_p", AIGoalWeight = 0, timeLimit = 100, timeLimitWinningTeam = ATT}
Objective3:AddCommandPost(Objective3CP)
Objective3.OnStart = function(self)
--Ambush("survivor", 6, 3)
--Ambush("survivor", 4, 4)
AICanCaptureCP("cp2", ATT, false)
AICanCaptureCP("cp2", DEF, true)
att_obj3_aigoal = AddAIGoal(ATT, "Defend", 150, "cp2")
def_obj3_aigoal = AddAIGoal(DEF, "Defend", 150, "cp2")
att_obj3_aigoal2 = AddAIGoal(ATT, "Deathmatch", 200)
def_obj3_aigoal2 = AddAIGoal(DEF, "Deathmatch", 200)
end
Objective3.OnComplete = function(self)
ShowMessageText("game.objectives.complete", ATT)
DeleteAIGoal(att_obj3_aigoal)
DeleteAIGoal(att_obj3_aigoal2)
DeleteAIGoal(def_obj3_aigoal)
DeleteAIGoal(def_obj3_aigoal2)
SetProperty("cp2", "Team", 1)
SetProperty("cp2", "CaptureRegion", "")
end
end
end
function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 3)
StartTimer(beginobjectivestimer)
end
function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:AddObjectiveSet(Objective2)
objectiveSequence:AddObjectiveSet(Objective3)
objectiveSequence:Start()
end
function weak()
if randenemyweak == 1 then
enemyweak = "cis_inf_trooper"
elseif randenemyweak == 2 then
enemyweak = "cis_inf_rocketeer"
end
end
function medi()
if randenemymedi == 1 then
enemymedi = "cis_inf_super"
elseif randenemymedi == 2 then
enemymedi = "cis_inf_officer"
elseif randenemymedi == 2 then
enemymedi = "cis_inf_pilot"
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("dc:Load\\common.lvl")
if not ScriptCB_InMultiplayer() then
DecideLegion(1, 1, 1, 1)
DecideUnits(1, 1, 1, 4, 4, 2, 2, 1, 1)
SepUnits1(1, 1, 1)
elseif ScriptCB_InMultiplayer() then
herostrSep = "rep_hero_cloakedanakin"
supportstrSep = "cis_inf_super_r"
herostrRep = "rep_hero_rai"
supportstrRep = "merc_plain"
auxSep = "cis_inf_droideka"
clonelegion = "..\\..\\addon\\FAI\\data\\_LVL_PC\\SIDE\\91st.lvl"
baseRep = "rep_inf_ep3_comm"
eliteRep = "rep_inf_s_unique91"
end
SetMaxFlyHeight(60)
SetMaxPlayerFlyHeight (60)
SetMemoryPoolSize("SoldierAnimation", 1000)
SetMemoryPoolSize ("ClothData",90)
SetMemoryPoolSize ("Combo",200) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",2400) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",2550) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",2550) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",2000) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",20000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",200) -- should be ~1x #combo -- should be ~1x #combo
ReadDataFile("ingame.lvl")
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\SIDE\\dark.lvl",
"fel_hero_rancor")
ReadDataFile("dc:SIDE\\repu2.lvl",
baseRep,
"rep_inf_ep3_rifleman",
"rep_inf_ep3_medic",
"rep_inf_ep3_hev",
"rep_inf_ep3_commander2",
"rep_inf_ep3_delta",
"rep_inf_ep3_jettrooper",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_commander",
"rep_inf_ep3_sniper",
"merc_plain",
"rep_inf_ep3_nader",
"rep_inf_ep3_officer",
"rep_walk_atxt")
ReadDataFile(clonelegion,
"rep_inf_s_rifleman",
"rep_inf_s_jettrooper",
"rep_inf_s_rocketeer",
"rep_inf_s_engineer",
"rep_inf_s_sniper",
eliteRep,
"rep_inf_s_medic",
"rep_inf_s_commander",
"rep_inf_s_commander2",
"rep_inf_s_hev",
"rep_inf_s_officer")
ReadDataFile("dc:SIDE\\ciss.lvl",
"cis_inf_rocketeer",
"cis_inf_pilot",
"cis_inf_sniper",
"cis_inf_officer",
auxSep,
supportstrSep,
"cis_hover_aat",
"cis_inf_super",
"cis_inf_superf",
"cis_inf_trooper")
ReadDataFile("dc:SIDE\\hero.lvl",
herostrRep,
herostrSep)
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof")
SetupTeams{
rep = {
team = REP,
units = 0,
reinforcements = 5,
soldier = { herostrRep,12, 25},
-- turret = { "rep_bldg_defensegridturret"},
},
cis = {
team = CIS,
units = 23,
reinforcements = 250,
soldier = { "CIS_inf_trooper",6, 17},
assault = { "CIS_inf_rocketeer",6, 17},
-- -- turret = { "cis_bldg_defensegridturret"},
},
}
SetTeamName(3, "CIS")
AddUnitClass(3, enemymedi, 12,12)
SetUnitCount(3, 32)
AddAIGoal(3, "Deathmatch", 1000)
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)
SetTeamAsFriend(3,DEF)
SetTeamAsFriend(DEF,3)
SetTeamName(4, "CIS")
AddUnitClass(4, auxSep, 25,25)
SetUnitCount(4, 25)
AddAIGoal(4, "Deathmatch", 1000)
SetTeamAsEnemy(ATT,4)
SetTeamAsEnemy(4,ATT)
SetTeamAsFriend(4,DEF)
SetTeamAsFriend(DEF,4)
SetTeamAsFriend(3,4)
SetTeamAsFriend(4,3)
-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:FAI\\FAI.lvl", "FAI_conquest")
SetDenseEnvironment("false")
-- Sound
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)
voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)
OpenAudioStream("sound\\global.lvl", "cw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")
SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)
SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")
SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)
SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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")
--OpeningSateliteShot
AddCameraShot(0.908386, -0.209095, -0.352873, -0.081226, -45.922508, -19.114113, 77.022636);
AddCameraShot(-0.481173, 0.024248, -0.875181, -0.044103, 14.767292, -30.602322, -144.506851);
AddCameraShot(0.999914, -0.012495, -0.004416, -0.000055, 1.143253, -33.602314, -76.884430);
AddCameraShot(0.839161, 0.012048, -0.543698, 0.007806, 19.152437, -49.802273, 24.337317);
AddCameraShot(0.467324, 0.006709, -0.883972, 0.012691, 11.825212, -49.802273, -7.000720);
AddCameraShot(0.861797, 0.001786, -0.507253, 0.001051, -11.986043, -59.702248, 23.263165);
AddCameraShot(0.628546, -0.042609, -0.774831, -0.052525, 20.429928, -48.302277, 9.771714);
AddCameraShot(0.765213, -0.051873, 0.640215, 0.043400, 57.692474, -48.302277, 16.540724);
AddCameraShot(0.264032, -0.015285, -0.962782, -0.055734, -16.681797, -42.902290, 129.553268);
AddCameraShot(-0.382320, 0.022132, -0.922222, -0.053386, 20.670977, -42.902290, 135.513001);
end
function weather()
if WeatherMode == 1 then
ReadDataFile("dc:FAI\\sky.lvl", "darkrain")
elseif WeatherMode == 2 then
ReadDataFile("dc:FAI\\sky.lvl", "greyrain")
elseif WeatherMode == 3 then
ReadDataFile("dc:FAI\\sky.lvl", "duskrain")
elseif WeatherMode == 4 then
ReadDataFile("dc:FAI\\sky.lvl", "darkclear")
elseif WeatherMode == 5 then
ReadDataFile("dc:FAI\\sky.lvl", "greyclear")
elseif WeatherMode == 6 then
ReadDataFile("dc:FAI\\sky.lvl", "duskclear")
end
end
Hidden/Spoiler:
Message Severity: 2
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "ParticleTransformer::ColorTrans" is full; raise count to at least 3364
uf_updateClassIndex(): Added class: rep_hero_obiwan
uf_updateClassIndex(): Added class: CIS_inf_trooper
uf_updateClassIndex(): Added class: CIS_inf_rocketeer
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #2 to `RetailAddUnitClass' (string expected, got nil)
stack traceback:
[C]: in function `RetailAddUnitClass'
(none): in function `AddUnitClass'
(none): in function `ScriptInit'
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp2" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp1" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp2" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp3" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp8" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp5" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp6" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp7" not found
C:\Battlefront2\main\RedEngineFL\Memory\RedMemoryPool.cpp(170)
Memory pool "ParticleTransformer::ColorTrans" is full; raise count to at least 3364
uf_updateClassIndex(): Added class: rep_hero_obiwan
uf_updateClassIndex(): Added class: CIS_inf_trooper
uf_updateClassIndex(): Added class: CIS_inf_rocketeer
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #2 to `RetailAddUnitClass' (string expected, got nil)
stack traceback:
[C]: in function `RetailAddUnitClass'
(none): in function `AddUnitClass'
(none): in function `ScriptInit'
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp2" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp1" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp2" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp3" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp8" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp5" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp6" not found
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "cp7" not found



