Hundreds? Pfft, that's nothing. Though, I've thought that making a pseudo dynamic array using Data Tables would be better.
Assign your building an ID by giving it a custom value of a unique integer. Index your unit group Data Table with a name like: building + unit's custom value.
Presto, if your building dies, delete the referred Data Table and you save space? I dunno.
I haven't really fleshed out my idea.
But anyway, the maximum for a global variable is 8192 per dimension. Though 8192^4 is going to give off errors. Unless you need tens of thousands of variables, you don't need to worry. (And you know... Why don't you just put a cap?)
Rollback Post to RevisionRollBack
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
An 8192^4 array size will definitely give errors, since that is an exponential formula and is quite a large number. However, myArray[8192][4] will not give you an error.
I forgot the exact cap, but the variable cap is around 440,000~
Yes, the max is pretty high, and certain variable types do use more memory than others. Some also lower than others. But, the maximum dimension will always be 8192.
Rollback Post to RevisionRollBack
Project Rise of Nigma
To post a comment, please login or register a new account.
My new map need a unit group array for each buildings. i.e. UnitGroup (1) for the first building, UnitGroup (2) for the second, etc.
Is there a maximum value of index? I fear it may cause error when I have hundreds of buildings.
Hundreds? Pfft, that's nothing. Though, I've thought that making a pseudo dynamic array using Data Tables would be better.
Assign your building an ID by giving it a custom value of a unique integer. Index your unit group Data Table with a name like: building + unit's custom value.
Presto, if your building dies, delete the referred Data Table and you save space? I dunno.
I haven't really fleshed out my idea.
But anyway, the maximum for a global variable is 8192 per dimension. Though 8192^4 is going to give off errors. Unless you need tens of thousands of variables, you don't need to worry. (And you know... Why don't you just put a cap?)
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
@Vicboy: Go
An 8192^4 array size will definitely give errors, since that is an exponential formula and is quite a large number. However, myArray[8192][4] will not give you an error.
I forgot the exact cap, but the variable cap is around 440,000~
Thanks! Looks like I do not need to worry too much about exceeding the maximum. :P
I will still try and see if using data table works better.
@Wakeman: Go
Yes, the max is pretty high, and certain variable types do use more memory than others. Some also lower than others. But, the maximum dimension will always be 8192.