Help Adding a new game mode. . .

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
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Help Adding a new game mode. . .

Post 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.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

RE: Help Adding a new game mode. . .

Post 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)
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

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

Post 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?
Hebes24
Sith Master
Sith Master
Posts: 2594
Joined: Sat Jun 03, 2006 5:15 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: In An Epic Space Battle!
Contact:

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

Post 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.
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

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

Post by Ace_Azzameen_5 »

Thanks alot Hebes! That got it. No idea those files existed.
Post Reply