Brigg

Veteran
Veteran
Joined
Apr 22, 2015
Messages
129
Reaction score
4
First Language
English
Primarily Uses
I have an event that sets values to Variables 24-31. Variable 11, in this scenario, is a random number.
Rather than list them individually, I made a loop that references another variable within the variable.
However, I just can't seem to get it to work. I realize, listing them is technically less lines of code, but I prefer using the loop.
So what is it that I'm doing wrong?

This:
$gameVariables.value($gameVariables.value(32)) == $gameVariables.value($gameVariables.value(52))

Should become this:
$gameVariables.value(24) == $gameVariables.value(11)


RMMV.Var.within.Var.JPG

Sidenote:
I had to add an additional "=" inbetween the strings to avoid a Left-Hand error, which I thought was odd since it's not an IF condition, but I guess that's javaScript for you.

EDIT:
I think I just realized the problem. I need to write it as:
$gameVariables.setValue($gameVariables.value(32),$gameVariables.value($gameVariables.value(52)))
 
Last edited:

Sarlecc

Veteran
Veteran
Joined
Sep 16, 2012
Messages
453
Reaction score
211
First Language
English
Primarily Uses
RMMV
Actually by using the double ='s it was evaluated as being either true or false. So:
Code:
1 == 1 // this equals true
1 == 0 // this equals false
Currently I am too tired to be of much further help at the moment sorry. :LZYdizzy:
 

Latest Threads

Latest Profile Posts

I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!
So much game make... I needs to rest. The foods call.
-Casino with bunnysuit green check.png
1638563168795.png
Monday December 6th 2021 at 7PM Hawkzombie will stream A Thief's Voyage on his Twitch.

Hawkzombie Twitch

Check it out.​
Ladies and gentlepeeps, I'm working on a Chuck E Cheese horror game! Did you know that in the 80's, in the Pizza Time Theater, Helen Henny was a separate character who performed in a separate room called the Cabaret? She was one of the possible guest stars there, and she was a Hollywood star at the time. But this particular unit seems to have a dark secret...

Forum statistics

Threads
117,162
Messages
1,105,057
Members
153,245
Latest member
RiraiMel
Top