Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: IsolatedPurity on December 23, 2019, 02:01:48 PM

Title: Compare multiple ints less than/equal/greater than
Post by: IsolatedPurity on December 23, 2019, 02:01:48 PM
Is there a way to compare multiple ints and choose the lowest one without using an array? Kind of the like the Int Compare action but with more than two.
Title: Re: Compare multiple ints less than/equal/greater than
Post by: Fat Pug Studio on December 23, 2019, 04:50:49 PM
Well, you could probably do it without arrays in code. I'm curious, why wouldn't you use an array?
Title: Re: Compare multiple ints less than/equal/greater than
Post by: daniellogin on December 23, 2019, 10:46:28 PM
Well, the easiest way to do it is to just stack em up.

Eg;

* Int compare = 5
- equal = event 1
- greater = event 1
- less = ...

* Int compare = 0
- equal = event 2
- greater = event 2
- less = ...

And so on

With the above example; Event 1 is int 5 or more. Event 2 is 0 to 4. This will only work when the int compares are sequenced correctly. If the second int compare went first, it would send the event for everything, but by going last, all the higher options have happened (or not) before reaching it, so only 0 to 4 remains to be checked.