playMaker

Author Topic: Int compare + between function  (Read 3724 times)

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Int compare + between function
« on: March 18, 2012, 08:23:00 PM »
Hi guys!
I need to compare if my int is between 2 another ints.
Is there are already any action who can make this? I need it.
If not can someone make an int compare with between function? ::)
Please I need it.It´s very important. ;)
Bye

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Int compare + between function
« Reply #1 on: March 19, 2012, 01:37:36 AM »
Hi,

 using "int compare" action will allow you do that.

you can compare two integer and see if the first one is less than , equal or greater than

so, make one state with two of these actions.

the first action will check against the minimum and throw a "Fail" event only if it is below the minium, it not it will go to the next action that will compare against the maximum, if it is above the maximum throw the same fail event. at that point it will call the "finish" event if you have it as a transition.

But I made an action to do this in one step and also so that checking for this everything is easier:

http://hutonggames.com/playmakerforum/index.php?topic=1237.0

Bye,

 Jean

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Int compare + between function
« Reply #2 on: March 19, 2012, 07:52:09 AM »
I think you are right Jean.Your idea is very useful.
Thanks a lot for the action.
Bye