Hello!
As the title says, when should I use a variable?
I'm checking over all my triggers and everytime I see something like casting unit, owner of triggering unit, etc. I just put it in a variable and use that variable everytime I need it in the same trigger.
I got a few questions about it...
I know a few things that leak memory, an example of it would be a unit group. I can use destroygroup custom script to.. destroy it. Is there something similar for a single unit? for a single player?
Does it matters if I don't destroy a unit variable at the end of a trigger and use it right away in another trigger?
Now that may sound strange, but I fear that if I use the same variable in 2 triggers that could.. trigger.. like.. at almost the same time that could cause some trouble.. am I right? or do I have nothing to fear about it?
If someone has a tutorial or know a few things about variable I could use such informations.
Thats about all I can think of.. for now
Thanks!
As the title says, when should I use a variable?
I'm checking over all my triggers and everytime I see something like casting unit, owner of triggering unit, etc. I just put it in a variable and use that variable everytime I need it in the same trigger.
I got a few questions about it...
I know a few things that leak memory, an example of it would be a unit group. I can use destroygroup custom script to.. destroy it. Is there something similar for a single unit? for a single player?
Does it matters if I don't destroy a unit variable at the end of a trigger and use it right away in another trigger?
Now that may sound strange, but I fear that if I use the same variable in 2 triggers that could.. trigger.. like.. at almost the same time that could cause some trouble.. am I right? or do I have nothing to fear about it?
If someone has a tutorial or know a few things about variable I could use such informations.
Thats about all I can think of.. for now
Thanks!
Last edited: