• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

where does this trigger leak?

Status
Not open for further replies.
Level 4
Joined
Jul 15, 2012
Messages
89
hello everyone , this is my only leaking trigger (according to leak tester) how can i fix it ? it makes wc3 use 1gb ram after half an hour playing.
  • Police win
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Group = (Units in Prison <gen> matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)))
      • Set Group2 = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)))
      • Unit Group - Remove all units of Group from Group2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Group2) Equal to 0
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
          • Game - Victory Player 10 (Light Blue) (Show dialogs, Show scores)
          • Game - Defeat Player 2 (Blue) with the message: Defeat!
          • Game - Defeat Player 3 (Teal) with the message: Defeat!
          • Game - Defeat Player 4 (Purple) with the message: Defeat!
          • Game - Defeat Player 5 (Yellow) with the message: Defeat!
          • Game - Defeat Player 9 (Gray) with the message: Defeat!
          • Game - Defeat Player 11 (Dark Green) with the message: Defeat!
          • Game - Defeat Player 12 (Brown) with the message: Defeat!
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Group)
      • Custom script: call DestroyGroup(udg_Group2)
 
Level 4
Joined
Jul 15, 2012
Messages
89
says this 73 times (with different numbers):

Type: trigger
Trig_Police_win_Actions [war3map.j:6040]
CustomVictoryBJ [war3map.j:6027]
CustomVictoryDialogBJ [Blizzard.j:5257]
CreateTrigger [Blizzard.j:5202]

Type: trigger
Trig_Police_win_Actions [war3map.j:6040]
CustomVictoryBJ [war3map.j:6027]
CustomVictoryDialogBJ [Blizzard.j:5257]
CreateTrigger [Blizzard.j:5207]

Type: triggeraction
Trig_Police_win_Actions [war3map.j:6040]
CustomVictoryBJ [war3map.j:6027]
CustomVictoryDialogBJ [Blizzard.j:5257]
TriggerAddAction [Blizzard.j:5209]
 
Level 4
Joined
Jul 15, 2012
Messages
89
this is how i fixed it sorry fot bothering.
  • Police win
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Group = (Units in Zendan <gen> matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)))
      • Set Group2 = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)))
      • Unit Group - Remove all units of Group from Group2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Group2) Equal to 0
        • Then - Actions
          • Set PG = (All allies of Player 1 (Red))
          • Player Group - Pick every player in PG and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
          • Custom script: call DestroyForce(udg_PG)
          • Set PG = (All enemies of Player 1 (Red))
          • Player Group - Pick every player in PG and do (Actions)
            • Loop - Actions
              • Game - Defeat (Picked player) with the message: Defeat!
          • Custom script: call DestroyForce(udg_PG)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Group)
      • Custom script: call DestroyGroup(udg_Group2)
 
Level 5
Joined
Nov 30, 2012
Messages
200
Leak tester? Isn't the only program that does that hopelessly outdated? Or is there a new one?
 
Level 5
Joined
May 6, 2013
Messages
125
The Leak tester isn't particularly wrong. In fact, the leaks it detected were correct leaks (except for the AddAction leak, which i don't quite get; i guess it just always leaks and the program suggests that one should not add any actions to dynamically created triggers; at least i remember something along these lines). It simply cannot know that the Defeat player function actually ends the game and, therefor, makes the leak insignificant as the game will end after the trigger is executed for the last time, and as the leaking function therefor will never be called more than one time.
(now that i think about it, maybe it would leak if you would constantly click the "continue" button, though i'm not sure if that menu would even pop up more than once.)

TL;DR: The Victory for Player x Action creates Triggers that are never destroyed. As it also ends the game, it is however not harmful and should not be considered a leak. Your first trigger was just fine.

Now, someone explain to me why the second trigger did not deliver the same results. i don't get it.
edit: also, why doesnt it detect the CustomDefeatDialogBJ trigger. It has the exact same "flaw".
 
Status
Not open for further replies.
Top