I have an old loadsave with module( …, package.seeall )
It is deprecated
I would like to update it
This is the old code. It works with the old loadsave.
I replaced the old with the new and it does not work.
I use this new library.
https://github.com/robmiracle/Simple-Table-Load-Save-Functions-for-Corona-SDK
I get this log
*******************************************************************
main.lua58: attemp to call field ‘fileExists’(a nil value)
stack traceback:
main.lua:58 in main chunk
Do you want to relaunch the project?
*********************************************************************
I dont know how to update the code.
I get this log
main.lua
[lua]
local myGlobalData = require( “globalData” )
local loadsave = require(“loadsave”) -
_G.saveDataTable = {} – Define the Save/Load base Table to hold our data
storyboard.purgeOnSceneChange = true
– Load in the saved data to our game table
–check the files exists before !
if loadsave.fileExists(“dba_vc_template_data.json”, system.DocumentsDirectory) then
saveDataTable = loadsave.loadTable(“dba_vc_template_data.json”)
else
saveDataTable.highScore = 0
– Save the NEW json file, for referencing later…
loadsave.saveTable(saveDataTable, “dba_vc_template_data.json”)
end
saveDataTable.highScore = 0
–Now load in the Data
saveDataTable = loadsave.loadTable(“dba_vc_template_data.json”)
myGlobalData.highScore = saveDataTable.highScore
myGlobalData.gameScore = 0
[/lua]