• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[General] Leak Remove

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,614
Hey.

I think this trigger leaks and I've no idea how to fix it. Please fix it for me and can I continue doing this boss spell!

Map attached. Trigger looks like this:

  • Damage
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
      • Boss_Event Equal to True
    • Actions
      • Set Skull_Point[Skull_Counter] = (Position of AAAPhodom)
      • Set Skull_Counter = (Skull_Counter + 1)
      • Wait 1.00 seconds
      • -------- --------
      • Special Effect - Create a special effect at Skull_Point[1] using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set TempGroup = (Units owned by Player 1 (Red))
      • Set TempGroup2 = (Units within 100.00 of Skull_Point[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup) Equal to True) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to 0))))
      • Unit Group - Pick every unit in TempGroup2 and do (Actions)
        • Loop - Actions
          • Unit - Cause AAAPhodom to damage AAAPhodom, dealing 50.00 damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call DestroyGroup(udg_TempGroup2)
      • Custom script: call RemoveLocation(udg_Skull_Point[1])
      • -------- --------
      • For each (Integer A) from 1 to (Skull_Counter - 1), do (Actions)
        • Loop - Actions
          • Set Skull_Point[(Integer A)] = Skull_Point[((Integer A) + 1)]
      • Custom script: call RemoveLocation(udg_Skull_Point[udg_Skull_Counter])
      • Set Skull_Counter = (Skull_Counter - 1)
Rep + credits for the helper.
 

Attachments

  • PALADIN DMG.w3x
    18.1 KB · Views: 42
Level 17
Joined
Nov 13, 2006
Messages
1,814
Hey.

I think this trigger leaks and I've no idea how to fix it. Please fix it for me and can I continue doing this boss spell!

Map attached. Trigger looks like this:

  • Damage
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
      • Boss_Event Equal to True
    • Actions
      • Set Skull_Point[Skull_Counter] = (Position of AAAPhodom)
      • Set Skull_Counter = (Skull_Counter + 1)
      • Wait 1.00 seconds
      • -------- --------
      • Special Effect - Create a special effect at Skull_Point[1] using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set TempGroup = (Units owned by Player 1 (Red))
      • Set TempGroup2 = (Units within 100.00 of Skull_Point[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup) Equal to True) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to 0))))
      • Unit Group - Pick every unit in TempGroup2 and do (Actions)
        • Loop - Actions
          • Unit - Cause AAAPhodom to damage AAAPhodom, dealing 50.00 damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call DestroyGroup(udg_TempGroup2)
      • Custom script: call RemoveLocation(udg_Skull_Point[1])
      • -------- --------
      • For each (Integer A) from 1 to (Skull_Counter - 1), do (Actions)
        • Loop - Actions
          • Set Skull_Point[(Integer A)] = Skull_Point[((Integer A) + 1)]
      • Custom script: call RemoveLocation(udg_Skull_Point[udg_Skull_Counter])
      • Set Skull_Counter = (Skull_Counter - 1)
Rep + credits for the helper.

for me its give fatal error when i try start the map even i turned off all trigger. to u this demo map well?

just a notice, maybe u can removelocation in loop?

  • For each (Integer A) from 1 to (Skull_Counter - 1), do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation(udg_Skull_Point[GetForLoopIndexA()])
      • Set Skull_Point[(Integer A)] = Skull_Point[((Integer A) + 1)]
  • Custom script: call RemoveLocation(udg_Skull_Point[udg_Skull_Counter])
 
Level 17
Joined
Nov 13, 2006
Messages
1,814

Attachments

  • 1.jpg
    1.jpg
    17.4 KB · Views: 77
Level 7
Joined
Jan 28, 2012
Messages
266
  • Damage
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
      • Boss_Event Equal to True
    • Actions
      • Custom script: local location udg_Skull_Loc
      • Set Skull_Loc = (Position of AAAPhodom)
      • Wait 1.00 seconds
      • -------- --------
      • Special Effect - Create a special effect at Skull_Loc using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set TempGroup = (Units owned by Player 1 (Red))
      • Set TempGroup2 = (Units within 100.00 of Skull_Loc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup) Equal to True) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to 0))))
      • Unit Group - Pick every unit in TempGroup2 and do (Actions)
        • Loop - Actions
          • Unit - Cause AAAPhodom to damage AAAPhodom, dealing 50.00 damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call DestroyGroup(udg_TempGroup2)
      • Custom script: call RemoveLocation(udg_Skull_Loc)
made leakless uses a local instead of a global.
 

Attachments

  • PALADIN DMG.w3x
    142.8 KB · Views: 42
Level 17
Joined
Nov 13, 2006
Messages
1,814
Okay fixed. Here's the fixed map in this post.

acctually if u replace points to coords then i think ok

still i think kinda wrong if u use 1 sec waits in 0.3 sec periodic triggers but u know, also u just pick the units in temp group2 only around 1st point :p

JASS:
function Trig_Damage_Conditions takes nothing returns boolean
    return udg_Boss_Event
endfunction

function Trig_Damage_Actions takes nothing returns nothing
    local unit pu
    local integer i
    local integer max
    set udg_X[udg_Skull_Counter] = GetUnitX(udg_AAAPhodom)
    set udg_Y[udg_Skull_Counter] = GetUnitY(udg_AAAPhodom)
    set udg_Skull_Counter = udg_Skull_Counter + 1
    call TriggerSleepAction( 1.00 )
    //  
    call DestroyEffect(AddSpecialEffect( "Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl" , udg_X[1], udg_Y[1]))
    call GroupEnumUnitsOfPlayer (udg_TempGroup, Player(0), null)
    call GroupEnumUnitsInRange(udg_TempGroup2, udg_X[1], udg_Y[1], 100.00, null)
    loop
        set pu = FirstOfGroup(udg_TempGroup2)
        exitwhen (pu==null)
        if IsUnitInGroup(pu, udg_TempGroup) and GetUnitAbilityLevel(pu, 'Avul') == 0 and not IsUnitType(pu, UNIT_TYPE_DEAD) then
            call UnitDamageTarget(udg_AAAPhodom, udg_AAAPhodom, 50.00, true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null)
        endif
        call GroupRemoveUnit(udg_TempGroup2, pu)
    endloop
 
    set i = 1
    set max = udg_Skull_Counter - 1
    loop
        exitwhen i > max
        set udg_X[i] = udg_X[i + 1 ]
        set udg_Y[i] = udg_Y[i + 1 ]
        set i = i + 1
    endloop
    set udg_Skull_Counter = udg_Skull_Counter - 1
    set pu = null
endfunction

//===========================================================================
function InitTrig_Damage takes nothing returns nothing
    set gg_trg_Damage = CreateTrigger( )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Damage, 0.30 )
    call TriggerAddCondition( gg_trg_Damage, Condition( function Trig_Damage_Conditions ) )
    call TriggerAddAction( gg_trg_Damage, function Trig_Damage_Actions )
endfunction

if u want make to others points too then
JASS:
    call DestroyEffect(AddSpecialEffect( "Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl" , udg_X[1], udg_Y[1]))
    call GroupEnumUnitsInRange(udg_TempGroup2, udg_X[1], udg_Y[1], 100.00, null)

change to this

JASS:
    call DestroyEffect(AddSpecialEffect( "Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl" , udg_X[udg_Skull_Counter], udg_Y[udg_Skull_Counter]))
     call GroupEnumUnitsInRange(udg_TempGroup2, udg_X[udg_Skull_Counter], udg_Y[udg_Skull_Counter], 100.00, null)
 

Attachments

  • PALADIN DMG1.w3x
    142.9 KB · Views: 35
Level 37
Joined
Mar 6, 2006
Messages
9,243
I'm not sure if shadowing a global leaks if you do not null the variable.

I would do it this way:
  • Damage
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
      • Boss_Event Equal to True
    • Actions
      • Custom script: local location l = GetUnitLoc(udg_AAAPhodom)
      • Wait 1.00 seconds
      • Custom script: set udg_Skull_Loc = l
      • -------- --------
      • Special Effect - Create a special effect at Skull_Loc using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set TempGroup = (Units within 100.00 of Skull_Loc matching ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) Equal to Player 1 (Red)) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to 0))))
      • Unit Group - Pick every unit in TempGroup2 and do (Actions)
        • Loop - Actions
          • Unit - Cause AAAPhodom to damage AAAPhodom, dealing 50.00 damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(l)
      • Custom script: set l = null
 
Status
Not open for further replies.
Top