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

Need help cleaning leaks

Status
Not open for further replies.
Level 8
Joined
Jul 17, 2004
Messages
283
Here are my triggers. What is leaking and how do I fix them?

  • Dash Knockback
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dash
    • Actions
      • Set maxIndexDash = (maxIndexDash + 1)
      • Set casterUnitsIndexDash[maxIndexDash] = (Triggering unit)
      • Set targetUnitsIndexDash[maxIndexDash] = (Target unit of ability being cast)
      • Set locationUnitsIndexDash[maxIndexDash] = (Position of casterUnitsIndexDash[maxIndexDash])
      • Set timeLeftDash[maxIndexDash] = 9
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • maxIndexDash Equal to 1
        • Then - Actions
          • Trigger - Turn on Dash Push <gen>
        • Else - Actions
  • Dash Push (Initially Off)
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to maxIndexDash, do (Actions)
        • Loop - Actions
          • Unit - Move targetUnitsIndexDash[tempInt] instantly to ((Position of targetUnitsIndexDash[tempInt]) offset by 8.00 towards (Facing of casterUnitsIndexDash[tempInt]) degrees)
          • Set timeLeftDash[tempInt] = (timeLeftDash[tempInt] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • timeLeftDash[tempInt] Equal to 0
            • Then - Actions
              • Set casterUnitsIndexDash[tempInt] = casterUnitsIndexDash[maxIndexDash]
              • Set casterUnitsIndexDash[tempInt] = No unit
              • Set targetUnitsIndexDash[tempInt] = targetUnitsIndexDash[maxIndexDash]
              • Set targetUnitsIndexDash[maxIndexDash] = No unit
              • Set timeLeftDash[tempInt] = timeLeftDash[maxIndexDash]
              • Set timeLeftDash[maxIndexDash] = 0
              • Set maxIndexDash = (maxIndexDash - 1)
              • Set tempInt = (tempInt - 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • maxIndexDash Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
i already told u what leaks in ur other post. You shouldn't of started a new post for the exact same question.
this leaks
  • ((Position of targetUnitsIndexDash[tempInt]) offset by 8.00 towards (Facing of casterUnitsIndexDash[tempInt]) degrees)
Anything with center of / position of / offset / player start location / random point leaks.
 
Level 8
Joined
Jul 17, 2004
Messages
283
So is this how it should look?

  • Dash Knockback
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dash
    • Actions
      • Set maxIndexDash = (maxIndexDash + 1)
      • Set casterUnitsIndexDash[maxIndexDash] = (Triggering unit)
      • Set targetUnitsIndexDash[maxIndexDash] = (Target unit of ability being cast)
      • Set tempLocation[maxIndexDash] = ((Position of targetUnitsIndexDash[maxIndexDash]) offset by 8.00 towards (Facing of casterUnitsIndexDash[maxIndexDash]) degrees)
      • Set timeLeftDash[maxIndexDash] = 9
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • maxIndexDash Equal to 1
        • Then - Actions
          • Trigger - Turn on Dash Push <gen>
        • Else - Actions
  • Dash Push
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to maxIndexDash, do (Actions)
        • Loop - Actions
          • Unit - Move targetUnitsIndexDash[tempInt] instantly to tempLocation[tempInt]
          • Custom script: call RemoveLocation( udg_tempLocation[tempInt])
          • Set timeLeftDash[tempInt] = (timeLeftDash[tempInt] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • timeLeftDash[tempInt] Equal to 0
            • Then - Actions
              • Set casterUnitsIndexDash[tempInt] = casterUnitsIndexDash[maxIndexDash]
              • Set casterUnitsIndexDash[tempInt] = No unit
              • Set targetUnitsIndexDash[tempInt] = targetUnitsIndexDash[maxIndexDash]
              • Set targetUnitsIndexDash[maxIndexDash] = No unit
              • Set timeLeftDash[tempInt] = timeLeftDash[maxIndexDash]
              • Set timeLeftDash[maxIndexDash] = 0
              • Set maxIndexDash = (maxIndexDash - 1)
              • Set tempInt = (tempInt - 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • maxIndexDash Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
this leaks still.
  • (Position of targetUnitsIndexDash[maxIndexDash])
also this wont work all it will do is move the unit to the same spot everytime.

You need tempPoint1 and tempPoint2
tempPoint1 = position of the unit.
tempPoint2 = offset
then move unit then remove the locations with custom script to clean the leaks.

this must all be done in your loop trigger not in your cast trigger.
 
Level 8
Joined
Jul 17, 2004
Messages
283
Should it be like this?

  • Dash Push
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to maxIndexDash, do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of targetUnitsIndexDash[tempInt])
          • Set TempPoint2 = (TempPoint offset by 8.00 towards (Facing of casterUnitsIndexDash[tempInt]) degrees)
          • Unit - Move targetUnitsIndexDash[tempInt] instantly to TempPoint2
          • Custom script: call RemoveLocation( udg_TempPoint)
          • Custom script: call RemoveLocation( udg_TempPoint2)
          • Set timeLeftDash[tempInt] = (timeLeftDash[tempInt] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • timeLeftDash[tempInt] Equal to 0
            • Then - Actions
              • Set casterUnitsIndexDash[tempInt] = casterUnitsIndexDash[maxIndexDash]
              • Set casterUnitsIndexDash[maxIndexDash] = No unit
              • Set targetUnitsIndexDash[tempInt] = targetUnitsIndexDash[maxIndexDash]
              • Set targetUnitsIndexDash[maxIndexDash] = No unit
              • Set timeLeftDash[tempInt] = timeLeftDash[maxIndexDash]
              • Set timeLeftDash[maxIndexDash] = 0
              • Set maxIndexDash = (maxIndexDash - 1)
              • Set tempInt = (tempInt - 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • maxIndexDash Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Status
Not open for further replies.
Top