So, I want to create a conditional branch where if a certain variable's value is either 2 or 3, it will trigger the condition. I can do it, like that screenshot I shared. But want to know, if there is a script call that I can use to do the same thing using a single conditional branch. I much appreciate your help on this.
MZ Script call for using multiple value of a single variable in a conditional branch event.
Javascript/Plugin SupportHi there!
If the values you are checking will always be between two numbers, you can do this:
- Checking if the variable value is equal to or higher than 2 AND equal to or lower than 3.
But if you want to check for specific numbers:
If the values you are checking will always be between two numbers, you can do this:
- Checking if the variable value is equal to or higher than 2 AND equal to or lower than 3.
$gameVariables.value(ID) >= 2 && $gameVariables.value(ID) <= 3But if you want to check for specific numbers:
[1, 8, 5, 9, 13].includes($gameVariables.value(ID))such conditional branches (without the script solution) look better if you disable the else-branch. you don't need it for lists of equal comparisons.
This is exactly what I was looking for! Thank you very much for your help 🙂 It will solve a lot's my problem I was having so far. Much appreciated! 🙂
I know that. 🙂 I guess I overlooked disabling the else-branch when I took the screenshot.
choice expansion
Increase the number of items by connecting options
Hide items by condition
Conditionally display items semi-transparently
選択肢拡張 | ペンギンの寝床
woodpenguin.web.fc2.com
Hide items by condition
Conditionally display items semi-transparently
Original thread: https://forums.rpgmakerweb.com/threads/script-call-for-using-multiple-value-of-a-single-variable-in-a-conditional-branch-event.151437/