Page 1 of 1

[Solved] Syntax for combinations of AND/OR conditions

Posted: Mon Jun 03, 2024 5:48 pm
by tomb
Hi Tony

I was wondering if there is a valid syntax for checking a mix of AND/OR conditions in a single entry?

For example if I wanted to check (pseudo code):

Code: Select all

If (A == true and B == true) OR (C == true)
i.e. This entry is valid if both A and B are true. This entry is also valid if C is true (regardless of the state of A or B)

At the moment I would do this using two different entries:

Code: Select all

Variable["A"] == true and (Variable["B"] == true)

Code: Select all

Variable["C"] == true
Both entries would have a Continue() sequence and link to the same dialogue entry for the text I wanted to display in this situation.

If I could achieve this check in a single entry that would be helpful. I wondered if it's possible to use brackets to wrap sets of conditions in but I haven't been able to get this to work so far. For example:

Code: Select all

((Variable["A"] == true) and (Variable["B"] == true)) or (Variable["C"] == true)

Thank you

Tom

Re: Syntax for combinations of AND/OR conditions

Posted: Mon Jun 03, 2024 7:38 pm
by Tony Li
Hi Tom,

I just tested that last condition, and it works fine. What issue are you seeing?

Re: Syntax for combinations of AND/OR conditions

Posted: Tue Jun 04, 2024 9:15 am
by tomb
Hi Tony

You're right it is working - great to know this is possible!

I must have gotten myself confused.

Thanks

Tom

Re: [Solved] Syntax for combinations of AND/OR conditions

Posted: Tue Jun 04, 2024 10:45 am
by Tony Li
Glad to help!