How to track multiple NPCs?

There was only one line that talked about 2D arrays, and it didn’t even explain them, so I suspect you’re getting concepts mixed up…

A 2D array $x[a][b] is just a 1D array $x[a] that itself contains more arrays, that then finally contain values (or in other words, an array of arrays of values). You could just as easily make a 3D array, which is an array of arrays of arrays of values, or to any depth you like.

Most of that post was talking about a 1D array of FlagBits, though, which is a different thing. A FlagBit isn’t an array, although it is another way to encode multiple pieces of data together.

1 Like