"Rob Miracle" game saving method and nested tables problems

I’ve been successfully saving/loading app data by the “Rob Miracle method”:

http://omnigeek.robmiracle.com/2012/02/23/need-to-save-your-game-data-in-corona-sdk-check-out-this-little-bit-of-code/

But I haven’t been able to get it to work with “nested tables” like this:

myGameSettings = {} myGameSettings.highScore = 1000 myGameSettings.soundOn = true myGameSettings.customLevels = {} saveTable(myGameSettings, "mygamesettings.json")

I guess there is no way around using multiple files (one sub file per table)?

Can you define “have not been able to get it to work” ?

I save my data using JSON, and have had no trouble saving nested tables.

Turned out I was really messing it up with the lua tables. I find them confusing sometimes, coming from C/C++. Not that it’s any excuse…  :unsure:

I think I’ve managed to get it to work now.

Glad you got it solved.

Can you define “have not been able to get it to work” ?

I save my data using JSON, and have had no trouble saving nested tables.

Turned out I was really messing it up with the lua tables. I find them confusing sometimes, coming from C/C++. Not that it’s any excuse…  :unsure:

I think I’ve managed to get it to work now.

Glad you got it solved.