I'm poking around with trying to save some data between sessions for a plugin of mine, and I ran into a wall trying to deal with nested tables. Here's an example of some of the test data I was using:
The same error is thrown each time I try to use a nested table, no matter what values I try. I know I'm missing something blatantly obvious here, but I can't figure out what that would be.
/temp = {"qwerty","asdfgh","zxvcbn"}
/print( serialize.save("temp", temp))
temp = {}
temp[1] = "qwerty"
temp[2] = "asfdgh"
temp[3] = "zxvcbn" table: 0116D540
/test = { {1,2,3},{4,5,6},{7,8,9} }
/print( serialize.save("test", test))
Run-time error
World: Aardwolf - Balaam
Immediate execution
C:\Program Files\MUSHclient\lua\serialize.lua:116: Invalid name 'test[1]' for table
stack traceback:
[C]: in function 'assert'
C:\Program Files\MUSHclient\lua\serialize.lua:116: in function 'save_item'
C:\Program Files\MUSHclient\lua\serialize.lua:169: in function 'save_item'
C:\Program Files\MUSHclient\lua\serialize.lua:61: in function 'save'
[string "Command line"]:1: in main chunk
The same error is thrown each time I try to use a nested table, no matter what values I try. I know I'm missing something blatantly obvious here, but I can't figure out what that would be.