GameSalad

Score won't reset even after I close the application

johnsheerin215johnsheerin215 Posts: 20Member, BASIC

For a while, any time I'd use the Preview button to play the game from the top, the score would start at zero as it ought to, but now it seems to be preserving any increases that accumulate during editing individual scenes, with the result that when I start the game now, even the first scene will show points accumulated in past playthroughs, the oddest part being that the number sticks even if I close and reopen GameSalad.

Any ideas what's suddenly causing this?

Comments

  • johnsheerin215johnsheerin215 Posts: 20Member, BASIC

    Figure I'll bump this and see if anyone has an idea. My score is now set at 3 instead of 0 zero when I start the game. I have no idea where it's deriving the number 3 from. Anyone encounter such a thing before?

  • johnsheerin215johnsheerin215 Posts: 20Member, BASIC

    Now having the same issue with a timer: Starts at 15 seconds and counts down just fine, but when I reopen or restart the game, the timer is at 0; it hasn't reset to 15 seconds.

    I notice when I go to Game > Attributes, my score is set to 3 and my timer is set to 0. This seems to be the heart of both the score and the timer issue, though I can't figure out what I did do cause this. Ideas, anyone?

  • johnsheerin215johnsheerin215 Posts: 20Member, BASIC

    Please forgive the repeated clarifications, but I think I've discovered the heart of the problem: I periodically save my progress, and in doing so the core attribute changes. So if I save the game when the score is 3, when I go back to the Home screen and hit Preview again, the score's new baseline is 3.

    So it seems my real question is how do you save your build progress without saving the current score and timer state as the new starting points for the next playthrough?

  • RowdyPantsRowdyPants Posts: 382Member, PRO

    @johnsheerin215 You can just save it into another variable or into a table cell and later access it when the user wants to see their high score.

    Before saving that variable each time there's a game over (or whenever you're saving it) you can check if now new score is greater than the saved variable (or saved table cell value) and only overwrite it if that's true.

  • johnsheerin215johnsheerin215 Posts: 20Member, BASIC

    @RowdyPants said:
    @johnsheerin215 You can just save it into another variable or into a table cell and later access it when the user wants to see their high score.

    Before saving that variable each time there's a game over (or whenever you're saving it) you can check if now new score is greater than the saved variable (or saved table cell value) and only overwrite it if that's true.

    Thanks for the explanation, but my case is actually simpler: I don't require scores to be saved. Frankly, only one person (my teacher) is ever going to play the game, and I just need the timer and the score to both reset after I'm done my preview and after my teacher is done his playthroughs. Currently, just playing the game alters the integer in the original attribute and I don't know why that is.

  • ArmellineArmelline Posts: 4,590Member, PRO

    Game attributes will only be saved if you specifically save them, and will only be loaded if you specifically load them. Your score has, by the sounds of it, a default value of 3. That means it will always start at 3. If you want it to start at zero, make sure your game.Score is set to 0, not 3.

    If you play a game and then hit Home, and then hit Preview again, it shouldn't be saving any information from previous play sessions.

    I'm not clear on what you mean by "saving progress" - are you at any point specifically saving the game.Score attribute? If not, then it shouldn't be getting saved.

  • HopscotchHopscotch Posts: 2,769Member, PRO

    @johnsheerin215

    which version of GS are you using? There was one version a while back where the values where not cleared between sessions, but has subsequently been fixed.

    Otherwise I am also baffled as to why the value gets saved, unless it is code related.

  • johnsheerin215johnsheerin215 Posts: 20Member, BASIC

    @Hopscotch said:
    @johnsheerin215

    which version of GS are you using? There was one version a while back where the values where not cleared between sessions, but has subsequently been fixed.

    Otherwise I am also baffled as to why the value gets saved, unless it is code related.

    I just got the program 2-3 months back.

  • johnsheerin215johnsheerin215 Posts: 20Member, BASIC

    @Armelline said:
    Game attributes will only be saved if you specifically save them, and will only be loaded if you specifically load them. Your score has, by the sounds of it, a default value of 3. That means it will always start at 3. If you want it to start at zero, make sure your game.Score is set to 0, not 3.

    If you play a game and then hit Home, and then hit Preview again, it shouldn't be saving any information from previous play sessions.

    I'm not clear on what you mean by "saving progress" - are you at any point specifically saving the game.Score attribute? If not, then it shouldn't be getting saved.

    I think you may have cracked the case. If I use the Home button before saving, the score and timer both reset. I'd been doing it like this: I'd preview the game--the score and timer would be in flux during, of course--and midstream I'd go to Scenes, edit a scene, add an actor, etc., and then save. The result would be the actual game attributes' original values would be overwritten, so that when I tried another playthrough by clicking Preview, the values hadn't reset.

    Very grateful for the assistance from all of you. I think you might have helped salvage my school project. Thanks.

    I'd be interested to hear the suggestions for a solid sequence of steps to use when building, testing, and saving build progress in a way that both allows edits on the fly without saving unhelpful game states. If my score is at 4 when I notice a typo in a text-based actor, and I fix the typo, must I really hit Home, restarting the game, before it's safe to save?

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

    Any chance you can upload a video showing what's happening on your screen? I think without knowing exactly how your attribute values are being retained, it's hard to know what to suggest.

    As others have said, unless you explicitly save attribute values, they don't save. So there's something about the exact steps you're doing when editing and previewing that is causing the problem.

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

Sign In or Register to comment.