- Joined
- Jan 4, 2014
- Messages
- 556
Hello friends,
I was wondering when I should use the Custom script call Destroy*whatever*(udg_*whatever*)
Should i destroy my variable at the end of every trigger that uses it or should I only destroy it once I have absolutely no more use for it.
Here is an example. I have this trigger where I want to give every unit in a unit group a tome, but I also have another bunch of triggers where i pick every unit in this same group and teleport them some place. So should I use the Custom script call to destroy my variable at the end of each of these individual triggers or only use it once I am no longer using this unit group?
Also on a similar note, if I make a custom spell where it uses temp points and temp unit, should I use this command every time the spell is cast, even though the spell will be cast multiple times?
Sorry if I am not clear, I am pretty new to this whole CustomScript call destroy thing.
I was wondering when I should use the Custom script call Destroy*whatever*(udg_*whatever*)
Should i destroy my variable at the end of every trigger that uses it or should I only destroy it once I have absolutely no more use for it.
Here is an example. I have this trigger where I want to give every unit in a unit group a tome, but I also have another bunch of triggers where i pick every unit in this same group and teleport them some place. So should I use the Custom script call to destroy my variable at the end of each of these individual triggers or only use it once I am no longer using this unit group?
Also on a similar note, if I make a custom spell where it uses temp points and temp unit, should I use this command every time the spell is cast, even though the spell will be cast multiple times?
Sorry if I am not clear, I am pretty new to this whole CustomScript call destroy thing.