Scene reset: resetting and saving score when changing scene

MegaemmanMegaemman Member, PRO Posts: 72
edited January 2014 in Working with GS (Mac)
I'm having a bit of an issue with resetting the current scene score and saving a high score.

When the time reaches 0 i have these rules set:

https://www.dropbox.com/s/l1m2rk3hdr8y0py/Screenshot 2014-01-23 23.53.38.png

And when it switches go the scene i have these rules for me high score actor :

https://www.dropbox.com/s/8crz6f82clztqbw/Screenshot 2014-01-23 23.55.32.png

The problem is whenever i leave the scene or change to a new scene the score from the previous game remains. I've tried a change attribute behavior ( game.score To:0) but that erases the High Score. I was wonder how would i go about returning the score to zero without interfering with the my High Score attribute.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You forgot to reset your score attribute. Game attributes do not reset when you change scenes. You have to do it manually (change attribute game.Score to 0).

    You said that erases the high score but I don't see anything that would cause that in the two screenshots you posted. Perhaps that's happening somewhere else (in another actor).

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

  • MegaemmanMegaemman Member, PRO Posts: 72
    @tatiang

    Ok I think I'm missing a loading attribute.....and it would be put in the high score actor ?

    Or should it be in a separate loading actor all together ?

  • slowcutslowcut Member, PRO Posts: 164
    Put all your loading behaviours together in one actor on the root layer of your game/scene, so that they will automatically load when the game starts.
    If you have lots of attributes to load, you should consider to use tables for save and load, it will make the workflow much more easier
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    What @slowcut said. :)

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

  • MegaemmanMegaemman Member, PRO Posts: 72
    @slowcut , @ tatiang

    Yeah it took a minute but i figured it out, i needed a scene actor that had all of my attributes for saving scores into my score table once the level was completed. Just like slowcut said a loading attribute in the menu to load unlocked levels and other things. Thanks again!
Sign In or Register to comment.