Hey iceteaftw.
So a leak is any bit of information that is not removed once used. Locations like (Position of Unit), (Center of Region) leak. Groups leak as well. There's a whole bunch of things that you have to watch out for. If there's too many leaks the game's performance will drop and eventually become unplayable.
MUI, as said above, stands for multi-unit instanceability. It's a fancy little word that means multiple units can do a thing and it will work.
Now, on to the triggers.
---
Time shift trigger:
-
Set facing_of_caster = (Angle from (Position of caster[writeindex_TS]) to (Target point of ability being cast))
This leaks as you're not using your variable, 'position of cast[writeindex_TS]', but the function. As with '(Target point of ability being cast)', you need to put your variable 'reach_point' there instead. It should look like this:
-
Set facing_of_caster = (Angle from position_of_caster[writeindex_TS] to reach_point[writeindex_TS])
---
-
Animation - Change (Triggering unit)'s vertex coloring to (40.00%, 40.00%, 40.00%) with 40.00% transparency
-
Unit - Make (Triggering unit) Invulnerable
-
Unit - Turn collision for (Triggering unit) Off
You could replace the (Triggering unit) with your variable 'caster[writeindex_TS]'. It will function the same and run more efficiently.
---
You have to destroy the 'unit_group' variable else it will leak. Since you're using a variable, destroy it with the following:
-
freeze all enemies
-
Events
-
Conditions
-
Actions
-
Set unit_group = (Units within 400.00 of (Position of caster[writeindex_TS]) matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of caster[writeindex_TS])) Equal to True)))
-
Unit Group - Pick every unit in unit_group and do (Actions)
-
Loop - Actions
-
Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
-
Unit - Pause (Picked unit)
-
Custom script: call DestroyGroup(udg_unit_group)
---
You could probably merge the four triggers into two triggers. I'm not 100% on that one though.
---
The following leaks two locations:
-
Unit - Move caster[writeindex_TS] instantly to ((Position of caster[writeindex_TS]) offset by 50.00 towards (Angle from (Position of caster[writeindex_TS]) to reach_point[writeindex_TS]) degrees)
You need to set (Position of caster[writeindex_TS]) as your location variable, and another location as the offset. You must destroy the variable later on as well.
Example:
-
Set Point2 = (position_of_caster[writeindex_TS] offset by 50.00 towards (Angle from position_of_caster[writeindex_TS] to reach_point[writeindex_TS]) degrees)
-
Unit - Move caster[writeindex_TS] instantly to Point2
-
Custom script: call RemoveLocation(udg_Point2)
---
You're leaking one location here:
-
(Distance between (Position of caster[writeindex_TS]) and reach_point[writeindex_TS]) Less than 100.00
Just replace it with your position_of_caster[writeindex_TS] variable.
---
You should move the 'call DestroyGroup' function outside of the group loop so it runs properly.
-
Unit Group - Pick every unit in unit_group and do (Actions)
-
Loop - Actions
-
Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
-
Unit - Unpause (Picked unit)
-
Custom script: call DestroyGroup(udg_unit_group)
-
--->
-
Unit Group - Pick every unit in unit_group and do (Actions)
-
Loop - Actions
-
Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
-
Unit - Unpause (Picked unit)
-
Custom script: call DestroyGroup(udg_unit_group)
---
Chronosphere trigger:
come inside trigger:
Try to avoid using .01 intervals. .03 is the lowest you should ever need.
-
Time - Every 0.01 seconds of game time
-
--->
-
Time - Every 0.03 seconds of game time
The groups leak four times as well, one location and one group for the two of them. You need to destroy both of them, like this:
-
Actions
-
Set Point2 = (Position of dummy_effect[writeindex_TS])
-
Set unit_group_chro[maxindex_CH] = (Units within 400.00 of Point2 matching ((Unit-type of (Matching unit)) Not equal to Faceless Void))
-
Unit Group - Pick every unit in unit_group_chro[maxindex_CH] and do (Actions)
-
Custom script: call RemoveLocation(udg_Point2)
-
Custom script: call DestroyGroup(udg_unit_group)
-
Set Point2 = (Position of dummy_effect[(maxindex_CH - 1)])
-
Set unit_group_chro[(maxindex_CH - 1)] = (Units within 400.00 of Point2 matching ((Unit-type of (Matching unit)) Not equal to Faceless Void))
-
Unit Group - Pick every unit in unit_group_chro[(maxindex_CH - 1)] and do (Actions)
-
Custom script: call DestroyGroup(udg_unit_group)
-
Custom script: call RemoveLocation(udg_Point2)
To ensure that those units have the animation speed reset when the spell is done, add them to another indexed unit group, when the spell is done pick up all in the indexed unit group, reset their animation speeds and clear the group. Do not destroy re-usable groups.
---
You should turn off the loop when the spell is done as well.
---
Backtrack trigger:
-
Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Faceless Void)) and do (Actions)
-
Loop - Actions
-
Trigger - Add to damaged <gen> the event (Unit - (Picked unit) Takes damage)
-
--->
-
Trigger - Add to damaged <gen> the event (Unit - (Triggering unit) Takes damage)
---
Damaged trigger:
This trigger can be simplified to the following:
-
damaged
-
Events
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Random integer number between 0 and 100) Less than or equal to (5 + ((Level of Backtrack for (Triggering unit)) x 5))
-
Then - Actions
-
Set damage_taken = (Damage taken)
-
Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Weapons\WingedSerpentMissile\WingedSerpentMissile.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + damage_taken)
-
Else - Actions