Renaming an Era [Solved]

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
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Renaming an Era [Solved]

Post 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?
Last edited by Noobasaurus on Mon Apr 02, 2012 11:46 am, edited 1 time in total.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Renaming an Era

Post 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" 
					}, 
				 }, 
			} 
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Renaming an Era

Post 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?
kinetosimpetus
Imperial Systems Expert
Imperial Systems Expert
Posts: 2381
Joined: Wed Mar 25, 2009 4:15 pm
Projects :: A secret project
Games I'm Playing :: Warframe STO

Re: Renaming an Era

Post 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,},},})
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Renaming an Era

Post 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")
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Renaming an Era

Post by Noobasaurus »

Thanks Kinetos and WULF; it worked.
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: Renaming an Era [Solved]

Post 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")
CressAlbane
Master Bounty Hunter
Master Bounty Hunter
Posts: 1519
Joined: Fri Dec 18, 2009 8:02 am
Projects :: CTF Arenas
Games I'm Playing :: Steam- cressalbane2
Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı

Re: Renaming an Era [Solved]

Post by CressAlbane »

What's happening, exactly?

There's another tutorial here.
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: Renaming an Era [Solved]

Post 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.
Post Reply