I discovered a lua trick that totally blew my mind

Post everything from general questions, to modding questions, to map WIPs to releases. (SWBF1 only)

Moderator: Moderators

User avatar
jdee/barc
1st Lieutenant
1st Lieutenant
Posts: 444
Joined: Wed Aug 25, 2010 2:47 pm
Projects :: Battlefront One and a Half
xbox live or psn: No gamertag set
Location: Boston

I discovered a lua trick that totally blew my mind

Post by jdee/barc »

I was modding my sides mod when I discovered this. I have the missionlist.lua from shell.lvl that teancum posted.
-I made an addon map with the intent of trying to make an test era mod to see if era mods were possible in BF1
-after failing three times I thought of, copying the part of missionlist.lua where maps/eras are added and overwriting the part of the addme.lua where maps/eras are added.

I got this result with new maps that were suddenly not addon maps but rather part of the game itself, like the stock maps. (the names are not localized, and I don't have the scripts fully compiled yet. (the green strip is because it was in sptest)

my reaction= :shock:

Image
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: I discovered a lua trick that totally blew my mind

Post by THEWULFMAN »

Good work :thumbs:
CommanderCody212
Second Lance Corporal
Second Lance Corporal
Posts: 103
Joined: Mon Feb 14, 2011 4:44 pm
Projects :: BattleFront 1.5 tester
Games I'm Playing :: Battlefront

Re: I discovered a lua trick that totally blew my mind

Post by CommanderCody212 »

Wow!
Keep it up!
:thumbs:
User avatar
jdee/barc
1st Lieutenant
1st Lieutenant
Posts: 444
Joined: Wed Aug 25, 2010 2:47 pm
Projects :: Battlefront One and a Half
xbox live or psn: No gamertag set
Location: Boston

Re: I discovered a lua trick that totally blew my mind

Post by jdee/barc »

This might be as close as one could get with making an era mod in BF1.
User avatar
bamdur123
Sergeant Major
Sergeant Major
Posts: 243
Joined: Fri Oct 15, 2010 7:15 pm
Projects :: Tython-Siege of Darkness Zombie Hotel
Games I'm Playing :: SWBF 1+2
Location: Ohio, USA

Re: I discovered a lua trick that totally blew my mind

Post by bamdur123 »

I would of never thought about the addme.lua nice job (ill be trying to get some shell work if i can and will expierement with this)
User avatar
jdee/barc
1st Lieutenant
1st Lieutenant
Posts: 444
Joined: Wed Aug 25, 2010 2:47 pm
Projects :: Battlefront One and a Half
xbox live or psn: No gamertag set
Location: Boston

Re: I discovered a lua trick that totally blew my mind

Post by jdee/barc »

you need the missionlist lua. teancum posted it. just go back through the bf1 threads and look for it.
User avatar
bamdur123
Sergeant Major
Sergeant Major
Posts: 243
Joined: Fri Oct 15, 2010 7:15 pm
Projects :: Tython-Siege of Darkness Zombie Hotel
Games I'm Playing :: SWBF 1+2
Location: Ohio, USA

Re: I discovered a lua trick that totally blew my mind

Post by bamdur123 »

Yes i have it. i am trying to look for more scripts
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Anniversary

Re: I discovered a lua trick that totally blew my mind

Post by giftheck »

So in essence this works much like the BF2 addme.lua's function of adding new maps/eras to the main game via addon. Pretty cool discovery but have you tested it yet to see if it works 100% yet? Can this be used to, say, add Clone Wars to Hoth and Endor, and Galactic Civil War to Geonosis and Kamino? And does this bypass the 21 addon maps restriction?
User avatar
jdee/barc
1st Lieutenant
1st Lieutenant
Posts: 444
Joined: Wed Aug 25, 2010 2:47 pm
Projects :: Battlefront One and a Half
xbox live or psn: No gamertag set
Location: Boston

Re: I discovered a lua trick that totally blew my mind

Post by jdee/barc »

no i haven't tested those yet and i hadn't thought about that yet.

- Editing the campaign might be possible through this. and each campaign can have up to 255 missions each but i doubt anyone would want to do that.

EDIT

So far I've tested with 15 maps and it works fine
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Anniversary

Re: I discovered a lua trick that totally blew my mind

Post by giftheck »

Cool!

Now I really do wonder what else can be done from addon. Maybe new Historical Campaigns (possibly overwriting the shipped campaigns?)

Have you tried overwriting a shipped Instant Action map using this to see if it works (since I assume this method loads the scripts from addon and not the shipped game), say, Kamino: Tipoca City with Rhen Var: Citadel?

Because if it loads from your addon mission.lvl, I think we've cracked it so we can get custom animations and sides ingame WITHOUT overwriting the old ones.

Just to let you know, for the main game, maps are named in the localization files (in core.lvl) and not the missionlist.
User avatar
jdee/barc
1st Lieutenant
1st Lieutenant
Posts: 444
Joined: Wed Aug 25, 2010 2:47 pm
Projects :: Battlefront One and a Half
xbox live or psn: No gamertag set
Location: Boston

Re: I discovered a lua trick that totally blew my mind

Post by jdee/barc »

no, actually, the mission scripts run from the regular mission.lvl itself, which I edited by creating new scripts for the eras, most of which are basically edited, renameed duplicates of the stock ones and which call for the use of the modded worlds and sides. the only thing i really did that made this possible was copy the first half of missionlist that that outlined all the non-addon worlds into the addme lua, editing it, and munging, and that became the new "missionlist" lua. addme and missionlist are very similar.


about custom animations, Bamdur is having a great sucess with doing that for my mod. He ported a two-hand gripped pistol anim by darthduck and an aayla lightsabre anim. search for some of his videos on xfire. all you really need to do is be good at animating and animationsets/banks and putting it in a common.lvl

about sides that don't overwrite the stock sides, i already did that with my mod by having my sides run from a folder separate from the sides folder (the stock sides remain in folder SIDE, mine run from new folder called MAIN). I thought you did that with Battlefront Expansion as well, or did i misunderstand?

and thanks for the info about localization.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: I discovered a lua trick that totally blew my mind

Post by Teancum »

I'm glad someone caught it - that's what I posted it for but didn't have any time then to explain how it worked. I'll follow this topic and try to answer anything I can.
User avatar
jdee/barc
1st Lieutenant
1st Lieutenant
Posts: 444
Joined: Wed Aug 25, 2010 2:47 pm
Projects :: Battlefront One and a Half
xbox live or psn: No gamertag set
Location: Boston

Re: I discovered a lua trick that totally blew my mind

Post by jdee/barc »

alright-y then, does this actually affect the addon map limit or how many add-on maps you have? I mean, i tested it with 15 maps, but I'm still not entirely sure.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: I discovered a lua trick that totally blew my mind

Post by Teancum »

There will still be a total number of missions that you have. A mission counts as one LUA setup for a map (so Bespin Platforms - Clone Wars is one mission). In SWBF2 the limit is 500. Dunno what that'll be in SWBF1.
User avatar
jdee/barc
1st Lieutenant
1st Lieutenant
Posts: 444
Joined: Wed Aug 25, 2010 2:47 pm
Projects :: Battlefront One and a Half
xbox live or psn: No gamertag set
Location: Boston

Re: I discovered a lua trick that totally blew my mind

Post by jdee/barc »

the addon limit is 21 in the 1.2 patch and possibly up to 512 in the 1.3 . Now I can't install the 1.3 patch because I have the best of pc edition, not the regular CD version so I'm limited.
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Anniversary

Re: I discovered a lua trick that totally blew my mind

Post by giftheck »

With this trick are we able to override the Historical Campaign?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: I discovered a lua trick that totally blew my mind

Post by Teancum »

Yes, I highlighted the historical campaign sections in yellow below. It's still just a CW/GCW campaign, but you can definitely extend it with new maps or replace them if you want.
Hidden/Spoiler:
-- List of missions presented to the user for IA/MP/splitscreen/etc.
-- This list is kept in alphabetical order (in English, anyhow).
--
-- Each entry should be in the following form:
-- { -- starts a table entry
-- mapluafile = "END1", -- base name of map, w/o attacking side, no ".lua" either
-- showstr = "planets.endor.name1", -- localization key in DB of item to show
-- side_a = 1, -- [OPTIONAL] Put this in the table if there is a "a" version of the map
-- side_c = 1, -- [OPTIONAL] Put this in the table if there is a "c" version of the map
-- side_i = 1, -- [OPTIONAL] Put this in the table if there is a "i" version of the map
-- side_r = 1, -- [OPTIONAL] Put this in the table if there is a "r" version of the map
-- side_a_team1 = "common.sides.all.name" -- [OPTIONAL] -- localized name of team1 in an 'a' version of this map
-- side_a_team2 = "common.sides.imp.name" -- [OPTIONAL] -- localized name of team2 in an 'a' version of this map
-- -- Note, there's also OPTIONAL side_c_team1, side_i_team1, side_r_team1,
-- -- side_c_team2, side_i_team2, side_r_team2 fields.
--
-- }, -- ends a table entry
--
-- Below, things are in one-entry-per-line format to make it easier to
-- comment in/out maps by commenting in/out a single line

sp_missionselect_listbox_contents = {
{ mapluafile = "BES1", showstr = "planets.bespin.mapname1", side_r = 1, side_a = 1},
{ mapluafile = "BES2", showstr = "planets.bespin.mapname2", side_r = 1, side_a = 1},

{ mapluafile = "END1", showstr = "planets.endor.mapname1", side_a = 1},

{ mapluafile = "GEO1", showstr = "planets.geonosis.mapname1", side_r = 1},

{ mapluafile = "HOT1", showstr = "planets.hoth.mapname1", side_i = 1},

{ mapluafile = "KAM1", showstr = "planets.kamino.mapname1", side_c = 1},

{ mapluafile = "KAS1", showstr = "planets.kashyyyk.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "KAS2", showstr = "planets.kashyyyk.mapname2", side_c = 1, side_i = 1},

{ mapluafile = "NAB1", showstr = "planets.naboo.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "NAB2", showstr = "planets.naboo.mapname2", side_c = 1, side_a = 1},

{ mapluafile = "RHN1", showstr = "planets.rhenvar.mapname1", side_r = 1, side_i = 1},
{ mapluafile = "RHN2", showstr = "planets.rhenvar.mapname2", side_c = 1, side_a = 1},

{ mapluafile = "TAT1", showstr = "planets.tatooine.mapname1", side_r = 1, side_i = 1},
{ mapluafile = "TAT2", showstr = "planets.tatooine.mapname2", side_r = 1, side_i = 1},

{ mapluafile = "YAV1", showstr = "planets.yavin.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "YAV2", showstr = "planets.yavin.mapname2", side_r = 1, side_i = 1},

}

mp_missionselect_listbox_contents = {
{ mapluafile = "BES1", showstr = "planets.bespin.mapname1", side_r = 1, side_a = 1},
{ mapluafile = "BES2", showstr = "planets.bespin.mapname2", side_r = 1, side_a = 1},

{ mapluafile = "END1", showstr = "planets.endor.mapname1", side_a = 1},

{ mapluafile = "GEO1", showstr = "planets.geonosis.mapname1", side_r = 1},

{ mapluafile = "HOT1", showstr = "planets.hoth.mapname1", side_i = 1},

{ mapluafile = "KAM1", showstr = "planets.kamino.mapname1", side_c = 1},

{ mapluafile = "KAS1", showstr = "planets.kashyyyk.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "KAS2", showstr = "planets.kashyyyk.mapname2", side_c = 1, side_i = 1},

{ mapluafile = "NAB1", showstr = "planets.naboo.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "NAB2", showstr = "planets.naboo.mapname2", side_c = 1, side_a = 1},

{ mapluafile = "RHN1", showstr = "planets.rhenvar.mapname1", side_r = 1, side_i = 1},
{ mapluafile = "RHN2", showstr = "planets.rhenvar.mapname2", side_c = 1, side_a = 1},

{ mapluafile = "TAT1", showstr = "planets.tatooine.mapname1", side_r = 1, side_i = 1},
{ mapluafile = "TAT2", showstr = "planets.tatooine.mapname2", side_r = 1, side_i = 1},

{ mapluafile = "YAV1", showstr = "planets.yavin.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "YAV2", showstr = "planets.yavin.mapname2", side_r = 1, side_i = 1},
}

-- List of maps usable in attract mode. These should be the raw lua
-- filenames (without ".lua"), and one per line, so we can turn them
-- on/off easily. Historical missions could go in here if desired.
attract_mode_maps = {
"bes1a",
"bes1r",
"bes2a",
"bes2r",
"end1a",
"geo1r",
"hot1i",
"kam1c",
"kas1c",
"kas1i",
"kas2c",
"kas2i",
"nab1c",
"nab1i",
"nab2a",
"nab2c",
"rhn1i",
"rhn1r",
"tat1i",
"tat1r",
"tat2i",
"tat2r",
"yav1c",
"yav1i",
"yav2i",
"yav2r",

-- Historical maps, off by default
"nab1c_h",
"nab2c_h",
"kas1c_h",
"geo1r_h",
"kam1c_h",
"rhn1r_h",
"kas2c_h",
"tat1i_h",
"tat2i_h",
"rhn2a_h",
"yav2i_h",
"yav1i_h",
"hot1i_h",
"bes2a_h",
"bes1a_h",
"end1a_h",
}


-- Singleplayer campaigns. Each of these tables has a set of
-- sub-tables, one sub-table per mission. These are run through in
-- order. Note: there is a max of 255 missions in a campaign. Todo:
-- add in listings for VOs, backgrounds, etc.
--
-- Optional params per line:
-- side = 2, -- forces the user to team 2 (defender). If omitted, team 1 (attacker) is forced
-- intromovie = "", --movie played before yoda
-- outtromovie = "", --movie played after yoda, before mission
-- exitmovie = "", --movie played after mission is done (and you win)
-- [More will be coming, which refer to text to print, voiceover, etc.]

SPCampaign_CW = {
--Player is CIS
{
mapluafile = "nab1c_h",
side = 1,
showstr = "ifs.sp.cw.map1name",
description = "ifs.sp.cw.map1descr",
movie = "nab1fly",
voiceover = "cis_missionbriefing_nab1",
intromovie = "nab1h01",
outtromovie = "tutorial01cw",
outtromovie_left = 90,
outtromovie_top = 60,
outtromovie_width = 460,
outtromovie_height = 350,
outtromovielocalized = 1,
briefingmusic = "shell_droidinvasion",
iconmodel = "com_icon_CIS"
}, --Player is CIS
{
mapluafile = "nab2c_h",
side = 1,
showstr = "ifs.sp.cw.map2name",
description = "ifs.sp.cw.map2descr",
movie = "nab2fly",
voiceover = "cis_missionbriefing_nab2",
outtromovie = "nab2h01",
briefingmusic = "shell_droidinvasion",
unlockable = 1,
iconmodel = "com_icon_CIS"
}, --Player is CIS
{
mapluafile = "kas1c_h",
side = 1,
showstr = "ifs.sp.cw.map3name",
description = "ifs.sp.cw.map3descr",
movie = "kas1fly",
voiceover = "cis_missionbriefing_kas1",
briefingmusic = "shell_droidinvasion",
unlockable = 2,
iconmodel = "com_icon_CIS"
},

--Player is Republic
{
mapluafile = "geo1r_h",
side = 1,
showstr = "ifs.sp.cw.map4name",
description = "ifs.sp.cw.map4descr",
movie = "geo1fly",
outtromovie = "geo1h01",
voiceover = "rep_missionbriefing_geo1",
briefingmusic = "shell_clonewars",
unlockable = 3,
iconmodel = "com_icon_republic"
},

--Player is Republic
{
mapluafile = "kam1c_h",
side = 2,
showstr = "ifs.sp.cw.map5name",
description = "ifs.sp.cw.map5descr",
movie = "kam1fly",
intromovie = "kam1h01",
outtromovie = "kam1h02",
voiceover = "rep_missionbriefing_kam1",
briefingmusic = "shell_clonewars",
unlockable = 4,
iconmodel = "com_icon_republic"
},--Player is Republic
{
mapluafile = "rhn1r_h",
side = 1,
showstr = "ifs.sp.cw.map6name",
description = "ifs.sp.cw.map6descr",
movie = "rhn1fly",
voiceover = "rep_missionbriefing_rhn1",
briefingmusic = "shell_clonewars",
unlockable = 5,
iconmodel = "com_icon_republic"
},--Player is Republic
{
mapluafile = "kas2c_h",
side = 2,
showstr = "ifs.sp.cw.map7name",
description = "ifs.sp.cw.map7descr", side = 2,
movie = "kas2fly",
voiceover = "rep_missionbriefing_kas1",
briefingmusic = "shell_clonewars",
exitmovie = "kas2h01",
iconmodel = "com_icon_republic"
},--Player is Republic
}

SPCampaign_GCW = {
--Player is the Empire
{
mapluafile = "tat1i_h",
side = 1,
showstr = "ifs.sp.gcw.map1name",
description = "ifs.sp.gcw.map1descr",
movie = "tat1fly",
intromovie = "tat1h01",
outtromovie = "tutorial01gcw",
outtromovie_left = 90,
outtromovie_top = 60,
outtromovie_width = 460,
outtromovie_height = 350,
outtromovielocalized = 1,
voiceover = "imp_missionbriefing_tat1",
briefingmusic = "shell_imperialmarch",
iconmodel = "com_icon_imperial"
},--Player is the Empire
{
mapluafile = "tat2i_h",
side = 1,
showstr = "ifs.sp.gcw.map2name",
description = "ifs.sp.gcw.map2descr",
movie = "tat2fly",
intromovie = "tat2h01",
voiceover = "imp_missionbriefing_tat2",
briefingmusic = "shell_imperialmarch",
unlockable = 6,
iconmodel = "com_icon_imperial"
},--Player is the Empire
{
mapluafile = "rhn2a_h",
side = 2,
showstr = "ifs.sp.gcw.map3name",
description = "ifs.sp.gcw.map3descr",
movie = "rhn2fly",
voiceover = "imp_missionbriefing_rhn1",
briefingmusic = "shell_imperialmarch",
iconmodel = "com_icon_imperial"
},--Player is the Empire
{
mapluafile = "yav2i_h",
side = 1,
showstr = "ifs.sp.gcw.map4name",
description = "ifs.sp.gcw.map4descr",
movie = "yav2fly",
intromovie = "yav2h01",
voiceover = "imp_missionbriefing_yav1",
briefingmusic = "shell_imperialmarch",
iconmodel = "com_icon_imperial"
},--Player is the Alliance
{
mapluafile = "yav1i_h",
side = 2,
showstr = "ifs.sp.gcw.map5name",
description = "ifs.sp.gcw.map5descr",
movie = "yav1fly",
intromovie = "yav1h01",
voiceover = "all_missionbriefing_yav1",
briefingmusic = "shell_clash",
unlockable = 7,
iconmodel = "com_icon_alliance"
},--Player is the Alliance

--Player is the Alliance
{
mapluafile = "hot1i_h",
side = 2,
showstr = "ifs.sp.gcw.map6name",
description = "ifs.sp.gcw.map6descr", side = 2,
movie = "hot1fly",
outtromovie = "hot1h02",
voiceover = "all_missionbriefing_hot1",
briefingmusic = "shell_clash",
unlockable = 8,
iconmodel = "com_icon_alliance"
},--Player is the Alliance
{
mapluafile = "bes2a_h",
side = 1,
showstr = "ifs.sp.gcw.map7name",
description = "ifs.sp.gcw.map7descr",
movie = "bes2fly",
intromovie = "bes2h01",
voiceover = "all_missionbriefing_bes1",
briefingmusic = "shell_clash",
unlockable = 9,
iconmodel = "com_icon_alliance"
},--Player is the Alliance
{
mapluafile = "bes1a_h",
side = 1,
showstr = "ifs.sp.gcw.map8name",
description = "ifs.sp.gcw.map8descr",
movie = "bes1fly",
outtromovie = "bes1h01",
voiceover = "all_missionbriefing_bes2",
briefingmusic = "shell_clash",
unlockable = 10,
iconmodel = "com_icon_alliance"
},--Player is the Alliance
{
mapluafile = "end1a_h",
side = 1,
showstr = "ifs.sp.gcw.map9name",
description = "ifs.sp.gcw.map9descr",
movie = "end1fly",
outtromovie = "end1h02",
exitmovie = "end1h03",
voiceover = "all_missionbriefing_end1",
briefingmusic = "shell_clash",
iconmodel = "com_icon_alliance"
},--Player is the Alliance
}
SleepKiller
Corporal
Corporal
Posts: 143
Joined: Thu Mar 03, 2011 5:08 pm
xbox live or psn: N/A

Re: I discovered a lua trick that totally blew my mind

Post by SleepKiller »

Nice find :)
User avatar
jdee/barc
1st Lieutenant
1st Lieutenant
Posts: 444
Joined: Wed Aug 25, 2010 2:47 pm
Projects :: Battlefront One and a Half
xbox live or psn: No gamertag set
Location: Boston

Re: I discovered a lua trick that totally blew my mind

Post by jdee/barc »

Teancum wrote:Yes, I highlighted the historical campaign sections in yellow below. It's still just a CW/GCW campaign, but you can definitely extend it with new maps or replace them if you want.
Hidden/Spoiler:
-- List of missions presented to the user for IA/MP/splitscreen/etc.
-- This list is kept in alphabetical order (in English, anyhow).
--
-- Each entry should be in the following form:
-- { -- starts a table entry
-- mapluafile = "END1", -- base name of map, w/o attacking side, no ".lua" either
-- showstr = "planets.endor.name1", -- localization key in DB of item to show
-- side_a = 1, -- [OPTIONAL] Put this in the table if there is a "a" version of the map
-- side_c = 1, -- [OPTIONAL] Put this in the table if there is a "c" version of the map
-- side_i = 1, -- [OPTIONAL] Put this in the table if there is a "i" version of the map
-- side_r = 1, -- [OPTIONAL] Put this in the table if there is a "r" version of the map
-- side_a_team1 = "common.sides.all.name" -- [OPTIONAL] -- localized name of team1 in an 'a' version of this map
-- side_a_team2 = "common.sides.imp.name" -- [OPTIONAL] -- localized name of team2 in an 'a' version of this map
-- -- Note, there's also OPTIONAL side_c_team1, side_i_team1, side_r_team1,
-- -- side_c_team2, side_i_team2, side_r_team2 fields.
--
-- }, -- ends a table entry
--
-- Below, things are in one-entry-per-line format to make it easier to
-- comment in/out maps by commenting in/out a single line

sp_missionselect_listbox_contents = {
{ mapluafile = "BES1", showstr = "planets.bespin.mapname1", side_r = 1, side_a = 1},
{ mapluafile = "BES2", showstr = "planets.bespin.mapname2", side_r = 1, side_a = 1},

{ mapluafile = "END1", showstr = "planets.endor.mapname1", side_a = 1},

{ mapluafile = "GEO1", showstr = "planets.geonosis.mapname1", side_r = 1},

{ mapluafile = "HOT1", showstr = "planets.hoth.mapname1", side_i = 1},

{ mapluafile = "KAM1", showstr = "planets.kamino.mapname1", side_c = 1},

{ mapluafile = "KAS1", showstr = "planets.kashyyyk.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "KAS2", showstr = "planets.kashyyyk.mapname2", side_c = 1, side_i = 1},

{ mapluafile = "NAB1", showstr = "planets.naboo.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "NAB2", showstr = "planets.naboo.mapname2", side_c = 1, side_a = 1},

{ mapluafile = "RHN1", showstr = "planets.rhenvar.mapname1", side_r = 1, side_i = 1},
{ mapluafile = "RHN2", showstr = "planets.rhenvar.mapname2", side_c = 1, side_a = 1},

{ mapluafile = "TAT1", showstr = "planets.tatooine.mapname1", side_r = 1, side_i = 1},
{ mapluafile = "TAT2", showstr = "planets.tatooine.mapname2", side_r = 1, side_i = 1},

{ mapluafile = "YAV1", showstr = "planets.yavin.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "YAV2", showstr = "planets.yavin.mapname2", side_r = 1, side_i = 1},

}

mp_missionselect_listbox_contents = {
{ mapluafile = "BES1", showstr = "planets.bespin.mapname1", side_r = 1, side_a = 1},
{ mapluafile = "BES2", showstr = "planets.bespin.mapname2", side_r = 1, side_a = 1},

{ mapluafile = "END1", showstr = "planets.endor.mapname1", side_a = 1},

{ mapluafile = "GEO1", showstr = "planets.geonosis.mapname1", side_r = 1},

{ mapluafile = "HOT1", showstr = "planets.hoth.mapname1", side_i = 1},

{ mapluafile = "KAM1", showstr = "planets.kamino.mapname1", side_c = 1},

{ mapluafile = "KAS1", showstr = "planets.kashyyyk.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "KAS2", showstr = "planets.kashyyyk.mapname2", side_c = 1, side_i = 1},

{ mapluafile = "NAB1", showstr = "planets.naboo.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "NAB2", showstr = "planets.naboo.mapname2", side_c = 1, side_a = 1},

{ mapluafile = "RHN1", showstr = "planets.rhenvar.mapname1", side_r = 1, side_i = 1},
{ mapluafile = "RHN2", showstr = "planets.rhenvar.mapname2", side_c = 1, side_a = 1},

{ mapluafile = "TAT1", showstr = "planets.tatooine.mapname1", side_r = 1, side_i = 1},
{ mapluafile = "TAT2", showstr = "planets.tatooine.mapname2", side_r = 1, side_i = 1},

{ mapluafile = "YAV1", showstr = "planets.yavin.mapname1", side_c = 1, side_i = 1},
{ mapluafile = "YAV2", showstr = "planets.yavin.mapname2", side_r = 1, side_i = 1},
}

-- List of maps usable in attract mode. These should be the raw lua
-- filenames (without ".lua"), and one per line, so we can turn them
-- on/off easily. Historical missions could go in here if desired.
attract_mode_maps = {
"bes1a",
"bes1r",
"bes2a",
"bes2r",
"end1a",
"geo1r",
"hot1i",
"kam1c",
"kas1c",
"kas1i",
"kas2c",
"kas2i",
"nab1c",
"nab1i",
"nab2a",
"nab2c",
"rhn1i",
"rhn1r",
"tat1i",
"tat1r",
"tat2i",
"tat2r",
"yav1c",
"yav1i",
"yav2i",
"yav2r",

-- Historical maps, off by default
"nab1c_h",
"nab2c_h",
"kas1c_h",
"geo1r_h",
"kam1c_h",
"rhn1r_h",
"kas2c_h",
"tat1i_h",
"tat2i_h",
"rhn2a_h",
"yav2i_h",
"yav1i_h",
"hot1i_h",
"bes2a_h",
"bes1a_h",
"end1a_h",
}


-- Singleplayer campaigns. Each of these tables has a set of
-- sub-tables, one sub-table per mission. These are run through in
-- order. Note: there is a max of 255 missions in a campaign. Todo:
-- add in listings for VOs, backgrounds, etc.
--
-- Optional params per line:
-- side = 2, -- forces the user to team 2 (defender). If omitted, team 1 (attacker) is forced
-- intromovie = "", --movie played before yoda
-- outtromovie = "", --movie played after yoda, before mission
-- exitmovie = "", --movie played after mission is done (and you win)
-- [More will be coming, which refer to text to print, voiceover, etc.]

SPCampaign_CW = {
--Player is CIS
{
mapluafile = "nab1c_h",
side = 1,
showstr = "ifs.sp.cw.map1name",
description = "ifs.sp.cw.map1descr",
movie = "nab1fly",
voiceover = "cis_missionbriefing_nab1",
intromovie = "nab1h01",
outtromovie = "tutorial01cw",
outtromovie_left = 90,
outtromovie_top = 60,
outtromovie_width = 460,
outtromovie_height = 350,
outtromovielocalized = 1,
briefingmusic = "shell_droidinvasion",
iconmodel = "com_icon_CIS"
}, --Player is CIS
{
mapluafile = "nab2c_h",
side = 1,
showstr = "ifs.sp.cw.map2name",
description = "ifs.sp.cw.map2descr",
movie = "nab2fly",
voiceover = "cis_missionbriefing_nab2",
outtromovie = "nab2h01",
briefingmusic = "shell_droidinvasion",
unlockable = 1,
iconmodel = "com_icon_CIS"
}, --Player is CIS
{
mapluafile = "kas1c_h",
side = 1,
showstr = "ifs.sp.cw.map3name",
description = "ifs.sp.cw.map3descr",
movie = "kas1fly",
voiceover = "cis_missionbriefing_kas1",
briefingmusic = "shell_droidinvasion",
unlockable = 2,
iconmodel = "com_icon_CIS"
},

--Player is Republic
{
mapluafile = "geo1r_h",
side = 1,
showstr = "ifs.sp.cw.map4name",
description = "ifs.sp.cw.map4descr",
movie = "geo1fly",
outtromovie = "geo1h01",
voiceover = "rep_missionbriefing_geo1",
briefingmusic = "shell_clonewars",
unlockable = 3,
iconmodel = "com_icon_republic"
},

--Player is Republic
{
mapluafile = "kam1c_h",
side = 2,
showstr = "ifs.sp.cw.map5name",
description = "ifs.sp.cw.map5descr",
movie = "kam1fly",
intromovie = "kam1h01",
outtromovie = "kam1h02",
voiceover = "rep_missionbriefing_kam1",
briefingmusic = "shell_clonewars",
unlockable = 4,
iconmodel = "com_icon_republic"
},--Player is Republic
{
mapluafile = "rhn1r_h",
side = 1,
showstr = "ifs.sp.cw.map6name",
description = "ifs.sp.cw.map6descr",
movie = "rhn1fly",
voiceover = "rep_missionbriefing_rhn1",
briefingmusic = "shell_clonewars",
unlockable = 5,
iconmodel = "com_icon_republic"
},--Player is Republic
{
mapluafile = "kas2c_h",
side = 2,
showstr = "ifs.sp.cw.map7name",
description = "ifs.sp.cw.map7descr", side = 2,
movie = "kas2fly",
voiceover = "rep_missionbriefing_kas1",
briefingmusic = "shell_clonewars",
exitmovie = "kas2h01",
iconmodel = "com_icon_republic"
},--Player is Republic
}

SPCampaign_GCW = {
--Player is the Empire
{
mapluafile = "tat1i_h",
side = 1,
showstr = "ifs.sp.gcw.map1name",
description = "ifs.sp.gcw.map1descr",
movie = "tat1fly",
intromovie = "tat1h01",
outtromovie = "tutorial01gcw",
outtromovie_left = 90,
outtromovie_top = 60,
outtromovie_width = 460,
outtromovie_height = 350,
outtromovielocalized = 1,
voiceover = "imp_missionbriefing_tat1",
briefingmusic = "shell_imperialmarch",
iconmodel = "com_icon_imperial"
},--Player is the Empire
{
mapluafile = "tat2i_h",
side = 1,
showstr = "ifs.sp.gcw.map2name",
description = "ifs.sp.gcw.map2descr",
movie = "tat2fly",
intromovie = "tat2h01",
voiceover = "imp_missionbriefing_tat2",
briefingmusic = "shell_imperialmarch",
unlockable = 6,
iconmodel = "com_icon_imperial"
},--Player is the Empire
{
mapluafile = "rhn2a_h",
side = 2,
showstr = "ifs.sp.gcw.map3name",
description = "ifs.sp.gcw.map3descr",
movie = "rhn2fly",
voiceover = "imp_missionbriefing_rhn1",
briefingmusic = "shell_imperialmarch",
iconmodel = "com_icon_imperial"
},--Player is the Empire
{
mapluafile = "yav2i_h",
side = 1,
showstr = "ifs.sp.gcw.map4name",
description = "ifs.sp.gcw.map4descr",
movie = "yav2fly",
intromovie = "yav2h01",
voiceover = "imp_missionbriefing_yav1",
briefingmusic = "shell_imperialmarch",
iconmodel = "com_icon_imperial"
},--Player is the Alliance
{
mapluafile = "yav1i_h",
side = 2,
showstr = "ifs.sp.gcw.map5name",
description = "ifs.sp.gcw.map5descr",
movie = "yav1fly",
intromovie = "yav1h01",
voiceover = "all_missionbriefing_yav1",
briefingmusic = "shell_clash",
unlockable = 7,
iconmodel = "com_icon_alliance"
},--Player is the Alliance

--Player is the Alliance
{
mapluafile = "hot1i_h",
side = 2,
showstr = "ifs.sp.gcw.map6name",
description = "ifs.sp.gcw.map6descr", side = 2,
movie = "hot1fly",
outtromovie = "hot1h02",
voiceover = "all_missionbriefing_hot1",
briefingmusic = "shell_clash",
unlockable = 8,
iconmodel = "com_icon_alliance"
},--Player is the Alliance
{
mapluafile = "bes2a_h",
side = 1,
showstr = "ifs.sp.gcw.map7name",
description = "ifs.sp.gcw.map7descr",
movie = "bes2fly",
intromovie = "bes2h01",
voiceover = "all_missionbriefing_bes1",
briefingmusic = "shell_clash",
unlockable = 9,
iconmodel = "com_icon_alliance"
},--Player is the Alliance
{
mapluafile = "bes1a_h",
side = 1,
showstr = "ifs.sp.gcw.map8name",
description = "ifs.sp.gcw.map8descr",
movie = "bes1fly",
outtromovie = "bes1h01",
voiceover = "all_missionbriefing_bes2",
briefingmusic = "shell_clash",
unlockable = 10,
iconmodel = "com_icon_alliance"
},--Player is the Alliance
{
mapluafile = "end1a_h",
side = 1,
showstr = "ifs.sp.gcw.map9name",
description = "ifs.sp.gcw.map9descr",
movie = "end1fly",
outtromovie = "end1h02",
exitmovie = "end1h03",
voiceover = "all_missionbriefing_end1",
briefingmusic = "shell_clash",
iconmodel = "com_icon_alliance"
},--Player is the Alliance
}

YES!!!! :runaway: I'm remaking the campaigns.
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Anniversary

Re: I discovered a lua trick that totally blew my mind

Post by giftheck »

My mod will finally also be able to modify the campaigns, and the map list can at last look tidier.
Post Reply