Page 1 of 1
Removing unit classes during a campaign mission script
Posted: Thu Jan 14, 2010 5:59 pm
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
Re: Removing unit classes during a campaign mission script
Posted: Thu Jan 14, 2010 9:09 pm
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).
Re: Removing unit classes during a campaign mission script
Posted: Fri Jan 15, 2010 3:59 am
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

Re: Removing unit classes during a campaign mission script
Posted: Fri Jan 15, 2010 6:40 am
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....
Re: Removing unit classes during a campaign mission script
Posted: Fri Jan 15, 2010 11:38 am
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?
Re: Removing unit classes during a campaign mission script
Posted: Fri Jan 15, 2010 11:47 am
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]
Re: Removing unit classes during a campaign mission script
Posted: Fri Jan 15, 2010 3:20 pm
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.
Re: Removing unit classes during a campaign mission script
Posted: Sat Jan 16, 2010 5:06 pm
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.
Re: Removing unit classes during a campaign mission script
Posted: Sat Jan 16, 2010 5:10 pm
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.
Re: Removing unit classes during a campaign mission script
Posted: Mon Jan 18, 2010 2:20 am
by Aman/Pinguin
Don't forget to add an reinforcement point after killing the unit.