ianu74
New Member
- Reaction score
- 8
I've made a trigger for a boomerang-like skill, dragging units towards you. However, after using it for some time, the game becomes quite laggy.
Can anyone see if there are any leaks in the trigger?
Can anyone see if there are any leaks in the trigger?
Trigger:
- Boomerang
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Boomerang Pull (Neutral Hostile)
- Actions
- Set Temp_point = (Position of (Triggering unit))
- Set BoomerangNo = (BoomerangNo + 1)
- Unit - Create 1 Boomerang for (Owner of (Triggering unit)) at Temp_point facing (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Custom script: call RemoveLocation(udg_Temp_point)
- Set Boomerang[BoomerangNo] = (Last created unit)
- Set BoomerangThrower[BoomerangNo] = (Triggering unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- BoomerangNo Greater than 3
- Then - Actions
- Set BoomerangNo = 0
- Else - Actions
- If - Conditions
- Events
Trigger:
- Boomerang Movement
- Events
- Time - Every 0.02 seconds of game time
- Conditions
- Actions
- For each (Integer A) from 1 to 4, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Boomerang[(Integer A)] is alive) Equal to True
- Then - Actions
- Set BoomerangPulledGroup[(Integer A)] = (Units within 360.00 of (Position of Boomerang[(Integer A)]) matching ((((Matching unit) belongs to an enemy of (Owner of Boomerang[(Integer A)])) Equal to True) and (((Matching unit) is A Hero) Equal to False)))
- Unit Group - Pick every unit in BoomerangPulledGroup[(Integer A)] and do (Actions)
- Loop - Actions
- Set Temp_point = (Position of (Picked unit))
- Set Temp_point2 = (Temp_point offset by 30.00 towards (Facing of Boomerang[(Integer A)]) degrees)
- Unit - Move (Picked unit) instantly to Temp_point2
- Custom script: call RemoveLocation(udg_Temp_point2)
- Custom script: call RemoveLocation(udg_Temp_point)
- Loop - Actions
- Custom script: call DestroyGroup(udg_BoomerangPulledGroup[1])
- Custom script: call DestroyGroup(udg_BoomerangPulledGroup[2])
- Custom script: call DestroyGroup(udg_BoomerangPulledGroup[3])
- Custom script: call DestroyGroup(udg_BoomerangPulledGroup[4])
- Unit - Set the custom value of Boomerang[(Integer A)] to ((Custom value of Boomerang[(Integer A)]) + 1)
- Set Temp_point2 = (Position of Boomerang[(Integer A)])
- Set Temp_point = (Temp_point2 offset by 30.00 towards (Facing of Boomerang[(Integer A)]) degrees)
- Unit - Move Boomerang[(Integer A)] instantly to Temp_point
- Custom script: call RemoveLocation(udg_Temp_point)
- Custom script: call RemoveLocation(udg_Temp_point2)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of Boomerang[(Integer A)]) Greater than 35
- Then - Actions
- Unit - Make Boomerang[(Integer A)] face BoomerangThrower[(Integer A)] over 0.00 seconds
- Else - Actions
- If - Conditions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer A) from 1 to 4, do (Actions)
- Events