High Score save driving me nuts

beefy_clyrobeefy_clyro Member Posts: 5,394
edited November -1 in Working with GS (Mac)
Hello. I have a problem which is driving me mad now and i have spent a bit of time now over the weekend and just cant get it functioning problem.

I have a highscore list - 1st, 2nd, and 3rd.

I have global attributes created for current score, best score, best score 2 and best score 3.

Rule

All

When game.life <1
when current score > best score

Have tried change and constrain attribute - change attribute best score 3 to best score 2
save best score 3

After 0.1 second

Change attribute best score 2 to best score
save best score 2

After 0.2 seconds

change best score to current score
save best score

Rule

All

If game.life <1
current score > best score 2
current score < best score

change attribute best score 3 to best score 2
save best score 3

After 0.1 seconds

change attribute best score 2 current score
save best score 2

Rule

All

Game.life <1
current score > best score 3
current score < best score 2

change attribute best score 3 to current score
save best score 3

Now what is happening is that all scores start as 0. lets say you score 10 points it displays;

1. 10
2. 0
3. 0

Next go you get 20

1. 20
2. 10
3. 0

Then you beat your top score again

1. 60
2. 50
3. 20

In the last attempt you beat the score by a bit but it seems to pick up another score (yet you never get to a point where you finished with 50 points. The figures are examples but hopefully you understand what im saying. Its very frustrating and i just cant figure out why and im out of ideas! Grrr. Any help would be greatly appreciated. Thanks

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    ok just been doing some more testing and its just going wrong from 1st go.

    Start

    1. 0
    2. 0
    3. 0

    Play one go and score 100 points

    1. 100
    2. 80
    3. 0

    I seriously cant figure out where its getting that number 2 score from!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi beefy_clyro, does this help you out?

    Rule

    All

    When game.life <1
    when current score > best score

    change attribute best score 2 to best score 3
    save best score 3

    After 0.1 second

    Change attribute best score to best score 2
    save best score 2

    After 0.2 seconds

    change current score to best score
    save best score

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Hi Gyro, i dont think this will work, i dont have my mac with me at work so cant test until tonight.

    If highsocres are as follows

    1. 30
    2. 20
    3. 10

    You then break your high score and get 80

    Going by your suggestion i think the results will end up like

    Change best score 2 to 3 = 20 changing to 10
    Change best score to 2 = 30 changing to 20
    Change current score to best score = 80 changing to 30
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    beefy_clyro said:
    Hi Gyro, i dont think this will work, i dont have my mac with me at work so cant test until tonight.

    You are correct, my suggestion won't work; silly me. I won't make the excuse again of trying to help out early in the mornings, otherwise i'll start to get on people's nerves! (drat, too late...)

    Running through it again, I can't see anything wrong personally, so have no idea what's going wrong. i'll have some spare time today and make a test if you like, see if I can spot anything that way.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    yes exactly, everything looks good but for some strange reason it just adds a score in. Its almost like when current score beats best score during the game it saves but i have checked my rules and it should only be changing and saving when you die! Thats why its so frustrating, it all looks good, i just really cant see for why its going wong! If you have some spare time and can knock up a demo that would be great.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    beefy_clyro said:
    Its almost like when current score beats best score during the game it saves...

    Ah yes, you might well me right there; maybe try using a boolean attribute called GameFinished perhaps. This would be set to false until the final life, when only then it becomes true; and in each of your "When all conditions are valid:" add when GameFinished = true. Hopefully that would solve it.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • JackBQuickJackBQuick Member Posts: 524
    @beefy_clyro: Did you get your High Score to work?

    I needed to create a scoreboard for my own game. I don't know how other people do it but this is what I did:

    Best Score (Demo)
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    @gyro - tried with the boolean switch and it still wouldnt work!

    @JackBQuick - Sweet, im not with my mac now so i'll try it out later, thanks.

    I think my gameproj maybe slightly corrupted! The save in theory should work!
    Also, i have some actors, i drag them on to the scene, edit the instance and delete all the rules, preview it on my phone and they still do what the prototype was set to do, even though the rules have been deleted! Its weird, so i had to copy the actor and delete the rules from the prototype and it now works as it should! Everything else is fine, just those weird problems but im right at the end and nearly finished now.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    2D-Sprite-Box said:
    I used this

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

    Here is the thread explaining my logic in that demo:

    http://gamesalad.com/forums/topic.php?id=5524
  • 2D-Sprite-Box2D-Sprite-Box Member Posts: 72
    barkbark00, that demo is AWESOME! I used it to create 10 high scores for my easy level, 10 for my med level, and 10 for my hard level
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    Great to hear someone got some use out of it! Now if I could just get enough time lined up to release my own game! ;-)
  • 2D-Sprite-Box2D-Sprite-Box Member Posts: 72
    Anytime you want to collaborate, I'm all ears!
Sign In or Register to comment.