Addme making SWBF2 crash [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Owning people in SWBF2
Contact:

Addme making SWBF2 crash [Solved]

Post 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
Xavious
Sith Master
Sith Master
Posts: 2783
Joined: Mon Jun 12, 2006 3:46 pm

Re: Addme making SWBF2 crash

Post by Xavious »

What did you change/ add before it started crashing?
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Owning people in SWBF2
Contact:

Re: Addme making SWBF2 crash

Post 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]
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Addme making SWBF2 crash

Post 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.
User avatar
Par3210
Jedi
Jedi
Posts: 1033
Joined: Sun Jun 14, 2009 10:31 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Owning people in SWBF2
Contact:

Re: Addme making SWBF2 crash {SOLVED}

Post 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!
Post Reply