Help Adding a new game mode. . .
Posted: Mon Aug 14, 2006 3:17 pm
I'm trying to setup new game modes for my map, current name "Ace Race" and current three letter "ACE". I've got the mode to show up in the map list, but they crash with the Fatal Error Cannot open Mission\Ace_c.lvl and Cannot open Mission\Ace_race.lvl.
My map list entry looks like this:

and Here is my add me:
This is my Acec_race call to the mrq.

The layer exists btw. Campaign calls for layers conquest and campaign.
Any help would be appreaciated, and btw I didn't find any thread for getting new modes to work.
My map list entry looks like this:

and Here is my add me:
The mode lua scripts munge to .script fine, and visualmunge doesn't say anything, but I cab't find corresponding ..lvl's in build\common\scripts\munged.--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 = "ACE%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_ctf_g = 1, mode_ctf_c = 1, mode_1flag_g = 1, mode_1flag_c = 1, mode_eli_g = 1, mode_c_c = 1, mode_race_c = 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("ACE","ACEg_con",4)
AddDownloadableContent("ACE","ACEc_con",4)
AddDownloadableContent("ACE","ACEg_ctf",4)
AddDownloadableContent("ACE","ACEc_ctf",4)
AddDownloadableContent("ACE","ACEg_1flag",4)
AddDownloadableContent("ACE","ACEc_1flag",4)
AddDownloadableContent("ACE","ACEg_eli",4)
AddDownloadableContent("ACE","ACE_campaign",4)
AddDownloadableContent("ACE","ACE_race",4)
-- all done
newEntry = nil
n = nil
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\ACE\\data\\_LVL_PC\\core.lvl")
This is my Acec_race call to the mrq.
and campaign mode:.....
SetMemoryPoolSize("SoldierAnimation",380)
SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:ACE\\ACE.lvl", "ACE_conquest")
ReadDataFile("dc:ACE\\ACE.lvl", "ACE_race")
SetDenseEnvironment("false")
-- Sound
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
...
and finally race mode in ZE.SetMemoryPoolSize("SoldierAnimation",380)
SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:ACE\\ACE.lvl", "ACE_conquest")
ReadDataFile("dc:ACE\\ACE.lvl", "ACE_campaign")
SetDenseEnvironment("false")
-- Sound
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")

The layer exists btw. Campaign calls for layers conquest and campaign.
Any help would be appreaciated, and btw I didn't find any thread for getting new modes to work.