New era modifying shell.lvl [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
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

New era modifying shell.lvl [Solved]

Post by Deviss »

hello to all, i know the v1.3 patch adding support for new eras and gamemodes but his shell.lvl file also modify other things i dont like, so i want to learn to modify the original shell's file for create myself only for add support for new eras, so i wanted learn WHICHs, and HOW modify the files found in shell folder for release my objective :D , i think this 'll be useful for others people also.


thanks in advance :clone:
Last edited by Deviss on Tue Jun 09, 2009 6:18 am, edited 1 time in total.
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: new era modifing shell.lvl

Post by Frisbeetarian »

The best way for you to learn is to go through the scripts in assets\shell\scripts yourself, it should become evident where everything is. You can ignore the ifs_campaign_... the ifs_freeform_... and possibly the ifs_meta_... since none of these should involve anything for which you're looking (though they do contain interesting stuff!). Keep in mind also that Zerted added new scripts to the shell to get the new eras (and possibly also the modes) to show up, though this may have been just for neatness and not out of necessity. The scripts under data\Common\scripts might also contain some things you need, but probably not.

There is no quick way to go about doing this. I myself have spent hours going over the scripts and barely touched the surface. Zerted had to spend probably hundreds more to write his full shell upgrade.
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: new era modifing shell.lvl

Post by Deviss »

Frisbeetarian wrote:The best way for you to learn is to go through the scripts in assets\shell\scripts yourself, it should become evident where everything is. You can ignore the ifs_campaign_... the ifs_freeform_... and possibly the ifs_meta_... since none of these should involve anything for which you're looking (though they do contain interesting stuff!). Keep in mind also that Zerted added new scripts to the shell to get the new eras (and possibly also the modes) to show up, though this may have been just for neatness and not out of necessity. The scripts under data\Common\scripts might also contain some things you need, but probably not.

There is no quick way to go about doing this. I myself have spent hours going over the scripts and barely touched the surface. Zerted had to spend probably hundreds more to write his full shell upgrade.
so i must add new scripts files?? i though must modify the missionlist.lua file
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: new era modifing shell.lvl

Post by Frisbeetarian »

The scripts I've spent time looking over are not those that you would need to modify, so I can't tell you exactly what scripts you need to change. I looked through the one you suggested, and you will need to change that one, but I'm not sure if that's the only one. As to adding new files, one, it's really easy, and two, I said that I suspect Zerted did it out of neatness and not out of necessity.

Basically, if you already know what script you need to change, why don't you try it and see if it works.
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: new era modifing shell.lvl

Post by Deviss »

Frisbeetarian wrote:The scripts I've spent time looking over are not those that you would need to modify, so I can't tell you exactly what scripts you need to change. I looked through the one you suggested, and you will need to change that one, but I'm not sure if that's the only one. As to adding new files, one, it's really easy, and two, I said that I suspect Zerted did it out of neatness and not out of necessity.

Basically, if you already know what script you need to change, why don't you try it and see if it works.
i tried modify that files and other adding new eras but don't work, i downloaded THIS FILE i am sure that file will work the new eras support but i don't know how add these to shell file :(
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: new era modifing shell.lvl

Post by DarthD.U.C.K. »

from the "add an era howto" which can be found in the 1.3 patch documentation:
Hidden/Spoiler:
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
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: new era modifing shell.lvl

Post by Frisbeetarian »

@ DarthD.U.C.K.
Read his first post. He knows about what you posted and wants to do something else.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: new era modifing shell.lvl

Post by DarthD.U.C.K. »

sorry, i should have read more carefully..
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: New era modifying shell.lvl

Post by [RDH]Zerted »

First off, the v1.3 patch is integerated into ingame.lvl, common.lvl, and shell.lvl. The whole reason for the patch was because the Shell Mod and the FC Mod both needed to change common.lvl. If you want to replace any of those lvl files, you have to uninstall the v1.3 patch.

What things don't you like? It may be easier/faster to use a cGC script to remove them then attempt to recreate other parts of v1.3.

Yeah, I added new scripts for neatness. Eras and gamemodes were handled in multiple places. I rewrote their related function calls to point to new functions in ifs_era_handler.lua so everything would be processed in the same place and so that I wouldn't need to duplicate any code.

Sorry, but theres a lot more then just adding a few table entries to missionlist.lua. Well, new game modes aren't too hard to add. You edit missionlist and another one or two places. However the game is hard coded for 2 eras in many places. All those spots need to be changes to support multiple eras.

Adding files is the easy part. Its just a ScriptCB_Do file in anything loaded off of shell_interface.lua or an addme.lua.

The files in Zerted.7z are only parts to v1.3. Granted, they are the more important parts, but you have to change the retail files to point to all those custom_ functions. Sadly I lost the entire source code when I was backing it up and Zerted.7z (and v1.2's source) is all that remains of the v1.3 patch's source code.

Zerted.7z Files:
utility_functions2.lua - mostly used by FC commands.
fakeconsole_functions.lua - the source code to all the FC commands (except whats in utility_functions2.lua).
ifs_era_handlers.lua - contains maybe 70% of the shell changes.

ifs_era_handlers' functions sortof follow a naming scheme. I added custom_ to the names of functions which that function mostly replaces, but custom_ is also on new functions too. As an example, custom_AddEraBoxes replaces the games ..._AddEraBoxes functions.

ifs_missionselect_pcmulti.lua and ifs_missionselect.lua were two files that had a bunch of era stuff in them. They are basically the same thing, but pcmulti is for MP and the other is for SP. They represent the map selection screens. One of the changes I did was to murge all their common code, then redirect some of their function calls to simlar functions in ifs_era_handlers.
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: New era modifying shell.lvl

Post by Deviss »

[RDH]Zerted wrote:
Hidden/Spoiler:
First off, the v1.3 patch is integerated into ingame.lvl, common.lvl, and shell.lvl. The whole reason for the patch was because the Shell Mod and the FC Mod both needed to change common.lvl. If you want to replace any of those lvl files, you have to uninstall the v1.3 patch.

What things don't you like? It may be easier/faster to use a cGC script to remove them then attempt to recreate other parts of v1.3.

Yeah, I added new scripts for neatness. Eras and gamemodes were handled in multiple places. I rewrote their related function calls to point to new functions in ifs_era_handler.lua so everything would be processed in the same place and so that I wouldn't need to duplicate any code.

Sorry, but theres a lot more then just adding a few table entries to missionlist.lua. Well, new game modes aren't too hard to add. You edit missionlist and another one or two places. However the game is hard coded for 2 eras in many places. All those spots need to be changes to support multiple eras.

Adding files is the easy part. Its just a ScriptCB_Do file in anything loaded off of shell_interface.lua or an addme.lua.

The files in Zerted.7z are only parts to v1.3. Granted, they are the more important parts, but you have to change the retail files to point to all those custom_ functions. Sadly I lost the entire source code when I was backing it up and Zerted.7z (and v1.2's source) is all that remains of the v1.3 patch's source code.

Zerted.7z Files:
utility_functions2.lua - mostly used by FC commands.
fakeconsole_functions.lua - the source code to all the FC commands (except whats in utility_functions2.lua).
ifs_era_handlers.lua - contains maybe 70% of the shell changes.

ifs_era_handlers' functions sortof follow a naming scheme. I added custom_ to the names of functions which that function mostly replaces, but custom_ is also on new functions too. As an example, custom_AddEraBoxes replaces the games ..._AddEraBoxes functions.

ifs_missionselect_pcmulti.lua and ifs_missionselect.lua were two files that had a bunch of era stuff in them. They are basically the same thing, but pcmulti is for MP and the other is for SP. They represent the map selection screens. One of the changes I did was to murge all their common code, then redirect some of their function calls to simlar functions in ifs_era_handlers.
so must i modify the missionselect and add the era_handler and the others 2 files to shell.req file??
i only want add support for eras, modifying the shell file
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: New era modifying shell.lvl

Post by [RDH]Zerted »

No, you have to make a bunch of changes to ifs_missionselect_pcmulti.lua and ifs_missionselect.lua. As well as a bunch of other files.

It would be much easier to remove the movie preview window and remove the FakeConsole button through the custom scripts supported by the v1.3 patch.
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: New era modifying shell.lvl

Post by Deviss »

[RDH]Zerted wrote:No, you have to make a bunch of changes to ifs_missionselect_pcmulti.lua and ifs_missionselect.lua. As well as a bunch of other files.

It would be much easier to remove the movie preview window and remove the FakeConsole button through the custom scripts supported by the v1.3 patch.
understand, many thanks for your help and for make me see the difficult of make a new shell lol, problem solved i will continuous using patch 1.3 so, questions SOLVED :wink:
Post Reply