If AmenMoses and smallg don't mind I would like to give my understanding using terminology I have always used with various programming languages that include BASIC, Pascal, C, Visual Basic and Visual Basic 6, C++, COBOL, and Assembly Language. The ability to have tables/matrices in Lua is referred to as arrays within the official documentation. So, that is why I like to use the terminology of arrays.
Arrays are ordered arrangements of objects, which can have one-dimensionality containing a collection of rows or a multi-dimensionality containing multiple rows and columns.
In Lua, arrays are implemented using indexing tables with integers. A one-dimensional array can be represented using a simple table structure and can be initialized and read using a simple for loop.
When trying to access an element in an index that is not actually there, it returns nil. In Lua, indexing generally starts at index 1. But, it is possible to create objects at index 0 and even below 0 as well, I would suggest to always use "1" as the start index.
OK, let's now look at multi-dimensional arrays. These can be implemented in two ways.
* Array of arrays
* Single dimensional array by manipulating indices
I'm only going to look at an array using "array of arrays."
So, g_Entity[e]['health'], g_Entity[e]['angley'], and g_Entity[e]['x'] are examples of multi-dimensional arrays using "array of arrays".
Alienware Aurora R7 with SSD 256GB boot drive ( C: ) and a secondary drive ( D: ) that is 2TB
Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 with Intel Turbo-burst
Installed RAM 16.0 GB
64-bit operating system, x64-based processor
Windows 10 Home
NVIDIA GeForce GTX 1070 with 8192 MB GDDR5 and 8095 MB shared system memory