So I set a trigger: (attacking unit) == Probe [115.23, 98.47]
but now I need to know when Probe [115.23, 98.47] dies, I want a new probe to spawn (I got that part) but I want the new probe to also trigger the event.
I started using this editor yesterday so I'm not very amazing yet...
Thanks in advance :D
if this question doesn't make sense, plz ask for more details.
Sounds like you need a global variable that is a unit group.
You add the probe you have to the unit group on map init or however you have it, then when the probe dies you remove it from the unit group, then spawn another probe and add last created unit to the unit group.
Or on map init set a unit variable to be that probe, then u can just use your variable when checking attacking unit == MyVar. On create of a new probe simply assign that probe to the variable.
So let's say 2 probes get killed in an AoE blast that also kills 2 marines, 6 Thors and a zergling...how do I ensure that only the probe dying is what makes a new probe?
I'm hella confused because i can't figure out how to make a new probe just be a probe...without it having already been on the map initially. i can set a variable PP1 to be the var for the Probe that's on the map...but I can't figure out how to make a new probe just be a probe without having to give it the initial coords of the one on the map.
I just want to type, if it were C##
Probe(00.1, 455.39) = global.PP1
if (global.PP1 = dead)
{
create PP1 (0.001, 245.29);
}
that way it'll make a new probe with the global var already assigned to it.
Because the condition for that trigger to work is that the the unit that dies is the unit in the p1probe variable. Here: (Triggering unit) == p1probe
EDIT::
I think you are really overcomplicating this.. The trigger that I posted above spawns a new probe when the p1probe dies and assigns the new probe to p1probe. Before you can use that trigger, you must either have a probe set to p1probe initially or use another trigger to spawn the initial probe and set it to p1probe.
Ok, I see how I was overcomplicating it and now it's working.
maybe if I explained what I'm trying to do it'll be more helpful.
Brief Overview:
The map is a normal melee map and each unit is stock. You start off with 15 marines and a probe. Your goal is to kill the other team's probe. (of course there are other factors to make this more exciting) I just need it to when the probe dies, another exact copy is made.
With your code above; when the unit dies it creates another unit with the variable. Everything works great, but when the second created unit dies it doesn't create a new one.
Your goal is to kill the other team's probe. (of course there are other factors to make this more exciting) I just need it to when the probe dies, another exact copy is made.
I know you solved it, but you mentioned overcomplicating so I figured I'd just mention how I'd have done it:
event: on unit death
condition: unit type of triggering unit = probe
action: create 1 probe for triggering player
simplest way to get a new probe without even needing a variable - just a thought :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I set a trigger: (attacking unit) == Probe [115.23, 98.47] but now I need to know when Probe [115.23, 98.47] dies, I want a new probe to spawn (I got that part) but I want the new probe to also trigger the event.
I started using this editor yesterday so I'm not very amazing yet...
Thanks in advance :D
if this question doesn't make sense, plz ask for more details.
Sounds like you need a global variable that is a unit group.
You add the probe you have to the unit group on map init or however you have it, then when the probe dies you remove it from the unit group, then spawn another probe and add last created unit to the unit group.
Or on map init set a unit variable to be that probe, then u can just use your variable when checking attacking unit == MyVar. On create of a new probe simply assign that probe to the variable.
@johnsmithlol: Go
Well maybe I like unit groups better. :P
Should be the same result either way.
Thanks for the help guys!
SO on my map init I have p1probe = Probe [115.23, 98.47] <Unit (Constant)>
I'm confused how to set the var to a new probe when it's created :L
First, don't make the unit variable constant or you can't change it.
then:
So let's say 2 probes get killed in an AoE blast that also kills 2 marines, 6 Thors and a zergling...how do I ensure that only the probe dying is what makes a new probe?
I'm hella confused because i can't figure out how to make a new probe just be a probe...without it having already been on the map initially. i can set a variable PP1 to be the var for the Probe that's on the map...but I can't figure out how to make a new probe just be a probe without having to give it the initial coords of the one on the map.
I just want to type, if it were C##
Probe(00.1, 455.39) = global.PP1
if (global.PP1 = dead) { create PP1 (0.001, 245.29); }
that way it'll make a new probe with the global var already assigned to it.
Because the condition for that trigger to work is that the the unit that dies is the unit in the p1probe variable. Here: (Triggering unit) == p1probe
EDIT::
I think you are really overcomplicating this.. The trigger that I posted above spawns a new probe when the p1probe dies and assigns the new probe to p1probe. Before you can use that trigger, you must either have a probe set to p1probe initially or use another trigger to spawn the initial probe and set it to p1probe.
Ok, I see how I was overcomplicating it and now it's working.
maybe if I explained what I'm trying to do it'll be more helpful.
Brief Overview: The map is a normal melee map and each unit is stock. You start off with 15 marines and a probe. Your goal is to kill the other team's probe. (of course there are other factors to make this more exciting) I just need it to when the probe dies, another exact copy is made.
With your code above; when the unit dies it creates another unit with the variable. Everything works great, but when the second created unit dies it doesn't create a new one.
That's weird.
Try removing the conditions and changing the Event to Unit - p1probe dies
Solved, I was misunderstanding your instructions! Thanks for your help.
Variable - Set MyVar = (Last created unit)@speizzer: Go
I know you solved it, but you mentioned overcomplicating so I figured I'd just mention how I'd have done it: event: on unit death condition: unit type of triggering unit = probe action: create 1 probe for triggering player
simplest way to get a new probe without even needing a variable - just a thought :)