Removing unit classes during a campaign mission script
Moderator: Moderators
-
MandeRek
- Sith Master

- Posts: 2766
- Joined: Tue Oct 02, 2007 10:51 am
- Projects :: Battlefront Zer0
- xbox live or psn: No gamertag set
- Location: Ghosting around GT
- Contact:
Removing unit classes during a campaign mission script
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
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
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Removing unit classes during a campaign mission script
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).
- SW_elite
- Filthy Thief

- Posts: 507
- Joined: Sat Jan 02, 2010 6:43 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia!!!
Re: Removing unit classes during a campaign mission script
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 
- lucasfart
- Sith

- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Removing unit classes during a campaign mission script
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....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
-
MandeRek
- Sith Master

- Posts: 2766
- Joined: Tue Oct 02, 2007 10:51 am
- Projects :: Battlefront Zer0
- xbox live or psn: No gamertag set
- Location: Ghosting around GT
- Contact:
Re: Removing unit classes during a campaign mission script
Okay that would do.. Is that something like KillOnSpawn?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).
- DarthD.U.C.K.
- 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
[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]
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Removing unit classes during a campaign mission script
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.MandeRek wrote:Okay that would do.. Is that something like KillOnSpawn?
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Removing unit classes during a campaign mission script
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.DarthD.U.C.K. wrote:...(i think thats why zerted said telpotring before killing is better)
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Removing unit classes during a campaign mission script
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.[RDH]Zerted wrote: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.DarthD.U.C.K. wrote:...(i think thats why zerted said telpotring before killing is better)
-
Aman/Pinguin
- Jedi

- Posts: 1104
- Joined: Tue Jan 30, 2007 6:04 am
- Projects :: Inactive
- Location: Germany
Re: Removing unit classes during a campaign mission script
Don't forget to add an reinforcement point after killing the unit.
