I'll try to explain as best as I can. Let's say I have a variable that is currently set to 20. I want a way to then run a conditional branch where the game checks if the switch with the matching ID of the current variable number (so switch with the "20" ID in this case) is on or not. Any way to do this?
condintion where the game checks if a switch with X ID that matches the current number that a variable is set to is on?
RPG Maker MZ SupportYes. Just as a tip, little bits of code like this are referred to as "script calls," and you can find them pretty quickly by Googling the relevant term: e.g. "rpg maker mz variable script call" or "rpg maker mz switch script call".
There's even a pinned thread listing all of the script call equivalents of the event commands (such as Control Variables and Control Switch).
You would type into the Script field of your Conditional Branch:
you didn't actually say what the ID of your variable is, so I put 20 there, but you'd replace it with whatever.
There's even a pinned thread listing all of the script call equivalents of the event commands (such as Control Variables and Control Switch).
You would type into the Script field of your Conditional Branch:
Code:
$gameSwitches.value($gameVariables.value(20))
So I looked over the pinned script call list you mentioned and i'm still a bit confused about how to achieve what i'm trying to achieve.
Let's say variable with the I.D of "5" currently has its value set to "8", I now want the game to check if the switch with the I.D that matches Variable "5"'s current value is turned on, so checking if the switch with I.D of "8" is turned on.
I imagine it would be something like this?
Code:
gameSwitches.value($gameVariables.value(5) == true)