Levels completed not loaded after device restart

spock1234spock1234 Member, PRO Posts: 65
edited November -1 in Working with GS (Mac)
Dear All,

In my game, I am able to save the levels completed and unlock the levels player has completed.
This works very fine as long as I have the the device running.

But, as soon as I restart the device my all saved levels are lost and I have to start from level 1.

Here is I am doing it. Would be Great if some of the GS expert can suggest. I save the last level complete with save attribute and a key. At the beginning of the code, I am loading the level complete attribute 2 times in 2 scenes (just to be doubly sure :). And then In my level select i say lock the level in case Level Number Image is > level select attribute.

Not sure why then it is losing that attribute after the device restart. Is't load and save attribute meant to work even after device restart?

Thank You

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    I had a similar problem to this, your code sounds ok to me, in the end i ended up deleting my load attributes and re-doing them, making sure not to use any copy and paste and it then worked. If this doesn't work, trying doing it on your save behaviours too.

    To test, you could have a display text actor showing on your 1st screen what the unlocked level is. Play a few levels, close the app, restart and see what that number is. If it as expected the problem lies in the unlocking, if its say 0 then its with the saving and loading.

    Hope that helps.

    Cheers
  • spock1234spock1234 Member, PRO Posts: 65
    beefy_clyro : Thank you, much appreciated. Yes, it helps. But the thing is can I test this with loading my game on device using GS Previewer? Because I know that i can not test this kind of thing in GS preview (i mean the one which is on the MAC and not on device).

    I hope you get what i mean? Do I must publish the game on App store, before I can actually test if what I have done will work fine or not?

    Thanks
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You'll be able to test by either using the GS viewer on your phone or by building an ad-hoc build
  • spock1234spock1234 Member, PRO Posts: 65
    Buddy. Thanks very much for that. Last thing please to help, can you please give me some pointers on "ad-hoc build" how to do that?

    Thanks very much for ur help.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You need to create a dev profile in iTunes connect as a dev build, not for app store. Then you publish in GameSalad and select that profile. Drag the file GS builds into iTunes, sync to your phone ... test away. Look in the cookbook, videos, etc, there maybe more details in there
Sign In or Register to comment.