• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!
In-cred-ib-le
Reaction score
0

Profile posts Latest activity Postings Experience Resources About

  • Keep in mind that the gg_unit_H000_0000 must be generated by the world editor, otherwise it will register a unit which is "null", meaning, a variable which doesn't point at any unit at all.
    function ME takes nothing returns nothing
    //I never said it, but Locations are stupid. Use x/y coordinates whenever you can.
    local real tX = GetOrderPointX()
    local real tY = GetOrderPointY()
    local string s = "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl"

    //Before, you created the effect twice and never removed the first one.
    call DestroyEffect(AddSpecialEffect(s, GetUnitX(gg_unit_H000_0000), GetUnitY(gg_unit_H000_0000)))
    //SetUnitX/Y is also nice.
    call SetUnitX(gg_unit_H000_0000, tX)
    call SetUnitY(gg_unit_H000_0000, tY)
    call DestroyEffect(AddSpecialEffect(s, tX, tY))

    //And done. We didn't have to clear up anything this time :D
    endfunction

    function InitTrig_MEffects takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterUnitEvent(t, gg_unit_H000_0000, EVENT_UNIT_ISSUED_POINT_ORDER )
    call TriggerAddAction(t, function ME )
    set t = null
    endfunction
    Well, nothing gets "un-leaked" unless you dont destroy them, right?

    Also, is is depending on the effect model you are using, when you are to destroy it.

    You know ThunderClap, and WarStomp for instance. They have no specific animation index, which means, they can be removed instantly after they have been created without aborting its gfx. In cases like these, the easiest you could do is to simply:
    call DestroyEffect(AddSpecialEffectLoc(s, i))

    In other cases, you would have to store the effect in a variable, wait, and then destroy it.
    Also, dont forget, that locations leak if you dont destroy them as well (in fact, practically everything which is not code, integer, real or boolean do leak, and are called handles)

    Keep in mind, always null local handles at the end of the function.
  • Loading…
  • Loading…
  • Loading…
  • Loading…
  • Loading…
Top