• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Why doesn't this destroy the Special Effect!?

Status
Not open for further replies.
Level 6
Joined
Apr 23, 2009
Messages
94
  • Events
    • Time - Every 5.00 seconds of game time
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Life of (Matching unit)) Less than or equal to 45.00)) and do (Actions)
      • Loop - Actions
        • Set loc = (Position of (Picked unit))
        • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
        • Special Effect - Destroy (Last created special effect)
        • Custom script: call RemoveLocation(udg_loc)
The special effect remains after the unit has died.
But why!?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Because the animation has to finish. The WC3 engine has the animation system unrelated to the actual object system. Thus WC3 can still be rendering objects which do not exist if done correctly. This is most noticable with particles and trails as those are rendered separatly.

When you destroy an effect, it plays its death animation afterwhich the object will stop being rendered. However your effect has no death animation, thus it must finish its current animation if its being displayer before it stops being displayed, no mater how long that is, leaving the view of that area of the map will instantly stop it being rendered. Be assured that no leaks will occur.

If you mean why does the ground effect persist so long, its like other effects, its unrelated to any actual model and thus will eventually automatically expire so do not wory about leaks.
 
Level 4
Joined
Jun 16, 2009
Messages
92
No, it's because you aren't checking to see whether the unit is dead or not.

You can add an if/then/else condition, or just adjust your "pick every unit in unit group" to "pick every unit in unit group matching condition" (unit is alive = true.)

Although the unit is 'dead' it still exists, and its hp is 'still' below your given amount. They will continue to exist until either A. The unit's decay time is complete, or B. They explode upon death.
 
Status
Not open for further replies.
Top