Add Unit.....

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
Alpha-17
Master Sergeant
Master Sergeant
Posts: 165
Joined: Mon Jan 22, 2007 2:26 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Add Unit.....

Post by Alpha-17 »

Hi all,
I got some Problems ... Can you say me what I should do and write into the .lua to add an 7. trooper to the others ??
THX !
Darth_Z13
Jedi High Council
Jedi High Council
Posts: 2275
Joined: Sat Jun 17, 2006 9:51 am
xbox live or psn: Xanthius Wylon
Location: Canada

RE: Add Unit.....

Post by Darth_Z13 »

What's a 7. trooper?
Alpha

RE: Add Unit.....

Post by Alpha »

A seventh trooper class is what he's talking about.
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

RE: Add Unit.....

Post by Penguin »

Theres marine or pilot((if an engineer is put in this spot they will heal ships))

Take a look at the eli lua's.
EGG_GUTS
Master Bounty Hunter
Master Bounty Hunter
Posts: 1626
Joined: Thu Dec 07, 2006 7:38 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: CANADA!

Post by EGG_GUTS »

I tried doing that and it didn't work the AddUnit "blah_blah_blah" and it didn't work :(
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post by Penguin »

Then you diddn't do it right
Alpha-17
Master Sergeant
Master Sergeant
Posts: 165
Joined: Mon Jan 22, 2007 2:26 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Alpha-17 »

I wouldn't add an Marine or pilot --i would add a new trooper, just like a republic commando or a sandtrooper
Xavious
Sith Master
Sith Master
Posts: 2783
Joined: Mon Jun 12, 2006 3:46 pm

Post by Xavious »

Here's an exmaple of a working set-up teams with extra units.
SetupTeams{
rep = {
team = REP,
units = 64,
reinforcements = 200,
soldier = { "rep_inf_ep3_rifleman",9, 55},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 64,
reinforcements = 200,
soldier = { "cis_inf_rifleman",9, 55},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
}
}

AddUnitClass(CIS, "cis_inf_marine",1,5)
AddUnitClass(REP, "rep_hero_obiwan",1,1)
AddUnitClass(CIS, "cis_hero_darthmaul",1,1)
AddUnitClass(REP, "all_inf_rocketeer",1,1)

SetHeroClass(CIS, "cis_hero_grievous")
SetHeroClass(REP, "rep_hero_anakin")
Alpha-17
Master Sergeant
Master Sergeant
Posts: 165
Joined: Mon Jan 22, 2007 2:26 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Alpha-17 »

I tried it but this is what happened :

C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\NIG\NIGc_con.lua:94: unexpected symbol near `)'
ERROR[scriptmunge scripts\NIG\NIGc_con.lua]:Could not read input file.ERROR[scriptmunge scripts\NIG\NIGc_con.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings
The_Emperor
Supreme Galactic Ruler
Posts: 2118
Joined: Sat Dec 10, 2005 6:30 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Waaaaay over there.

Post by The_Emperor »

You made a typo in line 94 in the lua :P
Droideka88

Post by Droideka88 »

AddUnitClass(CIS, "cis_inf_marine",1,5)
AddUnitClass(REP, "rep_hero_obiwan",1,1)
AddUnitClass(CIS, "cis_hero_darthmaul",1,1)
AddUnitClass(REP, "all_inf_rocketeer",1,1)

SetHeroClass(CIS, "cis_hero_grievous")
SetHeroClass(REP, "rep_hero_anakin")
If anyone such as Darth_maul knows about this, could I simply delete the set hero classes and add the extra units? Also, why do AddUnitClass have to come after the other two sides such as CIS and REP.
Darth_Z13
Jedi High Council
Jedi High Council
Posts: 2275
Joined: Sat Jun 17, 2006 9:51 am
xbox live or psn: Xanthius Wylon
Location: Canada

Post by Darth_Z13 »

Here's the code from one of the modes in my Conversion Showcase to help some people out. ;)

Code: Select all

	SetupTeams{
		rep = {
			team = REP,
			units = 20,
			reinforcements = 150,
			soldier  = { "rep_inf_ep3_rifleman",9, 25},
			assault  = { "rep_inf_ep3_rocketeer",1, 4},
			engineer = { "rep_inf_ep3_engineer",1, 4},
			sniper   = { "rep_inf_ep3_sniper",1, 4},
			officer = {"rep_inf_ep3_officer",1, 4},
			special = { "rep_inf_ep3_jettrooper",1, 4},

        },
    }   

    AddUnitClass(REP,"imp_inf_commander_black",   1,2)
    AddUnitClass(REP,"imp_inf_commander_grey",  1,2)

    SetupTeams{
		cis = {
			team = CIS,
			units = 20,
			reinforcements = 150,
			soldier  = { "rep_inf_boss_commando",9, 25},
			assault  = { "rep_inf_fixer_commando",1, 4},
			engineer = { "rep_inf_scorch_commando",1, 4},
			sniper   = { "rep_inf_sev_commando",1, 4},
			officer = {"rep_inf_caboose_commando",1, 4},
			special = { "rep_inf_marz_commando",1, 4},
		}
	}
Droideka88

Post by Droideka88 »

Just to make sure Darth, you have no heroes at all right?
Xavious
Sith Master
Sith Master
Posts: 2783
Joined: Mon Jun 12, 2006 3:46 pm

Post by Xavious »

Alpha-17 wrote:I tried it but this is what happened :

C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\NIG\NIGc_con.lua:94: unexpected symbol near `)'
ERROR[scriptmunge scripts\NIG\NIGc_con.lua]:Could not read input file.ERROR[scriptmunge scripts\NIG\NIGc_con.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings
That error is somewhere in the area where you called for your units.

(Underneath ReadDataFile("SIDE\\###.lvl)

You put an extra character there where it isn't needed.
Droideka88 wrote:If anyone such as Darth_maul knows about this, could I simply delete the set hero classes and add the extra units?
Yes, but I think you also need to edit out the "EnableSPHeroRules" line.
Darth_Z13
Jedi High Council
Jedi High Council
Posts: 2275
Joined: Sat Jun 17, 2006 9:51 am
xbox live or psn: Xanthius Wylon
Location: Canada

Post by Darth_Z13 »

Droideka88 wrote:Just to make sure Darth, you have no heroes at all right?
When I remove heroes I just take the SetHero line out. That's all and it works. :wink:
Alpha-17
Master Sergeant
Master Sergeant
Posts: 165
Joined: Mon Jan 22, 2007 2:26 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Alpha-17 »

Ok thx to all i ll try it soon !!!
Post Reply