Page 1 of 1

Addme making SWBF2 crash [Solved]

Posted: Thu Aug 20, 2009 1:07 pm
by Par3210
Hi. I am pretty sure that my Addme is making SWBF2 crash. Here it is:
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] = {
isModLevel = 1,
mapluafile = "WW2%s_%s",
era_g = 1,
mode_con_g = 1,
mode_1flag_g = 1,
mode_eli_g = 1,
change = {
era_g = { name="WW2 Era"},
mode_con = { name="WW2 Conquest", icon="mode_icon_XL", about="Fight on either side to win or lose, your choice!" },
mode_1flag = { name="RPG mode", icon="mode_icon_eli", about="Play up to 14 different units! - !!! =$ MP ONLY $= !!!" },
mode_eli = { name="Zombie Mode", icon="mode_icon_hunt", about="Wipe out the other side to gain control of the battlefield." },
},
}
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("WW2","WW2g_con",4)
AddDownloadableContent("WW2","WW2g_1flag",4)
AddDownloadableContent("WW2","WW2g_eli",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\WW2\\data\\_LVL_PC\\core.lvl")
HELP ME PLEASE!
My BF2 Log.
Hidden/Spoiler:
Opened logfile BFront2.log 2009-08-20 1827
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: No custom_gc_10.lvl
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_GetGCButtonList()
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

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaScript.cpp(435)
Script file addme not found

Re: Addme making SWBF2 crash

Posted: Thu Aug 20, 2009 1:44 pm
by Xavious
What did you change/ add before it started crashing?

Re: Addme making SWBF2 crash

Posted: Thu Aug 20, 2009 1:50 pm
by Par3210
Well I followed a tut on making a mappack run in one addon slot, added another section here:
Hidden/Spoiler:
--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 = "WW2%s_%s",
era_g = 1,
mode_con_g = 1,
mode_1flag_g = 1,
mode_eli_g = 1,
change = {
era_g = { name="WW2 Era"},
mode_con = { name="WW2 Conquest", icon="mode_icon_XL", about="Fight on either side to win or lose, your choice!" },
mode_1flag = { name="RPG mode", icon="mode_icon_eli", about="Play up to 14 different units! - !!! =$ MP ONLY $= !!!" },
mode_eli = { name="Zombie Mode", icon="mode_icon_hunt", about="Wipe out the other side to gain control of the battlefield." },
},
}
sp_missionselect_listbox_contents[sp_n+2] = {
isModLevel = 1,
mapluafile = "PRI%s_%s",
era_g = 1,
mode_con_g = 1,
}
And this:
Hidden/Spoiler:
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]
mp_missionselect_listbox_contents[mp_n+2] = sp_missionselect_listbox_contents[sp_n+2]

Re: Addme making SWBF2 crash

Posted: Thu Aug 20, 2009 2:23 pm
by [RDH]Zerted
The code you first posted is different from the code in your last post. Please just post your entire addme.lua (the version which generated the error).

Also, move all the other maps (including AAA-v1.3patch) out of your addon folder just to double-check that it is your map having the problem.

Re: Addme making SWBF2 crash {SOLVED}

Posted: Fri Aug 21, 2009 8:33 am
by Par3210
Tried this, and it is definetly the map, as I just left the map and it crashed the game.
Please help... my addme.lua? Which one? My old one? I don't know that one as I edited to see if it would work if I got rid of the part I added.
WELL WELL WELL! I just cleaned and it is working again! SOLVED!