Page 1 of 1

Help Adding a new game mode. . .

Posted: Mon Aug 14, 2006 3:17 pm
by Ace_Azzameen_5
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:
Image
and Here is my add me:
--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")
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.
This is my Acec_race call to the mrq.
.....
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 campaign mode:
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")
and finally race mode in ZE.
Image
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.

RE: Help Adding a new game mode. . .

Posted: Mon Aug 14, 2006 5:51 pm
by Teancum
These two

AddDownloadableContent("ACE","ACE_campaign",4)
AddDownloadableContent("ACE","ACE_race",4)

should be

AddDownloadableContent("ACE","ACEc_campaign",4)
AddDownloadableContent("ACE","ACEc_race",4)

RE: Help Adding a new game mode. . .still

Posted: Mon Aug 14, 2006 5:55 pm
by Ace_Azzameen_5
Thanks, lol, I guess this is now pretty much a tutorial for adding new game modes. I just assumed it was the mrq that went there and didn't notice the other c's and g's.

Ooops, it should also just be c instead of campaign.

Still not working, doing a clean munge.

Still not working, do I need to add something to my build folder?

RE: Help Adding a new game mode. . .still

Posted: Mon Aug 14, 2006 6:45 pm
by Hebes24
Is therer a ***c_race.req in data_***\common\mission?

Is the mode in data_TST\Common\mission.req?

If not, add them. Look at how the other game modes req look to help you when making the ***c_race.req.

RE: Help Adding a new game mode. . .still

Posted: Mon Aug 14, 2006 7:00 pm
by Ace_Azzameen_5
Thanks alot Hebes! That got it. No idea those files existed.