DestroyEffect() doesn't work as expected

Ashlebede

New Member
Reaction score
43
When I use [ljass]DestroyEffect()[/ljass] to remove a special effect, it sometimes doesn't play the model's death animation. I'd say it is played correctly about 75% of the time. The other 25% of the time, the model just disappears.

Any idea what's wrong here, or should I just try attaching every effect to a dummy to see if it works any better when the effect is added with [ljass]AddSpecialEffectTarget()[/ljass] ?

Edit : The model I use is [ljass]"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"[/ljass], just for the info.

Oh, and another thing I need to mention. My spell creates 21 effects when used. Every spell cast, all of the effects will have the same behaviour ; they will either all play the death animation or all not play the death animation. And I need it to play the death animation, since I destroy them as soon as they're created.
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
Some effects won't play their entire animation when you call DestroyEffect() as soon as you create it. You'll have to destroy it after the animation. You can find the animation length by viewing the model in the Object Editor.
 

jrhetf4xb

Member
Reaction score
12
But that doesn't make sense if the effect doesn't show from time to time - if the effect needs time to play its death animation then it wouldn't randomly appear it or not. Are you sure that your script hasn't got any problems?

In the meantime: TimedEffects
 

Bribe

vJass errors are legion
Reaction score
67
Special Effects need to be preloaded at map initialization, otherwise they will not play the first time they are used.

JASS:
function init takes nothing returns nothing
    call Preload("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl")
endfunction
 

Bribe

vJass errors are legion
Reaction score
67
I am pretty sure it also works for special effects, because I have tested my special effects both ways.

1. Without Preload - effect does not appear the first request

2. With Preload - effect appears every single time.

Those were controlled experiments.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top