• 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] Need help fixing leaks

Status
Not open for further replies.
Level 2
Joined
Dec 15, 2012
Messages
26
I've been working on a spell, and i've gotten to this point. I need to figure out how to fix the leaks. I haven't done anything like this before(I've done triggering for a while, but i haven't been aware of leaks.), but i've done everything i could find about it. If anybody knows what the issue is, help would be largely apreciated. :3
  • Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dusk
    • Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 50.00 at loc3, dealing 100.00 damage of attack type Chaos and damage type Enhanced
      • Special Effect - Create a special effect at (loc2 offset by (Real(dusk2)) towards (Angle from loc2 to loc) degrees) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Set dusk = ((Integer(((Distance between loc and loc2) / 20.00))) - ((Integer((Distance between loc and loc2))) mod 20))
      • -------- The above triggers are leftovers from previous efforts. I decided to keep them in, in case they may help in some way. --------
      • Set loc = (Target point of ability being cast)
      • Set loc2 = (Position of (Casting unit))
      • Set dusk = (Integer(((Distance between loc and loc2) / 20.00)))
      • For each (Integer A) from 1 to dusk, do (Actions)
        • Loop - Actions
          • Set loc3 = (loc2 offset by (Real(dusk2)) towards (Angle from loc2 to loc) degrees)
          • Special Effect - Create a special effect at loc3 using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set Group = (Units within 50.00 of loc3 matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
          • Unit Group - Pick every unit in Group and do (Actions)
            • Loop - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Normal
          • Custom script: call DestroyGroup(udg_Group)
          • Set dusk2 = (dusk2 + 20)
      • Set dusk2 = 0
      • Set dusk = 0
      • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call RemoveLocation(udg_loc2)
      • Custom script: call RemoveLocation(udg_loc3)
Hope someone will help soon, and thanks in advance.
 
Level 2
Joined
Dec 15, 2012
Messages
26
I tried that now. Still leaks, it seems.
This is what it looks like now.
  • Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dusk
    • Actions
      • Set loc = (Target point of ability being cast)
      • Set loc2 = (Position of (Casting unit))
      • Set dusk = (Integer(((Distance between loc and loc2) / 20.00)))
      • For each (Integer A) from 1 to dusk, do (Actions)
        • Loop - Actions
          • Set loc3 = (loc2 offset by (Real(dusk2)) towards (Angle from loc2 to loc) degrees)
          • Special Effect - Create a special effect at loc3 using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set Group = (Units within 50.00 of loc3 matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
          • Custom script: call RemoveLocation(udg_loc3)
          • Unit Group - Pick every unit in Group and do (Actions)
            • Loop - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Normal
          • Custom script: call DestroyGroup(udg_Group)
          • Set dusk2 = (dusk2 + 20)
      • Set dusk2 = 0
      • Set dusk = 0
      • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call RemoveLocation(udg_loc2)
 
Level 2
Joined
Dec 15, 2012
Messages
26
Sorry, but i'm not very familiar with the terminology. Would nulling them mean to set the variables to zero?
 
Level 2
Joined
Dec 15, 2012
Messages
26
I'm not entirely sure if this is right, but this is what i assume is right. It still, leaks so i guess i'd just like to know if i can even possibly get it to stop leaking. I'm a perfectionist, so it bothers me if i know it could be optimized further ^^
  • Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dusk
    • Actions
      • Set loc = (Target point of ability being cast)
      • Set loc2 = (Position of (Casting unit))
      • Set dusk = (Integer(((Distance between loc and loc2) / 20.00)))
      • For each (Integer A) from 1 to dusk, do (Actions)
        • Loop - Actions
          • Set loc3 = (loc2 offset by (Real(dusk2)) towards (Angle from loc2 to loc) degrees)
          • Special Effect - Create a special effect at loc3 using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set Group = (Units within 50.00 of loc3 matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
          • Custom script: call RemoveLocation(udg_loc3)
          • Custom script: set udg_loc3 = null
          • Unit Group - Pick every unit in Group and do (Actions)
            • Loop - Actions
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Normal
          • Custom script: call DestroyGroup(udg_Group)
          • Custom script: set udg_Group = null
          • Set dusk2 = (dusk2 + 20)
      • Set dusk2 = 0
      • Set dusk = 0
      • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call RemoveLocation(udg_loc2)
      • Custom script: set udg_loc = null
      • Custom script: set udg_loc2 = null
 
Level 2
Joined
Dec 15, 2012
Messages
26
Thanks a bunch for the help then. Good day/night to the both of you, then. ^^

Edit: Sorry, but i noticed it's still leaking a bit. Should i just ignore it?
 
Level 2
Joined
Dec 15, 2012
Messages
26
JASS:
function HandleCount takes nothing returns nothing
    local location L = Location(0,0)
    call BJDebugMsg(I2S(GetHandleId(L)-0x100000))
    call RemoveLocation(L)
    set L = null
endfunction

//===========================================================================
function InitTrig_HandleCounter takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterTimerEvent(t,0.09,true)
    call TriggerAddAction(t,function HandleCount)
endfunction
I use this script from this tutorial: http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/debugging-188204/
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,994
Thanks a bunch for the help then. Good day/night to the both of you, then. ^^

Edit: Sorry, but i noticed it's still leaking a bit. Should i just ignore it?
Uhm? Are you kidding me? Removing locations and groups isn't enough to clear memory leaks? That is ...crap. If you remove a location that has a value, it is completed cleared lol.
 
Level 2
Joined
Dec 15, 2012
Messages
26
Uhm? Are you kidding me? Removing locations and groups isn't enough to clear memory leaks? That is ...crap. If you remove a location that has a value, it is completed cleared lol.
Excuse me? I have no idea what you're trying to communicate, but it seems like you're attacking me for asking for help. Smooth.
I'm basing what i say off off that the thing i use to see the leaks tell me that it increases steadily every time i use the spell.
 
Status
Not open for further replies.
Top