Unit - Probe [38.75, 16.17] Enters a distance of 5.0 from Zergling [10.42, 18.92]
Unit - Kill (Triggering unit)
And of course, when I move the Zergling close to the probe, the probe dies.
But when I do this:
Game - Map initialization
Unit Group - Add Zergling [10.42, 18.92] to NormalAttack
Unit - Probe [38.75, 16.17] Enters a distance of 5.0 from (Unit 1 from NormalAttack)
Unit - Kill (Triggering unit)
The probe does not die.
So, wondering if my Zergling is really "Unit 1" from "NormalAttack", I make a quick test:
UI - Player Any Player presses H key Down with shift Allow, control Allow, alt Allow
Unit - Kill (Unit 1 from NormalAttack)
And the Zergling dies. It is indeed that unit.
It is important for me to figure out unit groups, because I will need to add units created during the course of play to a group to check with other things.
What you need to do is set the Event to "Probe enters a distance of 5.0 from Any Unit" and then make a condition to check whether it was indeed Unit 1 From NormalAttack.
Dont use unit count from unit group. It is unreliable and not following a first come first serve basis, and may also varies from time to time (my experience). Use an array of unit instead if you want precise call of an unit. In your case, if your unit group contain only 1 unit, it might be a bug
What you need to do is set the Event to "Probe enters a distance of 5.0 from Any Unit" and then make a condition to check whether it was indeed Unit 1 From NormalAttack.
Hmm, "any unit" you say? I can't find a choice like that. Just things like "unit from unit group", "random unit from unit group", etc...
Dont use unit count from unit group. It is unreliable and not following a first come first serve basis, and may also varies from time to time (my experience). Use an array of unit instead if you want precise call of an unit. In your case, if your unit group contain only 1 unit, it might be a bug
Well, maybe you mean the same thing, but I'm not using "unit count"; I'm using "unit from unit group", which specifically refers to the one and only unit in the group through "index 1". It should be so simple, but it just doesn't work.
I have tried using an array, and it also has failed to work. An array of units doesn't seem to be much different from a group of units, and neither of them are working...
Well, maybe you mean the same thing, but I'm not using "unit count"; I'm using "unit from unit group", which specifically refers to the one and only unit in the group through "index 1". It should be so simple, but it just doesn't work.
I have tried using an array, and it also has failed to work. An array of units doesn't seem to be much different from a group of units, and neither of them are working...
You are right, the event really needs a specific, predefined unit (you could use a constant.. but that doesnt make much of a sense). on top of that, in the current version of the editor, we cant change trigger events on the fly, like in the wc 3 editor (eg. trigger - add event "last created unit enters range 5.0 of unit). this ultimately leads to you not being able to use this workaround.. which is what i tried to do..
if i were you, id rather give the unit in question a permanent search area ability (range 5.0) which searches for a specific unit type.. then make the effect a dummy which causes nothing.. and then, in trigger editor, just make an event trigger "dummy_1 effect is caused by any unit" -> "kill triggering unit" or if you want it the other way around "kill caster of ability being cast".. or smth. like that.. that should work in any case :P
You are right, the event really needs a specific, predefined unit (you could use a constant.. but that doesnt make much of a sense). on top of that, in the current version of the editor, we cant change trigger events on the fly, like in the wc 3 editor (eg. trigger - add event "last created unit enters range 5.0 of unit). this ultimately leads to you not being able to use this workaround.. which is what i tried to do..
if i were you, id rather give the unit in question a permanent search area ability (range 5.0) which searches for a specific unit type.. then make the effect a dummy which causes nothing.. and then, in trigger editor, just make an event trigger "dummy_1 effect is caused by any unit" -> "kill triggering unit" or if you want it the other way around "kill caster of ability being cast".. or smth. like that.. that should work in any case :P
Search Area ability? It seems like you are referring to something from the data editor.
Here is what I am actually trying to do: have a projectile kill a unit when it comes close enough.
There are a few tutorials out there for creating projectiles using things like Banelings on patrol, and almost none on using the data editor. I can reproduce these with success, but I find them limiting. I have avoided the data editor so far because I have looked at it and it seems overly complicated.
It's easy enough for me to copy the "data editor missiles" of other maps, but they don't cover all the attributes of a projectile I would like to have, so I hit a wall. For example, I want the projectile to be unspammable and limited to 2 alive on screen at a time. I don't want to simply cut the rate of fire to produce this effect. Or what if I want a missile that after reaching a region, changes direction? I feel I could manage these with triggers (if they would work as expected), but in the data editor I have no idea where to begin.
The data editor seems overly complicated, because it is. But being complicated means it lets us do alot of things that are pretty mind blowing. For example, you could put a search on your enemy units, still fire with triggers, but don't hit check with triggers. The search on the enemy units would be the hitcheck.
If I remember, Beider has a tutorial on a speed aura, which will show you how to make a behavior that searches. After you make that, just have the effect like gh0st00 said.
Have a variable set to that unit you are trying to call as unit 1 of normal attack.
Remember that units in the unitgroup array don't fall to the same index the way they did in a previous unitgroup action.
What happens is the code grabs units and puts them in a unit group array. index 0, index 1, etc. It's not always the same unless you have a unit group variable which is assigned only once with units. Assigning even the same set of units to that group may not put the said units in the same order as before.
Rollback Post to RevisionRollBack
Whatever you do, wholeheartedly, moment by heartfelt moment, becomes a tool for the expression of your very soul.
To post a comment, please login or register a new account.
I can do something simple like:
Unit - Probe [38.75, 16.17] Enters a distance of 5.0 from Zergling [10.42, 18.92]
Unit - Kill (Triggering unit)
And of course, when I move the Zergling close to the probe, the probe dies.
But when I do this:
Game - Map initialization
Unit Group - Add Zergling [10.42, 18.92] to NormalAttack
Unit - Probe [38.75, 16.17] Enters a distance of 5.0 from (Unit 1 from NormalAttack)
Unit - Kill (Triggering unit)
The probe does not die.
So, wondering if my Zergling is really "Unit 1" from "NormalAttack", I make a quick test:
UI - Player Any Player presses H key Down with shift Allow, control Allow, alt Allow
Unit - Kill (Unit 1 from NormalAttack)
And the Zergling dies. It is indeed that unit.
It is important for me to figure out unit groups, because I will need to add units created during the course of play to a group to check with other things.
What you need to do is set the Event to "Probe enters a distance of 5.0 from Any Unit" and then make a condition to check whether it was indeed Unit 1 From NormalAttack.
@HeroicPrinny: Go
Dont use unit count from unit group. It is unreliable and not following a first come first serve basis, and may also varies from time to time (my experience). Use an array of unit instead if you want precise call of an unit. In your case, if your unit group contain only 1 unit, it might be a bug
Hmm, "any unit" you say? I can't find a choice like that. Just things like "unit from unit group", "random unit from unit group", etc...
Well, maybe you mean the same thing, but I'm not using "unit count"; I'm using "unit from unit group", which specifically refers to the one and only unit in the group through "index 1". It should be so simple, but it just doesn't work.
I have tried using an array, and it also has failed to work. An array of units doesn't seem to be much different from a group of units, and neither of them are working...
You are right, the event really needs a specific, predefined unit (you could use a constant.. but that doesnt make much of a sense). on top of that, in the current version of the editor, we cant change trigger events on the fly, like in the wc 3 editor (eg. trigger - add event "last created unit enters range 5.0 of unit). this ultimately leads to you not being able to use this workaround.. which is what i tried to do..
if i were you, id rather give the unit in question a permanent search area ability (range 5.0) which searches for a specific unit type.. then make the effect a dummy which causes nothing.. and then, in trigger editor, just make an event trigger "dummy_1 effect is caused by any unit" -> "kill triggering unit" or if you want it the other way around "kill caster of ability being cast".. or smth. like that.. that should work in any case :P
Search Area ability? It seems like you are referring to something from the data editor.
Here is what I am actually trying to do: have a projectile kill a unit when it comes close enough.
There are a few tutorials out there for creating projectiles using things like Banelings on patrol, and almost none on using the data editor. I can reproduce these with success, but I find them limiting. I have avoided the data editor so far because I have looked at it and it seems overly complicated.
It's easy enough for me to copy the "data editor missiles" of other maps, but they don't cover all the attributes of a projectile I would like to have, so I hit a wall. For example, I want the projectile to be unspammable and limited to 2 alive on screen at a time. I don't want to simply cut the rate of fire to produce this effect. Or what if I want a missile that after reaching a region, changes direction? I feel I could manage these with triggers (if they would work as expected), but in the data editor I have no idea where to begin.
The data editor seems overly complicated, because it is. But being complicated means it lets us do alot of things that are pretty mind blowing. For example, you could put a search on your enemy units, still fire with triggers, but don't hit check with triggers. The search on the enemy units would be the hitcheck.
If I remember, Beider has a tutorial on a speed aura, which will show you how to make a behavior that searches. After you make that, just have the effect like gh0st00 said.
Have a variable set to that unit you are trying to call as unit 1 of normal attack.
Remember that units in the unitgroup array don't fall to the same index the way they did in a previous unitgroup action.
What happens is the code grabs units and puts them in a unit group array. index 0, index 1, etc. It's not always the same unless you have a unit group variable which is assigned only once with units. Assigning even the same set of units to that group may not put the said units in the same order as before.
Whatever you do, wholeheartedly, moment by heartfelt moment, becomes a tool for the expression of your very soul.