If the number of ultralisks in region 1==0 and if the number of siege tanks in region 1==0, then kill unit pylon [25.00, 105.00] else kill pylon [37.00, 105.00]
Im not entirely sure, but I think if you test to see if a unit is in a certain region, and it's dead, its corpse might still be there. Make sure you're checking if there's any alive units in the region, that will exclude corpses.
if you want to do it a lot cleaner and need to kill more than just 2 units do it like this:
global unit array[number of units] UNITS
global integer COUNTER = 0
on init:
UNITS[0] = first unit
UNITS[1] = second unit
....
whenever you want to kill a unit:
kill UNITS[COUNTER]
COUNTER = COUNTER + 1
So, the title basically says it all. Is there an action that kill a certain unit, but kills a different unit if the first one is dead?
Thanks!
If/then/else function
@BasharTeg: Go
I have tried this, but when I put the second unit in the else it doesn't get killed
What conditions are you using in the function?
@BasharTeg: Go
If the number of ultralisks in region 1==0 and if the number of siege tanks in region 1==0, then kill unit pylon [25.00, 105.00] else kill pylon [37.00, 105.00]
Thank you for your help
http://starcraftmapping.de/gui.php?id=77
Just set each unit to a avariable, and if Unit[1] Dies, kill Unit[2]
@Pshyched: Go
I don't want unit to die after unit 1, I want unit one to die the first time the trigger runs and then unit 2 the second time.
Thanks for your help!
Im not entirely sure, but I think if you test to see if a unit is in a certain region, and it's dead, its corpse might still be there. Make sure you're checking if there's any alive units in the region, that will exclude corpses.
global variable: zomgdead
trigger:
event: w/e
action:
if
- zomgdead=0
then
- kill SC2Mapster
- modify variable, zomgdead + 1
else
- if
- - zomgdead = 1
then
- - kill Staredit
- - modify variable, zomgdead + 1
else
- - - if
- - - zomgdead = 2
then
- - - kill BNet
- - - modify variable, zomgdead + 1
else
- - - - if
etc. etc. etc.