Hi Everyone,
At the moment, I am making a Hero RPG with customizable spells. However, I ran into a problem with memory leaks. I am using a UnitGroup[ ] Variable so that there is the same number of indexes as there are total players (9 in this case). I am doing this because I need to account for events to happen based on the actions of each individual player (in this case: knocking back a unit each .01 second based on the buff duration of "War Stomp"). I am using an array for each player so that on the rare occasion that multiple players use the same spell at the same time, the units affected would react in its respective manner.
I have read online that leaving variables filled with unused assets will drag down the game. I am wondering how to destroy specific indexes in a variable (using GUI), without having to clear the entire variable as a whole. If I clear the variable as a whole, the effects are done with one player's cast, stopping the effects of the spell for another player who might be casting the spell at the same time.
I do not have experience coding vJass and I prefer to remain using GUI.
EXAMPLE:
Set UnitGroup Spell_Targets[1] = BlahBlahBlah <--- I just want to clear Spell_Targets[1]
Custom Script: DestroyGroup(udg_Spell_Targets) <--- ??? What to do here?
I know no clear method to tell whether single Memory Leaks will slow down the game; for all I know, it could be "DestroyGroup(udg_Spell_Targets[1])," but I feel knowing this info would allow me to smooth out the game in the long run. I appreciate all the help I could get.
P.S. Is it required to clear Unit variables (Spell_Target = (Target Unit of Ability Cast))? The general consensus for clearing units seems to be killing them off.
At the moment, I am making a Hero RPG with customizable spells. However, I ran into a problem with memory leaks. I am using a UnitGroup[ ] Variable so that there is the same number of indexes as there are total players (9 in this case). I am doing this because I need to account for events to happen based on the actions of each individual player (in this case: knocking back a unit each .01 second based on the buff duration of "War Stomp"). I am using an array for each player so that on the rare occasion that multiple players use the same spell at the same time, the units affected would react in its respective manner.
I have read online that leaving variables filled with unused assets will drag down the game. I am wondering how to destroy specific indexes in a variable (using GUI), without having to clear the entire variable as a whole. If I clear the variable as a whole, the effects are done with one player's cast, stopping the effects of the spell for another player who might be casting the spell at the same time.
I do not have experience coding vJass and I prefer to remain using GUI.
EXAMPLE:
Set UnitGroup Spell_Targets[1] = BlahBlahBlah <--- I just want to clear Spell_Targets[1]
Custom Script: DestroyGroup(udg_Spell_Targets) <--- ??? What to do here?
I know no clear method to tell whether single Memory Leaks will slow down the game; for all I know, it could be "DestroyGroup(udg_Spell_Targets[1])," but I feel knowing this info would allow me to smooth out the game in the long run. I appreciate all the help I could get.
P.S. Is it required to clear Unit variables (Spell_Target = (Target Unit of Ability Cast))? The general consensus for clearing units seems to be killing them off.