HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Memory Leak

01-22-2006, 03:43 PM#1
BanishedSoull
I know theres a memory leak in this trigger somewhere, but i cant figure out where it is or what it is. This is a trigger to control a wolf not owned by the player. The wolf always stands on your left side unless your target (a variable im using) is an enemy and within 600.

Trigger:
Wolf AI
Collapse Events
Time - Every 0.10 seconds of game time
Collapse Conditions
(Number of units in (Units of type Wolf)) Greater than or equal to 1
Collapse Actions
Set TempUnit = (Random unit from (Units of type Wolf))
Set TempUnit2 = (Random unit from (Units owned by (Player((Custom value of TempUnit))) matching ((Unit-type of (Matching unit)) Equal to Feral Warrior)))
Set TempPoint = ((Position of TempUnit2) offset by 100.00 towards ((Facing of TempUnit2) + 90.00) degrees)
Advanced - Set the custom real value for TempUnit to ((TempUnit2's custom real value) + 25.00)
Trigger - Run Speed Update <gen> (ignoring conditions)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Distance between (Position of TempUnit2) and (Position of Target[(Player number of (Owner of TempUnit2))])) Less than or equal to 600.00
(Target[(Player number of (Owner of TempUnit2))] belongs to an enemy of (Owner of TempUnit2)) Equal to True
(Current order of TempUnit) Not equal to (Order(attack))
Collapse Then - Actions
Unit - Order TempUnit to Attack Target[(Player number of (Owner of TempUnit2))]
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Distance between (Position of TempUnit) and TempPoint) Greater than or equal to 25.00
Target[(Player number of (Owner of TempUnit2))] Equal to TempUnit2
(Current order of TempUnit) Not equal to (Order(move))
Collapse Then - Actions
Unit - Order TempUnit to Move To TempPoint
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Distance between (Position of TempUnit) and TempPoint) Greater than or equal to 25.00
(Target[(Player number of (Owner of TempUnit2))] belongs to an enemy of (Owner of TempUnit2)) Equal to False
(Current order of TempUnit) Not equal to (Order(move))
Collapse Then - Actions
Unit - Order TempUnit to Move To TempPoint
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Edit: Please use the [trigger] [/trigger] tag
01-22-2006, 03:58 PM#2
Thunder_Eye
The (Position of TempUnit) leaks I believe.
01-22-2006, 04:01 PM#3
Vexorian
yep, use temp point variables to clean those (Position of TempUnit) too
01-22-2006, 04:29 PM#4
BanishedSoull
how do i do that?
01-22-2006, 04:35 PM#5
Azazel_
Set TempPoint1 = Position of (TempUnit2)
Set TempPoint2 = ((TempPoint1) offset by 100.00 towards ((Facing of TempUnit2) + 90.00) degrees)

...

call RemoveLocation(udg_TempPoint1)
call RemoveLocation(udg_TempPoint2)
01-22-2006, 04:36 PM#6
BanishedSoull
ok thanks for the help