How do I have a conditional branch check multiple variables?

Just as the topic title states, I need to know how to have a conditional branch check multiple variables.


For example:


If, killed, healed, attacked, and defended vairables all equal 5, the event returns true and runs the contents in the conditional branch.


I hope I was clear enough.
You could use nested conditional branches.


ec9b69ca7e72419dbaa95caf96940114.png



Alternatively, I've written a plugin that can do what you ask in fewer steps: http://forums.rpgmakerweb.com/index.php?/topic/63723-conditional-branch/
The only way I can think of doing this without a plugin or something would be to have multiple conditional branches, one for each variable you want to check.  Then, at the final branch you can add what you want to have happen.
Nesting conditional branches is the last thing I want to do which is why I posted here in the first place and your plugin only looks at items, not variables so sadly its of no help to me but thanks for trying! 🙂
It checks variables.


You'd have to do something like


Check.each_is([a, 5], [b, 5], [c, 5], [d, 5])


where a, b, c and d are the ids of the variables.


Of course, you can expand or contract this as needed.


(ex. Check.each_is([a, 5], [b, 5])


Full documentation can be found in the spoiler of the plugin's forum page, or its help file.
does it have to be the variable's name or can it just be the number?
@deathsia...


Did you actually read through the description of the plugin that was suggested..? If so, you may have missed the phrase stating that it can be used for Switches, Variables and more besides.


Nested Conditionals is the 'normal' way to do this, whether you wish to or not. The plugin offers you an alternative; it's your call as to whether or not it's worth using, but should do what you asked for. Have a closer look, perhaps..?
Is there any reason not to use Nested Conditions? I'm new to the more technical aspects of RPGMaker.
Is there any reason not to use Nested Conditions? I'm new to the more technical aspects of RPGMaker.

Nothing particularly wrong (from my limited experience?...). The plugin just provide a cleaner alternative - if you're checking a lot of variables the event can get pretty hard to follow :c.
Is there any reason not to use Nested Conditions? I'm new to the more technical aspects of RPGMaker.

Your code will very quickly start to look quite messy. I would advise using the plugin suggested to eliminate headaches. I haven't used the plugin yet but it seems quite promising. For example, I'm coding a lottery in the game where the player has the chance to guess a 4 variable long answer. Of course if the player gets all four right then it's easy to use nested conditional branches as shown above, but I want the player to get credit for getting 1, 2, or 3 of the variables correct as well for a smaller prize. For that I'd need this plugin if I don't want my code to be really long and confusing.
Necro-post notice: ZiyaBeast
Sadly your advice is unlikely to be taken up as the post you are replying to is well over a year old.

Moderator note: Closing

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-have-a-conditional-branch-check-multiple-variables.68415/