HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to clea nthe leaks in those triggers...

03-04-2011, 06:55 AM#1
shanghai
Trigger:
Setup
Collapse Events
Time - Elapsed game time is 0.10 seconds
Conditions
Collapse Actions
Countdown Timer - Create a timer window for DeathTimer2 with title (Name of Player 2 (Blue))
Set DeathTimerWindow[(Player number of Player 2 (Blue))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 2 (Blue))]
Countdown Timer - Create a timer window for DeathTimer3 with title (Name of Player 3 (Teal))
Set DeathTimerWindow[(Player number of Player 3 (Teal))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 3 (Teal))]
Countdown Timer - Create a timer window for DeathTimer4 with title (Name of Player 4 (Purple))
Set DeathTimerWindow[(Player number of Player 4 (Purple))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 4 (Purple))]
Countdown Timer - Create a timer window for DeathTimer5 with title (Name of Player 5 (Yellow))
Set DeathTimerWindow[(Player number of Player 5 (Yellow))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 5 (Yellow))]
Countdown Timer - Create a timer window for DeathTimer6 with title (Name of Player 6 (Orange))
Set DeathTimerWindow[(Player number of Player 6 (Orange))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 6 (Orange))]
Countdown Timer - Create a timer window for DeathTimer8 with title (Name of Player 8 (Pink))
Set DeathTimerWindow[(Player number of Player 8 (Pink))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 8 (Pink))]
Countdown Timer - Create a timer window for DeathTimer9 with title (Name of Player 9 (Gray))
Set DeathTimerWindow[(Player number of Player 9 (Gray))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 9 (Gray))]
Countdown Timer - Create a timer window for DeathTimer10 with title (Name of Player 10 (Light Blue))
Set DeathTimerWindow[(Player number of Player 10 (Light Blue))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 10 (Light Blue))]
Countdown Timer - Create a timer window for DeathTimer11 with title (Name of Player 11 (Dark Green))
Set DeathTimerWindow[(Player number of Player 11 (Dark Green))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 11 (Dark Green))]
Countdown Timer - Create a timer window for DeathTimer12 with title (Name of Player 12 (Brown))
Set DeathTimerWindow[(Player number of Player 12 (Brown))] = (Last created timer window)
Countdown Timer - Hide DeathTimerWindow[(Player number of Player 12 (Brown))]
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Player((Integer A))) Equal to Player 1 (Red)
(Player((Integer A))) Equal to Player 7 (Green)
((Player((Integer A))) slot status) Equal to Is playing
Collapse Then - Actions
Countdown Timer - Hide DeathTimerWindow[(Player number of (Player((Integer A))))]
Else - Actions

Trigger:
Team Setup
Collapse Events
Time - Elapsed game time is 0.01 seconds
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
(Integer A) Not equal to 1
(Integer A) Not equal to 7
((Player((Integer A))) slot status) Not equal to Is playing
Collapse Then - Actions
Set Millzys_TempGroup = (Units in Start Spawn <gen> owned by (Player((Integer A))))
Collapse Unit Group - Pick every unit in Millzys_TempGroup and do (Actions)
Collapse Loop - Actions
Unit - Remove (Picked unit) from the game
Else - Actions
-------- Team 1 --------
Player Group - Add Player 2 (Blue) to TeamCT
Player Group - Add Player 3 (Teal) to TeamCT
Player Group - Add Player 4 (Purple) to TeamCT
Player Group - Add Player 5 (Yellow) to TeamCT
Player Group - Add Player 6 (Orange) to TeamCT
-------- Team 2 --------
Player Group - Add Player 8 (Pink) to TeamT
Player Group - Add Player 9 (Gray) to TeamT
Player Group - Add Player 10 (Light Blue) to TeamT
Player Group - Add Player 11 (Dark Green) to TeamT
Player Group - Add Player 12 (Brown) to TeamT



Would be nice if i get the real triggers back because im not very good at triggers im still ok.
03-05-2011, 05:15 AM#2
PurgeandFire111
The first trigger doesn't leak, assuming that you are using those timer windows later on. For the second trigger, you are leaking unit groups. This would fix it:
Trigger:
Team Setup
Collapse Events
Time - Elapsed game time is 0.01 seconds
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
(Integer A) Not equal to 1
(Integer A) Not equal to 7
((Player((Integer A))) slot status) Not equal to Is playing
Collapse Then - Actions
Set Millzys_TempGroup = (Units in Start Spawn <gen> owned by (Player((Integer A))))
Collapse Unit Group - Pick every unit in Millzys_TempGroup and do (Actions)
Collapse Loop - Actions
Unit - Remove (Picked unit) from the game
Custom script: call DestroyGroup(udg_Millzys_TempGroup)
Else - Actions
-------- Team 1 --------
Player Group - Add Player 2 (Blue) to TeamCT
Player Group - Add Player 3 (Teal) to TeamCT
Player Group - Add Player 4 (Purple) to TeamCT
Player Group - Add Player 5 (Yellow) to TeamCT
Player Group - Add Player 6 (Orange) to TeamCT
-------- Team 2 --------
Player Group - Add Player 8 (Pink) to TeamT
Player Group - Add Player 9 (Gray) to TeamT
Player Group - Add Player 10 (Light Blue) to TeamT
Player Group - Add Player 11 (Dark Green) to TeamT
Player Group - Add Player 12 (Brown) to TeamT

I just added a DestroyGroup() afterward. That will make sure that the group gets destroyed after has been used. (since you don't need it later on)