• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Removing leak of Array Locations?

Status
Not open for further replies.
Level 30
Joined
Jul 23, 2009
Messages
1,033
I've read on tutorials about removing locations to prevent leaks using the

  • Custom script: call RemoveLocation(udg_Loc)
however my question is; how do I remove an array location?

I tried guessing

  • Custom script: call RemoveLocation(udg_Consecration_FireLoc[Consecration_LoopInt])
It just gave me this error

attachment.php


In case you want to see the triggers I am tyring to prevent leaks from:
  • Consecration Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Consecration
    • Actions
      • Set Consecration_Index = (Consecration_Index + 1)
      • Set Consecration_Caster[Consecration_Index] = (Triggering unit)
      • Set Consecration_Loc[Consecration_Index] = (Target point of ability being cast)
      • Special Effect - Create a special effect at Consecration_Loc[Consecration_Index] using Abilities\Spells\Other\Levelup\LevelupCaster.mdl
      • Set Consecration_Effect[Consecration_Index] = (Last created special effect)
      • Special Effect - Destroy Consecration_Effect[Consecration_Index]
      • Trigger - Turn on Consecration Loop <gen>
      • Unit - Create 1 Consecration Dummy for (Owner of (Triggering unit)) at Consecration_Loc[Consecration_Index] facing Default building facing (270.0) degrees
      • Set Consecration_Dummy[Consecration_Index] = (Last created unit)
      • Set Consecration_Timer[Consecration_Index] = 5.00
  • Consecration Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer Consecration_LoopInt) from 1 to Consecration_Index, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Consecration_Timer[Consecration_LoopInt] Greater than (>) 0.00
            • Then - Actions
              • Set Consecration_FireOffset[Consecration_LoopInt] = (Random real number between 0.00 and 150.00)
              • Set Consecration_FireAngle[Consecration_LoopInt] = (Random real number between 0.00 and 360.00)
              • Set Consecration_FireLoc[Consecration_LoopInt] = (Consecration_Loc[Consecration_LoopInt] offset by Consecration_FireOffset[Consecration_LoopInt] towards Consecration_FireAngle[Consecration_LoopInt] degrees)
              • Special Effect - Create a special effect at Consecration_FireLoc[Consecration_LoopInt] using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
              • Set Consecration_Fire[Consecration_LoopInt] = (Last created special effect)
              • Special Effect - Destroy Consecration_Fire[Consecration_LoopInt]
              • Set Consecration_Timer[Consecration_LoopInt] = (Consecration_Timer[Consecration_LoopInt] - 0.10)
              • Set Consecration_TargetGroup[Consecration_LoopInt] = (Units within 150.00 of Consecration_Loc[Consecration_LoopInt] matching ((((Owner of (Matching unit)) is an enemy of (Owner of Consecration_Caster[Consecration_LoopInt])) Equal to (==) True) and (((Matching unit) is alive) Equal to (==) True)))
              • Unit Group - Pick every unit in Consecration_TargetGroup[Consecration_LoopInt] and do (Actions)
                • Loop - Actions
                  • Unit - Cause Consecration_Caster[Consecration_LoopInt] to damage (Picked unit), dealing 10.00 damage of attack type Spells and damage type Normal
            • Else - Actions
              • Unit - Remove Consecration_Dummy[Consecration_LoopInt] from the game
              • Set Consecration_Caster[Consecration_LoopInt] = Consecration_Caster[Consecration_Index]
              • Set Consecration_Dummy[Consecration_LoopInt] = Consecration_Dummy[Consecration_Index]
              • Set Consecration_Effect[Consecration_LoopInt] = Consecration_Effect[Consecration_Index]
              • Set Consecration_Fire[Consecration_LoopInt] = Consecration_Fire[Consecration_Index]
              • Set Consecration_FireAngle[Consecration_LoopInt] = Consecration_FireAngle[Consecration_Index]
              • Custom script: call RemoveLocation(udg_Consecration_FireLoc[Consecration_LoopInt])
              • Set Consecration_FireLoc[Consecration_LoopInt] = Consecration_FireLoc[Consecration_Index]
              • Set Consecration_FireOffset[Consecration_LoopInt] = Consecration_FireOffset[Consecration_Index]
              • Custom script: call RemoveLocation(udg_Consecration_Loc[Consecration_LoopInt])
              • Set Consecration_Loc[Consecration_LoopInt] = Consecration_Loc[Consecration_Index]
              • Custom script: call DestroyGroup(udg_Consecration_TargetGroup[Consecration_LoopInt])
              • Set Consecration_TargetGroup[Consecration_LoopInt] = Consecration_TargetGroup[Consecration_Index]
              • Set Consecration_Timer[Consecration_LoopInt] = Consecration_Timer[Consecration_Index]
              • Set Consecration_Index = (Consecration_Index - 1)
              • Set Consecration_LoopInt = (Consecration_LoopInt - 1)
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Consecration_Index Equal to (==) 0
                  • Then - Actions
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
 

Attachments

  • temp.png
    temp.png
    58 KB · Views: 163
Last edited by a moderator:
Status
Not open for further replies.
Top