Ok, say I wanted to spawn a unit at around 20 minutes. I think the easiest way to do this would be to... well.. spawn the unit at 20 minutes. But now, if I want to check if that unit has died to give the killing player some minerals or something, I can't, because the unit does not exist on the map.
Of course, a workaround is placing the unit there at the start and making it completely translucent, and then at the 20 minute mark, make it visible. The problem is that this unit can still be attacked(I just figured this out as I was posting lol), and it also takes up collision space.
So how do I make a trigger for a dynamically created unit. I don't script galaxy, so I can't read that stuff.
If your only using one unit make a unit variable, then when you create that unit right after in that trigger that made it have a Set Variable Action Last Created Unit = <Unit Variable>. If you want more than one unit then make a Unit Group Variable.
Then for you money Trigger you just need to use Any Unit Dies Event, Triggering unit is <Unit Variable> for one unit, or Triggering Unit in <Unit Group Variable> for many units Condition. Your Actions are Set or Add X Minerals, Gas, or both to Player A .
My Projects:
Sorted Multiplayer Leader Board
Card Shuffle Dialog Demo
Air Wars Mass
Blizzard Fan since Starcraft. The Single Player story is AMAZING IMO, I can't wait for the Expansions. In Warcraft 3 I only enjoy the Custom Maps scene (& Blizzards...
To post a comment, please login or register a new account.
Ok, say I wanted to spawn a unit at around 20 minutes. I think the easiest way to do this would be to... well.. spawn the unit at 20 minutes. But now, if I want to check if that unit has died to give the killing player some minerals or something, I can't, because the unit does not exist on the map.
Of course, a workaround is placing the unit there at the start and making it completely translucent, and then at the 20 minute mark, make it visible. The problem is that this unit can still be attacked(I just figured this out as I was posting lol), and it also takes up collision space.
So how do I make a trigger for a dynamically created unit. I don't script galaxy, so I can't read that stuff.
Create Unit Set Variable to last created unit.
When any unit dies if dying unit = unit variable from before Give minerals to killing player.
@PsionicData: Go
If your only using one unit make a unit variable, then when you create that unit right after in that trigger that made it have a Set Variable Action Last Created Unit = <Unit Variable>. If you want more than one unit then make a Unit Group Variable.
Then for you money Trigger you just need to use Any Unit Dies Event, Triggering unit is <Unit Variable> for one unit, or Triggering Unit in <Unit Group Variable> for many units Condition. Your Actions are Set or Add X Minerals, Gas, or both to Player A .