Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Aaddiction on May 04, 2020, 09:35:07 AM

Title: Meet several conditions before going to state [SOLVED]
Post by: Aaddiction 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
     }
Title: Re: Meet several conditions before going to state
Post by: djaydino 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 (https://hutonggames.fogbugz.com/default.asp?W1181))

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

There is also a action on the Ecosytem (https://hutonggames.fogbugz.com/default.asp?W1181) called 'bool multi condition' which can be also very useful if some have to be true and others false.
Title: Re: Meet several conditions before going to state
Post by: Aaddiction on May 04, 2020, 02:27:52 PM
Thank you!
Title: Re: Meet several conditions before going to state [SOLVED]
Post by: djaydino 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