Hidden/Spoiler:
--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] = {
red = 20,
blue = 40,
green = 240,
isModLevel = 1,
mapluafile = "GAA%s_%s",
era_g = 1,
era_c = 1,
mode_c2_g = 1,
mode_c2_c = 1,
mode_c1_c = 1,
mode_c1_g = 1,
mode_c4_g = 1,
mode_c4_c = 1,
mode_c3_g = 1,
mode_c3_c = 1,
change = {
mode_c1 = { name="Easy", icon="mode_icon_wav", about="Even though this may be the easiest mode, it's still not that easy." },
mode_c2 = { name="Medium", icon="mode_icon_rpg", about="Harder than easy but easier than hard." },
mode_c3 = { name="Hard", icon="mode_icon_survival", about="Watch for ambushes and other evilness!" },
mode_c4 = { name="5 Minutes", icon="mode_icon_siege", about="Need a quick break to PWN? Here you are!" },
era_g = { name="Alpha Squad", icon2="mode_icon_xtra" },
era_c = { name="The Really Cool People", icon2="mode_icon_uber" },
},
}
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("GAA","GAAg_c2",4)
AddDownloadableContent("GAA","GAAc_c2",4)
AddDownloadableContent("GAA","GAAg_c1",4)
AddDownloadableContent("GAA","GAAc_c1",4)
AddDownloadableContent("GAA","GAAg_c4",4)
AddDownloadableContent("GAA","GAAc_c4",4)
AddDownloadableContent("GAA","GAAg_c3",4)
AddDownloadableContent("GAA","GAAc_c3",4)
-- all done
newEntry = nil
n = nil
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\GAA\\data\\_LVL_PC\\core.lvl")
--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] = {
red = 20,
blue = 40,
green = 240,
isModLevel = 1,
mapluafile = "GAA%s_%s",
era_g = 1,
era_c = 1,
mode_c2_g = 1,
mode_c2_c = 1,
mode_c1_c = 1,
mode_c1_g = 1,
mode_c4_g = 1,
mode_c4_c = 1,
mode_c3_g = 1,
mode_c3_c = 1,
change = {
mode_c1 = { name="Easy", icon="mode_icon_wav", about="Even though this may be the easiest mode, it's still not that easy." },
mode_c2 = { name="Medium", icon="mode_icon_rpg", about="Harder than easy but easier than hard." },
mode_c3 = { name="Hard", icon="mode_icon_survival", about="Watch for ambushes and other evilness!" },
mode_c4 = { name="5 Minutes", icon="mode_icon_siege", about="Need a quick break to PWN? Here you are!" },
era_g = { name="Alpha Squad", icon2="mode_icon_xtra" },
era_c = { name="The Really Cool People", icon2="mode_icon_uber" },
},
}
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("GAA","GAAg_c2",4)
AddDownloadableContent("GAA","GAAc_c2",4)
AddDownloadableContent("GAA","GAAg_c1",4)
AddDownloadableContent("GAA","GAAc_c1",4)
AddDownloadableContent("GAA","GAAg_c4",4)
AddDownloadableContent("GAA","GAAc_c4",4)
AddDownloadableContent("GAA","GAAg_c3",4)
AddDownloadableContent("GAA","GAAc_c3",4)
-- all done
newEntry = nil
n = nil
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\GAA\\data\\_LVL_PC\\core.lvl")
Hidden/Spoiler:
Opened logfile BFront2.log 2012-12-03 0810
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawl.mvs
shell_interface: Opening movie: movies\shell.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
ifs_missionselect_pcMulti_fnSetMapPreview(): Stored movie name, file: preview-loop MOVIES\pre-movie
this.CurButton = nil
cur_button = nil
custom_CheckChangeMovies(): Update(): Time to change movies
ifs_missionselect_pcMulti_ChangeMovieFile(): MovieFile: nil
ifs_missionselect_pcMulti_ChangeMovieFile(): Closed any open movie
ifs_missionselect_pcMulti_ChangeMovieFile(): Opening movie: MOVIES\pre-movie.mvs
ifs_missionselect_pcMulti_ChangeMovieFile(): Finished opening movie
this.CurButton = check_mode17
cur_button = nil
Checkbox for check_era3 clicked
this.CurButton = check_era3
cur_button = nil
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 0538036C
The key, value is: mode_c1_c 1
The key, value is: era_g 1
The key, value is: isModLevel 1
The key, value is: mode_c1_g 1
The key, value is: bSelected 1
The key, value is: mode_c2_g 1
The key, value is: era_c 1
The key, value is: mode_c4_c 1
The key, value is: red 20
The key, value is: blue 40
The key, value is: mode_c3_g 1
The key, value is: mode_c2_c 1
The key, value is: green 240
The key, value is: change table: 0538044C
The key, value is: mode_c3_c 1
The key, value is: mode_c4_g 1
The key is mapluafile, the formated value is: GAA<A>_<B>
custom_printTable(): Returning
custom_printTable(): table: 05385F0C
The key, value is: key mode_c1
The key, value is: subst c1
The key, value is: showstr modename.name.c1
The key, value is: descstr modename.description.c1
The key, value is: icon mode_icon_c1
custom_printTable(): Returning
gMapEras.key = era_c Era = era_c subst = c
Adding map: GAAc_c1 idx: 1
this.CurButton = Launch
cur_button = nil
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawl.mvs
shell_interface: Opening movie: movies\shell.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
ifs_missionselect_pcMulti_fnSetMapPreview(): Stored movie name, file: preview-loop MOVIES\pre-movie
this.CurButton = nil
cur_button = nil
custom_CheckChangeMovies(): Update(): Time to change movies
ifs_missionselect_pcMulti_ChangeMovieFile(): MovieFile: nil
ifs_missionselect_pcMulti_ChangeMovieFile(): Closed any open movie
ifs_missionselect_pcMulti_ChangeMovieFile(): Opening movie: MOVIES\pre-movie.mvs
ifs_missionselect_pcMulti_ChangeMovieFile(): Finished opening movie
this.CurButton = check_mode17
cur_button = nil
Checkbox for check_era3 clicked
this.CurButton = check_era3
cur_button = nil
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 0538036C
The key, value is: mode_c1_c 1
The key, value is: era_g 1
The key, value is: isModLevel 1
The key, value is: mode_c1_g 1
The key, value is: bSelected 1
The key, value is: mode_c2_g 1
The key, value is: era_c 1
The key, value is: mode_c4_c 1
The key, value is: red 20
The key, value is: blue 40
The key, value is: mode_c3_g 1
The key, value is: mode_c2_c 1
The key, value is: green 240
The key, value is: change table: 0538044C
The key, value is: mode_c3_c 1
The key, value is: mode_c4_g 1
The key is mapluafile, the formated value is: GAA<A>_<B>
custom_printTable(): Returning
custom_printTable(): table: 05385F0C
The key, value is: key mode_c1
The key, value is: subst c1
The key, value is: showstr modename.name.c1
The key, value is: descstr modename.description.c1
The key, value is: icon mode_icon_c1
custom_printTable(): Returning
gMapEras.key = era_c Era = era_c subst = c
Adding map: GAAc_c1 idx: 1
this.CurButton = Launch
cur_button = nil
Anyone know what is causing this problem? It can't be a problem with the units; they aren't even loaded at this point in time.




