High score not saving.

As_Of_LatteAs_Of_Latte Member, BASIC Posts: 343
edited June 2015 in Working with GS (Mac)

I'm sure I'm missing something obvious, but another set of eyes might help me out with this one :#

Here is how I am saving my high score. I am using a game.HighScore attribute to save to key highscore.

Here is how I am loading my high score. Within a "loading" transition screen in-between scenes, I have the high score loading attribute. I thought this may work, for everytime the user presses retry, the transition screen quickly appears before the scene and updates the high score for each new round.

What I have setup seems to work inside the game. Every new round, the high score is updated. However, when I close out the GS Viewer and reopen, the high score starts back at 0...

How would I go about having the high score stay where the user left off before closing the game?

Hope this makes sense and thank you!

Comments

  • frdfrd Member Posts: 191

    I think that every time the viewer opens it acts like it is playing the game for the first time. I could well be wrong, but I think it should be fine once it is published. Anyone, am I wrong?

  • As_Of_LatteAs_Of_Latte Member, BASIC Posts: 343
    edited June 2015

    @frd I thought the same thing as well. But when saving/loading other attributes, such as an in app purchase, then closing/reopening the GS Viewer, my purchased attribute was saved...

    So I'm a little confused as to why my high score att. isn't doing the same :/

  • As_Of_LatteAs_Of_Latte Member, BASIC Posts: 343

    Anyone, get a chance to look at this? Been trying things all day and still can't figure it out...

  • LovejoyLovejoy Member Posts: 2,078

    @As Of Latte said:
    Anyone, get a chance to look at this? Been trying things all day and still can't figure it out...

    Im not sure about the viewer, but does the highscore stay saved when you click on the restart button?(which is equivalent to exiting and reopening the app), if it does then you are good, if not then try redoing the rules again.

    Fortuna Infortuna Forti Una

  • AngryBoiAngryBoi Member Posts: 586

    Are you sure it isn't working? That looks perfect. I just looked into my game and it looks the exact same.

  • As_Of_LatteAs_Of_Latte Member, BASIC Posts: 343

    Thanks for the reply guys.

    @Lovejoy Unfortunately, the score doesn't stay saved when I hit the restart button...

    @tappwaterGames Yeah, I've read over this code hundreds of times and can't find what's wrong.

    But, I'm sure I'll get it! Thanks again.

  • Saridus2012Saridus2012 Member Posts: 1

    I'm having the same issue. If anyone finds a solution let me know! It would be greatly appreciated!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Saridus2012 Have you tested this on an actual device? If you're having "the same issue" be sure to post a screenshot of your rules. It may be that your rules look the same but actually aren't.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Did you open the expression on the load when entering the key? Be sure just to type it in without opening.

Sign In or Register to comment.