- Joined
- Apr 10, 2012
- Messages
- 17
- Reaction score
- 7
- Primarily Uses
Hey there! I am trying to figure out how to turn on a switch if a variable is equal to a bunch of possible values? What I got so far is something like this...
So I have an event that sets variable 1 to the value of 115. And then I create the following script call:
var hs = [113, 114, 115, 116, 117];
if ($gameVariables.value(1) === hs) {
$gameSwitches.setValue(100, true);
}
So basically if variable #1 is equal to 113, 114, 115, 116, or 117, game switch 100 will turn on. I'm no programmer so I'm not entirely sure how to do this part exactly. I can do this through a bunch of conditional branches but what if variable 1 can be equal to lets say 1000 different numbers, then I'd have a bunch of conditionals
. Any help would be greatly appreciated! Thank you!!!!
So I have an event that sets variable 1 to the value of 115. And then I create the following script call:
var hs = [113, 114, 115, 116, 117];
if ($gameVariables.value(1) === hs) {
$gameSwitches.setValue(100, true);
}
So basically if variable #1 is equal to 113, 114, 115, 116, or 117, game switch 100 will turn on. I'm no programmer so I'm not entirely sure how to do this part exactly. I can do this through a bunch of conditional branches but what if variable 1 can be equal to lets say 1000 different numbers, then I'd have a bunch of conditionals


