- Joined
- Mar 24, 2010
- Messages
- 950
So was just wondering this.. you know in the place you create variables.
Well when you make it an array theres an option to declare the number of array you'll be using.
I'm wondering is there any advantage to doing this. I notice especially with integers it will just make them without setting a exact number, you can leave it [1] and it will go on forever if you just set it later via triggers.
But i also notice with certain arrays it will glitch or not work unless the array length number is set in there, i think with unit groups maybe this is the case, cant remember what variable type it was that did that.
This is what i assume to be the case. Pre-setting the array length value in there creates the memory space for it at initialization aka statically assigning memory for the array length you specify.
So in other words if you have an int array your using and you want 12 in the array if you set that number value in there for the array length you want of 12, that memory space in the map is pre reserved for those 12 array integers or whatever variable type your using. If your lazy and just leave it as default at 1 it will work dynamically and create memory space for it during the game when its first used or referenced.
am i right in my assumptions? if not let me know.
Well when you make it an array theres an option to declare the number of array you'll be using.
I'm wondering is there any advantage to doing this. I notice especially with integers it will just make them without setting a exact number, you can leave it [1] and it will go on forever if you just set it later via triggers.
But i also notice with certain arrays it will glitch or not work unless the array length number is set in there, i think with unit groups maybe this is the case, cant remember what variable type it was that did that.
This is what i assume to be the case. Pre-setting the array length value in there creates the memory space for it at initialization aka statically assigning memory for the array length you specify.
So in other words if you have an int array your using and you want 12 in the array if you set that number value in there for the array length you want of 12, that memory space in the map is pre reserved for those 12 array integers or whatever variable type your using. If your lazy and just leave it as default at 1 it will work dynamically and create memory space for it during the game when its first used or referenced.
am i right in my assumptions? if not let me know.