- Joined
- Mar 11, 2009
- Messages
- 26
Im currently recieveing some really heavy memory leaks, and its probably related to timely events such as game - for every 0.01 etc.
The triggers that i suspect is behind it is probably one of the following which ive tried to fix memory leaks in, but it doesnt seem to work really.
Does a point stored in a variable leak if it doesn't get removed if it is assigned a new value? Looked into the sticky on memory leaks but found nothing useful on that and its 40 pages long. And the first trigger create a region where it checks for units of a certain unit type, does this region leak? cause i ran these trigger through the leak checker software and it didnt find anything, just some variables that werent destroyed.
I also have four more periodic triggers that dont create anything, they just checks for some conditions and resurrects or kill a destructible that is dead/living if a unit is in a region:
The triggers that i suspect is behind it is probably one of the following which ive tried to fix memory leaks in, but it doesnt seem to work really.
Does a point stored in a variable leak if it doesn't get removed if it is assigned a new value? Looked into the sticky on memory leaks but found nothing useful on that and its 40 pages long. And the first trigger create a region where it checks for units of a certain unit type, does this region leak? cause i ran these trigger through the leak checker software and it didnt find anything, just some variables that werent destroyed.
-
Moving Iceblocks
-

Events
-


Time - Every 0.02 seconds of game time
-
-

Conditions
-

Actions
-


-------- 1 - south, 2 - east, 3 - north 4, - west , 0 - stop --------
-


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



If - Conditions
-




(Number of units in (Units in (Region(((Position of Ice_Block_Unit) offset by (-50.00, -50.00)), ((Position of Ice_Block_Unit) offset by (50.00, -140.00)))) matching (((Unit-type of (Matching unit)) Equal to Ice Block Stopper) or ((Unit-type of (Matching unit Greater than or equal to 1
-




Ice_Block_Acelleration Greater than or equal to 1
-




Ice_Block_Facing Equal to 1
-
-



Then - Actions
-




Set Ice_Block_Acelleration = 0
-




Set Ice_Block_Facing = 0
-
-



Else - Actions
-




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





If - Conditions
-






(Number of units in (Units in (Region(((Position of Ice_Block_Unit) offset by (50.00, -50.00)), ((Position of Ice_Block_Unit) offset by (140.00, 50.00)))) matching (((Unit-type of (Matching unit)) Equal to Ice Block Stopper) or ((Unit-type of (Matching unit)) Greater than or equal to 1
-






Ice_Block_Acelleration Greater than or equal to 1
-






Ice_Block_Facing Equal to 2
-
-





Then - Actions
-






Set Ice_Block_Acelleration = 0
-






Set Ice_Block_Facing = 0
-
-





Else - Actions
-






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







If - Conditions
-








(Number of units in (Units in (Region(((Position of Ice_Block_Unit) offset by (-50.00, 50.00)), ((Position of Ice_Block_Unit) offset by (50.00, 140.00)))) matching (((Unit-type of (Matching unit)) Equal to Ice Block Stopper) or ((Unit-type of (Matching unit)) Greater than or equal to 1
-








Ice_Block_Acelleration Greater than or equal to 1
-








Ice_Block_Facing Equal to 3
-
-







Then - Actions
-








Set Ice_Block_Acelleration = 0
-








Set Ice_Block_Facing = 0
-
-







Else - Actions
-








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









If - Conditions
-










(Number of units in (Units in (Region(((Position of Ice_Block_Unit) offset by (-50.00, -50.00)), ((Position of Ice_Block_Unit) offset by (-140.00, 50.00)))) matching (((Unit-type of (Matching unit)) Equal to Ice Block Stopper) or ((Unit-type of (Matching unit Greater than or equal to 1
-










Ice_Block_Acelleration Greater than or equal to 1
-










Ice_Block_Facing Equal to 4
-
-









Then - Actions
-










Set Ice_Block_Acelleration = 0
-










Set Ice_Block_Facing = 0
-
-









Else - Actions
-
-
-
-
-
-
-
-


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



If - Conditions
-




Ice_Block_Acelleration Equal to 1
-




Ice_Block_Facing Equal to 1
-
-



Then - Actions
-




Set LeakFixPosition[2] = (Position of Ice_Block_Unit)
-




Set LeakFixPosition[3] = (LeakFixPosition[2] offset by (0.00, -3.00))
-




Unit - Move Ice_Block_Unit instantly to LeakFixPosition[3]
-
-



Else - Actions
-




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





If - Conditions
-






Ice_Block_Acelleration Equal to 1
-






Ice_Block_Facing Equal to 2
-
-





Then - Actions
-






Set LeakFixPosition[2] = (Position of Ice_Block_Unit)
-






Set LeakFixPosition[3] = (LeakFixPosition[2] offset by (3.00, 0.00))
-






Unit - Move Ice_Block_Unit instantly to LeakFixPosition[3]
-
-





Else - Actions
-






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







If - Conditions
-








Ice_Block_Acelleration Equal to 1
-








Ice_Block_Facing Equal to 3
-
-







Then - Actions
-








Set LeakFixPosition[2] = (Position of Ice_Block_Unit)
-








Set LeakFixPosition[3] = (LeakFixPosition[2] offset by (0.00, 3.00))
-








Unit - Move Ice_Block_Unit instantly to LeakFixPosition[3]
-
-







Else - Actions
-








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









If - Conditions
-










Ice_Block_Acelleration Equal to 1
-










Ice_Block_Facing Equal to 4
-
-









Then - Actions
-










Set LeakFixPosition[2] = (Position of Ice_Block_Unit)
-










Set LeakFixPosition[3] = (LeakFixPosition[2] offset by (-3.00, 0.00))
-










Unit - Move Ice_Block_Unit instantly to LeakFixPosition[3]
-
-









Else - Actions
-
-
-
-
-
-
-
-


Custom script: call RemoveLocation (udg_LeakFixPosition[2])
-


Custom script: call RemoveLocation (udg_LeakFixPosition[3])
-
-
-
Cains Tower F3 random encounters
-

Events
-


Time - Every 1.00 seconds of game time
-
-

Conditions
-

Actions
-


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



If - Conditions
-




(Number of units in (Units in Cains Tower F3 <gen> owned by Player 12 (Brown))) Equal to 0
-




(Number of units in (Units in Cains Tower F3 <gen> matching (((Matching unit) is A Hero) Equal to True))) Greater than or equal to 1
-




(Random integer number between 1 and 30) Equal to 1
-
-



Then - Actions
-




Set LeakFixUnitGroup[1] = (Units in Cains Tower F3 <gen> matching (((Matching unit) is A Hero) Equal to True))
-




Unit Group - Pick every unit in LeakFixUnitGroup[1] and do (Actions)
-





Loop - Actions
-






Set LeakFixPosition[1] = (Position of (Picked unit))
-






Unit - Create 1 Spirit of the Dead (Cain's Tower) for Player 12 (Brown) at LeakFixPosition[1] facing Default building facing degrees
-






Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
-






Unit - Order (Last created unit) to Attack (Picked unit)
-






Special Effect - Create a special effect at LeakFixPosition[1] using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
-






Set Cains_Tower_Special_Effects[2] = (Last created special effect)
-






Special Effect - Destroy Cains_Tower_Special_Effects[2]
-
-
-
-



Else - Actions
-
-


Custom script: call RemoveLocation (udg_LeakFixPosition[1])
-


Custom script: call DestroyGroup (udg_LeakFixUnitGroup[1])
-
-
I also have four more periodic triggers that dont create anything, they just checks for some conditions and resurrects or kill a destructible that is dead/living if a unit is in a region:
-
Cains Tower F2 Switch 1
-

Events
-


Time - Every 0.10 seconds of game time
-
-

Conditions
-


Cains_Tower_Switches[5] Equal to False
-
-

Actions
-


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



If - Conditions
-




(Foot Switch 0394 <gen> is dead) Equal to False
-




(Number of units in (Units in Cains Tower F2 Switch 1 <gen> matching ((Unit-type of (Matching unit)) Equal to Ice Block))) Greater than or equal to 1
-
-



Then - Actions
-




Destructible - Kill Foot Switch 0394 <gen>
-




Set Cains_Tower_Switches[5] = True
-
-



Else - Actions
-
-


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



If - Conditions
-




Cains_Tower_Switches[6] Equal to True
-




(Tower Forcewall 0392 <gen> is dead) Equal to False
-
-



Then - Actions
-




Destructible - Kill Tower Forcewall 0392 <gen>
-
-



Else - Actions
-
-
-
-
Cains Tower F2 Switch 1 off
-

Events
-


Time - Every 0.10 seconds of game time
-
-

Conditions
-


Cains_Tower_Switches[5] Equal to True
-
-

Actions
-


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



If - Conditions
-




(Foot Switch 0394 <gen> is dead) Equal to True
-




(Number of units in (Units in Cains Tower F2 Switch 1 <gen> matching ((Unit-type of (Matching unit)) Equal to Ice Block))) Equal to 0
-
-



Then - Actions
-




Destructible - Resurrect Foot Switch 0394 <gen> with 99999.00 life and Show birth animation
-




Set Cains_Tower_Switches[5] = False
-
-



Else - Actions
-
-


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



If - Conditions
-




Cains_Tower_Switches[6] Equal to False
-




(Tower Forcewall 0392 <gen> is dead) Equal to True
-
-



Then - Actions
-




Destructible - Resurrect Tower Forcewall 0392 <gen> with 99.00 life and Show birth animation
-
-



Else - Actions
-
-
-
-
Cains Tower F2 Switch 2
-

Events
-


Time - Every 0.10 seconds of game time
-
-

Conditions
-


Cains_Tower_Switches[6] Equal to False
-
-

Actions
-


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



If - Conditions
-




(Foot Switch 0389 <gen> is dead) Equal to False
-




(Number of units in (Units in Cains Tower F2 Switch 2 <gen> matching ((Unit-type of (Matching unit)) Equal to Ice Block))) Greater than or equal to 1
-
-



Then - Actions
-




Destructible - Kill Foot Switch 0389 <gen>
-




Set Cains_Tower_Switches[6] = True
-
-



Else - Actions
-
-


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



If - Conditions
-




Cains_Tower_Switches[5] Equal to True
-




(Tower Forcewall 0392 <gen> is dead) Equal to False
-
-



Then - Actions
-




Destructible - Kill Tower Forcewall 0392 <gen>
-
-



Else - Actions
-
-
-
-
Cains Tower F2 Switch 2 off
-

Events
-


Time - Every 0.10 seconds of game time
-
-

Conditions
-


Cains_Tower_Switches[6] Equal to True
-
-

Actions
-


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



If - Conditions
-




(Foot Switch 0389 <gen> is dead) Equal to True
-




(Number of units in (Units in Cains Tower F2 Switch 2 <gen> matching ((Unit-type of (Matching unit)) Equal to Ice Block))) Equal to 0
-
-



Then - Actions
-




Destructible - Resurrect Foot Switch 0389 <gen> with 99999.00 life and Show birth animation
-




Set Cains_Tower_Switches[6] = False
-
-



Else - Actions
-
-


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



If - Conditions
-




Cains_Tower_Switches[5] Equal to False
-




(Tower Forcewall 0392 <gen> is dead) Equal to True
-
-



Then - Actions
-




Destructible - Resurrect Tower Forcewall 0392 <gen> with 99.00 life and Show birth animation
-
-



Else - Actions
-
-
-

