Sometimes 2 points get added to the score instead of 1, which i don't want.

Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

Hi everyone, i have a little problem, sometimes two points get added to the score when pressing a button instead of 1. I only want 1 point to be added.
I have put in the rule, when touch is pressed- change attribute game.score to game.score+1.

Anyone have any ideas on why its adding 2 points instead of 1?

Thanks.

Comments

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

    Somewhere in your rules, you have another change attribute behavior that is adding one to that value. You may want to turn rules off and/or delete actors from the scene until you discover the cause. It could be as simple as having an unlocked actor on the scene with unique "instance" rules. Try deleting the offending actor and re-adding it to the scene.

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

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @tatiang said:
    Somewhere in your rules, you have another change attribute behavior that is adding one to that value. You may want to turn rules off and/or delete actors from the scene until you discover the cause. It could be as simple as having an unlocked actor on the scene with unique "instance" rules. Try deleting the offending actor and re-adding it to the scene.

    Thanks for the quick response tatiang.
    I have two game modes that use the same game.score attribute,
    i have now changed that so the other game mode uses a different score attribute, which is game.score 2.
    But its still happening.

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    @Thor

    Are you double tapping?

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @RabidParrot said:
    Thor

    Are you double tapping?

    No I'm not double tapping

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    @Thor

    Delete the change attribute rule game.score to game.score + 1.

    See if the points are still being added.

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @RabidParrot said:
    Thor

    Delete the change attribute rule game.score to game.score + 1.

    See if the points are still being added.

    The points don't get added.

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    @Thor said:
    The points don't get added.

    Can you post a screenshot?

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @RabidParrot said:
    Can you post a screenshot?

    Of what? The rule?

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    Yes

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @RabidParrot said:
    Yes

    If i was double tapping, what would i need to change, or what rule would i need to add for that not to happen?

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

    So if you turn off that one rule, the value of game.score doesn't change at all? Have you checked scene-->layers to make sure you don't have multiple copies of that actor on the scene? Another test would be to create a brand new blank scene and add the actor to that scene. When you do that, what happens when you click on the actor?

    If it's still adding two in the new scene, post a screenshot of the rule.

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

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

    These are the kinds of problems that are often very simple to solve when you have the project file in front of you but very difficult via back and forth messages. Often people (not saying you're this way) leave out important details such as "I have eighteen copies of this actor in the scene, all stacked on top of each other" or "My rule is embedded in a timer that's embedded in a rule that checks a boolean value that..."

    :p

    Anyway, hopefully we can figure out what's wrong!

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

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @tatiang said:
    These are the kinds of problems that are often very simple to solve when you have the project file in front of you but very difficult via back and forth messages. Often people (not saying you're this way) leave out important details such as "I have eighteen copies of this actor in the scene, all stacked on top of each other" or "My rule is embedded in a timer that's embedded in a rule that checks a boolean value that..."

    :p

    Anyway, hopefully we can figure out what's wrong!

    Hi tatiang, i think i may have figured out what it was, i think it was a timer issue.

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

    Glad to hear it! :)

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

Sign In or Register to comment.