- Joined
- Aug 20, 2020
- Messages
- 3
- Reaction score
- 0
- First Language
- English
- Primarily Uses
- N/A
how to make the internal clock of the game 1 minutes equal to 30 second computer clock
Probably means a time system with different flow of time.from a plugin or event?
through event 30 frames wait, (60 frames is 1 second),
from a plugin, depends if it can be done in hte params.
but your question is a bit vague though.
yes, like that,is there a way to code it to work that way?Probably means a time system with different flow of time.
Where 60 seconds in the real-world based on epoch/unix time is equivalent to 30 seconds of in-game time, assuming no speed modifiers.
But it's still pretty vague.
Game_System.prototype.playtime = function() {
return Math.floor(Graphics.frameCount / 60);
};
Game_System.prototype.playtimeText = function() {
var hour = Math.floor(this.playtime() / 60 / 60);
var min = Math.floor(this.playtime() / 60) % 60;
var sec = this.playtime() % 60;
return hour.padZero(2) + ':' + min.padZero(2) + ':' + sec.padZero(2);
};
Game_System.prototype.playtime = function() {
return Math.floor(Graphics.frameCount / 30);
};
but that means it only for the recorded length of playtime,right?RMMV remembers your play time by counting number of frames that have passed. When displaying your play time it converts that number of frames into number of seconds (usually 60 frames to a second) and then converts it to a time format readable for the player.
What I think will do the trick is if the playtime() function is replaced with this:Code:Game_System.prototype.playtime = function() { return Math.floor(Graphics.frameCount / 60); }; Game_System.prototype.playtimeText = function() { var hour = Math.floor(this.playtime() / 60 / 60); var min = Math.floor(this.playtime() / 60) % 60; var sec = this.playtime() % 60; return hour.padZero(2) + ':' + min.padZero(2) + ':' + sec.padZero(2); };
With that, the game's internal clock will be 30 frames to a second, while if everything else is equal will run 60 frames per second.Code:Game_System.prototype.playtime = function() { return Math.floor(Graphics.frameCount / 30); };
I tested this by pasting into my own plugin and it mostly works. Your save files will have the old time format but save again then it will work
Yes. The internal clock is literally just a count of how many frames passed while running. It's not very different from your computer clock, which is just a single variable of milliseconds elapsed after January 1 1970, then converts it to a human-readable timebut that means it only for the recorded length of playtime,right?