....
You can do something like this:
Say you have 4 units that each need 5 usable variables and you want to store all data into 1 array.
What I always do is give every unit a unique custom value.
Say each unit has a custom value from 1 to 4.
If I wanted to query unit 3's 4th value, I would use the following equation.
set variable = x((custom value of unit * 5) + 4)
x x x x x
x x x x x
x x x x x
x x x x x
In this case, "variable" gets set to the 5 times the custom value of the unit plus 4. In actuality it would return the value in slot number 19 which is on the 4th row. Don't worry about this for now, just know that this system works.
Hope that makes sense.