RMMV 1 minute equal 30 second

hana_no_haze

Warper
Member
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
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,895
Reaction score
1,029
First Language
Dutch
Primarily Uses
RMMV
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.
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.
 

hana_no_haze

Warper
Member
Joined
Aug 20, 2020
Messages
3
Reaction score
0
First Language
English
Primarily Uses
N/A
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.
yes, like that,is there a way to code it to work that way?
 

Pix3M

Veteran
Veteran
Joined
Feb 4, 2019
Messages
99
Reaction score
81
First Language
English
Primarily Uses
RMMV
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.


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);
};
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 / 30);
};
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.

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
 

hana_no_haze

Warper
Member
Joined
Aug 20, 2020
Messages
3
Reaction score
0
First Language
English
Primarily Uses
N/A
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.


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);
};
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 / 30);
};
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.

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
but that means it only for the recorded length of playtime,right?
 

Pix3M

Veteran
Veteran
Joined
Feb 4, 2019
Messages
99
Reaction score
81
First Language
English
Primarily Uses
RMMV
but that means it only for the recorded length of playtime,right?
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 time
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top