Conditional Branch Script Call

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

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
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)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top