GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Problems with highscore

bobertoboberto Posts: 35Member
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.Posts: 12,822Member
    edited January 2016

    Your rules are set up incorrectly.

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

    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 Posts: 35Member
    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 Posts: 35Member

    @Socks said:
    Your rules are set up incorrectly.

    How so?

  • tatiangtatiang Posts: 11,845Member, Sous Chef, PRO, Senior Sous-Chef
    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 Posts: 35Member

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

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

    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 Posts: 35Member

    @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 Posts: 2,827Member, Sous Chef, PRO

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

  • HopscotchHopscotch Posts: 2,782Member, PRO
    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 Posts: 35Member

    @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.