HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Game - Can you spot all of the leaks?

08-19-2006, 12:27 AM#1
|)@rk-Revenant
I have been rather unsuccessful in trying to remove all of my map's memory leaks. Perhaps you could help me out. Anyone who can spot a leak that's not already fixed gets a rep point.

Trigger:
Main Periodic Function List
Collapse Events
Time - Every 0.25 seconds of game time
Conditions
Collapse Actions
Set Tempgroup_2 = (Units of type Runner)
Collapse Unit Group - Pick every unit in Tempgroup_2 and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Picked unit)) Equal to 0
((Picked unit) is alive) Equal to True
Collapse Then - Actions
Set Temppoint = (Position of (Picked unit))
Set Tempgroup = (Units within 100.00 of Temppoint matching (((Unit-type of (Matching unit)) Equal to Flame Trap) and ((Custom value of (Matching unit)) Equal to 0)))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in Tempgroup) Greater than 0
Collapse Then - Actions
Collapse Unit Group - Pick every unit in Tempgroup and do (Actions)
Collapse Loop - Actions
Set Temppoint_2 = (Position of (Picked unit))
Unit - Create 1 Flame Pillar for (Owner of (Picked unit)) at Temppoint_2 facing Default building facing (270.0) degrees
Point - Remove Temppoint_2
Unit Group - Destroy unit group Tempgroup
Point - Remove Temppoint
Unit - Kill (Picked unit)
Set Temppoint = (Position of (Picked unit))
Collapse Else - Actions
Unit Group - Destroy unit group Tempgroup
Set Tempgroup = (Units within 100.00 of Temppoint matching (((Unit-type of (Matching unit)) Equal to Ice Trap) and ((Custom value of (Matching unit)) Equal to 0)))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in Tempgroup) Greater than 0
Collapse Then - Actions
Collapse Unit Group - Pick every unit in Tempgroup and do (Actions)
Collapse Loop - Actions
Set Temppoint_2 = (Position of (Picked unit))
Unit - Create 1 Ice Pillar for (Owner of (Picked unit)) at Temppoint_2 facing Default building facing (270.0) degrees
Point - Remove Temppoint_2
Unit Group - Destroy unit group Tempgroup
Point - Remove Temppoint
Unit - Kill (Picked unit)
Set Temppoint = (Position of (Picked unit))
Collapse Else - Actions
Unit Group - Destroy unit group Tempgroup
Set Tempgroup = (Units within 100.00 of Temppoint matching (((Unit-type of (Matching unit)) Equal to Poison Trap) and ((Custom value of (Matching unit)) Equal to 0)))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in Tempgroup) Greater than 0
Collapse Then - Actions
Collapse Unit Group - Pick every unit in Tempgroup and do (Actions)
Collapse Loop - Actions
Set Temppoint_2 = (Position of (Picked unit))
Unit - Create 1 Poison Dummy for (Owner of (Picked unit)) at Temppoint_2 facing Default building facing (270.0) degrees
Point - Remove Temppoint_2
Unit Group - Destroy unit group Tempgroup
Point - Remove Temppoint
Unit - Kill (Picked unit)
Set Temppoint = (Position of (Picked unit))
Collapse Else - Actions
Unit Group - Destroy unit group Tempgroup
Set Tempgroup = (Units within 100.00 of Temppoint matching (((Unit-type of (Matching unit)) Equal to Spike Trap) and ((Custom value of (Matching unit)) Equal to 0)))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in Tempgroup) Greater than 0
Collapse Then - Actions
Collapse Unit Group - Pick every unit in Tempgroup and do (Actions)
Collapse Loop - Actions
Set Temppoint_2 = (Position of (Picked unit))
Unit - Create 1 Spikes for (Owner of (Picked unit)) at Temppoint_2 facing Default building facing (270.0) degrees
Point - Remove Temppoint_2
Unit Group - Destroy unit group Tempgroup
Point - Remove Temppoint
Unit - Kill (Picked unit)
Set Temppoint = (Position of (Picked unit))
Collapse Else - Actions
Unit Group - Destroy unit group Tempgroup
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Terrain type at Temppoint) Equal to Dungeon - Lava
Collapse Then - Actions
Advanced - Make (Picked unit) burn using the burning style Clean Flames for 3.00 seconds
Unit - Kill (Picked unit)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Terrain type at Temppoint) Equal to Lordaeron Summer - Dirt
(Number of units in (Units within 60.00 of Temppoint matching (((Matching unit) is An Ancient) Equal to True))) Greater than 0
Collapse Then - Actions
Unit - Kill (Picked unit)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Terrain type at Temppoint) Equal to Felwood - Poison
Collapse Then - Actions
Unit - Create 1 Lesser Poison Dummy for (Owner of (Picked unit)) at Temppoint facing Default building facing (270.0) degrees
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 20.00)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Terrain type at Temppoint) Equal to Dungeon - Lava Cracks
Collapse Then - Actions
Advanced - Make (Picked unit) burn using the burning style Clean Flames for 0.20 seconds
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 50.00)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Checkpoint Circle))) Greater than 0
Collapse Then - Actions
Set Tempgroup = (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Checkpoint Circle))
Collapse Unit Group - Pick every unit in Tempgroup and do (Actions)
Collapse Loop - Actions
Unit - Add Teleport Runners to (Picked unit)
Unit - Order (Picked unit) to Human Paladin - Activate Divine Shield
Unit - Kill (Picked unit)
Unit Group - Destroy unit group Tempgroup
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Circle of Reward))) Greater than 0
Collapse Then - Actions
Set Tempgroup = (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Circle of Reward))
Collapse Unit Group - Pick every unit in Tempgroup and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Picked unit)) Equal to 0
Collapse Then - Actions
Do nothing
Collapse Else - Actions
Set Temppoint_2 = ((Position of (Picked unit)) offset by (Random real number between 0.00 and 50.00) towards (Random angle) degrees)
Collapse For each (Integer A) from 1 to (Custom value of (Picked unit)), do (Actions)
Collapse Loop - Actions
Item - Create Gold Coins at Temppoint_2
Point - Remove Temppoint_2
Unit - Kill (Picked unit)
Unit Group - Destroy unit group Tempgroup
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units within 100.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Jumper))) Greater than 0
Collapse Then - Actions
Unit - Set the custom value of (Picked unit) to 5
Advanced - Set the custom boolean value for (Picked unit) to False
Animation - Change (Picked unit) flying height to 5.00 at 200.00
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Portal Circle))) Greater than 0
Collapse Then - Actions
Set Tempgroup = (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Portal Circle))
Set Temppoint_2 = (Point((Real((Custom value of (Random unit from Tempgroup)))), ((Random unit from Tempgroup)'s custom real value)))
Unit - Move (Picked unit) instantly to Temppoint_2
Point - Remove Temppoint_2
Unit Group - Destroy unit group Tempgroup
Point - Remove Temppoint
Set Temppoint = (Position of (Picked unit))
Unit - Create 1 Portal Effect for (Owner of (Picked unit)) at Temppoint facing Default building facing (270.0) degrees
Collapse Else - Actions
Do nothing
Collapse Destructible - Pick every destructible within 100.00 of Temppoint and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
(Destructible-type of (Picked destructible)) Equal to Iron Gate (Horizontal)
((Picked destructible) is dead) Equal to False
Collapse And - All (Conditions) are true
Collapse Conditions
(Destructible-type of (Picked destructible)) Equal to Iron Gate (Vertical)
((Picked destructible) is dead) Equal to False
Collapse Or - Any (Conditions) are true
Collapse Conditions
((Picked unit) has an item of type Blood Key) Equal to True
((Picked unit) has an item of type Ghost Key) Equal to True
((Picked unit) has an item of type Moon Key) Equal to True
((Picked unit) has an item of type Mooncrystal Key) Equal to True
((Picked unit) has an item of type Sun Key) Equal to True
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type Blood Key) Equal to True
Collapse Then - Actions
Item - Remove (Item carried by (Picked unit) of type Blood Key)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type Ghost Key) Equal to True
Collapse Then - Actions
Item - Remove (Item carried by (Picked unit) of type Ghost Key)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type Moon Key) Equal to True
Collapse Then - Actions
Item - Remove (Item carried by (Picked unit) of type Moon Key)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type Mooncrystal Key) Equal to True
Collapse Then - Actions
Item - Remove (Item carried by (Picked unit) of type Mooncrystal Key)
Collapse Else - Actions
Item - Remove (Item carried by (Picked unit) of type Sun Key)
Destructible - Open (Picked destructible)
Collapse Else - Actions
Do nothing
Point - Remove Temppoint
Collapse Else - Actions
Do nothing
Unit Group - Destroy unit group Tempgroup_2
08-19-2006, 01:35 AM#2
SFilip
(Number of units in (Units within 60.00 of Temppoint matching (((Matching unit) is An Ancient) Equal to True))) Greater than 0
unit group

(Number of units in (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Checkpoint Circle))) Greater than 0
another

(Number of units in (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Circle of Reward))) Greater than 0
again

Set Temppoint_2 = ((Position of (Picked unit)) offset by (Random real number between 0.00 and 50.00) towards (Random angle) degrees)
point...polar projection can leak one as you can see.

(Number of units in (Units within 100.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Jumper))) Greater than 0
another group

(Number of units in (Units within 50.00 of Temppoint matching ((Unit-type of (Matching unit)) Equal to Portal Circle))) Greater than 0
and another

that's about it. i recommend that you use Leak Check for large triggers like this. its a handy little tool that checks for leaks in gui - and to be honest the above leaks are discovered using it.
08-19-2006, 07:46 AM#3
BertTheJasser
Set Temppoint_2 = (Position of (Picked unit))
leaves a location, and sets the var to a new one.
08-19-2006, 01:49 PM#4
Alevice
Trigger:
Waldo - Is here

THERE YOU ARE!
08-19-2006, 03:49 PM#5
|)@rk-Revenant
Quote:
Originally Posted by BertTheJasser
Set Temppoint_2 = (Position of (Picked unit))
leaves a location, and sets the var to a new one.

How would I possibly fix that?
08-19-2006, 03:53 PM#6
SFilip
well as far as i can see you removed that location so its not a leak...nothing to fix there.
08-20-2006, 07:33 AM#7
BertTheJasser
GUI is so anoying(?), it always crashes my brain straight to the wall. I never saw the GUI RemoveLocation.
08-20-2006, 04:34 PM#8
|)@rk-Revenant
That's a WEU feature. Otherwise, you need a custom text function.

But thanks to SFilip and the leak finder, the map is now leak-free!
08-20-2006, 05:10 PM#9
The_AwaKening
Code:
Set Temppoint_2 = ((Position of (Picked unit)) offset by (Random real number between 0.00 and 50.00) towards (Random angle) degrees)
Wouldn't the above also need a temp location for ((Position of (Picked unit))
so.....
Code:
Set unitLoc = Position of (Picked unit)
Set Temppoint_2 = (unitLoc) offset by (Random real number between 0.00 and 50.00) towards (Random angle) degrees)
08-20-2006, 05:14 PM#10
BertTheJasser
correct