I’ve been using the tutorial found here: https://coronalabs.com/blog/2014/10/14/tutorial-saving-and-loading-lua-tables-with-json/
I have a table called playerData that I use to save all key factors of the game (how much money the player has, the level they are on, etc…)
I have downloaded the file as mentioned under the “Table load/save functions” and I have included it in my project folder as well as every .lua file that I plan on triggering the save function and the load function.
in my main.lua file I have this code (only place I plan to load the playerData)
playerData = loadsave.loadTable( "playerData.json" ) if ( playerData == nil ) then print("Nil info on data table seemed to not have loaded...") end
pretty much in every .lua file that has the ability to change any of the info in the playerData table, I also trigger the following code to save
loadsave.saveTable( playerData, "playerData.json" )
I have recently started testing my app on my physical device. I have noticed that when I close out of the app completely on my device and load it up again, nothing has saved.
I would love it if I could get some help as to what I am doing wrong here.
Thanks