Problems with highscore

bobertoboberto Member Posts: 35
edited January 2016 in Working with GS (PC)

So I have a highscore counter in the game. My rules say this:
If game.Score>game.highscore
do
Change attribute game.highscore to game.score.
But my highscore always stays at 0.
What am I doing wrong?

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2016

    Your rules are set up incorrectly.

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

    The most detailed information you can provide is to upload your project file. Second to that is a screenshot of your rules. Without seeing exactly how you have things set up, it's tough to guess but here goes:

    Check that your actor is not an instance. To do this, double-click on the actor. If it shows a lock symbol, it is still a prototype. If not, you've already unlocked the actor and given it unique instance rules that might be different from the prototype in the actor browser window.

    You might have typed in an attribute name instead of selecting it from the Attribute Browser.

    You might have forgotten to add the actor to the scene.

    You might have a rule condition that isn't triggering when you expect it to or isn't triggering at all (Log Debugging Statements are helpful in determining this).

    Also, you're posting in the Help Wanted subforum which usually indicates that this is a paid request. Are you using a Mac or PC? I can move this to the appropriate "Working with ______" subforum for you.

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

  • bobertoboberto Member Posts: 35
    edited January 2016

    @tatiang said:
    The most detailed information you can provide is to upload your project file. Second to that is a screenshot of your rules. Without seeing exactly how you have things set up, it's tough to guess but here goes:

    Check that your actor is not an instance. To do this, double-click on the actor. If it shows a lock symbol, it is still a prototype. If not, you've already unlocked the actor and given it unique instance rules that might be different from the prototype in the actor browser window.

    You might have typed in an attribute name instead of selecting it from the Attribute Browser.

    You might have forgotten to add the actor to the scene.

    You might have a rule condition that isn't triggering when you expect it to or isn't triggering at all (Log Debugging Statements are helpful in determining this).

    Also, you're posting in the Help Wanted subforum which usually indicates that this is a paid request. Are you using a Mac or PC? I can move this to the appropriate "Working with ______" subforum for you.

    I will check all of those, thanks. Sorry for posting in the wrong place, I had no idea. I'm working with PC.

  • bobertoboberto Member Posts: 35

    @Socks said:
    Your rules are set up incorrectly.

    How so?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2016

    I will check all of those, thanks. Sorry for posting in the wrong place, I had no idea. I'm working with PC.

    No worries!

    What @Socks meant is that there's something about how your rules and behaviors were created that is causing the problem you described but there's no way to know without seeing them (which is what I said but in a few more words).

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

  • bobertoboberto Member Posts: 35

    Ok, I figured it out. My rules were actually correct, the actor that displays my highsore wasn't working.

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

    Glad you figured it out! In what way was the actor not working?

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

  • bobertoboberto Member Posts: 35

    @tatiang said:
    Glad you figured it out! In what way was the actor not working?

    I thought I could make it display text like this:
    Display text: Highscore:game.highscore
    but I guess you can't have text and an attribute display at the same time.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    You can concatenate text and an attribute like this:
    "Highscore: "..game.highscore

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited January 2016

    but I guess you can't have text and an attribute display at the same time.

    @boberto sure you can, wrap the text in quotes and use two full-stops for concatenation, like so:

    "Highscore : "..game.highscore

  • bobertoboberto Member Posts: 35

    @Hopscotch said:

    but I guess you can't have text and an attribute display at the same time.

    @boberto sure you can, wrap the text in quotes and use two full-stops for concatenation, like so:

    "Highscore : "..game.highscore

    Oh ok good to know

Sign In or Register to comment.