problem with the command: "AddUnitClass"[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
User avatar
hunting shadow
Private First Class
Posts: 79
Joined: Sun Jan 18, 2009 11:37 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: Somewhere in the wilderness of Mandalore
Contact:

problem with the command: "AddUnitClass"[SOLVED]

Post by hunting shadow »

Hi,

I have a question: I tried to add an additional unit with the command: AddUnitClass
But when I munge and play the map, there shows up the teams hero instead of the unit I added with the command. The ai is able to polay the extra unit, but I'm not. I addded a screenshot of my lua to show you what i mean:
addunit.gif
Please help me.
Last edited by hunting shadow on Fri Jan 23, 2009 9:58 am, edited 1 time in total.
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: problem with the command: "AddUnitClass"

Post by DarthD.U.C.K. »

you have to write the addunitclass command into the setupteams section
Aman/Pinguin
Jedi
Jedi
Posts: 1104
Joined: Tue Jan 30, 2007 6:04 am
Projects :: Inactive
Location: Germany

Re: problem with the command: "AddUnitClass"

Post by Aman/Pinguin »

No, you don't have to. It just has to be BEFORE the SetHeroClass() command.
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: problem with the command: "AddUnitClass"

Post by [RDH]Zerted »

Aman/Pinguin wrote:No, you don't have to.
and you really shouldn't
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: problem with the command: "AddUnitClass"

Post by DarthD.U.C.K. »

you are right, i thouht it had to be in the brackets because its in them in hero assault, i looked into the eli lua another time-it has two setupteam commands
my fault :oops:
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: problem with the command: "AddUnitClass"

Post by [RDH]Zerted »

It would still work in the SetupTeams section, but thats not the proper place to put it. I don't know why a few of the official scripts do it that way. They really shouldn't have.
User avatar
hunting shadow
Private First Class
Posts: 79
Joined: Sun Jan 18, 2009 11:37 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: Somewhere in the wilderness of Mandalore
Contact:

Thank you

Post by hunting shadow »

Yeah, it runs. Thank you very much :thumbs:
User avatar
G_M_StYlEr_M
Rebel Sergeant
Rebel Sergeant
Posts: 194
Joined: Wed Oct 01, 2008 5:59 am
Projects :: No Mod project currently.
Games I'm Playing :: Minecraft XD
xbox live or psn: No gamertag set
Location: germany
Contact:

Re: problem with the command: "AddUnitClass"

Post by G_M_StYlEr_M »

DarthD.U.C.K. wrote:you are right, i thouht it had to be in the brackets because its in them in hero assault, i looked into the eli lua another time-it has two setupteam commands
my fault :oops:
this problem i have too :D
my lua is every broken :D
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: problem with the command: "AddUnitClass"

Post by Teancum »

I'm a little rusty, but if I remember right SetHeroClass has to be last. So if you have an AddUnitClass it has to be above it.
Post Reply