playMaker

Author Topic: need help with int values  (Read 1560 times)

andyandyandy

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 63
need help with int values
« on: June 01, 2020, 08:51:58 PM »
Hey guys I just started using Playmaker and need alittle help.

What do I need to put in the state if I want my max numbers for scores to be between only 1-5 from adding a score, if the score goes greater than 5, it restarts the value at 1 and add again.

Say I add 3+3 into score board and I want the answer to be 1. Or 4+4 with a answer of 3. It will go through 1 to 5 and then restart and add the remaining value.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: need help with int values
« Reply #1 on: June 02, 2020, 02:10:03 AM »
Hi and welcome!

Every time you increment your score, check if the value is >5 and if so, go to a state that set it back to 1.



To have your event and variable to show up in the inspector, check the "Inspector" check box when you edit them.

Bye,

 Jean
« Last Edit: June 03, 2020, 02:42:11 AM by jeanfabre »

andyandyandy

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 63
Re: need help with int values
« Reply #2 on: June 02, 2020, 02:37:55 PM »
thank you so much! I was playing around with it last night and figure a way, but your way is definitely simpler! Love this software!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: need help with int values
« Reply #3 on: June 03, 2020, 02:44:05 AM »
Hi,

 yes, that's a good process that you kept trying, never give up on such problem, try to find a way, no matter how complex, weird, hacky, and then compare with other's solution, that's the best way to learn and also develop the much needed "duck and tape" coding attitude and learn many tricks along the way.

Bye,

 Jean