High Score attribute doesn't work

I am making an endless runner in which the score works fine, so I made another integer attribute, highscore, and put in an actor which is always on the screen in the scene to change game.highscore to game.score whenever score is greater than highscore. And I even put an actor that displays game.highscore on the screen at al times, but it remains at 0. I have tried putting the rule in almost every actor in my game you could imagine, still always 0. Any thoughts? Also, I don't want to use a table because I made a custom font.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Is it possible that you have more than one game attribute named "highscore"? Is it possible that you've unlocked an actor on the scene and created an instance with its own unique rules? Try deleting the actors that control score and highscore from the scene and then re-adding them.

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

  • gineepiggineepig Member Posts: 26
    all of the actors are set to spawn once the scene starts, so the scene template is basically empty.
  • quantumsheepquantumsheep Member Posts: 8,188
    Also, your logic may be out.

    Rather than changing the highscore to gamescore, *constrain* it to gamescore.

    Or, you can calculate it at the end of a round/game over:

    If score is greater than high score, change attribute score to highscore
    Save highscore.

    Hope that helps,

    QS =D

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

  • gineepiggineepig Member Posts: 26
    Yeah, none of that worked:/
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Can you send me a link to download your file? It may be something obvious that is easier to find visually.

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

  • j75j75 Member, PRO Posts: 235
    can you post a screenshot of your rule?
    Are you sure the actor is actually spawning when the game starts?
    Why not create an actor slightly off scene with your rules that is always there?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    We got this sorted out over private messages.

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

Sign In or Register to comment.