Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: derkoi on October 16, 2013, 06:41:25 AM

Title: Compare multiple floats?
Post by: derkoi on October 16, 2013, 06:41:25 AM
I need to check if a 2 float values are above a values and if they are transition to next event.

Is there a way I can do this with multiple float compare actions or will i need something else?

Thanks
Title: Re: Compare multiple floats?
Post by: Lane on October 16, 2013, 07:13:54 AM
You could use two Float Compare's, store as bools, and use a Bool All True to fire the event.

*edit

just noticed float compare cant store as bool, so you'd have to exit the state and switch the bool or do something else to modify the bool.
Title: Re: Compare multiple floats?
Post by: derkoi on October 16, 2013, 07:20:24 AM
I cant really exit the state as it's translating the object every frame. I know i could translate in the next state but I'd rather keep things tidy if possible.
Title: Re: Compare multiple floats?
Post by: Lane on October 16, 2013, 07:35:40 AM
You could use a Float Operator to add the Floats together, then Compare the total stored float and send an event off of the Greater Than.

That could create issues though... If one number goes too high it will fire the event for example. It's very conditional.

Sounds like you need a second FSM doing those calcs and sending the results back. Either that or modify the Float Compare action to store a bool actively.
Title: Re: Compare multiple floats?
Post by: derkoi on October 16, 2013, 07:48:39 AM
I was thinking about modifying the compare float action to use the && condition and fire an event?
Title: Re: Compare multiple floats?
Post by: Lane on October 16, 2013, 08:34:06 AM
I went ahead and made an action with bools.

http://hutonggames.com/playmakerforum/index.php?topic=5198.0
Title: Re: Compare multiple floats?
Post by: derkoi on October 16, 2013, 09:03:57 AM
Awesome, thanks Lane  8)