Adding eras in the stock Endor, Geonosis and Hoth [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
Indytotof
Chief Warrant Officer
Chief Warrant Officer
Posts: 348
Joined: Fri Jun 06, 2014 6:58 am
Projects :: SWBF2 Sides Overhaul Mod
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set
Location: Senlis, France

Adding eras in the stock Endor, Geonosis and Hoth [Solved]

Post by Indytotof »

Hello modders and mappers, here is Indytotof !

I've wanted to add Clone Wars era and Galactic Civil Wars era in Geonosis, Hoth and Endor respectivly but the eras don't appears when I selected one the three maps. I've followed the tuto find with the v1.3 patch documentations.

Here is the BF2 Log:
Hidden/Spoiler:
[code]Opened logfile BFront2.log 2014-08-25 2056
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy french 3
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawlfr.mvs
shell_interface: Opening movie: movies\shellfr.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
(none):0: attempt to call field `mapluafile' (a nil value)
prev = none iLastPage = nil
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: [Nil]
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
ifs_missionselect_pcMulti_fnSetMapPreview(): Stored movie name, file: preview-loop MOVIES\pre-movie
custom_CheckChangeMovies(): Update(): Time to change movies
ifs_missionselect_pcMulti_ChangeMovieFile(): MovieFile: nil
ifs_missionselect_pcMulti_ChangeMovieFile(): Closed any open movie
ifs_missionselect_pcMulti_ChangeMovieFile(): Opening movie: MOVIES\pre-movie.mvs
ifs_missionselect_pcMulti_ChangeMovieFile(): Finished opening movie
ifs_missionselect_pcMulti_fnSetMapPreview(): Stored movie name, file: preview-loop MOVIES\pre-movie
custom_CheckChangeMovies(): Update(): Time to change movies
ifs_missionselect_pcMulti_ChangeMovieFile(): MovieFile: nil
ifs_missionselect_pcMulti_ChangeMovieFile(): Same as last movie
ifs_missionselect_pcMulti_fnSetMapPreview(): Stored movie name, file: preview-loop MOVIES\pre-movie
custom_CheckChangeMovies(): Update(): Time to change movies
ifs_missionselect_pcMulti_ChangeMovieFile(): MovieFile: nil
ifs_missionselect_pcMulti_ChangeMovieFile(): Same as last movie[/code]
Last edited by Indytotof on Thu Aug 28, 2014 10:30 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: Adding eras in the stock Endor, Geonosis and Hoth

Post by Marth8880 »

You'll need to go into much more detail than that. What are all of the steps that you have taken to add these eras to these maps?
User avatar
Kingpin
Jedi
Jedi
Posts: 1096
Joined: Fri Sep 13, 2013 7:09 pm
Projects :: The Sith Wars II
Location: Denver, CO
Contact:

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by Kingpin »

I'd like to see your addme, too.
Indytotof
Chief Warrant Officer
Chief Warrant Officer
Posts: 348
Joined: Fri Jun 06, 2014 6:58 am
Projects :: SWBF2 Sides Overhaul Mod
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set
Location: Senlis, France

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by Indytotof »

Sorry to haven't be so vague, but due to the character limitations and due to my parents, I cannot be clear as I wanted initially be.

But there is the addme.lua 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 the new gamemodes or maps here for pre-existing maps:
AddNewGameModes(sp_missionselect_listbox_content, "cor1%s_%s",{era_g = 1, mode_eli_g = 1,})

AddNewGameModes(sp_missionselect_listbox_contents,
"end1%s_%s",
{era_c = 1, mode_con_c = 1, mode_1flag_c = 1,})

AddNewGameModes(sp_missionselect_listbox_contents,
"geo1%s_%s",
{era_g = 1, mode_con_g = 1, mode_ctf_g = 1,})

AddNewGameModes(sp_missionselect_listbox_contents,
"hot1%s_%s",
{era_c = 1, mode_con_c = 1, mode_1flag_c = 1,})


--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] = {}
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("COR1","cor1g_eli",4)
AddDownloadableContent("END1","end1c_con",4)
AddDownloadableContent("END1","end1c_1flag",4)
AddDownloadableContent("GEO1","geo1g_con",4)
AddDownloadableContent("GEO1","geo1g_ctf",4)
AddDownloadableContent("HOT1","hot1c_con",4)
AddDownloadableContent("HOT1","hot1c_1flag",4)
-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TES\\data\\_LVL_PC\\core.lvl")[/code]
And there is the tuto I follow (it's a step by step tuto):
Hidden/Spoiler:
[code]This tutorial will take you through the process of adding the 'y' era with a Conquest game mode to the 'LVL' map.

Basic Era Support
1) In addme/addme.lua, add "era_y = 1, " to the sp_missionselect_listbox_contents table. This tells the game to display the Y era checkbox when the map is selected in the selection screen.
2) In addme/addme.lua, add "mode_con_y = 1, " to the sp_missionselect_listbox_contents table. This tells the game to display the Conquest mode checkbox when the map is selected in the selection screen. The "_y" allows the game to know that this game mode corresponds to the Y era.
3)) As an example, this is the orginal listbox table line: sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "LVL%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, }
3)) this is the updated listbox table line: sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "LVL%s_%s", era_g = 1, era_c = 1, era_y = 1, mode_con_g = 1, mode_con_c = 1, mode_con_y = 1, }
4) In addme/addme.lua, add the line "AddDownloadableContent("LVL","LVLy_con",4)" before the "-- all done" comment
5) In Common/mission/, create the file "LVLy_con.req". This file name sort-of corresponds to the 'LVLy_con' in AddDownloadableContent() and the values entered into the listbox table.
6) In Common/mission/LVLy_con.req, put the following code. The code tells VisualMunge what is needed when building the map's lvls. The "script" section tells what additional scripts to include and the "config" section deals with the video configurations. The following code to put is:

ucft
{
REQN
{
"config"
"cor_movies"
}
REQN
{
"script"
"LVLy_con"
}
}

7) In Common/mission.req, add "LVLy_con" to the "lvl" section. This tells VistualMunge to include everything in our newly created Common/mission/LVLy_con file when munging the map's mission.lvl. Mission.lvl is where all of the map's game mode script files should end up.
8) In Common/scripts/LVL/, create the file "LVLy_con.lua" It is easiest do this by copying an exist Conquest script, such as LVLg_con.lua. If you don't copy the file, you will need to manually add in all the Conquest scripting details. This tutorial does not cover the finer parts of game mode scripting, but only what changes are needed for a custom era. Our new LVLy_con.lua is the script we referrenced a few steps ago in the "script"ing section of Common/mission/LVLy_con.req. Following through the reqs, this is the actual lua script file which will be munged into the map's mission.lvl.
9) Munge Common
10) Thats it. If you only want basic era support for the map you are done. If you open up SWBF2, your map will now display a Y era Conquest mode. If thats all you wanted, you can stop reading this tutorial right here -> |. However, if you want full era integeration there is still much to do...

Full Era Integeration
1) The parts that are missing from basic era support are custom side icons, custom CP icons, and custom side names. This advanced part of the tutorial will help you enable or add these features to your map. Step wise, it continues were the basic era support section left off.
2) In Common/scripts/LVL/LVLy_con.lua, add the line "SupportsCustomEraTeams = true" at the top of the file. This will tell the team selection screen to around the game's orginal design and use your custom team/side names instead.
3) In Common/scripts/LVL/LVLy_con.lua, add the line "CustomEraTeam2 = "Era Team 2"" right below the SupportsCustomEraTeams line. Replace 'Era Team 2' with the name of your second team's name.
4) In Common/scripts/LVL/LVLy_con.lua, add the line "CustomEraTeam1 = "Era Team 1"" right below the SupportsCustomEraTeams line. Replace 'Era Team 1' with the name of your first team's name.
5) In Common/scripts/LVL/LVLy_con.lua, take a close look at the 'SetupTeams' section. You will see something like:

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman",9, 25},

The little "all" is the real team name. According to the 'Battlefront2_scripting_system.doc' doc, SWBF2 has nine predefined team names (neutral, neu, alliance, all, empire, imp, republic, rep, cis). Everything else maps to locals. This is not truly the case as "Villains" is also predeinfed, but those that are predefined and those that aren't has never been fully researched (would you like to be the first?). The team name manages the game's references for the team's name, team's icon, team's CP icons, and the team's unit names.
6) Make note of your two team names. 'all' maps to 'alliance', 'imp' maps to 'imperial', 'rep' maps to 'republic', and 'cis' maps to 'CIS'. The team names are case-insenstive.
7) Create your CP holo icon meshes. You can start from scratch or build off of an existing one like Common/mshs/com_icon_cis.msh. If needed, don't forget to create the msh's .option file too.
8) The custom CP holo icons go in Common/mshs/. Depending on your team name mappings, each icon should have one of the following names: com_icon_alliance, com_icon_imperial, com_icon_republic, or com_icon_CIS. If your map is CTF based, you might also want to look into com_icon_swap.
9) Open Common/ingame.req and wipe everything out. We since are going to be creating a custom ingame.lvl for this map, we only want to override the elements which have been changed. If you try to include everything the game might crash, but you would also override any other ingame.lvl mods the user might have installed.
10) Put the following code in Common/ingame.req. Make sure to adjuest it for your team names. The example uses a SetupTeams section with 'all' and 'imp' team names:

ucft
{
REQN
{
"model"
"com_icon_alliance"
"com_icon_imperial"
}
}

11) Munge Common
12) In data_LVL/_LVL_PC, rename the new ingame.lvl to "y_con-ingame.lvl". The 'y_con' part stands for the Y era and game mode Conquest. The renaming is not required, but should be done if you want to override the icons with different icons in other era/game modes of your map.
13) In Common/scripts/LVL/LVLy_con.lua, add "ReadDataFile("dc:y_con-ingame.lvl")" right before the non-'dc:' version of the line. This tells the game to read your map's ingame.lvl before reading the default ingame.lvl. Since your ingame.lvl is read first, its CP icons will be the ones used.
14) You will need to remember to manually copy the munged data_LVL/_LVL_PC/y_con-ingame.lvl to your munged map's GameData/addon/LVL/data/_LVL_PC/ folder any time you need to create a new y_con-ingame.lvl. A 'normal' mod map does not have a custom ingame.lvl, so VisualMunge will not move it for you. Do that copy now, so you don't forget to later.
15) Rename Common/ingame.req to "y_con-ingame.req". This is so you always have a copy of the req that created the y_con-ingame.lvl. If you want to make a new y_con-ingame.lvl, rename that file back to "ingame.lvl". VisualMunge does not build custom named lvls by you just creating a differently named req file.
16) Test your map[/code]
For the final info, I used the + 123 mod scripts for them.

Thanks for your future help !
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by Deviss »

add thse 3 lines:


AddNewGameModes( sp_missionselect_listbox_contents, "hot1%s_%s", {era_c = 1, mode_con_c = 1})
AddNewGameModes( sp_missionselect_listbox_contents, "end1%s_%s", {era_c = 1, mode_con_c = 1})
AddNewGameModes( sp_missionselect_listbox_contents, "geo1%s_%s", {era_g = 1, mode_con_g = 1})

and the next 3 lines on end:

AddDownloadableContent("HOT1","HOT1c_con",4)
AddDownloadableContent("END1","END1c_con",4)
AddDownloadableContent("GEO1","GEO1g_con",4)

and make you sure your mission.req file have incluided the 3 missions .lua
HOT1c_con.lua
END1c_con.lua
GEO1g_con.lua
Indytotof
Chief Warrant Officer
Chief Warrant Officer
Posts: 348
Joined: Fri Jun 06, 2014 6:58 am
Projects :: SWBF2 Sides Overhaul Mod
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set
Location: Senlis, France

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by Indytotof »

Nope, It doesn't worked....
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by Deviss »

making it, which is the error log message?
Indytotof
Chief Warrant Officer
Chief Warrant Officer
Posts: 348
Joined: Fri Jun 06, 2014 6:58 am
Projects :: SWBF2 Sides Overhaul Mod
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set
Location: Senlis, France

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by Indytotof »

There is no error. The eras just not appears on Geonosis, Endor and Hoth.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by commanderawesome »

Did you make .REQ files for those missions?
Indytotof
Chief Warrant Officer
Chief Warrant Officer
Posts: 348
Joined: Fri Jun 06, 2014 6:58 am
Projects :: SWBF2 Sides Overhaul Mod
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set
Location: Senlis, France

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by Indytotof »

Eeeyup.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by commanderawesome »

Indytotof
Chief Warrant Officer
Chief Warrant Officer
Posts: 348
Joined: Fri Jun 06, 2014 6:58 am
Projects :: SWBF2 Sides Overhaul Mod
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set
Location: Senlis, France

Re: Adding eras in the stock Endor, Geonosis and Hoth

Post by Indytotof »

OK, problem solved.

I've to used the addme.lua from the +123 mod assets to make them worked.
Post Reply