Hi guys,
I’ve been trying to figure out how I can load json tables with Rob Miracle load save library, but I can’t seem to figure it out. I’ve got my main file setup, this checks if there already is a json file at the directory and works fine.
----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- -- hide the status bar display.setStatusBar( display.HiddenStatusBar ) -- include the Corona "composer" module local composer = require "composer" -- load menu screen composer.gotoScene("menu") -- Create save file local loadsave = require("loadsave") local beginSettings = {} beginSettings.level = 1 beginSettings.bonus = 0 if loadsave.loadTable("settingsGame.json", system.DocumentsDirectory) == nil then local settings = beginSettings loadsave.saveTable(settings, "settingsGame.json", system.DocumentsDirectory) end local testvar = loadsave.loadTable("settingsGame.json", system.DocumentsDirectory) print(testvar.level) ------------------
How could I use the data in this tables in other scenes? I keep getting a nil value when I try to call: load save.loadTable
Any help would be great!
Kind regards