Hi, I have a question about game.loadValue using Beebe class
If anyone can help me or point me the right direction will be
greatly appreciated Thank you!
I will try explain the structure of my game:
main.lua: I have a local test = game.test
game.test = 1
selectlevel.lua: I have a button which takes you to level1(level1.lua)
and a button takes you to level2(level2.lua)
I already have the functions and event listeners connected with my
buttons to take me to level1 and level2, The problem is the following
in order to go to level2, in my button2(takes you to level2) I have a
function which will only take you to level 2 if game.test == 0.
in order to make game.test = 0 the player must first complete level1.
level1.lua: When the player completes level 1, I have game.test = 0
and game.saveValue(“test.txt”, game.test) I have also tried
using .data instead of .txt to see if it made a difference but
no luck. So i`m using .txt to monitor my test.txt to see if a
0 exist when player completes level1 and it does.
So far so good when player completes level 1 then game.test = 0 and
now in my level selection I can go to level2 but If i exit the game I no
longer can go to level2 even if I saved in a file that game.test = 0
So i tried implementing in my main.lua and selectlevel.lua (neither worked)
a game.loadValue(“test.txt”) and I implemented in different ways and so far
no luck. I tried ways like local game.test = game.loadValue(“test.txt”)
or local score = game.loadValue(“test.txt”) and changing the functions
of my button to if score == 0 instead of if game.test == 0 none seem to
work so I figure my problem is i`m not loading the value?
Note:I have tried many test with Runtime to see if when for example:
score == 0 a new image appears and if I code score = 0 (it works) the
image appears but if I code score = game.loadValue(“test.txt”) guess what
no image appears 
I`m still pretty new to corona/lua and programming itself I been working
on a game for over 2months and so far is pretty much completed runs fine
on corona simulator, xcode simulator, and iphone4,ipod,ipad.
Saving/loading is the last thing my application needs and is so frustrating
after all this time working hard and learning to program I cant seem to go
any further.After days studying files / SQLite I found Beebe Class(great class)
but now I ran into this problem
Any help is GREATLY appreciated Thank You!
Note:The Sample Codes/Structure posted above is not my real game because If
I will share my game it will be too many codes so I broke it down to a sample
which if I can make the sample work I can implement the solution to my game!
I also started this Post a few days again due to this same problem and so far no
luck: http://developer.anscamobile.com/forum/2011/03/16/please-help-saveload-game-lockunlock-levels
[import]uid: 30314 topic_id: 8007 reply_id: 308007[/import]
