'Unit within range' problem

Hadezown

TH.net Regular
Reaction score
5
I have 2 triggers, in the first one an ability is cast which causes a 'snowball' projectile (a locust unit) to move. Then in the second trigger if a unit comes within range of the projectile it takes damaged. Ive already done the move trigger but im have problems with the 'unit within range' trigger. More than one player can use this ability.

Trigger1:

Code:
Events
    Unit - A unit Starts the effect of an ability

Actions
    Unit - Create 1 SnowBall for (Owner of (Triggering unit)) at AA_Point facing Default building facing degrees
    Set Snowball_unit[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
    Trigger - Add to Fsnowball hit <gen> the event (Unit - A unit comes within 50.00 of Snowball_unit[(Player number of (Owner of (Triggering unit)))])

Trigger2 (Fsnowball hit)

Code:
Actions
    For each (Integer Hit_Integer) from 1 to 8, do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) belongs to an enemy of (Owner of Snowball_unit[Hit_Integer])) Equal to True
                Then - Actions
                    Unit - Cause Snowball_unit[Hit_Integer] to damage (Triggering unit), dealing (50.00 + (25.00 x (Real((Level of Fast Snowball for Snowball_caster[Hit_Integer]))))) damage of attack type Chaos and damage type Normal
                Else - Actions

The Actual Problem:
This trigger works pretty great except that if there is more than one snowball being thrown at the same time, the unit within range of a player's snowball will take damage from that snowball AND all of his allie's snowballs, if they exist.
I tried using a condition 'snowball is in (within range of triggering unit)' . but i think because its a locust unit it doesnt work..

Anyone have a solution for this?
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
Edit: Eh I should read the trigger first :p wait, looking into it..
EDIT2: Try adding another condition to the Is Player Enemy: Is Distance between Snowball_unit[Hit_Integer] and Triggering Unit equal or less than 50.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top