How to check if lots of switches are simultaneously on?

mellanny

I have no idea what I'm doing
Veteran
Joined
May 4, 2020
Messages
89
Reaction score
33
First Language
Portuguese
Primarily Uses
RMMV
Hi, everyone :kaoluv:

I'm making a "quest board" with missions the player can accept. I wanted it to show "no more quests to accept" when they're all taken and/or finished. I don't really know why, but just putting condicional within conditional isn't working, so I thought I'd come here and look for something simple that works. Any ideas?
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
Code:
function areAllSwitchesOn(v){for (var i = 0; i < v.length; i++){if (!$gameSwitches.value(v[i])){return false;}};return true;};
$gameSwitches.setValue(10, areAllSwitchesOn([1, 2, 5])); // This would set switch 10 to true only if 1, 2 & 5 are on.
 
Last edited:

mellanny

I have no idea what I'm doing
Veteran
Joined
May 4, 2020
Messages
89
Reaction score
33
First Language
Portuguese
Primarily Uses
RMMV
Thank you very much! It seems to be working perfectly.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top