here is my lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("Ambush")
ScriptCB_DoFile("MultiObjectiveContainer")
ScriptCB_DoFile("ObjectiveGoto")
ScriptCB_SetGameRules("Campaign")
-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2
ForestAmbush = 3
FAM = ForestAmbush
function ScriptPostLoad()
SetAIDifficulty(0, 2, "hard")
ScriptCB_SetGameRules("campaign")
onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
objectives_timer = CreateTimer("objectives_timer")
SetTimerValue(objectives_timer, 2)
StartTimer(objectives_timer)
begin_objectives = OnTimerElapse(
function(timer)
StartObjectives ()
ScriptCB_EnableCommandPostVO(0)
end,
objectives_timer
)
end
end
)
--Head towards bunker objective #1 (attack)
Objective1 = ObjectiveGoto:New{TeamATT = ATT, -- objective made
text = "Moveout1", popupText = "Moveout1", -- show objective on screen
regionName = "goto", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}
Objective1.OnStart = function(self)
ATT_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
MapAddEntityMarker("goto", "hud_objective_icon", 3.0, 1, "YELLOW", true) -- AI objective
end
--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"}
--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{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:Start()
SetUberMode(1)
EnableSPHeroRules()
SetupAmbushTrigger("forestambush", "forestpath", 6, 3)
end
function StartObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4.0 }
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:Start()
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\\nab.lvl;nab2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_sniper_snow",
"all_inf_engineer_snow",
"all_inf_officer_snow",
"all_inf_wookiee_snow",
"all_hero_chewbacca")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman_snow",
"imp_inf_rocketeer_snow",
"imp_inf_engineer_snow",
"imp_inf_sniper_snow",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_darthvader",
"imp_hover_fightertank" )
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_chaingun_tripod")
SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = -1,
soldier = { "all_inf_rifleman_snow",9, 35},
assault = { "all_inf_rocketeer_snow",1,14},
engineer = { "all_inf_engineer_snow",1,14},
sniper = { "all_inf_sniper_snow",1,14},
officer = { "all_inf_officer_snow",1,4},
special = { "all_inf_wookiee_snow",1,4},
},
imp = {
team = IMP,
units = 20,
reinforcements = 50,
soldier = { "imp_inf_rifleman_snow",9, 35},
assault = { "imp_inf_rocketeer_snow",1,14},
engineer = { "imp_inf_engineer_snow",1,14},
sniper = { "imp_inf_sniper_snow",1,14},
officer = { "imp_inf_officer",1,4},
special = { "imp_inf_dark_trooper",1,4},
},
fam = {
team = FAM,
units = 6,
reinforcements = -1,
soldier = { "all_inf_rifleman_snow",6,6},
}
}
SetTeamName(FAM, ALL)
SetTeamAsFriend(FAM, ALL)
SetTeamAsFriend(ALL, FAM)
SetTeamAsEnemy(FAM, IMP)
SetTeamAsEnemy(IMP, FAM)
ClearAIGoals(FAM)
AddAIGoal(FAM, "Deathmatch", 100)
SetHeroClass(ALL, "all_hero_chewbacca")
SetHeroClass(IMP, "imp_hero_darthvader")
-- 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)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 2024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 41)
SetMemoryPoolSize("EntityFlyer", 2)
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:GAD\\GAD.lvl", "GAD_eli")
SetDenseEnvironment("false")
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("Ambush")
ScriptCB_DoFile("MultiObjectiveContainer")
ScriptCB_DoFile("ObjectiveGoto")
ScriptCB_SetGameRules("Campaign")
-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2
ForestAmbush = 3
FAM = ForestAmbush
function ScriptPostLoad()
SetAIDifficulty(0, 2, "hard")
ScriptCB_SetGameRules("campaign")
onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
objectives_timer = CreateTimer("objectives_timer")
SetTimerValue(objectives_timer, 2)
StartTimer(objectives_timer)
begin_objectives = OnTimerElapse(
function(timer)
StartObjectives ()
ScriptCB_EnableCommandPostVO(0)
end,
objectives_timer
)
end
end
)
--Head towards bunker objective #1 (attack)
Objective1 = ObjectiveGoto:New{TeamATT = ATT, -- objective made
text = "Moveout1", popupText = "Moveout1", -- show objective on screen
regionName = "goto", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}
Objective1.OnStart = function(self)
ATT_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
MapAddEntityMarker("goto", "hud_objective_icon", 3.0, 1, "YELLOW", true) -- AI objective
end
--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"}
--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{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:Start()
SetUberMode(1)
EnableSPHeroRules()
SetupAmbushTrigger("forestambush", "forestpath", 6, 3)
end
function StartObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4.0 }
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:Start()
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\\nab.lvl;nab2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_sniper_snow",
"all_inf_engineer_snow",
"all_inf_officer_snow",
"all_inf_wookiee_snow",
"all_hero_chewbacca")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman_snow",
"imp_inf_rocketeer_snow",
"imp_inf_engineer_snow",
"imp_inf_sniper_snow",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_darthvader",
"imp_hover_fightertank" )
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_tat_barge",
"tur_bldg_chaingun_tripod")
SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = -1,
soldier = { "all_inf_rifleman_snow",9, 35},
assault = { "all_inf_rocketeer_snow",1,14},
engineer = { "all_inf_engineer_snow",1,14},
sniper = { "all_inf_sniper_snow",1,14},
officer = { "all_inf_officer_snow",1,4},
special = { "all_inf_wookiee_snow",1,4},
},
imp = {
team = IMP,
units = 20,
reinforcements = 50,
soldier = { "imp_inf_rifleman_snow",9, 35},
assault = { "imp_inf_rocketeer_snow",1,14},
engineer = { "imp_inf_engineer_snow",1,14},
sniper = { "imp_inf_sniper_snow",1,14},
officer = { "imp_inf_officer",1,4},
special = { "imp_inf_dark_trooper",1,4},
},
fam = {
team = FAM,
units = 6,
reinforcements = -1,
soldier = { "all_inf_rifleman_snow",6,6},
}
}
SetTeamName(FAM, ALL)
SetTeamAsFriend(FAM, ALL)
SetTeamAsFriend(ALL, FAM)
SetTeamAsEnemy(FAM, IMP)
SetTeamAsEnemy(IMP, FAM)
ClearAIGoals(FAM)
AddAIGoal(FAM, "Deathmatch", 100)
SetHeroClass(ALL, "all_hero_chewbacca")
SetHeroClass(IMP, "imp_hero_darthvader")
-- 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)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 2024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 41)
SetMemoryPoolSize("EntityFlyer", 2)
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:GAD\\GAD.lvl", "GAD_eli")
SetDenseEnvironment("false")
Hidden/Spoiler:
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "dittyTimer" not found
release self.dittyTimerResponse
idx in = 3
idx use = 3 side = 1
icon fast mode
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(439)
level.GAD.locals not localized
Message Severity: 2
.\Source\ActiveRegion.cpp(186)
Region "forestambush" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "victoryTimer" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "delayTimer" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "goto" not found
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "dittyTimer" not found
release self.dittyTimerResponse
idx in = 3
idx use = 3 side = 1
icon fast mode
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(884)
Missing a localized team name for this level, level.GAD.local
Message Severity: 2
.\Source\Team.cpp(439)
level.GAD.locals not localized
Message Severity: 2
.\Source\ActiveRegion.cpp(186)
Region "forestambush" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "victoryTimer" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(2523)
Timer "delayTimer" not found
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "goto" not found
Anyone have any clue why the ambush isn't working?




