saving permanently scores

carlosacj36carlosacj36 Member Posts: 54
edited November -1 in Working with GS (Mac)
i have make this
game.score=actor1.position.x
Rule:
game.score>game.highscore
Change Attribute game.highscore=game.score
save attribute
game.highscore

why if i close my app
and open again

load attribute
game.highscore shows 0

inside the game, i move betwen scenes and function ok, score and highscore

im doing something wrong

thanks in advance

Comments

  • orbnooborbnoob Member Posts: 79
    im not sure, you need to make sure you save your highscore in a certain key, then load it IN THE SAME KEY. it should load it even after you close and re open the app
  • carlosacj36carlosacj36 Member Posts: 54
    i set a key at the moment of save, and use it at the moment of load, but i really dont know what does that key means
  • orbnooborbnoob Member Posts: 79
    key is were it saves it, its like creating a folder, so if you save it under the key 1, then it will sorta create a folder with the saved attribute, someone correct me if im wrong
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Your testing this on the device right? Save and load doesnt work in the creator, and only works in the device viewer via the recent games tab. Best way to test save and load is adhoc
  • carlosacj36carlosacj36 Member Posts: 54
    sounds logic, and i think you are correct, but i never been asked by a path when a use save attribute, im testing in a mac, and in a ipod at the same time, im using a key but don't do nothing
  • carlosacj36carlosacj36 Member Posts: 54
    ok, im back with the answer, after some tests, first i declare

    Score =integer (i think would be real to)
    HighScore =integer (i think would be real to)

    and use the same name of my variable as key name,
    example......

    save attribute
    game.HighScore key: HighScore
    ************************************************************
    load attribute
    key:HighScore game.HighScore

    and you can test in the creator, only you need to load the value in diferent scene, and move to that scene without close the app, dobleclicking in the scene.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    carlosacj36 said:
    ok, im back with the answer, after some tests, first i declare

    Score =integer (i think would be real to)
    HighScore =integer (i think would be real to)

    and use the same name of my variable as key name,
    example......

    save attribute
    game.HighScore key: HighScore
    ************************************************************
    load attribute
    key:HighScore game.HighScore

    and you can test in the creator, only you need to load the value in diferent scene, and move to that scene without close the app, dobleclicking in the scene.

    No you cant test in the creator thats not save and load. It wil store the values between scenes without a save and load even there. Thats just the runtime data
  • carlosacj36carlosacj36 Member Posts: 54
    sorry my english...

    but do the same as in the viewer,

    before that changes i make.... don't work in the creator, and don't work in viewer.

    im agree with you about that maybe don't really save and load, but as testing without device, can help a little.

    i buy a mac and ipod, 2 weeks ago, i never been used one, i read posts before buy about 2 months, watch cookbook, 2 or 3 times each video, and im developing my first game, and im very glad with the comunity here, and with the work of Sous Chef, im trying to help a litter to.
Sign In or Register to comment.