- Joined
- May 12, 2008
- Messages
- 80
Hello Hive,
long time ago (when i started mapping) i was warned not to use the same integers for loops too often and i was told to never use Integer A and B because if two triggers which both use the same integer for a loop run at the same time there would be errors. I never really thought about that...
Now i want to clean up messy triggers within one of my maps and there are just too many integer variables. Further i have the feeling that what i stated above is wrong...
So here are my questions:
When i have several triggers, when can i use the same integer variables for loops and when do i have to use different integer variables?
Can i use the same variable in the same trigger multiple times?
Can i use the same variable in different triggers?
Can i use the same variable in trigger A and trigger B if trigger A triggers trigger B?
Does Integer A and B have any advantages or disadvantages compared to custom variables?
How does this work with UnitGroups, Hashtables, Locations, ...
Can i create just one Hashtable to destroy any Locations and UnitGroups and avoid memory leaks this way?
Probably it should work but i dont have any knowledge about jass and in which order triggers are executed if there are multiples that have to be done right now...
Maybe this one question is enough to answer all that stuff in a few words:
When i dont want to save any information for later use (whis is for example just to destroy a unit group or just to get a loop going) and if there are multiple triggers which need the same kind of variable to solve a problem, can i use the same custom variable over and over for this problem?
long time ago (when i started mapping) i was warned not to use the same integers for loops too often and i was told to never use Integer A and B because if two triggers which both use the same integer for a loop run at the same time there would be errors. I never really thought about that...
Now i want to clean up messy triggers within one of my maps and there are just too many integer variables. Further i have the feeling that what i stated above is wrong...
So here are my questions:
When i have several triggers, when can i use the same integer variables for loops and when do i have to use different integer variables?
Can i use the same variable in the same trigger multiple times?
Can i use the same variable in different triggers?
Can i use the same variable in trigger A and trigger B if trigger A triggers trigger B?
Does Integer A and B have any advantages or disadvantages compared to custom variables?
How does this work with UnitGroups, Hashtables, Locations, ...
Can i create just one Hashtable to destroy any Locations and UnitGroups and avoid memory leaks this way?
Probably it should work but i dont have any knowledge about jass and in which order triggers are executed if there are multiples that have to be done right now...
Maybe this one question is enough to answer all that stuff in a few words:
When i dont want to save any information for later use (whis is for example just to destroy a unit group or just to get a loop going) and if there are multiple triggers which need the same kind of variable to solve a problem, can i use the same custom variable over and over for this problem?