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
30
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,110
Reaction score
15,525
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
30
First Language
english
Primarily Uses
RMMV

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,110
Reaction score
15,525
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
16,244
Reaction score
9,011
First Language
English
Primarily Uses
RMMV

I've moved this thread to Learning JS. 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.

Latest Threads

Latest Posts

Latest Profile Posts

Uggh... been sick for the past week. I hope I get better soon.
There are so many coding terms that are complete gibberish to me. Like what the heck is "Return" or "Array"??
Sometimes I forget how tiny and fun working in 16x16 is (or with 18x18 if ya counting the white outline LOL) and before you ask Yes. Yes this is an appropriate ratio of drinks to all the other stuff. :popcorn:
f37ac128dedc8a53af7deb2b12e8ea81becf6e46.png
Phew, sleep all day, awake all night. I don't know what to draw tonight!

Does that count as poetry? ..Is there a super fast way to test my creations in RPG Maker? Has anyone played the new Pokémon games? I'm itching to buy it but I don't think my husband will want me to after he finds out how much I spent on Christmas!

Forum statistics

Threads
117,077
Messages
1,104,353
Members
153,059
Latest member
u-mu
Top