My Q was solved, and since all the info was all around the place, I'll make a tut that will show you how to do this.
First Part: How to make a multi map map pack (NOTE: replace the name's; PFE, BCT, TML, and PIV with your three letter map id)
Step1: making the addme
Open up your addme(found in data_PFE/addme) and scroll to this part;
Hidden/Spoiler:
[code]--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)
-- 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)
-- 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)
-- 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)
-- 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)
Next, go into the mission folder and make these reqs:
PIVe_con, TMLe_con, BCTe_con.
In the req's, put these lines:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"config"
"cor_movies"
}
REQN
{
"script"
"BCTe_con"
}
}
[/code]
Step 3: putting on the scripts
go back to your maps script folder(i.e.: BF2_modtools/data_BCT/common/scripts/BCT) and remove the abc folder and put it in the map packs script folder.(NOTE: replace abc with your map name)
Step 4: bringing the worlds
go back to data_BCT and go into the world folder. Remove the BCT folder and put it in the map packs world folder.
And your done! If there was a mistake in the tut, then feel free to edit the post.
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 12:20 am
by [RDH]Zerted
Just combine the addme luas. Do you still have your old attempt? If so, post it.
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 11:55 am
by RED51
No...I've seemed to have lost that addme file...but I do have the lastest one. here it is:
Hidden/Spoiler:
[code]--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)
-- 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\\PFE\\data\\_LVL_PC\\core.lvl")
[/code]
As you can read, I'm also trying to add a new era.
Here's a new addme file:
Hidden/Spoiler:
[code]--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)
-- 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\\PFE\\data\\_LVL_PC\\core.lvl")
[/code]
Also, there's a bug with the new era thing. The era icon shows up in the cor map mode selection, but it won't let me put it on the map play list. This new addme only has the BCT level showing up, where the last one had the above bug. It would just really save ne some time if Mav or someone who helped put in the kotor era just show me there addme.
You never need to bump to add in new information - especially when the post is only three hours old. Just edit your old post. -Staff
Only BCT is showing up because you only stored the BCT in the listbox (sp_missionselect_listbox_contents). The listbox is a table/array. Notice the sp_n+1? That says the location in the table to store the data. sp_n is equal to the amount of maps already in the table, and the +1 means to put your map the last map. However, you keep putting your map at the same spot in the table, thus overwriting the map you put there before. You need to increment the spot you are storing the map, so you want to use sp_n+2 for GEO, sp_n+3 for KAS, etc... Understand?
You will also need to do the same thing for the mp_missionselect_listbox_contents (so you will have 4 mp = sp listbox lines).
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 1:29 pm
by RED51
It worked...sort've. Now there's a new bug. Here's a pic of the new bug:
As you can see, there's two kas and geos(cor is also has this bug). How do I fix that? Oh, BCT works, so there's one problem solved.
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 1:39 pm
by Frisbeetarian
There's no bug there, it did exactly what you told it to do. You said isModLevel = 1, so it made a mode level of the scripts cor1, geo1, and kas. I'm guessing, however that the replica maps aren't perfect copies of each other, the copy probably has the new modes you added while the old one doesn't.
Are you trying to add an era and modes to the preexisting cor, geo, and kas?
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 1:43 pm
by [RDH]Zerted
RED51 wrote:As you can see, there's two kas and geos(cor is also has this bug). How do I fix that?
--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
Frisbeetarian wrote:You said isModLevel = 1, so it made a mode level of the scripts cor1, geo1, and kas...
No, isModLevel is just a variable the game uses to help determine map colors. The maps were added as new map entries, so they have their own line. If thats not what you wanted, then you want to use AddNewGameModes() instead of the 'sp/mp listbox[#] = { xxx=xxx, }'.
missionList is one of those sp/mp tables (you will need to do it for both) mapName is the value of your mapluafile newFlags is a table of everything you are changing/adding. Example: {era_e = 1, mode_uber_e = 1,}
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 2:00 pm
by RED51
Completely under stood what you said, but have no idea how to excute...what/where do I type in?
--add my modes to the singleplayer map selection screen
AddNewGameModes( sp_missionselect_listbox_contents, "cor1%s_%s", {era_e = 1, mode_con_e = 1, mode_ctf_e = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "geo1%s_%s", {era_e = 1, mode_xl_e = 1, mode_hunt_e = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "kas%s_%s", {era_e = 1, mode_uber_e = 1,} )
--add my modes to the multiplayer map selection screen
AddNewGameModes( mp_missionselect_listbox_contents, "cor1%s_%s", {era_e = 1, mode_con_e = 1, mode_ctf_e = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "geo1%s_%s", {era_e = 1, mode_xl_e = 1, mode_hunt_e = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kas%s_%s", {era_e = 1, mode_uber_e = 1,} )
--add my new map and its modes to both SP and MP
mp_n = table.getn(mp_missionselect_listbox_contents) --gets the length of the mp table
sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "BCT%s_%s", era_e = 1, mode_con_e = 1, mode_ctf_e = 1,}
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]
For the map names, I am unsure if it should be like cor1%s_%s or only cor1. You still need to do the AddDownloadableContent() calls.
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 2:37 pm
by RED51
It works!! Before this is locked, I'm gona make a tut on how to do this.
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 2:47 pm
by Frisbeetarian
[RDH]Zerted wrote:No, isModLevel is just a variable the game uses to help determine map colors.
Ah, got it.
I also wanted to throw out there that I've gotten it to work without using the AddNewGameModes script. I just created a new map, used the shipped map's name for the new maps Lua (might not be necessary), loaded any layers in this Lua from the shipped map, then put it into the addme.lua just like I normally would with one small change, for the AddDownloadableContent line, I use the shipped map's lvl file name instead of the mod map's.
Re: How do I make a multi map pack addme/lua?
Posted: Sat Oct 11, 2008 3:01 pm
by [RDH]Zerted
RED51 wrote:It works!! Before this is locked, I'm gona make a tut on how to do this.
Then edit your first post and stick it there. There is no reason to lose these good posts or start another topic.
Edit: You forgot to also increment mp_n+1. I changed that in your post, but don't forget to update your script if you need to.