• 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.

Does mem leaks still exist by creating Special Effects and not destroying them? [1.29]

Status
Not open for further replies.
By my tests, that function call does not automatically destroy the special effect, effectively implying the existence of a leak.

You can use this trigger as a reference point:

  • Special Effect Timed
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", 0, 0)
      • Special Effect - Set Time of (Last created special effect) to 1.00
      • Custom script: call BJDebugMsg("Handle id of effect adjusted to minimum index: " + I2S(GetHandleId(bj_lastCreatedEffect) - 0x100000))
or in JASS (vJASS isn't working right now)

JASS:
function Trig_Special_Effect_Timed_Actions takes nothing returns nothing
    set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", 0, 0)
    call BlzSetSpecialEffectTime(bj_lastCreatedEffect, 1.00)
    call BJDebugMsg("Handle id of effect adjusted to minimum index: " + I2S(GetHandleId(bj_lastCreatedEffect) - 0x100000))
endfunction

function InitTrig_Special_Effect_Timed takes nothing returns nothing
    set gg_trg_Special_Effect_Timed = CreateTrigger()
    call TriggerRegisterTimerEvent( gg_trg_Special_Effect_Timed, 0.1, true)
    call TriggerAddCondition( gg_trg_Special_Effect_Timed, Condition(function Trig_Special_Effect_Timed_Actions))
endfunction
 
is this the same as destroying it ??


  • ani.gif
    Special Effect - Set Time of (Last created special effect) to 1.00
No,
SetTime moves forward or backwards in the displayed part of the animation of the specialeffect (quite cool to animate custom Progressbars).
in your example it will display the effect from second 1.0, basicly skiping second 0 to 0.99.
Edit: It does not work for any model, guess it needs an animation.
 
Last edited:
Level 4
Joined
Jul 6, 2005
Messages
20
No,
SetTime moves forward or backwards in the displayed part of the animation of the specialeffect (quite cool to animate custom Progressbars).
in your example it will display the effect from second 1.0, basicly skiping second 0 to 0.99.
Edit: It does not work for any model, guess it needs an animation.

So it works for ex: Buildings birth animation, right?
 

Dr Super Good

Spell Reviewer
Level 65
Joined
Jan 18, 2005
Messages
27,290
One has to get their head around the concept of something still existing even if it is not visible. As far as Warcraft III is concerned the special effects still very much exist even if they are not visible. It will still try to draw them to the screen, it will still keep track of their animation state and will still require similar overhead as if they were visible. Destroying the special effect instructs Warcraft III to stop doing all of that and hence it is required to do so.

This same sort of leak exists in StarCraft II even though there are some mechanics in place to try and prevent it.
 
Status
Not open for further replies.
Top