Posted 24 June 2013 - 12:50 AM
Hiya, I'm trying to access information from a table, which is inside another table.
Here is my table:
What I'm trying to do is access info from the faces table to print it to the screen, but it always comes up nil. Is there an easy way to do this? Below are ways I've tried (and failed)
Any help is appreciated.
Here is my table:
this = {
coordsKnown = 0,
xCoord = 0,
zCoord = 0,
yCoord = 0,
face = 1,
faces = {"north", "east", "south", "west"},
zDiff = {-1, 0, 1, 0},
xDiff = {0, 1, 0, -1}
}
What I'm trying to do is access info from the faces table to print it to the screen, but it always comes up nil. Is there an easy way to do this? Below are ways I've tried (and failed)
this.faces[face]
this[faces[face]]
this[faces][face]
Any help is appreciated.