I have this ability that spawns a unit which I want to last forever. I want it so only one of these can exist at a time. My problem is I can't figure out how to destroy the old unit when the ability is spawning a new one.
You can make a validator / requirement ... not sure which one... that returns true or false if a specific unit type is owned by the player or not..... if this returns true that the player has none of this unit type... then spawn one.... if not .... dont spawn one.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Thanks for the help but what I am looking for is a way to destroy a unit once the ability is being cast again. The units are supposed to last forever unless a new one is being made.
What's about a behaviour applied to that unit type that initially searches for other units of the same type controlled by the same player and destroys them?
I have this ability that spawns a unit which I want to last forever. I want it so only one of these can exist at a time. My problem is I can't figure out how to destroy the old unit when the ability is spawning a new one.
Maybe that can de done with a validator. I don't know how exactly, but it should be doable, check em out (the validators).
That would prevent you from using the ability again as long as the other lives. (or maybe someone knows how you can do that with data)
The other way would be with triggers. Looks easier to me with triggers (and it is perfectly possible as you describe it).
You can make a validator / requirement ... not sure which one... that returns true or false if a specific unit type is owned by the player or not..... if this returns true that the player has none of this unit type... then spawn one.... if not .... dont spawn one.
Thanks for the help but what I am looking for is a way to destroy a unit once the ability is being cast again. The units are supposed to last forever unless a new one is being made.
What's about a behaviour applied to that unit type that initially searches for other units of the same type controlled by the same player and destroys them?
@madmaxII: Go
Maybe my problem is I dont know how to destroy a unit other than using the events/action destroy thing. I dont know.