How To create highscore with new function SAVE ?

venon_itvenon_it Member, PRO Posts: 594
edited November -1 in Working with GS (Mac)
How to create a page with report all highscore with use new bheaviors SAVE?

now i save score, but when replay the score rewrite!! and appears only one score!

Thankss

Comments

  • EastboundEastbound Member, BASIC Posts: 1,074
    I'm going to pick up lunch, but I'll try to make an example afterwards.
  • venon_itvenon_it Member, PRO Posts: 594
    Fabulous!

    Thank you a lot Eastbound
  • quantumsheepquantumsheep Member Posts: 8,188
    /watches Eastbound eat his lunch.

    /taps foot impatiently.

    ;)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • EastboundEastbound Member, BASIC Posts: 1,074
    Well my quick attempt was a failure :p

    Maybe somebody else can give it a go
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    This is just off the top of my head:

    attributes:
    score
    1stplace
    2ndplace
    3rdplace
    4thplace
    5thplace

    after your game ends load all of the saved high scores into the place holders.

    if score > 1stplace
    change attribute 5thplace = 4thplace
    change attribute 4thplace = 3rdplace
    change attribute 3rdplace = 2ndplace
    change attribute 2ndplace = 1stplace
    change attribute 1stplace = score

    if score > 2ndplace
    change attribute 5thplace = 4thplace
    change attribute 4thplace = 3rdplace
    change attribute 3rdplace = 2ndplace
    change attribute 2ndplace = score

    if score > 3rdplace
    change attribute 5thplace = 4thplace
    change attribute 4thplace = 3rdplace
    change attribute 3rdplace = score

    if score > 4thplace
    change attribute 5thplace = 4thplace
    change attribute 4thplace = score

    if score > 5thplace
    change attribute 5thplace = score

    then save all the scores into memory. this should work right?
  • EastboundEastbound Member, BASIC Posts: 1,074
    That's how I went about it but couldn't get the scores to display properly to see if it was working.
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Mulcahy I recently updated my game on GS with High Scores and I did exactly as you wrote except that instead of "if score > 1stplace" I used the "≥" symbol.

    I'll try to post an example.
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Here's a template for you:

    http://gamesalad.com/game/play/32379

    As it is now every score has to have its actor since I don't know if and how you could insert a return in the expression editor (I even tried using a text attribute with a return inside with no luck).

    Hope it helps
  • ktfrightktfright Member Posts: 964
    Im having a little problem...

    my scores on a game are saving, but when i exit the game to home screen and come back to it, the score didn't really save, at least not the highest score in the way that i wanted.
  • quantumsheepquantumsheep Member Posts: 8,188
    It's not 100% relevant to this subject, but I thought this would be the best place to put this anyway as it might help!

    Be careful when using keys for saving as it's case sensitive.

    So let's say you're saving the attribute 'score' with the key 'Score'

    If you try and load key 'score' for the attribute 'score' it won't load.

    You would have to load the key 'Score' for the attribute 'score'.

    Make sense?

    An addition to the Wiki perhaps?

    Hope that helps,

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • DanielAvniDanielAvni Member Posts: 114
    i dont get the key what does it stand for and why does it matter
    Sorry :(
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    So with the load and save attribute behaviors, you need a combination of an attribute and a key. The attribute is selected from the attribute browser and the key is just about anything you want it to be as far as text goes. So you can call it 'bob', or 'save', you can call it 'latefordinner'. As long as you use that same text value in both the save and load attributes then you can get and retrieve data from a persistent source.
  • EastboundEastbound Member, BASIC Posts: 1,074
    How do we test to see if saving is working? Say we play the game through the viewer, make progress and save then exit the viewer. If we re-open the viewer and select recently played and open the game, will progress be saved?
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    It should work that way for testing.
  • butterbeanbutterbean Member Posts: 4,315
    I have a game where the current score is placed on the top right, and the high score is in the top center, when the player dies, I have a rule that resets the game and it goes back to the title screen

    Does resetting the game reset the high score, or should I be able to see the high score when I restart the 1st level again?

    I want to be able to have a game over display, then go back to the title screen, then save the high score at the top center of the screen.

    How can I do this?
Sign In or Register to comment.