- Joined
- Oct 20, 2020
- Messages
- 4
- Reaction score
- 1
- First Language
- Italian
- Primarily Uses
- RMMZ
Hello everyone, I am a new RPGmaker user with basic JS knowledge for web design, I'd need to learn how to get and set game variables and how to alter them via calculation.
The specific situation here is an in-game clock mechanic (based on steps, NOT on playtime) I'm trying to get to work:
once a certain amount of Seconds is added to a variable (let's say 420 Seconds ) I need JS to get how many minutes are in the Seconds variable value, pass the correct amount to the Minutes variable and reduce the Seconds value to display accordingly: here is what I thought should have worked (should explain better):
Obviously none of this works, any help would be really appreciated 
The specific situation here is an in-game clock mechanic (based on steps, NOT on playtime) I'm trying to get to work:
once a certain amount of Seconds is added to a variable (let's say 420 Seconds ) I need JS to get how many minutes are in the Seconds variable value, pass the correct amount to the Minutes variable and reduce the Seconds value to display accordingly: here is what I thought should have worked (should explain better):
Code:
variables:
0007: time Seconds
0008: time Minutes
0011: temporary var (minutes to add)
Code:
$gameVariables.setValue(0011) = ( $gameVariables.value(0007) / 60 ) ;
$gameVariables.setValue(0008) += $gameVariables.value(0011) ;
$gameVariables.setValue(0007) -= ( $gameVariables.value(0011) * 60 )