Problems with highscore
boberto
Member Posts: 35
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
Your rules are set up incorrectly.
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
I will check all of those, thanks. Sorry for posting in the wrong place, I had no idea. I'm working with PC.
How so?
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
Ok, I figured it out. My rules were actually correct, the actor that displays my highsore wasn't working.
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
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.
You can concatenate text and an attribute like this:
"Highscore: "..game.highscore
@boberto sure you can, wrap the text in quotes and use two full-stops for concatenation, like so:
"Highscore : "..game.highscore
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Oh ok good to know