Multiple Variables for *if statements

@appleduck28 Technically, you don’t need the outer parentheses if you’re just using an *if (although you do need them around each equation), so:

*if (foo = true) and (bar = true)

does work. But there are some cases (like using *selectable_if) where you do need the outer parentheses, so it’s usually a good habit to get into (particularly as the extra parentheses never hurt).

@Daemonion There are two things to remember that aren’t always mentioned though: The first thing to remember is that each AND/OR will only connect two equations, so if you want to check if all of foo, bar and bat are true you’ll need to use:

*if ((foo = true) and (bar = true)) and (bat = true)

(Bolded the parenthese that are necessary but very easy to forget.)

The other thing to remember is (as mentioned by @Vendetta) mixing and matching AND/OR with the correct order of parentheses can be confusing at the best of times. Once you get a hand on how the logic works though, you may be surprised at how simple it can be, but while starting out, you’ll probably want to stick with each *if command only use AND or OR.

1 Like