Problems with High Score Saving

I'm having problems trying to figure out what I'm doing wrong with saving high scores. I have watched all the youtube videos and looks pretty easy. I have an attribute the has a integer value and I save attribute value to a key name. On my menu screen I have a controller that loads the key value into the attribute name when game is first started. My problem is that when the game is restarted the attribute doesn't have the saved key value. Does this only work when you are actually playing it on device or should it still work when running it in GameSalad? My code looks like this:

attribute "highscore" has integer value

Save Attribute
attribute: highscore key: highscoresave

On my menu screen

Load Attribute
key: highscoresave attribute: highscore

Comments

  • -Timo--Timo- Member Posts: 2,313
    im not sure but I think it only work on a device and not in gamesalad...
  • dimps620dimps620 Member Posts: 49
    I saw that posted somewhere else as well. I will have to get it loaded on device to try it out. Thanks!
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    yea, it only works on the device. it will work in the viewer or adhoc, but in the preview it does not save.

    do yourself a favor and test adhoc, it's the only way to truly test performance
  • zoopezoope Member Posts: 210
    Try using tables for saving and retrieving scores, found it to be faster, better and easier.
  • BrunoGamesBrunoGames Member, PRO Posts: 87
    it should work on GameSalad directly also, at least to check if code is well done...
    The difference is that any time you test your app, the highscore will start as "Zero", on the device, will keep the last value saved.

    Your code looks normal, test it on the device, maybe you can see something that will help you identify the problem... but also agree with zoope, give a look to the tables for saving information, like score /stars etc.. is must better..
  • lycettebroslycettebros Member, PRO Posts: 1,598
    How is the save key being triggered?

    Usually in a game you are likely setting the score back to zero before a new game is played....or if a new hiscore has not been achieved. This is where a conflict could be occurring. Are you resetting your score to zero somewhere in the rules of the menu or when the game ends?
  • dimps620dimps620 Member Posts: 49
    lycettebros,
    I think I have everything coded right. I'm tracking a lot of variables and the high score attribute was giving me problems between different scenes. I spent a couple hours trying to figuring that out. I plan on testing this on my ipad and iphone in the next day or two. I also have seen some strange things happening when testing on my mac book verse my mac mini at home. They are running the same version of GameSalad but slightly different operating system versions. Things are good for now.
  • Gamer1992Gamer1992 Member Posts: 83
    yeah it only works on your device it wont show up on the gamesalad preview screen
Sign In or Register to comment.