Here's my addme script:
Code: Select all
--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end
--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)
sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "TST%s_%s", era_g = 1, mode_assault_g = 1,mode_1flag_g = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]
-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)
AddDownloadableContent("TST","TSTg_1flag",4)
AddDownloadableContent("TST","TSTg_Diet Dr. Pepper",4)
-- all done
newEntry = nil
n = nil
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TST\\data\\_LVL_PC\\core.lvl")
Code: Select all
ucft
{
REQN
{
"script"
"TSTg_cmn"
"TSTg_1flag"
}
}
Code: Select all
ucft
{
REQN
{
"congraph"
"TST_GCW-CTF"
}
REQN
{
"world"
"TST_GCW-ctf"
}
}Code: Select all
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Galactic Civil Wars Template CTF File
--
ScriptCB_DoFile("ObjectiveOneFlagCTF")
ScriptCB_DoFile("TSTg_cmn")
myGameMode = "TST_GCW-CTF"
function SetupUnits()
ReadDataFile("SIDE\\all.lvl",
"all_inf_pilot",
"all_fly_xwing_sc",
"all_fly_ywing_sc",
"all_fly_awing",
"all_veh_remote_terminal")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_pilot",
"imp_fly_tiefighter_sc",
"imp_fly_tiebomber_sc",
"imp_fly_tieinterceptor",
"imp_veh_remote_terminal")
ReadDataFile("SIDE\\tur.lvl",
"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"
)
end
myTeamConfig = {
all = {
team = ALL,
units = 32,
reinforcements = -1,
pilot = { "all_inf_pilot",32},
},
imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "imp_inf_pilot",32},
}
}
function myScriptInit()
SetMemoryPoolSize("FlagItem", 1)
end
---------------------------------------------------------------------------
-- FUNCTION: ScriptPostLoad
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptPostLoad' 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()
ctf = ObjectiveOneFlagCTF:New{
teamATT = IMP, teamDEF = ALL,
textATT = "game.modes.1flag", textDEF = "game.modes.1flag2", flag = "cmn_flag",
homeRegion = "flaghome", captureRegionATT = "defhome", captureRegionDEF = "atthome",
capRegionDummyObjectATT = "1flag_cis_marker", capRegionDummyObjectDEF = "1flag_rep_marker",
multiplayerRules = true, hideCPs = true,
AIGoalWeight = 0.0,
}
SoundEvent_SetupTeams( IMP, 'imp', ALL, 'all' )
ctf:Start()
SetupTurrets()
AddAIGoal(ALL, "Deathmatch", 100)
AddAIGoal(IMP, "Deathmatch", 100)
end
