• 🏆 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!

Remove Attached Special Effects?

Status
Not open for further replies.
Level 2
Joined
Dec 19, 2013
Messages
6
Hello,

I'm trying to rework a lot of old systems in my map, mainly by rewriting everything in vJASS to catch and mitigate memory leaks. One system has been particularly difficult for me to find a suitable solution for. When a unit is killed by a certain player's unit, a permanent corpse is created after the dying unit is removed, and then a special effect is created above (attached overhead) that corpse to denote it was killed by this special player. My question involves the special effect created:
Is there any way to remove the special effect without causing memory leaks?

There are thousands of these units and subsequently special effects created every game. The units are removed guaranteed at a certain time of the day, but can also be removed anytime via various abilities. If they were just removed during fixed times, there would be no problem as I could just store them in a group and properly take care of them, though the fact that they can be deleted at any time has been difficult. I've tried using locust units but enumerating through them is a nightmare in itself, and I've tried using destructables, though I'm running into various pathing problems.

I can think of various other solutions to this, but this community is full of intelligent people, and I would greatly appreciate your help.
 
Level 11
Joined
Jun 2, 2004
Messages
849
A sort of fallback that might be usable is having a garbage collection timer for every special effect. If you know that none of these will possibly last longer than 60 seconds (or whatever), you can generate a timer and event that will remove the special effect 60 seconds after creation. Even if the unit is long gone from resurrection/raise dead/raise skeleton/what have you, it'll prevent the special effect from leaking.
 
Status
Not open for further replies.
Top