Score question (advanced) Math Genius are you out there?

Alright my player collects coins for every 10 coins collected he/she gets a Bonus. I set up an attribute called CoinsCollected. So every time the player collects 10 coins that attribute is set to true. Music plays and confetti comes out of a Cannon. Collect 10, 20, 30 ... .
Here is my problem. As far as I know I hve to create an endless amount of "If score is 10 then change attribute to true" "If score is 20...and so on.
This is getting very tiring if I have to go up to 1 Million.
Any suggestions?
Thank you.

Comments

  • Dazza006Dazza006 Member Posts: 248
    edited February 2013
    @JoeMeister Try creating an index attribute say "bonus count".
    Create a rule that says when attribute =10 change coins collected attribute to true.
    Then another rule thats says when bonus count is greater than 10 change back to 1.
    Hope this helps

    -Darren.
  • JoeMeisterJoeMeister Member Posts: 602
    Sounds good. I will try that right now. Thanks for you quick response.
    Have a great weekend.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Try using GameSalad's modulo function. (Done with the % sign.) It would look something like this:

    When score%10 = 0
    -- Change Attribute: CoinsCollected To: true
    otherwise
    -- Change Attribute: CoinsCollected To: false
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    @RThurman I'm not so sure that would work.

    If starting as a rule looking at an attribute you cant insert the modulo function.
    You could stick the modulo rule on the score counter but that will just loop it up in increments of 10.
    If I understand correctly it needs to count up;

    1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 .....

    But every 10, trigger the bonus!
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013
    @RThurman I'm not so sure that would work.

    If starting as a rule looking at an attribute you cant insert the modulo function.
    You could stick the modulo rule on the score counter but that will just loop it up in increments of 10.
    If I understand correctly it needs to count up;

    1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 .....

    But every 10, trigger the bonus!
    I think he (RThurman) intended to just sketch out the basic idea, as an idea it should work fine, you would, of course, need to play around with exactly how you might implement it.


    When you score a point make the 'bonus check' = '(bonus check'+1)%9
    When the bonus check = 9 then do your bonus thing (whatever that is).

    Something like that.
  • ericzingelerericzingeler Member Posts: 334
    Try using GameSalad's modulo function. (Done with the % sign.) It would look something like this:

    When score%10 = 0
    -- Change Attribute: CoinsCollected To: true
    otherwise
    -- Change Attribute: CoinsCollected To: false
    done deal if you ask me.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    @Socks Oh yeh, just didnt want the OP taking it thinking it was the full blown solution and not being able to get it working! The principal is correct and your elaboration of it does the job.
  • JoeMeisterJoeMeister Member Posts: 602
    Thank you all. Great stuff. At Daytime job right now thats why it takes me a while to test and answer. Thanks again.
Sign In or Register to comment.