[RMVA] Questions about the conditional branching of the switch for variables

1731227511755.png



I want to create a " conditional branch that runs when $game_switches[$game_variables[5]] = false " ,
but Actually running this gives " $game_switches[$game_variables[5]] =false "
How can i make " conditional branch that runs when $game_switches[$game_variables[5]] = false " ?

I'd really appreciate it if you could help me
View attachment 322598


I want to create a " conditional branch that runs when $game_switches[$game_variables[5]] = false " ,
but Actually running this gives " $game_switches[$game_variables[5]] =false "
How can i make " conditional branch that runs when $game_switches[$game_variables[5]] = false " ?

I'd really appreciate it if you could help me
The mistake you made is the equal sign.
in Ruby = sets the value, == compares the values
You can easily google the comparator values for ruby.
==
>=
<=
!=
There's a quick way to look for a negative, falsey value:

!$game_switches[$game_variables[5]]

That exclamation mark cares only about a false or nil result. In Ruby nil is also treated as a falsey value.
This is my first time using rpg vxace, and I didn't know the difference in equal sign. Thank you so much for your answer!

Original thread: https://forums.rpgmakerweb.com/threads/rmva-questions-about-the-conditional-branching-of-the-switch-for-variables.173129/