Hello, everyone! My doubt is the one in the title. During battles, I want a specific switch to be ON while at least 1 actor has a specific state and that same switch to be OFF if no actor (no longer) has the state mentioned.
Thanks for reading!
If you have Yanflys Buffs and States plugin this can be easily done with the Apply and Leave effects.
You would just need to add these into the state note box:
<Custom Apply Effect>
$gameSwitches.setValue(num, true);
</Custom Apply Effect>
<Custom Leave Effect>
$gameSwitches.setValue(num, false);
</Custom Leave Effect>
Changing the num to whatever switch number you wanted
or you could have a troop event checking for the states and reacting to them.
but a much better question would be an explanation of what the switch is supposed to do, because depending on that it might be easier to handle the effect of the switch directly.