Page 1 of 1

Adding Era mods to my own custom maps [Solved]

Posted: Sat Apr 13, 2013 12:32 am
by Dakota
I've made about 4 maps and I'm giving the map itself the stock sides and then having my era mod RvB add itself to them. The first time I tried it it worked perfectly and I've been able to play on the map fine. The second time however I can't seem to get the era on the second map at all. Same thing happened on the third map and I haven't tried on the fourth yet.

The first and second map are set up exactly the same in the mission.req and the addon file. They both also work using the stock units on their own mode.

My only idea is that I forgot something in the second one or accidently did something on the first that was the only reason it worked. I'm going to keep looking around, maybe check for a tutorial on doing what i'm doing to checklist things.

EDIT: I can't find a tutorial in the all you need to know thread...

Re: Adding Era mods to my own custom maps

Posted: Sat Apr 13, 2013 3:23 am
by noMatt
forums/viewtopic.php?f=27&t=15141
Search for things like that

Re: Adding Era mods to my own custom maps

Posted: Sat Apr 13, 2013 12:51 pm
by Dakota
See my problem is that I already did that. It actually worked on one of the maps but didn't on the other. I'm going to attempt a full manual clean.

Re: Adding Era mods to my own custom maps

Posted: Sat Apr 13, 2013 1:18 pm
by noMatt
I think thats always a good thing :D
And sorry for my inpolite sentence above.

Re: Adding Era mods to my own custom maps

Posted: Sat Apr 13, 2013 1:48 pm
by Dakota
don't worry I did not take offense.

Re: Adding Era mods to my own custom maps

Posted: Sat Apr 13, 2013 6:16 pm
by THEWULFMAN
The MOD ID's for all 4 maps, post them, and say which ones worked and which didn't.

Re: Adding Era mods to my own custom maps

Posted: Sat Apr 13, 2013 6:26 pm
by Dakota
ADF worked
TCN did not work
VBM did not work
CAV untested

Re: Adding Era mods to my own custom maps

Posted: Sun Apr 14, 2013 7:18 pm
by THEWULFMAN
As I suspected. I'll tell you right now that CAV will work.

It's this weird quirk that prevents you from adding eras to mod maps if their Mod ID starts with any letter between at least T-Z. I don't remember if R or S works.

There's a solution out there, I believe Zerted posted it. You'd have to search through his posts.

I do know of one solution however. What needs to be done is adding the era in the maps own Addme, rather than the Era's addme.

Re: Adding Era mods to my own custom maps

Posted: Sun Apr 14, 2013 9:13 pm
by Dakota
Wow thanks, I'm too busy to try it tonight but I'll get it done tomorrow.

I'll probably start the mod ID with an A for the rest of my maps now that I've come up with a planet name (only ADF was started after I came up with the name).

What a weird problem though, do you know if anyone has ever made a list of them?
(I know of the bf2 limitations and I guess this one could be added)

Re: Adding Era mods to my own custom maps

Posted: Sun Apr 14, 2013 9:24 pm
by Maveritchell
THEWULFMAN wrote:It's this weird quirk that prevents you from adding eras to mod maps if their Mod ID starts with any letter between at least T-Z. I don't remember if R or S works.
?
Hidden/Spoiler:
[code]sp_n = table.getn(sp_missionselect_listbox_contents)
sp_missionselect_listbox_contents[sp_n+1] = { red = 251, blue = 59, green = 224, isModLevel = 1, mapluafile = "TIS%s_%s", era_1 = 1, mode_con_1 = 1, mode_ctrl_1 = 1, mode_ins_1 = 1, change = {
era_1 = { name="Dark Times", icon2="darktimes_icon" }, mode_ins = { name="V.I.P.", icon="vip_icon", about="Protect the leader - or hunt him down!" },
},}

...

sp_n = table.getn(sp_missionselect_listbox_contents)
sp_missionselect_listbox_contents[sp_n+1] = { red = 251, blue = 59, green = 224, isModLevel = 1, mapluafile = "TIB%s_%s", era_1 = 1, mode_con_1 = 1, mode_ctrl_1 = 1, mode_ins_1 = 1, change = {
era_1 = { name="Dark Times", icon2="darktimes_icon" }, mode_ins = { name="V.I.P.", icon="vip_icon", about="Protect the leader - or hunt him down!" },
},}

[/code]
Edit, yeah, also, looking at the mission.lvl of this guy's mod (forums/viewtopic.php?f=35&t=25808), it also uses Dark Times with the modID of "y4p."

Re: Adding Era mods to my own custom maps

Posted: Sun Apr 14, 2013 9:28 pm
by kinetosimpetus
I think the problem isn't as predictable as that, I couldn't get Nal Hutta Slums working with mine either, and IIRC, the code for that one is HUT.

Re: Adding Era mods to my own custom maps

Posted: Sun Apr 14, 2013 9:35 pm
by Maveritchell
kinetosimpetus wrote:I think the problem isn't as predictable as that, I couldn't get Nal Hutta Slums working with mine either, and IIRC, the code for that one is HUT.
...which also worked fine with Dark Times. That doesn't sound like a general "adding eras" problem.

I don't want to divert, though. The OP should probably post his addme, because it's likely there's just a problem there.

Re: Adding Era mods to my own custom maps

Posted: Sun Apr 14, 2013 10:23 pm
by Dakota
At your request: The Addme.luas

TCN
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)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "TCN%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_xl_g = 1, mode_xl_c = 1, mode_hunt_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("TCN","TCNg_con",4)
AddDownloadableContent("TCN","TCNc_con",4)
AddDownloadableContent("TCN","TCNg_xl",4)
AddDownloadableContent("TCN","TCNc_xl",4)
AddDownloadableContent("TCN","TCNc_hunt",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TCN\\data\\_LVL_PC\\core.lvl")
DAK
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




AddNewGameModes( sp_missionselect_listbox_contents, "end1%s_%s", {era_r = 1, mode_hunt_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "end1%s_%s", {era_r = 1, mode_hunt_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "geo1%s_%s", {era_r = 1, mode_hunt_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "geo1%s_%s", {era_r = 1, mode_hunt_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "hot1%s_%s", {era_r = 1, mode_hunt_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "hot1%s_%s", {era_r = 1, mode_hunt_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "kam1%s_%s", {era_r = 1, mode_hunt_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kam1%s_%s", {era_r = 1, mode_hunt_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "kas2%s_%s", {era_r = 1, mode_hunt_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kas2%s_%s", {era_r = 1, mode_hunt_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "tat2%s_%s", {era_r = 1, mode_hunt_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tat2%s_%s", {era_r = 1, mode_hunt_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "cor1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "cor1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "cor1%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "cor1%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "nab1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "nab1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "dag1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "dag1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "dag1%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "dag1%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "dea1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "dea1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "dea1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "dea1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "end1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "end1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "end1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "end1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "fel1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "fel1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "fel1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "fel1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "geo1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "geo1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "geo1%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "geo1%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "hot1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "hot1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "hot1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "hot1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "kam1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kam1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "kam1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kam1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "kas2%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kas2%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "kas2%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kas2%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "mus1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "mus1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "mus1%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "mus1%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "myg1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "myg1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "myg1%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "myg1%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "nab2%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "nab2%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "nab2%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "nab2%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "pol1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "pol1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "pol1%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "pol1%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "tan1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tan1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "tan1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tan1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "tat1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tat1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "tat2%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tat2%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "tat2%s_%s", {era_r = 1, mode_ctf_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tat2%s_%s", {era_r = 1, mode_ctf_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "tat3%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tat3%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "tat3%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tat3%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "uta1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "uta1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "uta1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "uta1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "yav1%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "yav1%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "yav1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "yav1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "spa1%s_%s", {era_r = 1, mode_assault_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "spa1%s_%s", {era_r = 1, mode_assault_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "spa1%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "spa1%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "spa8%s_%s", {era_r = 1, mode_assault_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "spa8%s_%s", {era_r = 1, mode_assault_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "spa8%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "spa8%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "spa9%s_%s", {era_r = 1, mode_assault_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "spa9%s_%s", {era_r = 1, mode_assault_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "spa9%s_%s", {era_r = 1, mode_1flag_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "spa9%s_%s", {era_r = 1, mode_1flag_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "spa8%s_%s", {era_r = 1, mode_cmn_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "spa8%s_%s", {era_r = 1, mode_cmn_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "spa9%s_%s", {era_r = 1, mode_cmn_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "spa9%s_%s", {era_r = 1, mode_cmn_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "ADF%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "ADF%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "ADF%s_%s", {era_r = 1, mode_xl_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "ADF%s_%s", {era_r = 1, mode_xl_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "TCN%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "TCN%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "TCN%s_%s", {era_r = 1, mode_xl_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "TCN%s_%s", {era_r = 1, mode_xl_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "VBM%s_%s", {era_c = 1, mode_con_c = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "VBM%s_%s", {era_c = 1, mode_con_c = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "VBM%s_%s", {era_c = 1, mode_xl_c = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "VBM%s_%s", {era_c = 1, mode_xl_c = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "VBM%s_%s", {era_g = 1, mode_con_g = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "VBM%s_%s", {era_g = 1, mode_con_g = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "VBM%s_%s", {era_g = 1, mode_xl_g = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "VBM%s_%s", {era_g = 1, mode_xl_g = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "VBM%s_%s", {era_r = 1, mode_con_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "VBM%s_%s", {era_r = 1, mode_con_r = 1,} )

AddNewGameModes( sp_missionselect_listbox_contents, "VBM%s_%s", {era_r = 1, mode_xl_r = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "VBM%s_%s", {era_r = 1, mode_xl_r = 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("end1","end1r_hunt",4)
AddDownloadableContent("geo1","geo1r_hunt",4)
AddDownloadableContent("hot1","hot1r_hunt",4)
AddDownloadableContent("kam1","kam1r_hunt",4)
AddDownloadableContent("kas2","kas2r_hunt",4)
AddDownloadableContent("tat2","tat2r_hunt",4)
AddDownloadableContent("cor1","cor1r_con",4)
AddDownloadableContent("nab1","NAB1r_con",4)
AddDownloadableContent("cor1","cor1r_ctf",4)
AddDownloadableContent("dag1","dag1r_con",4)
AddDownloadableContent("dag1","dag1r_ctf",4)
AddDownloadableContent("dea1","dea1r_con",4)
AddDownloadableContent("dea1","dea1r_1flag",4)
AddDownloadableContent("end1","end1r_con",4)
AddDownloadableContent("end1","end1r_1flag",4)
AddDownloadableContent("fel1","fel1r_con",4)
AddDownloadableContent("fel1","fel1r_1flag",4)
AddDownloadableContent("geo1","geo1r_con",4)
AddDownloadableContent("geo1","geo1r_ctf",4)
AddDownloadableContent("hot1","hot1r_con",4)
AddDownloadableContent("hot1","hot1r_1flag",4)
AddDownloadableContent("kam1","KAM1r_con",4)
AddDownloadableContent("kam1","KAM1r_1flag",4)
AddDownloadableContent("kas2","kas2r_con",4)
AddDownloadableContent("kas2","kas2r_ctf",4)
AddDownloadableContent("mus1","mus1r_con",4)
AddDownloadableContent("mus1","mus1r_ctf",4)
AddDownloadableContent("myg1","myg1r_con",4)
AddDownloadableContent("myg1","myg1r_ctf",4)
AddDownloadableContent("nab2","nab2r_con",4)
AddDownloadableContent("nab2","nab2r_ctf",4)
AddDownloadableContent("pol1","pol1r_con",4)
AddDownloadableContent("pol1","pol1r_ctf",4)
AddDownloadableContent("tan1","tan1r_con",4)
AddDownloadableContent("tan1","tan1r_1flag",4)
AddDownloadableContent("tat1","tat2r_con",4)
AddDownloadableContent("tat2","tat2r_con",4)
AddDownloadableContent("tat2","tat2r_ctf",4)
AddDownloadableContent("tat3","tat3r_con",4)
AddDownloadableContent("tat3","tat3r_1flag",4)
AddDownloadableContent("uta1","uta1r_con",4)
AddDownloadableContent("uta1","uta1r_1flag",4)
AddDownloadableContent("yav1","yav1r_con",4)
AddDownloadableContent("yav1","yav1r_1flag",4)
AddDownloadableContent("spa1","spa1r_Diet Dr. Pepper",4)
AddDownloadableContent("spa1","spa1r_1flag",4)
AddDownloadableContent("spa8","spa8r_Diet Dr. Pepper",4)
AddDownloadableContent("spa8","spa8r_1flag",4)
AddDownloadableContent("spa9","spa9r_Diet Dr. Pepper",4)
AddDownloadableContent("spa9","spa9r_1flag",4)
AddDownloadableContent("spa8","spa8r_cmn",4)
AddDownloadableContent("spa9","spa9r_cmn",4)
AddDownloadableContent("ADF","ADFr_con",4)
AddDownloadableContent("ADF","ADFr_xl",4)
AddDownloadableContent("TCN","TCNr_con",4)
AddDownloadableContent("TCN","TCNr_xl",4)
AddDownloadableContent("VBM","VBMc_con",4)
AddDownloadableContent("VBM","VBMc_xl",4)
AddDownloadableContent("VBM","VBMg_con",4)
AddDownloadableContent("VBM","VBMg_xl",4)
AddDownloadableContent("VBM","VBMr_con",4)
AddDownloadableContent("VBM","VBMr_xl",4)
-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\DAK\\data\\_LVL_PC\\core.lvl")
ADF
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)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "ADF%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_xl_g = 1, mode_xl_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("ADF","ADFg_con",4)
AddDownloadableContent("ADF","ADFc_con",4)
AddDownloadableContent("ADF","ADFg_xl",4)
AddDownloadableContent("ADF","ADFc_xl",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\ADF\\data\\_LVL_PC\\core.lvl")
I've checked over them all quite a bit and haven't figured it out, I hope you guys have more luck... or the force.

Re: Adding Era mods to my own custom maps

Posted: Sun Apr 14, 2013 10:52 pm
by THEWULFMAN
http://www.gametoast.com/forums/viewtop ... 95#p492281

I had no issues adding my era to HUT. However whenever I tried adding the era to any map with a Mod ID beginning with the letters T through Z, it would refuse to cooperate.

I would say it's predictable, considering that this issue has popped up at least 2 other times since I've been here.

You posted your addme.lua from DT2 showing you adding the era to maps whose ID begins with T. The misunderstanding here is the issue only shows up in the AddNewGameModes section, it does not appear when adding entirely new maps in. I really should have clarified that to begin with. :wink:

This, for instance, did not work.
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)

AddNewGameModes( sp_missionselect_listbox_contents, "TDS%s_%s", {era_w = 1, mode_con_w = 1, change = { era_w = { name="The Clone Wars", icon2="cw_icon" },
},})


AddDownloadableContent("TDS","TDSw_con",4)



-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TCW\\data\\_LVL_PC\\core.lvl")

Re: Adding Era mods to my own custom maps

Posted: Mon Apr 15, 2013 6:18 pm
by Maveritchell
So here's your issue, and here's Wulfman's issue (I just ran some checks to confirm this). You need to understand how file loading works with addon missions. Missions are loaded in sequentially - first stock missions, and then any addon missions, in alphabetical order by addon folder name. This is why Zerted used AAA_v1.3patch for his folder name - it falls sequentially first and makes sure it loads stuff in first.

You guys have problems because you're telling a mission script from an earlier folder (DAK) to add a mode to a mission script from a later folder (TCN) that hasn't been read in yet. When you tell the game to add a new game mode to TCN%s_%s, it's like "derp what's that," because you haven't loaded the basic setup of that mission name yet. If you're making a mod that you want to extend to a lot of future maps, make sure your folder name is earlier on so that it's loaded in earlier.

Re: Adding Era mods to my own custom maps

Posted: Mon Apr 15, 2013 7:21 pm
by THEWULFMAN
Ah, that makes so much sense. Thank you. :)

Re: Adding Era mods to my own custom maps

Posted: Mon Apr 15, 2013 8:35 pm
by Dakota
Well that solves the mystery.

Also by loading the era mod from the map's addme I was able to get the maps working. I'll be sure to remember this when I start my next maps.

Thanks guys.