Charles2020

Veteran
Veteran
Joined
Feb 24, 2020
Messages
108
Reaction score
4
First Language
English
Primarily Uses
RMMV
Hi guys

I am trying to make a system that gold increase over time. I use Moghunter time system

So basically I assigned hour to variable id 1. I used this equation but did not work

If $gameVariables.value(1) == $gameVariables.value(1)+1;
do increase gold

For example, if 8am, variable ID 1 should be 8
When 9am, variable ID 1 should be 9 (which I hope go meet if condition), but I think my logic is incorrect

Any idea/suggests are welcome
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,060
Reaction score
7,977
First Language
German
Primarily Uses
RMMV
why are you trying to do things with javascript that are easier to do with event commands?
This is not the first time you asked something similar....

if you are trying to learn javascript, it is much easier if you forget about making a game like that while learning how to program - which would help you because your example shows that you don't know how computer logic works, that line can never be true.

and if you're just trying to make a game, then you should learn to use event commands first, and only switch to javascript if there are no event commands that can do that. Because the event system is designed to handle most of the simpler mechanics in any game...

that said, you need two different variables to handle that, because otherwise you'll always have it like "If 1 == 2" which will never be true.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,045
Reaction score
7,131
First Language
Indonesian
Primarily Uses
RMVXA
I used this equation but did not work
What you seek is not an equation, rather a system to track that the variable is changed.

The easiest way is to use the second variable.
For example,
Code:
If ($gameVariables.value(1) != $gameVariables.value(2)) {
  $gameVariables.setValue(2, $gameVariables.value(1))
  increase gold
}
 

Latest Threads

Latest Profile Posts

The light has gone out of my life.

About time they finally press the kill switch button for older makers.
Sorry everyone, I am here sporadically. After 6 years of delays after delays in my life, I try to do all mat once and that means that I spread thin everywhere because it just is impossible to crunch 6 years in one or even two, but I try! I wish many of that I would already given you and put behind but... well...
I'm looking for an experienced gamer who has played a few games created with RPG Maker, who knows what an alpha build is, who may remember the old days when cliché was the favorite word on Creation Asylum, who, if a reviewer, would ask for my permission before making a review to post on YouTube, or whatever, since I will be messaging you a 10 minute, or so, DEMO based on an alpha build of Effervesce Fallacy™.
No matter how many times I listen to him, I know this is Joker speaking, but my brain can only hear Dagda.

Forum statistics

Threads
108,821
Messages
1,039,805
Members
141,279
Latest member
SawYuuki
Top