I used:
TriggerAddEventUnitRange(lp_trigger, null, lp_unit, lp_range, true);
to add a projectile to a trigger I want to respond to collisions for that projectile.
The problem is, when the event fires I can only get the unit that came within range of the projectile (using Triggering Unit).
How the heck do I determine which projectile the triggering unit came within range of that fired off the event?
There is no way to get that unit easily. If this "gets in range of unit" thing works like it did in wc3 it is simply a periodic timer which checks for nearby units ... no magic ;)
What you could do would be saving your missles in a global unit group and use
ForEachUnitIn your missle group
if DistanceBetween(current missle, event unit) <= your distance (+tolerance) then
set variable unit_that_the_event_unit_came_in_range_of = current missle
not perfect, but I used something similiar in wc3 to work around just the same problem :)
gl hf
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I used: TriggerAddEventUnitRange(lp_trigger, null, lp_unit, lp_range, true); to add a projectile to a trigger I want to respond to collisions for that projectile.
The problem is, when the event fires I can only get the unit that came within range of the projectile (using Triggering Unit).
How the heck do I determine which projectile the triggering unit came within range of that fired off the event?
There is no way to get that unit easily. If this "gets in range of unit" thing works like it did in wc3 it is simply a periodic timer which checks for nearby units ... no magic ;)
What you could do would be saving your missles in a global unit group and use
ForEachUnitIn your missle group
if DistanceBetween(current missle, event unit) <= your distance (+tolerance) then
set variable unit_that_the_event_unit_came_in_range_of = current missle
not perfect, but I used something similiar in wc3 to work around just the same problem :)
gl hf