Count time even when not playing?

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
215
Reaction score
37
First Language
English
Primarily Uses
RMMV
So in my game, you enter a small code before it actually allows you to play. My issue is that upon entering this code I'd like it so that the game immediately begins counting down 720 hours. But I want it so that even if the game is closed and the playing is off working or going out somewhere, that the game continues counting down these 720 hours. Basically I need a way to create a realtime countdown timer that functions even if the game isn't running.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
So in my game, you enter a small code before it actually allows you to play. My issue is that upon entering this code I'd like it so that the game immediately begins counting down 720 hours. But I want it so that even if the game is closed and the playing is off working or going out somewhere, that the game continues counting down these 720 hours. Basically I need a way to create a realtime countdown timer that functions even if the game isn't running.
I've done this before using the date js object to simulate the amount of time passed...
(set the time to a variable when the countdown begins then being precise on how and when to check the time passed, I did mine at the start of the game then set the check right before the custom menu for my in-game shop was opened to prevent too many checks and causing lag)

Perhaps there is already now a plugin or a better way though...
This method could be broken by the player setting the time on their manually, that was a whole different problem. I honestly don't know if I figured out how to prevent that or not...

I would really actually like to hear if anyone else has more info on this also. :)
 

Nectar

Bees love me.
Veteran
Joined
Jul 7, 2017
Messages
215
Reaction score
37
First Language
English
Primarily Uses
RMMV
I've done this before using the date js object to simulate the amount of time passed...
(set the time to a variable when the countdown begins then being precise on how and when to check the time passed, I did mine at the start of the game then set the check right before the custom menu for my in-game shop was opened to prevent too many checks and causing lag)

Perhaps there is already now a plugin or a better way though...
This method could be broken by the player setting the time on their manually, that was a whole different problem. I honestly don't know if I figured out how to prevent that or not...

I would really actually like to hear if anyone else has more info on this also. :)
Yeah, this wouldn't work. My game counts how many hours pass until it needs to be renewed since it's subscription based.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top