sentrywiz
S
sentrywiz
This thread is in addition to this thread here: Map Huge Lag (Can't find issue)
It involves my "progress" to solve massive lag in a map of mine.
I have redone the triggers for skillshot missiles, because they had huge parts of triggers and I couldn't find the leaks using nhocklanhox6's memory leak checker
I now have a simpler, cleaner and much more effective missile system but the Leak Finder still reports on lots of leaks, most of them being Group Leaks that I cannot see or find, because the only group I use, I clean.
These are the triggers:
It involves my "progress" to solve massive lag in a map of mine.
I have redone the triggers for skillshot missiles, because they had huge parts of triggers and I couldn't find the leaks using nhocklanhox6's memory leak checker
I now have a simpler, cleaner and much more effective missile system but the Leak Finder still reports on lots of leaks, most of them being Group Leaks that I cannot see or find, because the only group I use, I clean.
These are the triggers:
-
Missile Launch
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


Or - Any (Conditions) are true
-



Conditions
-




(Ability being cast) Equal to Attack (Staff)
-




(Ability being cast) Equal to Attack (Spear)
-




(Ability being cast) Equal to Attack (Knife)
-
-
-
-

Actions
-


Set missile_PlayerNumber = (Player number of (Owner of (Triggering unit)))
-


Set missile_launcher[missile_PlayerNumber] = (Casting unit)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Ability being cast) Equal to Attack (Staff)
-
-



Then - Actions
-




Set missile_model[missile_PlayerNumber] = Staff Dummy
-




Set missile_speed[missile_PlayerNumber] = 35.00
-




Set missile_damage[missile_PlayerNumber] = 50.00
-




Set missile_hit_range[missile_PlayerNumber] = ITEM_Staff_Hit[missile_PlayerNumber]
-




Set missile_travel_range[missile_PlayerNumber] = ITEM_Staff_Range[missile_PlayerNumber]
-




Set missile_loc_start[missile_PlayerNumber] = (Position of missile_launcher[missile_PlayerNumber])
-




Set missile_loc_end[missile_PlayerNumber] = (Target point of ability being cast)
-




Unit - Create 1 missile_model[missile_PlayerNumber] for (Owner of missile_launcher[missile_PlayerNumber]) at missile_loc_start[missile_PlayerNumber] facing (Facing of missile_launcher[missile_PlayerNumber]) degrees
-




Set missile_projectile[missile_PlayerNumber] = (Last created unit)
-




Unit Group - Add missile_projectile[missile_PlayerNumber] to Missile_Group
-




Set total_missiles = (total_missiles + 1)
-




Trigger - Turn on Move Missiles <gen>
-




Custom script: call RemoveLocation ( udg_missile_loc_start [udg_missile_PlayerNumber] )
-




Custom script: call RemoveLocation ( udg_missile_loc_end [udg_missile_PlayerNumber] )
-
-



Else - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Ability being cast) Equal to Attack (Spear)
-
-





Then - Actions
-






Set missile_model[missile_PlayerNumber] = Spear Dummy
-






Set missile_speed[missile_PlayerNumber] = 35.00
-






Set missile_damage[missile_PlayerNumber] = 40.00
-






Set missile_critical_chance[missile_PlayerNumber] = ITEM_Spear_Crit[missile_PlayerNumber]
-






Set missile_hit_range[missile_PlayerNumber] = ITEM_Spear_Hit[missile_PlayerNumber]
-






Set missile_travel_range[missile_PlayerNumber] = ITEM_Spear_Range[missile_PlayerNumber]
-






Set missile_loc_start[missile_PlayerNumber] = (Position of missile_launcher[missile_PlayerNumber])
-






Set missile_loc_end[missile_PlayerNumber] = (Target point of ability being cast)
-






Unit - Create 1 missile_model[missile_PlayerNumber] for (Owner of missile_launcher[missile_PlayerNumber]) at missile_loc_start[missile_PlayerNumber] facing (Facing of missile_launcher[missile_PlayerNumber]) degrees
-






Set missile_projectile[missile_PlayerNumber] = (Last created unit)
-






Unit Group - Add missile_projectile[missile_PlayerNumber] to Missile_Group
-






Set total_missiles = (total_missiles + 1)
-






Trigger - Turn on Move Missiles <gen>
-






Custom script: call RemoveLocation ( udg_missile_loc_start [udg_missile_PlayerNumber] )
-






Custom script: call RemoveLocation ( udg_missile_loc_end [udg_missile_PlayerNumber] )
-
-





Else - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Ability being cast) Equal to Attack (Knife)
-
-







Then - Actions
-








Set missile_model[missile_PlayerNumber] = Knife Dummy
-








Set missile_speed[missile_PlayerNumber] = 45.00
-








Set missile_damage[missile_PlayerNumber] = 20.00
-








Set missile_slow_ratio[missile_PlayerNumber] = ITEM_Knife_Slow[missile_PlayerNumber]
-








Set missile_hit_range[missile_PlayerNumber] = ITEM_Knife_Hit[missile_PlayerNumber]
-








Set missile_travel_range[missile_PlayerNumber] = ITEM_Knife_Range[missile_PlayerNumber]
-








Set missile_loc_start[missile_PlayerNumber] = (Position of missile_launcher[missile_PlayerNumber])
-








Set missile_loc_end[missile_PlayerNumber] = (Target point of ability being cast)
-








Unit - Create 1 missile_model[missile_PlayerNumber] for (Owner of missile_launcher[missile_PlayerNumber]) at missile_loc_start[missile_PlayerNumber] facing (Facing of missile_launcher[missile_PlayerNumber]) degrees
-








Set missile_projectile[missile_PlayerNumber] = (Last created unit)
-








Unit Group - Add missile_projectile[missile_PlayerNumber] to Missile_Group
-








Set total_missiles = (total_missiles + 1)
-








Trigger - Turn on Move Missiles <gen>
-








Custom script: call RemoveLocation ( udg_missile_loc_start [udg_missile_PlayerNumber] )
-








Custom script: call RemoveLocation ( udg_missile_loc_end [udg_missile_PlayerNumber] )
-
-







Else - Actions
-
-
-
-
-
-
-
-
Move Missiles
-

Events
-


Time - Every 0.05 seconds of game time
-
-

Conditions
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




total_missiles Equal to 0
-
-



Then - Actions
-




Trigger - Turn off (This trigger)
-
-



Else - Actions
-




For each (Integer A) from 1 to total_missiles, do (Actions)
-





Loop - Actions
-






Set missile_loc_current[(Integer A)] = (Position of missile_projectile[(Integer A)])
-






Set missile_hit_group[(Integer A)] = (Units within missile_hit_range[(Integer A)] of missile_loc_current[(Integer A)] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of missile_launcher[(Integer A)])) Equal to True)))
-






Set missile_hit_random_unit[(Integer A)] = (Random unit from missile_hit_group[(Integer A)])
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Number of units in missile_hit_group[(Integer A)]) Greater than 0
-
-







Then - Actions
-








Trigger - Run Missle Damage <gen> (ignoring conditions)
-








Unit - Remove missile_projectile[(Integer A)] from the game
-








Set total_missiles = (total_missiles - 1)
-








Set missile_current_range[(Integer A)] = 0.00
-
-







Else - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










missile_current_range[(Integer A)] Less than missile_travel_range[(Integer A)]
-










(missile_projectile[(Integer A)] is in forbidden_group) Not equal to True
-
-









Then - Actions
-










Set missile_current_range[(Integer A)] = (missile_current_range[(Integer A)] + missile_speed[(Integer A)])
-










Unit - Move missile_projectile[(Integer A)] instantly to (missile_loc_current[(Integer A)] offset by missile_speed[(Integer A)] towards (Facing of missile_projectile[(Integer A)]) degrees), facing (Facing of missile_projectile[(Integer A)]) degrees
-










Game - Display to (All players) the text: (String(missile_current_range[(Integer A)]))
-
-









Else - Actions
-










Unit Group - Remove missile_projectile[(Integer A)] from forbidden_group
-










Unit - Remove missile_projectile[(Integer A)] from the game
-










Set total_missiles = (total_missiles - 1)
-










Set missile_current_range[(Integer A)] = 0.00
-
-
-
-
-






Custom script: call RemoveLocation ( udg_missile_loc_current [GetForLoopIndexA()] )
-






Custom script: call DestroyGroup ( udg_missile_hit_group [GetForLoopIndexA()] )
-
-
-
-
-
-




















