"If statement" for switch on?

Status
Not open for further replies.

Yitzi Litt

Made Nepenthe — An RPG that's one giant dad-joke
Veteran
Joined
Jul 31, 2017
Messages
103
Reaction score
29
First Language
english
Primarily Uses
RMMV
Hey!
How would I write an "if statement" in javascript that runs if a switch is on or not?
It would be in the "rpg_objects.js" file.
Thanks!
-Yitzi Litt
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,649
Reaction score
13,262
First Language
English
Primarily Uses
RMMV
if ($gameSwitches.value(15)) {
...
}

would run if switch 15 is on
 

Yitzi Litt

Made Nepenthe — An RPG that's one giant dad-joke
Veteran
Joined
Jul 31, 2017
Messages
103
Reaction score
29
First Language
english
Primarily Uses
RMMV

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,649
Reaction score
13,262
First Language
English
Primarily Uses
RMMV
You could just check Game_Interpreter to see what it does when you use a conditional branch to see if a switch is on, in an event.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,891
Reaction score
8,243
First Language
English
Primarily Uses
RMMV

I've moved this thread to Learning JS. Please be sure to post your threads in the correct forum next time. Thank you.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Who knew a adding menu commands would be so hard for something that should be a basic feature.
When you discover great tileset resources that you completely forgot that you had. :kaomad3::kaopride:
Just got a better look at the MZ RTP. I'm very happy with it, especially the sci-fi tiles and sprites. Glad I pre-ordered.
I've just checked the VisuStella Plugins for MZ and there are already 11 plugins. The Yanfly team(perhaps a big one?) really works so effectively and efficiently that some MZ users can likely use tons of Yanfly plugins right after MZ's released (still 13 days from now). I wonder if any other plugin developer(or team) will try to compete with Yanfly this time, no matter how slim the chance to win is :)
Hello! :kaopride:I am new to RPG Maker, though I have been lurking the forums for a while. :kaoswt: Hope to make some friends and learn some stuff here! :kaothx:

Forum statistics

Threads
100,597
Messages
977,605
Members
132,199
Latest member
Erasure2
Top