Setting variable as wording and conditional checking

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
If I want to set variable 1 to have wordings like "In Progress", I just script call $game_variables[1]="In Progress". However; if I would like to have an event to check whether variable 1 = In Progress. In conditional branch, how should I write?

Thanks!
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
$game_variables[1] == "In Progress"

Note the double equal.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
You need to use the script option of the conditional branch, and the comparison operator is ==. Example:


conditional branch:script:$game_variables[1]=="In Progress"


Edit: ninja'd
 
Last edited by a moderator:

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
Thanks for your reply Tsukihime and Andar!

A silly question but what is the difference between = and == ??

Because I used = in my conditional branch and it doesn't work correctly. The event is when you accept a quest from NPC, the variable 1 will change to "Not Completed" then switch on and move to the next event page. Then set conditional branch to check variable 1 = Completed. If yes then the quest is completed. However; it just ingores checking the variable and updates it to "Completed" automatically.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
= sets first variable equal to the value of the seccond variable.

== asks if variable 1 and 2 got the same value. is var1 same than var2, thats what it does in short words.
 
Last edited by a moderator:

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
= sets first variable equal to the value of the seccond variable.

== asks if variable 1 and 2 got the same value. is var1 same than var2, thats what it does in short words.
Thank you! It's very clear to me now.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
and because of that, using = in condition will return true as long as the setting goes without errors...
 

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

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top