- Joined
- Jan 22, 2011
- Messages
- 3,980
I want a unit group to only contain 1 unit (the first unit the trigger can find that matches the conditions that unit has to have in order to be part of the group). Sounds complicated? let me explain.
I have a spell that searches for the closest enemy hero and deals damage to it. It doesn't matter how far he is, but he must be the closests to the caster. In order to do so I used a group using range (because I am assuming that if I use region it just picks all units in that region at once, and not just only one by one).
I set the group as a variable so I can delete it later using custom scripts to avoid leaks. But I don't know how to make the group only contain one unit. Any ideas? All help will be appreciated.
I have a spell that searches for the closest enemy hero and deals damage to it. It doesn't matter how far he is, but he must be the closests to the caster. In order to do so I used a group using range (because I am assuming that if I use region it just picks all units in that region at once, and not just only one by one).
I set the group as a variable so I can delete it later using custom scripts to avoid leaks. But I don't know how to make the group only contain one unit. Any ideas? All help will be appreciated.
Sincerely, Paillan