• 🏆 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!

[Trigger] Leaking Issues.

Status
Not open for further replies.
Level 9
Joined
Jul 7, 2005
Messages
529
  • Map Started
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set DualTimeDur = 10.00
      • Set DuelTimeLoc[1] = (Center of SideHeavenArena <gen>)
      • Player Group - Add Player 1 (Red) to PlayerGroup[1]
      • Set DuelHeroLoc[1] = (Center of Player1Arena <gen>)
      • Player Group - Add Player 2 (Blue) to PlayerGroup[1]
      • Set DuelHeroLoc[2] = (Center of Player2Arena <gen>)
      • Player Group - Add Player 3 (Teal) to PlayerGroup[1]
      • Set DuelHeroLoc[3] = (Center of Player3Arena <gen>)
      • Player Group - Add Player 4 (Purple) to PlayerGroup[1]
      • Set DuelHeroLoc[4] = (Center of Player4Arena <gen>)
      • Set DuelTimeLoc[2] = (Center of SideHellArena <gen>)
      • Player Group - Add Player 5 (Yellow) to PlayerGroup[2]
      • Set DuelHeroLoc[5] = (Center of Player5Arena <gen>)
      • Player Group - Add Player 6 (Orange) to PlayerGroup[2]
      • Set DuelHeroLoc[6] = (Center of Player6Arena <gen>)
      • Player Group - Add Player 7 (Green) to PlayerGroup[2]
      • Set DuelHeroLoc[7] = (Center of Player7Arena <gen>)
      • Player Group - Add Player 8 (Pink) to PlayerGroup[2]
      • Set DuelHeroLoc[8] = (Center of Player8Arena <gen>)
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Camera - Apply Camera 001 <gen> for (Picked player) over 0.00 seconds
  • Start DuelHero
    • Events
      • Time - DualTime expires
    • Conditions
    • Actions
      • -------- Reset DuelHero and select new ones. --------
      • Set DuelHero[1] = 0
      • Set DuelHero[2] = 0
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero[(Integer A)] Not equal to No unit
              • GameKills[(Integer A)] Greater than or equal to DuelHero[1]
            • Then - Actions
              • Set DuelHero[1] = (Integer A)
            • Else - Actions
      • For each (Integer A) from 5 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero[(Integer A)] Not equal to No unit
              • GameKills[(Integer A)] Greater than or equal to DuelHero[2]
            • Then - Actions
              • Set DuelHero[2] = (Integer A)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • DuelHero[1] Equal to 0
              • DuelHero[2] Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: DualHero has been c...
          • Countdown Timer - Start DualTime as a One-shot timer that will expire in DualTimeDur seconds
        • Else - Actions
          • Set DuelTimeOn = True
          • -------- Revive all DEAD heroes! --------
          • Trigger - Run ReviveHero <gen> (ignoring conditions)
          • -------- Pause ALL units. --------
          • Unit - Pause all units
          • -------- Stores current hero locations and angle then moves them to the stands. --------
          • For each (Integer A) from 1 to 8, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Hero[(Integer A)] Not equal to No unit
                • Then - Actions
                  • Set HeroLoc[(Integer A)] = (Position of Hero[(Integer A)])
                  • Set HeroDeg[(Integer A)] = (Facing of Hero[(Integer A)])
                  • Wait 0.10 seconds
                  • Unit - Move Hero[(Integer A)] instantly to DuelHeroLoc[(Integer A)]
                  • Camera - Pan camera for (Player((Integer A))) to (Center of DuelArena <gen>) over 0.00 seconds
                • Else - Actions
          • -------- Move the DuelHero's from the stands to the arena. --------
          • Unit - Move Hero[DuelHero[1]] instantly to DuelTimeLoc[1], facing 315.00 degrees
          • Unit - Move Hero[DuelHero[2]] instantly to DuelTimeLoc[2], facing 135.00 degrees
          • Unit - Unpause Hero[DuelHero[1]]
          • Unit - Unpause Hero[DuelHero[2]]
          • Game - Display to (All players) the text: |cffff0000Fight!|r
  • KilledHero DuelHero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • ((Killing unit) is A Hero) Equal to True
          • And - All (Conditions) are true
            • Conditions
              • ((Killing unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
              • ((Owner of (Killing unit)) controller) Equal to User
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DuelTimeOn Equal to True
          • (DuelArena <gen> contains (Triggering unit)) Equal to True
        • Then - Actions
          • Set DuelTimeOn = False
          • Set GameKills[(Player number of (Owner of (Killing unit)))] = (GameKills[(Player number of (Owner of (Killing unit)))] + 1)
          • Leaderboard - Change the value for (Owner of (Killing unit)) in KillBoard to GameKills[(Player number of (Owner of (Killing unit)))]
          • For each (Integer A) from 1 to 8, do (Actions)
            • Loop - Actions
              • Unit - Move Hero[(Integer A)] instantly to HeroLoc[(Integer A)], facing HeroDeg[(Integer A)] degrees
              • Camera - Pan camera for (Owner of Hero[(Integer B)]) to (Position of Hero[(Integer A)]) over 0.00 seconds
              • Selection - Select Hero[(Integer A)] for (Owner of Hero[(Integer A)])
          • -------- Unpause ALL units. --------
          • Unit - Unpause all units
          • -------- Resume DualHero timer. --------
          • Countdown Timer - Start DualTime as a One-shot timer that will expire in DualTimeDur seconds
        • Else - Actions
          • Set GameKills[(Player number of (Owner of (Killing unit)))] = (GameKills[(Player number of (Owner of (Killing unit)))] + 1)
          • Leaderboard - Change the value for (Owner of (Killing unit)) in KillBoard to GameKills[(Player number of (Owner of (Killing unit)))]
  • HeroSelect
    • Events
      • Unit - A unit enters [i]Region[/i]
    • Conditions
    • Actions
      • Unit - Move [i]Unit[/i] instantly to ((Owner of (Triggering unit)) start location), facing Default building facing degrees
      • Unit - Change ownership of [i]Unit[/i] to (Owner of (Entering unit)) and Change color
      • Set Hero[(Player number of (Owner of (Triggering unit)))] = [i]Unit[/i]
      • Camera - Pan camera for (Owner of (Triggering unit)) to ((Owner of (Triggering unit)) start location) over 0.00 seconds
      • Unit - Remove (Triggering unit) from the game
      • Trigger - Turn off (This trigger)
  • PlayerLeft
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 7 (Green) leaves the game
      • Player - Player 8 (Pink) leaves the game
    • Conditions
    • Actions
      • Leaderboard - Change the display style for (Triggering player) in KillBoard to Show the label, Hide the value, and Hide the icon
      • Leaderboard - Change the color of the label for (Triggering player) in KillBoard to (50.00%, 50.00%, 50.00%) with 0.00% transparency
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • For each (Integer A) from 1 to 6, do (Actions)
                • Loop - Actions
                  • Hero - Drop the item from slot (Integer A) of (Picked unit)
              • Game - Display to (All players) the text: ((Name of (Picked unit)) + has dropped all of his/her items, be the lucky one to find them!)
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
              • Unit - Remove (Picked unit) from the game
      • Set GameKills[(Player number of (Triggering player))] = 0
      • Set Hero[(Player number of (Triggering player))] = No unit
That's the majority of the triggers i currently have in place. All i need to do is find a way to remove leaks, or if theres any point in trying to considering these variables are always being used.
 
Last edited:
Level 13
Joined
Mar 16, 2008
Messages
941
The whole remove and destroy stuff is true.
Store it in a variable and destroy it when you don't need it anymore.
You are using GUI, that means you use the same variables again and again
-> You don't have to null anything.
Btw, also if you use locals you don't have to null reals or integers, they don't leak ;)
 
Status
Not open for further replies.
Top