• 🏆 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] One trigger still leaks. Unsolved pls help

Status
Not open for further replies.
Level 19
Joined
Feb 15, 2008
Messages
2,184
Problem is i know how to do. But not where to put the set variable thing. This is point variable right? So i make variable named point. And where do i put this set variable?

  • Hero DeathRespawn Timer expires
    • Events
      • Time - DeathTimer2 expires
      • Time - DeathTimer3 expires
      • Time - DeathTimer4 expires
      • Time - DeathTimer5 expires
      • Time - DeathTimer6 expires
      • Time - DeathTimer8 expires
      • Time - DeathTimer9 expires
      • Time - DeathTimer10 expires
      • Time - DeathTimer11 expires
      • Time - DeathTimer12 expires
    • Conditions
    • Actions
      • Set Herorevivingspot[1] = (Center of Revive Spawn T <gen>)
      • Set Herorevivingspot[2] = (Center of Revive Spawn CT <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer2) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer3) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[3]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer4) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[4]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer5) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[5]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer6) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[6]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer8) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[8]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer9) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[9]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer10) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[10]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer11) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[11]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer12) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[12]
        • Else - Actions
      • Unit Group - Pick every unit in RevivableHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in TeamCT) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at Herorevivingspot[2], Show revival graphics
                  • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Revive Spawn CT <gen>) over 0.00 seconds
                  • Unit Group - Remove (Picked unit) from RevivableHeroes
                  • Custom script: call RemoveLocation (udg_Herorevivingspot[2])
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in TeamT) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at Herorevivingspot[1], Show revival graphics
                  • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Revive Spawn T <gen>) over 0.00 seconds
                  • Unit Group - Remove (Picked unit) from RevivableHeroes
                  • Custom script: call RemoveLocation (udg_Herorevivingspot[1])
                  • Custom script: call RemoveLocation (udg_Cam_Point_1)
                  • Custom script: call RemoveLocation (udg_Cam_Point_2)
                • Else - Actions
            • Else - Actions

(Line: 88) (Word: 10) Location Leak
Camera - Pan camera for (Owner of (Picked unit)) to (Center of Revive Spawn CT <gen>) over 0.00 seconds
Camera - Pan camera for (Owner of (Picked unit)) to ^Leak

(Line: 97) (Word: 10) Location Leak
Camera - Pan camera for (Owner of (Picked unit)) to (Center of Revive Spawn T <gen>) over 0.00 seconds
Camera - Pan camera for (Owner of (Picked unit)) to ^Leak

Scan Complete
Location leaks: 2
Special Effect leaks: 0
Lightning leaks: 0
Unit Group leaks: 0
Player Group leaks: 0

Variables
Herorevivingspot[1] : (Line: 15) Location - Removed: Yes
Herorevivingspot[2] : (Line: 16) Location - Removed: Yes

Summary
Total Leaks: 2
Unremoved Variables: 0
Scan duration: 0 seconds
Total Lines Scanned: 104
Total Words Scanned: 622
Fixing Memory Leaks: http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27219
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You create the locations before the loop and destroy it within the loop. Now is it sure that the loop runs exactly one time? I guess there could be more loop iterations or none, so destroy the locations after the loop.

Your camera actions should use the variables Herorevivingspot[1]/Herorevivingspot[2] like your revival actions already do. You want the same coordinates and do not have to freshly create the location. I do not know where your udg_Cam_Point_1/udg_Cam_Point_2 come from but since you do not give them a new location there they are probably wrong too.

Anyway, if you do not move your GUI regions which you extract your locations from, you could actually put the

  • Set Herorevivingspot[1] = (Center of Revive Spawn T <gen>)
  • Set Herorevivingspot[2] = (Center of Revive Spawn CT <gen>)
in an initialization trigger and leave out the remove actions completly. I presume that the trigger shown here can be run multiple times throughout the progress of the game.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It's exactly what WaterKnight said:

  • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Revive Spawn CT <gen>) over 0.00 seconds
You move the camera to a position and didn't use the variables you set up earlier.

The same goes for
  • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Revive Spawn T <gen>) over 0.00 seconds
And everything else WaterKnight said is also correct.
You use those 2 locations A LOT (in a lot of different triggers), so if you just set them up at map init and use those 2 variables in all your triggers, you never even have to remove them.

Also, if you can: use 2 separate variables instead of an arrayed one (arrayed variables can contain up to 8192 different values, a bit of an overkill if you only need 2 of them).
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
Thnx but i dont understand it all. Would be more simpel if some one show me the real trigger.

Or say where to put the set variable.

For example i made those but dont know where to put them in.

For example.

under hero instant revive you know what i mean. Under what line.
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
SOLVED? I think i get it now =) cheers.

  • Hero DeathRespawn Timer expires
    • Events
      • Time - DeathTimer2 expires
      • Time - DeathTimer3 expires
      • Time - DeathTimer4 expires
      • Time - DeathTimer5 expires
      • Time - DeathTimer6 expires
      • Time - DeathTimer8 expires
      • Time - DeathTimer9 expires
      • Time - DeathTimer10 expires
      • Time - DeathTimer11 expires
      • Time - DeathTimer12 expires
    • Conditions
    • Actions
      • Set Herorevivingspot[1] = (Center of Revive Spawn CT <gen>)
      • Set Herorevivingspot[2] = (Center of Revive Spawn T <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer2) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer3) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[3]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer4) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[4]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer5) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[5]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer6) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[6]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer8) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[8]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer9) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[9]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer10) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[10]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer11) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[11]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for DeathTimer12) Less than 1.00
        • Then - Actions
          • Countdown Timer - Hide DeathTimerWindow[12]
        • Else - Actions
      • Unit Group - Pick every unit in RevivableHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in TeamCT) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at Herorevivingspot[1], Show revival graphics
                  • Camera - Pan camera for (Owner of (Picked unit)) to Herorevivingspot[1] over 0.00 seconds
                  • Unit Group - Remove (Picked unit) from RevivableHeroes
                  • Custom script: call RemoveLocation (udg_Herorevivingspot[2])
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in TeamT) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at Herorevivingspot[2], Show revival graphics
                  • Camera - Pan camera for (Owner of (Picked unit)) to Herorevivingspot[2] over 0.00 seconds
                  • Unit Group - Remove (Picked unit) from RevivableHeroes
                  • Custom script: call RemoveLocation (udg_Herorevivingspot[1])
                • Else - Actions
            • Else - Actions
Note changed custom script 1 to 1 and 2 to 2
 
Status
Not open for further replies.
Top