• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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 26
Joined
Nov 18, 2012
Messages
1,895
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