playMaker

Author Topic: Meet several conditions before going to state [SOLVED]  (Read 1026 times)

Aaddiction

  • Full Member
  • ***
  • Posts: 166
Meet several conditions before going to state [SOLVED]
« on: May 04, 2020, 09:35:07 AM »
I'd like to ask for the best approach in the following case.

From state state 1 I want to go to state 2 but only if I have a string with the name "string1" and float that is over "800". Basically && in C#.

How to do that in Playmaker in a single state and combine a string and a float?
To do this:

Code: [Select]
if(x == z && y == z){
     //Do something
     }
« Last Edit: May 04, 2020, 02:45:56 PM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Meet several conditions before going to state
« Reply #1 on: May 04, 2020, 10:12:15 AM »
hi,
For string, use string compare and store the value

For float use 'float compare with bools' (Ecosytem)

Then use 'Bool All True' to check if both are true.

There is also a action on the Ecosytem called 'bool multi condition' which can be also very useful if some have to be true and others false.

Aaddiction

  • Full Member
  • ***
  • Posts: 166
Re: Meet several conditions before going to state
« Reply #2 on: May 04, 2020, 02:27:52 PM »
Thank you!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Meet several conditions before going to state [SOLVED]
« Reply #3 on: May 05, 2020, 12:50:05 PM »
Hi.
i have not used this action yet but this might be very helpful as well : conditional expression