Repeat rule every 5 points?

Tim_ATim_A Member, PRO Posts: 60

Hi all,

Just wondering if there's a simple way to repeat a rule every 5 points?

So if score = 5,10,15,20,25,30 do this

rather than

if score = 5 do this
if score = 10 do this
if score = 15 do this
if score = 20 do this
if score = 25 do this
if score = 30 do this

Thanks for any help

Tim

Comments

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

    Create an attribute called game.ZERO and give it the value zero.

    When attribute game.ZERO=mod(game.score,5)
    .....

    This will not work if your score increases by 5 at a time (5+5=10 won't trigger the rule) but you didn't mention that.

    If you use the Release Candidate or Nightly Build you don't need the zero attribute because you can put an expression on either side of the rule condition.

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

  • Tim_ATim_A Member, PRO Posts: 60

    Sorry for the late replay... that worked perfectly thank you :)

Sign In or Register to comment.