Well, we're locked out of using pointers, so dynamic arrays will not happen for us. The old "int *DynamicArrayLOL = malloc(4*maxsize);" method won't work in galaxy, sadly.
Not sure what qualifies as dynamic, but if you make an array in warcraft 3 of size 2 (for example), and you go over it, it works fine, leading me to believe it is resizing the array. I've done this many times, I know it works.
The global array size for arrays in warcraft 3 was 8192, as stated. Setting the "size" in Gui just initialized the variables to a start value. Still, you could use all slots of the array, you just needed to initialize the slot yourself, if required (for basic variable types like integer or boolean, this was obsolete anyway)
wait, so I don't have to be declaring all my arrays size 9 for 8 players, even if i'm not using slot 0?
No, just the opposite. 7 for 8 players, and take one off the player number to get the index. 0 becomes player 1, 1 becomes player 2, etc. When initializing arrays in SC2, the number isn't he size of the array, it's the index of the last element, so if that's 7 then you're really got 8 elements because you include 0.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Well, we're locked out of using pointers, so dynamic arrays will not happen for us. The old "int *DynamicArrayLOL = malloc(4*maxsize);" method won't work in galaxy, sadly.
The global array size for arrays in warcraft 3 was 8192, as stated. Setting the "size" in Gui just initialized the variables to a start value. Still, you could use all slots of the array, you just needed to initialize the slot yourself, if required (for basic variable types like integer or boolean, this was obsolete anyway)
wait, so I don't have to be declaring all my arrays size 9 for 8 players, even if i'm not using slot 0?
No, just the opposite. 7 for 8 players, and take one off the player number to get the index. 0 becomes player 1, 1 becomes player 2, etc. When initializing arrays in SC2, the number isn't he size of the array, it's the index of the last element, so if that's 7 then you're really got 8 elements because you include 0.