49 posts Uhhh... I see lots of pretty lights... joined
#1
Trigger leak problem
I resently downloaded the leak check tool in the tools section to find out why my map was leaking. I found the trigger but I dont know how to change it to the suggested solution! The orignal line was: (Condition) Distance between (Position of Vechical[(Integer A)]) and (Position of CS1)) Less than or equal to 500 (Vechical and CS1 are unit vareables)
The suggested fix is (Suggested fix) Set L= (Position of Vechical [(Integer A)]) and (Position of CS1) Less than or equal to 500 (Suggested fix) Custom Script: Call RemoveLocation(udg_L)
It also says theres a leak on the (Position of CS1) thing. Does anyone know how I fix it?
Set L = (Position of Vechical[(Integer A)])
Set L2 = (Position of CS1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between L and L2) Less than or equal to 500.00
Then - Actions
blabla
Else - Actions
Custom script: call RemoveLocation(udg_L)
Custom script: call RemoveLocation(udg_L2)
LOL you need a leak check tool? Folow this rule and no locations will leak.
Always attach any locations to variabls before use. All functions that return locations leak unless you destry the locations. Always destroy veriables as soon as you have used them.
But I guess for all you GUI fans you need a leak check tool. . .
49 posts Uhhh... I see lots of pretty lights... joined
#5
Question
When you say the set L stuff are you doing that in a diffrent trigger? Also will "removeing" the location make it unusable? Im gona have it runing almost constantly.
Oh and sorry dr super good but this is both the first time I have dealt with leak checks and it will be my first time writeing custom script.
Explaining on the term Memory Leak: If you create an object, and don't destroy it, that object will plain remain there, doing nothing but take away place. Take an example on units. If you create a new unit and don't want to use it anymore, because it was a dummy or w/e, he will remain there forever if you don't remove him, right? And if you keep creating such one-time-usage units and don't remove them, they will flood over the map, thus making the map lag. The same thing applies for Locations, and the following objects
49 posts Uhhh... I see lots of pretty lights... joined
#7
ok but
Ok I get that but if I leave it the way it is, the map gets to lagging so badly that it practicaly freezes after 15 minets. I have it repeating every .10 of a second and there are 3 other triggers almost exactly like it. Mabey theres a better way to do it? The idea is that whenever a starfighter flys close enough to a certain capital ship its given a ability that lets it "land" in the ships hanger. Theres also a triger that removes the ability if the starfighter flys out of range. Any suggestions? Oh and thanx for the help (all of you).