var(var(n)) == var(var(n)) not working?

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:
 

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

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top