Creating New mods [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

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

Creating New mods [Solved]

Post by Deviss »

hello GT :D anyone know how create news mods?? for example add a second conquest

thanks to all
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Creating New mods

Post by Fiodis »

If you want to add a second Conquest just to a single map (or a map pack), it might be possible to edit, say, hunt mode to seem like a second Conquest.

If you want to mod the entire game, then I suppose you could edit every single shipped map to have an extra mode, then modify that mode to resemble Conquest. That's the simplest way I can think of to do it.

Actually, that's the only way I can think of to do it. I'm sure there's a much more direct method that involves a lot of coding, but that's way outside my area of expertise.
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: Creating New mods

Post by Deviss »

Fiodis wrote:If you want to add a second Conquest just to a single map (or a map pack), it might be possible to edit, say, hunt mode to seem like a second Conquest.

If you want to mod the entire game, then I suppose you could edit every single shipped map to have an extra mode, then modify that mode to resemble Conquest. That's the simplest way I can think of to do it.

Actually, that's the only way I can think of to do it. I'm sure there's a much more direct method that involves a lot of coding, but that's way outside my area of expertise.
but i need add a new mod (second conquest), if i add how hunt mod, in the game this appear with this NAME so it will replace the existent hunt mod :(
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Creating New mods

Post by Fiodis »

Not if you use a different mode instead of hunt. Only a few maps have hunt. For those, instead of reconfiguring the shipped hunt mode, you could add a Hero Assault mode and reconfigure that.
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: Creating New mods

Post by Deviss »

Fiodis wrote:Not if you use a different mode instead of hunt. Only a few maps have hunt. For those, instead of reconfiguring the shipped hunt mode, you could add a Hero Assault mode and reconfigure that.
but i need add other mod, because i don't want modify the existent mod of the people, for this reason i search add a new mod for to play this a part
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Creating New mods

Post by Sky_216 »

Don't do what fiodis is saying. It does work but its a ridiculously complicated way to do it. If you
want to just add conquest, replace the existing conquest or add another era. You can do a mode too, but its a little more complicated.

Do the following:

1) Download Zerted's 1.3 patch. Lite version will do. Get it at SWBF Files.
2) Copy the scripts of the maps you want a mod for to your map's script's folder (where things like your map's conquest script and so on are). Eg copy myg1c_con to your maps folder.
3) Modify those scripts. So if, say, you have a custom republic side you'd like to load, replace the section that loads troops and the section that sets up the troops for teams. Here's an example of how I did it for XCW mygeeto:

Replaced this (loads the units gcw mygeeto conquest uses):
Hidden/Spoiler:
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_hero_luke_jedi",
"all_inf_wookiee",
"all_hover_combatspeeder")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_officer",
"imp_inf_sniper",
"imp_inf_engineer",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_hover_fightertank",
"imp_walk_atst")
With this (loads my units from my map's side folder):
Hidden/Spoiler:
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_sniper_snow",
"all_hover_combatspeeder",
"all_inf_engineer_snow",
"all_inf_officer_snow",
"all_inf_wookiee_snow",
"all_inf_infiltrator_snow",
"all_inf_assassin",
"all_inf_captain_snow")

ReadDataFile("dc:SIDE\\imp.lvl",
"imp_hero_darthvader",
"imp_hover_fightertank",
"imp_inf_rifleman_snow",
"imp_inf_officer",
"imp_inf_engineer_snow",
"imp_inf_dark_trooper",
"imp_inf_shock",
"imp_inf_medic",
"imp_inf_rocketeer_snow",
"imp_inf_sniper_snow" )
And replaced this (sets up units):
Hidden/Spoiler:
SetupTeams{

all={
team = ALL,
units = 32,
reinforcements = 150,
soldier = {"all_inf_rifleman",9, 25},
assault = {"all_inf_rocketeer",1, 4},
engineer = {"all_inf_engineer",1, 4},
sniper = {"all_inf_sniper",1, 4},
officer = {"all_inf_officer",1, 4},
special = {"all_inf_wookiee",1, 4},


},

imp={
team = IMP,
units = 32,
reinforcements = 150,
soldier = {"imp_inf_rifleman", 9, 25},
assault = {"imp_inf_rocketeer", 1, 4},
engineer = {"imp_inf_engineer", 1, 4},
sniper = {"imp_inf_sniper", 1, 4},
officer = {"imp_inf_officer",1, 4},
special = {"imp_inf_dark_trooper",1, 4},
}
}


-- Hero Setup --

SetHeroClass(IMP, "imp_hero_bobafett")
SetHeroClass(ALL, "all_hero_luke_jedi")
With this (sets up my units):
Hidden/Spoiler:
SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "all_inf_rifleman_snow",9, 25},
assault = { "all_inf_rocketeer_snow",1,4},
engineer = { "all_inf_engineer_snow",1,4},
sniper = { "all_inf_sniper_snow",1,4},
officer = { "all_inf_officer_snow",1,4},
special = { "all_inf_captain_snow",1,4},

},
imp = {
team = IMP,
units = 20,
reinforcements = 150,
soldier = { "imp_inf_rifleman_snow",9, 25},
assault = { "imp_inf_rocketeer_snow",1,4},
engineer = { "imp_inf_engineer_snow",1,4},
sniper = { "imp_inf_sniper_snow",1,4},
officer = { "imp_inf_medic",1,4},
special = { "imp_inf_officer",1,4},
}
}

AddUnitClass(IMP, "imp_inf_shock",1,4)
AddUnitClass(IMP, "imp_inf_dark_trooper",1,4)
AddUnitClass(ALL, "all_inf_wookiee_snow",1,4)
AddUnitClass(ALL, "all_inf_assassin",1,4)

-- Hero Setup --

SetHeroClass(IMP, "imp_hero_darthvader")
SetHeroClass(ALL, "all_inf_infiltrator_snow")
For this kind of thing where you just edit the units/vehicles (rather than things like CPs) then that's all you gotta do. But, do get it to actually show up you'll need to do the following.

If you want it to replace the stock cw/gcw era for that mode for that map:
4) Go to your 'mission'.req file (pretty sure its in the 'common' folder in your map) and edit the script files it says. It should have something along the lines of 'XXXc_con', 'XXXg_con' (where XXX is your maps three letter id). Add the name of the script you modified. So if you modified cw mygeeto conquest, add 'myg1c_con'.
5) Change your addme lua. RED51 explains how to do it in this link.....http://www.gametoast.com/forums/viewtop ... 94#p281994Munge and play. The map you modified a script for should now have your units.

If you want to still have the original eras for the map your editing, and just want an extra era:
4) I'll explain this later, I need to actually look at the files I used to remember.
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: Creating New mods

Post by Deviss »

thanks a lot sky :bowdown: :bowdown: now the new era appear with all but how do i change the name of this era on game?? but appear common.era.a, i must use the localize tool but what section must i change??
Commander_Fett
High General
High General
Posts: 847
Joined: Fri Oct 17, 2008 9:59 pm
Projects :: No Mod project currently.

Re: Creating New mods

Post by Commander_Fett »

Wait, did you add a new era or just replace an old one? 'Cause I'd really like to add a new era...
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Creating New mods

Post by Sky_216 »

If you want to still have the original eras for the map your editing, and just want an extra era:
4) I'll explain this later, I need to actually look at the files I used to remember.
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: Creating New mods

Post by Deviss »

Skyhammer_216 wrote:
If you want to still have the original eras for the map your editing, and just want an extra era:
4) I'll explain this later, I need to actually look at the files I used to remember.
ouh sorry i didn't want to push you, i will wait :D very thanks
Commander_Fett wrote:Wait, did you add a new era or just replace an old one? 'Cause I'd really like to add a new era...
i added a new era :D
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Creating New mods

Post by Sky_216 »

Hidden/Spoiler:
[quote="DEVISS-REX"][quote="Skyhammer_216"][quote]If you want to still have the original eras for the map your editing, and just want an extra era:
4) I'll explain this later, I need to actually look at the files I used to remember.[/quote][/quote]
ouh sorry i didn't want to push you, i will wait :D very thanks

[quote="Commander_Fett"]Wait, did you add a new era or just replace an old one? 'Cause I'd really like to add a new era...[/quote]
i added a new era :D[/quote]

Was actually aimed at Fett, not you...and I didn't read his post properly. :( :oops:
So, it works? And I'm assuming ya using this for your side mods?
How to change an era's/game mode's name - from the docs of Zerted's 1.3 patch:
Hidden/Spoiler:
This tutorial will take you through the process changing the displayed label, icon, and description of a Conquest, G era map.

Backgound:
* The v1.3 patch supports over 38 game modes and 27 eras. If you want to add a new game mode or era, look at these predefined ones first. Checkout the change log for shell.lvl and common.lvl to see exactly what was added and is directly supported.
* This tutorial will assume you have created a basic LVLg_con map.

Basic Era Support
1) In addme/addme.lua, expand your sp_missionselect_listbox_contents table. Meaning, put each element on a line by itself so the table is easier to read, like this:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
}

2) Edit the table to add the 'change' table:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
change = {

},
}

3) We want to change the Conquest game mode, so add another table inside the new 'change' table. The name/index of the new table has to match the game mode key. For Conquest, the key is 'mode_con'. So:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
change = {
mode_con = { },
},
}

4) Add indexes for Conquest's new name ('name'), new icon ('icon'), and new description ('about'). You only need to add the indexes you want to change, but this tutorial changes all of them so:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
change = {
mode_con = { name="Candy Conquest", icon="mode_icon_holo", about="Drop off ten cubes of sugar at your ant hill (CP) to win. Watch out for human overlords, kids with magnifying glasses, other ant colonies, and sticky traps..." },
},
}

5) Munge your map. Since we only changed addme.lua, you don't need to check or select anything in VisualMunge. This will greatly decrease its munge time.
6) Start the game. In the map selection screens, your map's Conquest game mode checkbox will now be labeled 'Candy Conquest' and its icon and description will have changed too.
7) In addition to Conquest, we also wanted to chagne the era's name and icon (eras display no descriptions). The procedure is the same except we use the era's key instead of the game mode's key and an index of 'icon2' instead of 'icon'. Here is the completed example table:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
change = {
era_g = { name="Ant Wars", icon2="rvb_icon" },
mode_con = { name="Candy Conquest", icon="mode_icon_holo", about="Drop off ten cubes of sugar at your ant hill (CP) to win. Watch out for humans overlords, kids with magnifying glasses, other ant colonies, and sticky traps..." },
},
}

8) In your map's readme, make sure to list that the 'v1.3 patch r112+' is required to correctly view the game mode/era. If the player doesn't have the v1.3 patch, then the map's mission will still be displayed, but it will show the original values (i.e. 'Conquest' instead of 'Candy Conquest').
9) Thats it!
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: Creating New mods

Post by Deviss »

Skyhammer_216 wrote: Was actually aimed at Fett, not you...and I didn't read his post properly. :( :oops:
So, it works? And I'm assuming ya using this for your side mods?

How to change an era's/game mode's name - from the docs of Zerted's 1.3 patch:
Hidden/Spoiler:
This tutorial will take you through the process changing the displayed label, icon, and description of a Conquest, G era map.

Backgound:
* The v1.3 patch supports over 38 game modes and 27 eras. If you want to add a new game mode or era, look at these predefined ones first. Checkout the change log for shell.lvl and common.lvl to see exactly what was added and is directly supported.
* This tutorial will assume you have created a basic LVLg_con map.

Basic Era Support
1) In addme/addme.lua, expand your sp_missionselect_listbox_contents table. Meaning, put each element on a line by itself so the table is easier to read, like this:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
}

2) Edit the table to add the 'change' table:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
change = {

},
}

3) We want to change the Conquest game mode, so add another table inside the new 'change' table. The name/index of the new table has to match the game mode key. For Conquest, the key is 'mode_con'. So:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
change = {
mode_con = { },
},
}

4) Add indexes for Conquest's new name ('name'), new icon ('icon'), and new description ('about'). You only need to add the indexes you want to change, but this tutorial changes all of them so:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
change = {
mode_con = { name="Candy Conquest", icon="mode_icon_holo", about="Drop off ten cubes of sugar at your ant hill (CP) to win. Watch out for human overlords, kids with magnifying glasses, other ant colonies, and sticky traps..." },
},
}

5) Munge your map. Since we only changed addme.lua, you don't need to check or select anything in VisualMunge. This will greatly decrease its munge time.
6) Start the game. In the map selection screens, your map's Conquest game mode checkbox will now be labeled 'Candy Conquest' and its icon and description will have changed too.
7) In addition to Conquest, we also wanted to chagne the era's name and icon (eras display no descriptions). The procedure is the same except we use the era's key instead of the game mode's key and an index of 'icon2' instead of 'icon'. Here is the completed example table:

sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "LVL%s_%s",
era_g = 1,
mode_con_g = 1,
change = {
era_g = { name="Ant Wars", icon2="rvb_icon" },
mode_con = { name="Candy Conquest", icon="mode_icon_holo", about="Drop off ten cubes of sugar at your ant hill (CP) to win. Watch out for humans overlords, kids with magnifying glasses, other ant colonies, and sticky traps..." },
},
}

8) In your map's readme, make sure to list that the 'v1.3 patch r112+' is required to correctly view the game mode/era. If the player doesn't have the v1.3 patch, then the map's mission will still be displayed, but it will show the original values (i.e. 'Conquest' instead of 'Candy Conquest').
9) Thats it!
this work perfect :bowdown: :eek: , but this is my new problem:
Hidden/Spoiler:
Image
appear two jabba's palace :( and this is my new addme file:
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:

--add my modes to the singleplayer map selection screen
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)
sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 0,
mapluafile = "tat3%s_%s",
era_a = 1,
era_b = 1,
mode_con_a = 1,
mode_con_b = 1,
change = {
era_a = { name="Clone Wars 2°", icon2="rvb_icon" },
era_b = { name="Glactic Civil War 2°", icon2="rvb_icon" },
},
}

sp_n = table.getn(sp_missionselect_listbox_contents)
sp_missionselect_listbox_contents[sp_n+1] = {
isModLevel = 1,
mapluafile = "myg1%s_%s",
era_a = 1,
mode_xl_a = 1,
change = {
era_a = { name="Clone Wars 2°", icon2="rvb_icon" },
},
}

-- 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("MYG1","myg1a_xl",4)
AddDownloadableContent("TAT3","tat3a_con",4)
AddDownloadableContent("TAT3","tat3b_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\ABC\\data\\_LVL_PC\\core.lvl")
bokkenblader56
Private First Class
Posts: 85
Joined: Mon Aug 04, 2008 7:20 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: South Carolina
Contact:

Re: Creating New mods

Post by bokkenblader56 »

I think that can be solved by backing up the original Jabba's Palace .lvl and replacing it with your modified JP .lvl.
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: Creating New mods

Post by Deviss »

bokkenblader56 wrote:I think that can be solved by backing up the original Jabba's Palace .lvl and replacing it with your modified JP .lvl.
no, because i have this problema with mygeeto also lol the map isn't the problem ovbiously
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Creating New mods

Post by Sky_216 »

Well I'm fairly sure the problem is you're using the 'is Mod level' command, which I'm fairly sure adds it in as an extra map. Here's my addme for my XCW mod.
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)

--add my modes to the singleplayer map selection screen

AddNewGameModes( sp_missionselect_listbox_contents, "myg1%s_%s", {era_g = 1, mode_xl_g = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "dea1%s_%s", {era_g = 1, mode_xl_g = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "kam1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "pol1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "mus1%s_%s", {era_g = 1, mode_xl_g = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "uta1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "tan1%s_%s", {era_g = 1, mode_xl_g = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "nab2%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "yav1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "tat2%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "kas2%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "tat3%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "cor1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "dag1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "fel1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "end1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( sp_missionselect_listbox_contents, "hot1%s_%s", {era_x = 1, mode_con_x = 1,} )

AddNewGameModes( mp_missionselect_listbox_contents, "dea1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kam1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "pol1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "mus1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "uta1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tan1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "nab2%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "yav1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tat2%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "kas2%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "tat3%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "cor1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "dag1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "fel1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "end1%s_%s", {era_x = 1, mode_con_x = 1,} )
AddNewGameModes( mp_missionselect_listbox_contents, "hot1%s_%s", {era_x = 1, mode_con_x = 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("myg1","myg1g_xl",4)
AddDownloadableContent("dea1","dea1g_xl",4)
AddDownloadableContent("kam1","kam1x_con",4)
AddDownloadableContent("pol1","pol1x_con",4)
AddDownloadableContent("mus1","mus1g_xl",4)
AddDownloadableContent("uta1","uta1x_con",4)
AddDownloadableContent("tan1","tan1g_xl",4)
AddDownloadableContent("nab2","nab2x_con",4)
AddDownloadableContent("yav1","yav1x_con",4)
AddDownloadableContent("tat2","tat2x_con",4)
AddDownloadableContent("kas2","kas2x_con",4)
AddDownloadableContent("cor1","cor1x_con",4)
AddDownloadableContent("tat3","tat3x_con",4)
AddDownloadableContent("dag1","dag1x_con",4)
AddDownloadableContent("fel1","fel1x_con",4)
AddDownloadableContent("end1","end1x_con",4)
AddDownloadableContent("hot1","hot1x_con",4)

-- all done
newEntry = nil
n = nil

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

Post by Deviss »

but if i make this so , i won't can change the name of the new era. I need add this line for modify the new era's name:

Code: Select all

change = {
era_a = { name="Clone Wars 2°", icon2="rvb_icon" },
era_b = { name="Glactic Civil War 2°", icon2="rvb_icon" },
},
}
so how can i add this line to your addme file?? :D

very thanks sky your help is the most :bowdown:
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Creating New mods

Post by Sky_216 »

I'm not sure this will work, but try anyway!

Do that for Jabba's palace:

Code: Select all

AddNewGameModes( sp_missionselect_listbox_contents, "tat3%s_%s", {era_a = 1, era_b = 1, mode_con_a = 1, mode_con_b = 1, change = {era_a = { name="Clone Wars 2°", icon2="rvb_icon" },era_b = { name="Glactic Civil War 2°", icon2="rvb_icon" },},} )

I haven't tried this, so any problems let me know!
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: Creating New mods

Post by [RDH]Zerted »

AddNewGameModes is used when a map already exists and you want to add/change its game modes. The sp_missionselect_listbox_content type lines are for when you are adding a new map. When you use one of those lines, it adds a new entry into the map list. When you use AddNewGameModes, it edits a map already in the map lists.

Oh, seems Skyhammer_216 beat me to it...
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: Creating New mods

Post by Deviss »

Skyhammer_216 wrote:I'm not sure this will work, but try anyway!

Do that for Jabba's palace:

Code: Select all

AddNewGameModes( sp_missionselect_listbox_contents, "tat3%s_%s", {era_a = 1, era_b = 1, mode_con_a = 1, mode_con_b = 1, change = {era_a = { name="Clone Wars 2°", icon2="rvb_icon" },era_b = { name="Glactic Civil War 2°", icon2="rvb_icon" },},} )

I haven't tried this, so any problems let me know!
wow this work very fine :bowdown: :bowdown: problem solved in advance thanks you very much sky :bowdown: and this is the addme lua 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


AddNewGameModes(sp_missionselect_listbox_contents,
"tas_%s",
{era_a = 1, era_b = 1, mode_con_a = 1, mode_con_b = 1,})

AddNewGameModes( sp_missionselect_listbox_contents, "tat3%s_%s", {era_a = 1, era_b = 1, mode_con_a = 1, mode_con_b = 1, change = {era_a = { name="Clone Wars 2°", icon2="rvb_icon" },era_b = { name="Glactic Civil War 2°", icon2="rvb_icon" },},} )

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

--add my modes to the singleplayer map selection screen

AddNewGameModes( sp_missionselect_listbox_contents, "myg1%s_%s", {era_a = 1, mode_xl_a = 1,} )

AddNewGameModes( mp_missionselect_listbox_contents, "myg1%s_%s", {era_a = 1, mode_xl_a = 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("MYG1","myg1a_xl",4)
AddDownloadableContent("TAT3","tat3a_con",4)
AddDownloadableContent("TAT3","tat3b_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\ABC\\data\\_LVL_PC\\core.lvl")
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Creating New mods

Post by Sky_216 »

Wow....worked and I never tried it.....
Anyway, glad it works Deviss. Can we expect to see some of your nice side mods as extra era/mode mods soon? :D

To everyone else: I'll write this up as full tutorial with screens soon. :)
Post Reply