Adding variable to timer

Hello everyone.


Just wondering if it is possible to add a variable to the timer. I have a game mechanic were you find a flashlight, but it runs out of batteries after a certain time. I want the player to be able to recharge the battery at different stations throughout the game, but I can't figure out how to add to the timer. I did a search and the plugins i found dont seem to help.
You do not need a plugin.


Just a script call! 🙂


$gameTimer + N?


Actually not sure it is that....but all of the script for timer is is rpg_objects.js


$gameTimer.start(time); is the start point of the timer. You could just take it into a variable....


var timeStam = $gameTimer.seconds + N


$gameTimer.start(timeStam);


Where N is the added time in frames....

Original thread: https://forums.rpgmakerweb.com/threads/adding-variable-to-timer.56871/