I’m using Rob’s easy save and load in JSON.
I have a table set up as myData.settings = {} with sub levels:
myData.settings.levels = {}
myData.settings.levels[1] = {}
in myData.settings.levels[1] I have
myData.settings.levels[1].score and myData.settings.levels[1].stars
in my game, I calculate the “game score” and then I want to compare it to the previously stored score for that level. The problem I’m having is even when I have a score that is not nil or 0, I’m not able to load the stored score from my table. I get an error: Attempt to compare number with nil.
I know the number is in the table because I can visibly see it in my Project Sandbox.
How do I load a number stored in the table to then compare it to my calculated game score?
I appreciate any help - I’ve tried as many options as I can think of.
Thanks
Lori