Page 1 of 1

Add Unit.....

Posted: Fri Feb 09, 2007 5:32 pm
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 !

RE: Add Unit.....

Posted: Fri Feb 09, 2007 5:34 pm
by Darth_Z13
What's a 7. trooper?

RE: Add Unit.....

Posted: Fri Feb 09, 2007 6:09 pm
by Alpha
A seventh trooper class is what he's talking about.

RE: Add Unit.....

Posted: Fri Feb 09, 2007 7:09 pm
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.

Posted: Fri Feb 09, 2007 8:57 pm
by EGG_GUTS
I tried doing that and it didn't work the AddUnit "blah_blah_blah" and it didn't work :(

Posted: Fri Feb 09, 2007 8:59 pm
by Penguin
Then you diddn't do it right

Posted: Sat Feb 10, 2007 4:05 pm
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

Posted: Sat Feb 10, 2007 4:08 pm
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")

Posted: Tue Feb 13, 2007 2:39 pm
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

Posted: Tue Feb 13, 2007 4:35 pm
by The_Emperor
You made a typo in line 94 in the lua :P

Posted: Tue Feb 13, 2007 8:30 pm
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.

Posted: Tue Feb 13, 2007 8:40 pm
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},
		}
	}

Posted: Tue Feb 13, 2007 9:15 pm
by Droideka88
Just to make sure Darth, you have no heroes at all right?

Posted: Tue Feb 13, 2007 9:52 pm
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.

Posted: Tue Feb 13, 2007 10:08 pm
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:

Posted: Thu Feb 15, 2007 2:18 pm
by Alpha-17
Ok thx to all i ll try it soon !!!