Removing unit classes during a campaign mission script

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
MandeRek
Sith Master
Sith Master
Posts: 2766
Joined: Tue Oct 02, 2007 10:51 am
Projects :: Battlefront Zer0
Games I'm Playing :: SWTOR
xbox live or psn: No gamertag set
Location: Ghosting around GT
Contact:

Removing unit classes during a campaign mission script

Post by MandeRek »

Just as the title, I want to remove an unit class from one of the base 2 teams (cis/rep), so not from a local team, and it won't be the hero too.. Anyhow, i need the line for the complete opposite of AddUnitClass

I tried KillUnitClass and RemoveUnitClass, but those don't exist, hehe. I think it has to do something with setting the number of AI to use that class to nil? But how to do that? Thanks in advance
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing unit classes during a campaign mission script

Post by Maveritchell »

You can't remove a unit class. You can make it inaccessible to the player (adding points requirement) and you can kill any unit that spawns as it (or teleport to a remote location and then kill, which would be preferable).
User avatar
SW_elite
Filthy Thief
Filthy Thief
Posts: 507
Joined: Sat Jan 02, 2010 6:43 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: Australia!!!

Re: Removing unit classes during a campaign mission script

Post by SW_elite »

You go into your sides REQ file and take the units out that you dont want. Then they dont appear ingame and you cant use em either. Hope I actually helped this time :?
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 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: Australia

Re: Removing unit classes during a campaign mission script

Post by lucasfart »

SW_elite wrote:You go into your sides REQ file and take the units out that you dont want. Then they dont appear ingame and you cant use em either. Hope I actually helped this time :?
Not trying to dampen your spirits here but i think what Manderek means is, halfway through the campaign, make a certain unit no longer useable....
MandeRek
Sith Master
Sith Master
Posts: 2766
Joined: Tue Oct 02, 2007 10:51 am
Projects :: Battlefront Zer0
Games I'm Playing :: SWTOR
xbox live or psn: No gamertag set
Location: Ghosting around GT
Contact:

Re: Removing unit classes during a campaign mission script

Post by MandeRek »

Maveritchell wrote:You can't remove a unit class. You can make it inaccessible to the player (adding points requirement) and you can kill any unit that spawns as it (or teleport to a remote location and then kill, which would be preferable).
Okay that would do.. Is that something like KillOnSpawn?
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: Removing unit classes during a campaign mission script

Post by DarthD.U.C.K. »

[no lua-knowledge]i dont think you can use a function of this kind since it would kill the units right after the spawn, then they would lie all around the cp(s) (i think thats why zerted said telpotring before killing is better)[/no lua-knowledge]
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing unit classes during a campaign mission script

Post by Maveritchell »

MandeRek wrote:Okay that would do.. Is that something like KillOnSpawn?
It's like OnCharacterSpawn() (function) and then KillObject(). You use a check to confirm when a character spawns if it's the "wrong" class, and then kill it however you want.
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: Removing unit classes during a campaign mission script

Post by [RDH]Zerted »

DarthD.U.C.K. wrote:...(i think thats why zerted said telpotring before killing is better)
I never remember saying that. Personally, I would up the unlock points for the unit super high and kill any units spawning as that class as soon as they spawn. A short message telling the player why they just died would be nice too.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing unit classes during a campaign mission script

Post by Maveritchell »

[RDH]Zerted wrote:
DarthD.U.C.K. wrote:...(i think thats why zerted said telpotring before killing is better)
I never remember saying that. Personally, I would up the unlock points for the unit super high and kill any units spawning as that class as soon as they spawn. A short message telling the player why they just died would be nice too.
I said it a couple posts above; he was confused as to who posted. The reason that's best is because you don't have bodies visually littering the field when they're spawned and killed. The unlock points can control human players who want to spawn as that; the teleporting and killing is just to manage AI units.
Aman/Pinguin
Jedi
Jedi
Posts: 1104
Joined: Tue Jan 30, 2007 6:04 am
Projects :: Inactive
Location: Germany

Re: Removing unit classes during a campaign mission script

Post by Aman/Pinguin »

Don't forget to add an reinforcement point after killing the unit.
Post Reply