Gryffin

Villager
Member
Joined
Dec 15, 2013
Messages
21
Reaction score
2
First Language
English
Primarily Uses
Hello,

Trying to script call a conditional branch, where the if statement is a switch status.It should check if Switch 1 is true and return either true or false text depending. But I must be doing something wrong because it always returns false (the latter option), whether or not the switch is on or off, and whether or not the condition is checking for true or false. Can anyone see a mistake?

if ($gameSwitches.setValue(1, true)){$gameMessage.add("True")} else {$gameMessage.add("False")}Thank You.
 

chalkdust

Resource Staff
Restaff
Joined
Mar 23, 2015
Messages
360
Reaction score
558
First Language
English
Primarily Uses
RMMV
I see the problem, but I haven't studied the code enough to know the solution for sure yet.

$gameSwitches.setValue(1, true)

That sets the switch. It doesn't return the value of the switch. I would try this:

if ($gameSwitches.value(1)) {$gameMessage.add("True")} else {$gameMessage.add("False")}
 
Last edited by a moderator:

Gryffin

Villager
Member
Joined
Dec 15, 2013
Messages
21
Reaction score
2
First Language
English
Primarily Uses
Ah, I see. Thank you, Chalkdust.
 

DaniloNocete

Warper
Member
Joined
Nov 6, 2015
Messages
1
Reaction score
0
First Language
English
I'm trying work with conditions in RPG Maker MV, but they always still false, when i have all the requisistes to let happen.

I know how do this, but the software dont let me do.

Maybe a bug?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,841
Reaction score
14,037
First Language
English
Primarily Uses
RMMV
Please start your own thread, rather than adding your question to someone else's related thread. Thank you.


Provide more details - screenshots of the events you are trying to get working (in your own thread)
 

Latest Threads

Latest Posts

Latest Profile Posts

>Testing with fonts change.
>Tries installing a plugin. Doesn't work.
>Tries changing the plugin commands. Doesn't work.
>Tries installing another plugin. Doesn't work.
>Changes a few more plugin commands. Doesn't work.
>Goes directly to the gamefont file and changes the src. Works.

YYEEEAAAAHHHAAAA

Perseverance is key, bois and girls.
What Reviews say on RPG Maker MZ?
Looking back at some sketches, and game design documents on my PC dated summer of 2015. I started development with the release of MZ, but in 2015, I felt a strong desire to make a game out of the blue. I remember feeling sad for no apparent reason, and all these ideas rushed into my head. Now that I think about it, since that day, everything has become easier to do on my PC . . . it’s very creepy.
Everything's going to be alright! We're all in this together. <3
Aaaaannd published my game's tech demo. :D

Feel free to download and play it. And give feedback!

Forum statistics

Threads
107,801
Messages
1,032,312
Members
139,946
Latest member
Yatsekonn
Top