legion_config.lua/legion50x.lua:[code]function SetupModelChanging()
--TODO add your model changing code here
end
function LegionDataSetup()
--read in the models here
ReadDataFile("dc:..\\deviss\\common\\50X.lvl",
"legion1",
"legion2",
"legion3",
"legion4",
"legion5",
"legion6",
"legion7",
"legion8",
"legion9")
end
function LegionUnitSetup
--add units to teams here
SetupTeams{
rep = {
team = REP,
units = 50,
reinforcements = 150,
soldier = { "legion1",15, 20},
pilot = { "legion2",4,5},
assault = { "legion3",4,5},
sniper = { "legion4",4,5},
marine = { "legion5",4,5},
engineer = { "legion6",4,5},
officer = { "legion7",4,5},
special = { "legion8",4,5},
commander = { "legion9",2,3},
},
}
end[/code]XXXc_con.lua:[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
-- Republic Attacking (attacker is always #1)
local REP = 1
local CIS = 2
-- These variables do not change
local ATT = 1
local 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()
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1-1"}
cp2 = CommandPost:New{name = "cp2-1"}
cp3 = CommandPost:New{name = "cp3-1"}
cp4 = CommandPost:New{name = "cp4-1"}
cp5 = CommandPost:New{name = "cp5-1"}
cp6 = CommandPost:New{name = "cp6-1"}
--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(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)
conquest:Start()
SetupModelChanging() --setups and starts the model chaning timer
EnableSPHeroRules()
end
function ScriptInit()
ReadDataFile("legion50x") --loads your custom lvl file
ScriptCB_DoFile("legion_config") --loads the lua script that was inside your custom lvl file
ReadDataFile("ingame.lvl")
SetMemoryPoolSize("Music", 200)
ReadDataFile("sound\\fel.lvl;fel1cw")
ReadDataFile("dc:sound\\ABC.lvl;ABCcw")
SetMaxFlyHeight(53)
SetMaxPlayerFlyHeight (53)
ReadDataFile("SIDE\\rep.lvl",
"rep_hero_aalya")
LegionDataSetup() --reads in the units
ReadDataFile("dc:SIDE\\fed.lvl",
"cis_droid1",
"cis_droid2",
"cis_droid3",
"cis_droid4",
"cis_droid5",
"cis_droid6",
"cis_droid7",
"cis_droid9",
"cis_hero")
ReadDataFile("dc:SIDE\\veh.lvl",
"cis_tread_snailtank",
"rep_walk_oneman_atst")
SetAttackingTeam(ATT)
LegionUnitSetup() --setups the Legion team
SetupTeams{
cis = {
team = CIS,
units = 50,
reinforcements = 150,
soldier = { "cis_droid1",10, 30},
pilot = { "cis_droid2",5,7},
assault = { "cis_droid3",5,7},
sniper = { "cis_droid4",5,7},
marine = { "cis_droid5",8,9},
engineer = { "cis_droid6",4,5},
officer = { "cis_droid7",4,5},
commander = { "cis_droid9",2,4},
},
}
SetHeroClass(REP, "rep_hero_aalya")
SetHeroClass(CIS, "cis_hero")
-- Level Stats
ClearWalkers()
AddWalkerType(1, 2)
AddWalkerType(0, 4)
local weaponCnt = 1600
SetMemoryPoolSize("Aimer", 1024)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("CommandWalker", 1)
SetMemoryPoolSize("EntityHover", 4)
SetMemoryPoolSize("EntityLight", 33)
SetMemoryPoolSize("EntitySoundStream", 100)
SetMemoryPoolSize("EntitySoundStatic", 200)
SetMemoryPoolSize("EntityWalker", 5)
SetMemoryPoolSize("MountedTurret", 100)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 1024)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("Weapon", 1024)
SetMemoryPoolSize("FlagItem", 5)
SetMemoryPoolSize("AcklayData", 6)
SetMemoryPoolSize("EntityFlyer", 6)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("xxx\\xxx1.lvl", "xxx1_conquest")
SetDenseEnvironment("false")
SetAIViewMultiplier(0.65)
-- Birdies
SetNumBirdTypes(1)
SetBirdType(0,1.0,"bird")
-- Sound Stats...
-- Camera Stats...
end[/code]