Page 1 of 1

Renaming an Era [Solved]

Posted: Sun Apr 01, 2012 7:02 pm
by Noobasaurus
How would one rename an era? I know of the

Code: Select all

change = {}
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?

Re: Renaming an Era

Posted: Sun Apr 01, 2012 7:15 pm
by Marth8880
Example:

Code: Select all

sp_missionselect_listbox_contents[sp_n+1] = {
		red = 15, 
		green = 15, 
		blue = 255, 
		isModLevel = 1, 
		mapluafile = "TST%s_%s", 
		era_n = 1, 
		mode_con_n = 1, 
		mode_c_n = 1, 
		change = { 
			era_n = { 
				name="Mass Effect", 
				icon2="era_icon_n7" 
					}, 
				 }, 
			} 

Re: Renaming an Era

Posted: Sun Apr 01, 2012 10:41 pm
by Noobasaurus
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):

Code: Select all

--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

AddNewGameModes( sp_missionselect_listbox_contents, 
"myg1%s_%s", 
{era_p = 1, mode_con_p = 1,} 
) change = {
 era_p = {
 name="Claymore Mod",
 icon2="mode_icon_wea" }
 }

AddNewGameModes( mp_missionselect_listbox_contents,
 "myg1%s_%s", 
 {era_p = 1,
 mode_con_p = 1,
} )

mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]
Right now it shows up as something like "Battlefront Project - The Clone Wars" and I want it to show up as "Claymore Mod." How would I achieve this?

Re: Renaming an Era

Posted: Sun Apr 01, 2012 11:23 pm
by kinetosimpetus
This is what mine looks like

AddNewGameModes(sp_missionselect_listbox_contents, "tat2%s_%s", {era_i = 1, mode_con_i = 1,

change = {era_i = { name=cwname, icon2=cwicon,},},})

Re: Renaming an Era

Posted: Mon Apr 02, 2012 2:07 am
by THEWULFMAN
Noobasaurus, you've got it backwards.

This is for adding new maps.
sp_missionselect_listbox_contents[sp_n+1] = {
red = 15,
green = 15,
blue = 255,
isModLevel = 1,
mapluafile = "TST%s_%s",
era_n = 1,
mode_con_n = 1,
mode_c_n = 1,
change = {
era_n = {
name="Mass Effect",
icon2="era_icon_n7"
},
},
}
This is for adding it to stock maps.
AddNewGameModes( sp_missionselect_listbox_contents,
"myg1%s_%s",
{era_p = 1, mode_con_p = 1,}
) change = {
era_p = {
name="Claymore Mod",
icon2="mode_icon_wea" }
}

Hence "AddNewGameModes"

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)

sp_missionselect_listbox_contents[sp_n+1] = {isModLevel = 1, mapluafile = "DAN%s_%s", era_j = 1, era_k = 1, mode_con_j = 1, mode_con_k = 1, change = { era_k = { name="BF3 Clone Wars", icon2="cw_icon" }, era_j = { name="BF3 Galactic Civil War", icon2="gcw_icon" }, }, }

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, "tat2%s_%s", {era_j = 1, era_k = 1, mode_con_j = 1, mode_con_k = 1, change = { era_k = { name="BF3 Clone Wars", icon2="cw_icon" }, era_j = { name="BF3 Galactic Civil War", icon2="gcw_icon" },
},})

AddDownloadableContent("DAN","DANj_con",4)
AddDownloadableContent("DAN","DANk_con",4)
AddDownloadableContent("tat2","tat2j_con",4)
AddDownloadableContent("tat2","tat2k_con",4)

-- all done
newEntry = nil
n = nil

-- 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!? :cry:

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)


AddNewGameModes( sp_missionselect_listbox_contents, "geo1%s_%s", {era_e = 1, mode_con_e = 1, change = { era_e = { name="Clone Wars Mod", icon2="cw_icon", }, }, })

AddNewGameModes( mp_missionselect_listbox_contents, "geo1%s_%s", {era_e = 1, mode_con_e = 1, change = { era_e = { name="Clone Wars Mod", icon2="cw_icon", }, }, })

AddNewGameModes( sp_missionselect_listbox_contents, "uta1%s_%s", {era_e = 1, mode_con_e = 1, change = { era_e = { name="Clone Wars Mod", icon2="cw_icon", }, }, })

AddNewGameModes( mp_missionselect_listbox_contents, "uta1%s_%s", {era_e = 1, mode_con_e = 1, change = { era_e = { name="Clone Wars Mod", icon2="cw_icon", }, }, })

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "CWM%s_%s", change = { era_e = { name="Clone Wars Mod", icon2="cw_icon" }
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("geo1","geo1e_con",4)
AddDownloadableContent("uta1","uta1e_con",4)

-- all done
newEntry = nil
n = nil

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

Re: Renaming an Era [Solved]

Posted: Sat Apr 07, 2012 7:16 pm
by CressAlbane
What's happening, exactly?

There's another tutorial here.

Re: Renaming an Era [Solved]

Posted: Sat Apr 07, 2012 7:27 pm
by ARCTroopaNate
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.