Page 1 of 1

any/all mix in Lua conditions

Posted: Mon Mar 22, 2021 10:57 am
by annathehank
Happy Monday!

I was curious if the and/or functions of the Lua conditions can be combined? For instance, in the buttons that I have turning on and off if certain conversations and relationship levels are met, would it be possible to set up a sort of, either or series of conditions?

Example: Conversation #3 is available to a player if conversation 1 had is true, conversation 2 had is true, and the relationship value is over 25. All of this works with the and function in the Lua condition wizard. Would I also be able to add an or condition at the end of that so the player could activate the conversation if some of those conditions are false but a secondary set of conditions is true?

Basically something like
V1 = true and
V2 = true and
V3 = true or
Vsecret = true and
Vothersecret = true

Re: any/all mix in Lua conditions

Posted: Mon Mar 22, 2021 1:19 pm
by Tony Li
Hi,

Yes. The easiest way is to choose one option, such as "All". This will add "and" between all of the conditions:

Code: Select all

V1 == true and
V2 == true and
V3 == true and
Vsecret == true and
Vothersecret == true
Then manually change the "and" to "or", and add parentheses to clarify the grouping:

Code: Select all

(V1 == true and
V2 == true and
V3 == true) or
(Vsecret == true and
Vothersecret == true)

Re: any/all mix in Lua conditions

Posted: Mon Mar 22, 2021 8:49 pm
by annathehank
ahh okay! I thought that might work but I didn't want to put it all together and end up with 7 errors when I try to run it :lol: Thank you!

Re: any/all mix in Lua conditions

Posted: Mon Mar 22, 2021 8:58 pm
by Tony Li
You're welcome!

BTW, while the format will be the same, your actual Conditions will almost certainly look a bit different in details. Maybe something closer to:

Code: Select all

(Variable["DidConv1"] == true and
 Variable["DidConv2"] == true and
 Actor["Ann"].Relationship > 25) or
(Variable["secret"] == true and
 Variable["othersecret"] == true)