playMaker

Author Topic: Compare multiple floats?  (Read 5407 times)

derkoi

  • Full Member
  • ***
  • Posts: 187
Compare multiple floats?
« 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

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Compare multiple floats?
« Reply #1 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.
« Last Edit: October 16, 2013, 07:15:26 AM by Lane »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: Compare multiple floats?
« Reply #2 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.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Compare multiple floats?
« Reply #3 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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: Compare multiple floats?
« Reply #4 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?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Compare multiple floats?
« Reply #5 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
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: Compare multiple floats?
« Reply #6 on: October 16, 2013, 09:03:57 AM »
Awesome, thanks Lane  8)