Posted 29 June 2014 - 03:16 AM
I have a monitor to display the status of doors, which is controlled by a different module (connected over networking). I'm using a for loop to grab each door from a table, then draw them consecutively. The problem is, they don't display in order. I'm assuming the reason is because of the nature of for loops and pairs.
The for loop is line 90.
http://pastebin.com/mrgE8u2p
The reason it matters is because the monitor_touch event part needs to associate the location of the touch with an id (which is assumes the table entries are consecutive). I'm also not too good with lua math, but my modulo stuff seems to work.
How do I get the subtables used consecutively? (i.e. the order that the id values are)
The for loop is line 90.
http://pastebin.com/mrgE8u2p
The reason it matters is because the monitor_touch event part needs to associate the location of the touch with an id (which is assumes the table entries are consecutive). I'm also not too good with lua math, but my modulo stuff seems to work.
How do I get the subtables used consecutively? (i.e. the order that the id values are)