hey,
i made a spell to create 3 roaches. but if i use the spell again, i have 6 roaches. is it possible to kill the old roaches when i use the ability again?
Well, there is no data-only way I know of to store those specific roaches in some kind of variable. You can always kill all roaches with a map-wide search effect before you spawn new ones, but if you need a more exact solution, I would use triggers.
1st, map wide search, looking for Roaches with a behavior on them(the same behavior applied in step 3) and kill them if they are under your control and they have the buff.
An alternative would be to have a self destruct on the roaches linked to a requirement similar to the broodlords broodling limit so that if the owning unit summons more the fresh ones have a delay for the self destruct so the old ones die in preference until there are fewer than the desired amount.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
hey, i made a spell to create 3 roaches. but if i use the spell again, i have 6 roaches. is it possible to kill the old roaches when i use the ability again?
Well, there is no data-only way I know of to store those specific roaches in some kind of variable. You can always kill all roaches with a map-wide search effect before you spawn new ones, but if you need a more exact solution, I would use triggers.
@Kueken531: Go
Your ability could do 3 things.
1st, map wide search, looking for Roaches with a behavior on them(the same behavior applied in step 3) and kill them if they are under your control and they have the buff.
2nd, summon your roaches.
3rd, apply behavior to the roaches.
thats genious, this could solve this problem. thanks
An alternative would be to have a self destruct on the roaches linked to a requirement similar to the broodlords broodling limit so that if the owning unit summons more the fresh ones have a delay for the self destruct so the old ones die in preference until there are fewer than the desired amount.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg