Hi all,
I have been struggeling with this for several hours and i just cant understand why it shouldnt work (maybe its getting to late for programming).
my code looks like this:
mapsize = 4 --number of tiles in x-y direction [square map]
griddata = {} --contains data for the grid griddata[1][1] eg.
function grid()
for x=1, mapsize do
for y=1, mapsize do
griddata[x] = {} --Expand the table to have a y value
griddata[x][y] = (x .. "," .. y)
end
function test()
for x=1,mapsize do
for y=1,mapsize do
print(griddata[x][y])
end
The output of the test() is something like this:
nil
nil
nil
1,4
nil
nil
nil
2,4
nil
nil
nil
3,4
nil
nil
nil
4,4
What am i missing in understanding this issue? it should be so easy…
Thanks in advance [import]uid: 162464 topic_id: 29579 reply_id: 329579[/import]