line in the addme but I'm not sure where to put it in in my side mod that adds a new era to stock maps. Localizing the era does not help, as it it already installed into the 1.3 patch. How did Mav do it in his Beach Troopers mod?
Isn't that for adding it to a mod map, not a stock one? I used it like that in a different map, but for this one it didn't work out so well since adding an era to stock maps is different than adding an era to a custom map and renaming it.
addme(the good stuff):
Here's an example addme adding a new map and an era to a stock map.
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)
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)
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\BF3\\data\\_LVL_PC\\core.lvl")
Re: Renaming an Era
Posted: Mon Apr 02, 2012 11:46 am
by Noobasaurus
Thanks Kinetos and WULF; it worked.
Re: Renaming an Era [Solved]
Posted: Sat Apr 07, 2012 7:14 pm
by ARCTroopaNate
Tried like 10 times, not working for me. What did I do wrong!?
Addme LUA
Hidden/Spoiler:
--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)
-- 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)
Yes, I used the tutorial to set up my mod, I've done it before. It was working fine before, but I now tried to change the name of my era and it isn't working. Battlefront closes before the Instant action screen because of the addme messup.