2D arrays
A quick improvement from sized arrays, is the ability to have two-dimensional arrays, n-dimensional arrays are not implemented, if you really need it very hard, contact me.
Two dimensional arrays in vJass, since vJass is implemented on top of Jass, are just normal arrays in disguise, using a multiplication trick to convert 2-dimension indexes into a one-dimension one. The way to declare one of these arrays is: <type> array name[width][height]
, notice the real size of the array is width*height, this size suffers the same limitations as normal array's size, it cannot go above approximately 40800
, and if this size is bigger than 8191
, you will be using slower function calls instead of array lookups and multiple arrays in the final script, etc.
The field size would return this total size we are talking about, the fields height and width return the ones we used to declare the array. As with sized arrays, you can use constants for the width and size.