| 07-19-2004, 08:07 PM | #1 |
function Ix3 takes integer x, integer y, integer z, integer ylimit, integer zlimit returns integer return(z+y*zlimit+x*zlimit*ylimit) endfunction Based off weaaddar's 2d array indexer, this one indexes 3d arrays for you into warcraft's 1d arrays. The only thing that limits you on this, obviously, are ylimit and zlimit. You have to come up with what the max amount of objects for y and z will be in your array, but other than that you are free to use all 4000~ indeces of Warcraft's arrays. So to use it, whenever you want to use the array just call this for the index with the supposed 3d coordinates and it'll find the right spot for you. If you see the pattern you can keep making higher and higher dimensions until you reach the actual array size limit, but you'd probably want to use that matrix API if you go any higher than maybe 4 dimensions. |
