Here is just some steps that I thought of that might make recycling dummies easy. I'd like to know if it would work and appreciate any input on it.
Setup:
1) Make a reincarnate ability with 0 cooldown and a defend ability that doesn't do anything.
2) Make a dummy unit. Give it the reincarnate ability and the defend ability.
3) Make a chaos ability that turns the unit into a dummy unit.
Main code ideas:
Some kind of
I think there is a "stop defending" order that fires when a unit reincarnates. This allows me to capture when the dummy dies. It will reincarnate, and at this time, I can give it the chaos ability (my idea is to erase any abilities it has). Then I add it to the recycle stack.
I haven't actually used the reincarnate + defend trick to detect when a unit reincarnates and I haven't used the chaos ability for anything, so I am not certain if my ideas will work. I also don't know how efficient this code would be - hopefully better than making new dummies each time. Just some thoughts and I'd rather get some feedback before experimenting.
Setup:
1) Make a reincarnate ability with 0 cooldown and a defend ability that doesn't do anything.
2) Make a dummy unit. Give it the reincarnate ability and the defend ability.
3) Make a chaos ability that turns the unit into a dummy unit.
Main code ideas:
Some kind of
spawnDummy(myPlayer, x, y)
function that will allow getting dummies whether recycled or not. When it spawns one or takes a recycled one, it will order the dummy to defend.I think there is a "stop defending" order that fires when a unit reincarnates. This allows me to capture when the dummy dies. It will reincarnate, and at this time, I can give it the chaos ability (my idea is to erase any abilities it has). Then I add it to the recycle stack.
I haven't actually used the reincarnate + defend trick to detect when a unit reincarnates and I haven't used the chaos ability for anything, so I am not certain if my ideas will work. I also don't know how efficient this code would be - hopefully better than making new dummies each time. Just some thoughts and I'd rather get some feedback before experimenting.