This is actually a rather common thing that is partially addressed by my setup (using SRDTimerUpgrade) but instead of simply counting frames I want to count the actual time (so 1'00"50 is displayed as 1'00"92 or whatever the calculations are). The reason of course is that I'm thinking of where I'm going to put my evac sequence and wanted something a little more accurate than the default.
Any ideas on modifications or other provisions for this?
EDIT: Turns out that I was almost in the correct position with my preliminary calculations. The default setup is as follows:
And I changed it to this to the following to get the actual time equivalent:
So with that working, I'm now asking instead for someone who can mod the plugin somewhat to where this can be done as an option (an either/or, if you will - either you want the frames or you want the time equivalency) and have it set to where you have something like this:
EDIT 2: For reference purposes I may as well explain the calculation. In a normal millisecond count the frames aren't as important, you simply need the time as it would normally show. The issue I ran into is that I had originally considered changing the frame count to achieve the effect (and obviously for a performance bump); however, as it turns out the MV base seems to be hard-coded to a 60FPS output (or correct me otherwise). This is different than the 100 count that milliseconds normally use, and because of the hard-coding the SRD timer upgrade doesn't even recognize the millisecond count, only the number of frames that have been counted.
And back to the drawing board this went (and several times over, in fact) when suddenly this evening I had a rather clever "brain fart" kind of moment - what if I used a multiplier to convert each processed frame number into its millisecond equivalent? So I loaded up the system calculator and plugged in 100 with a 60 divisor and BAM! 1.66666667 on the nose (well, not quite - it's actually a repetitive decimal). From there I proceeded to run the figures using rounded versions thereof, adding or subtracting in accordance with the observations. So 1.67 with a 60 frame multiple is 100.2, 1.66 is 99.6 and 1.65... is 99 even. And that, of course, its the number that I was looking for in all this work. I now had enough information to open the SRD timer upgrade file and begin hunting down the point where the frame calculation is returned for display, so I went in and tried several of the related positions before finally settling on the following line:
which I then changed so that it would display the millisecond equivalency off the additional calculations:
TECHNICAL NOTE: For reference purposes, Math.trunc is a standard scripting function which detects the presence of trailing fractional portions and strips them out (basically negating any decimal-based output in favor of the whole integer), much in the same way that Math.floor is for the normal calculation method (which returns the nearest whole integer). Technically you can either/or between the two as a consequence of that, however I actually started off with Math.trunc as it was the first option that was listed in my Google results (and because I only checked against Math.floor after the fact, if only so I'd have the additional reference to back it up).
Any ideas on modifications or other provisions for this?
EDIT: Turns out that I was almost in the correct position with my preliminary calculations. The default setup is as follows:
JavaScript:
Sprite_Timer.prototype.timerText = function() {
let result = _.format;
const frames = $gameTimer.getFrames();
const seconds = Math.floor(frames / 60);
const minutes = Math.floor(frames / (60 * 60));
const frm = frames % 60;
const sec = seconds % 60;
const min = minutes % 60;
const hur = Math.floor(minutes / 60) % 60;
if(_.usesFrames) result = result.replace(/%4/, frm.padZero(2));
if(_.usesSeconds) result = result.replace(/%3/, sec.padZero(2));
if(_.usesMinutes) result = result.replace(/%2/, min.padZero(2));
if(_.usesHours) result = result.replace(/%1/, hur.padZero(2));
return result;
};
And I changed it to this to the following to get the actual time equivalent:
JavaScript:
Sprite_Timer.prototype.timerText = function() {
let result = _.format;
const frames = $gameTimer.getFrames();
const seconds = Math.floor(frames / 60);
const minutes = Math.floor(frames / (60 * 60));
const frm = Math.trunc((frames % 60) * 1.65);
const sec = seconds % 60;
const min = minutes % 60;
const hur = Math.floor(minutes / 60) % 60;
if(_.usesFrames) result = result.replace(/%4/, frm.padZero(2));
if(_.usesSeconds) result = result.replace(/%3/, sec.padZero(2));
if(_.usesMinutes) result = result.replace(/%2/, min.padZero(2));
if(_.usesHours) result = result.replace(/%1/, hur.padZero(2));
return result;
};
So with that working, I'm now asking instead for someone who can mod the plugin somewhat to where this can be done as an option (an either/or, if you will - either you want the frames or you want the time equivalency) and have it set to where you have something like this:
JavaScript:
Sprite_Timer.prototype.timerText = function() {
let result = _.format;
const frames = $gameTimer.getFrames();
const seconds = Math.floor(frames / 60);
const minutes = Math.floor(frames / (60 * 60));
if (timeEquiv === true) {
const frm = Math.trunc((frames % 60) * 1.65);
} else {
const frm = frames % 60;
}
const sec = seconds % 60;
const min = minutes % 60;
const hur = Math.floor(minutes / 60) % 60;
if(_.usesFrames) result = result.replace(/%4/, frm.padZero(2));
if(_.usesSeconds) result = result.replace(/%3/, sec.padZero(2));
if(_.usesMinutes) result = result.replace(/%2/, min.padZero(2));
if(_.usesHours) result = result.replace(/%1/, hur.padZero(2));
return result;
};
EDIT 2: For reference purposes I may as well explain the calculation. In a normal millisecond count the frames aren't as important, you simply need the time as it would normally show. The issue I ran into is that I had originally considered changing the frame count to achieve the effect (and obviously for a performance bump); however, as it turns out the MV base seems to be hard-coded to a 60FPS output (or correct me otherwise). This is different than the 100 count that milliseconds normally use, and because of the hard-coding the SRD timer upgrade doesn't even recognize the millisecond count, only the number of frames that have been counted.
And back to the drawing board this went (and several times over, in fact) when suddenly this evening I had a rather clever "brain fart" kind of moment - what if I used a multiplier to convert each processed frame number into its millisecond equivalent? So I loaded up the system calculator and plugged in 100 with a 60 divisor and BAM! 1.66666667 on the nose (well, not quite - it's actually a repetitive decimal). From there I proceeded to run the figures using rounded versions thereof, adding or subtracting in accordance with the observations. So 1.67 with a 60 frame multiple is 100.2, 1.66 is 99.6 and 1.65... is 99 even. And that, of course, its the number that I was looking for in all this work. I now had enough information to open the SRD timer upgrade file and begin hunting down the point where the frame calculation is returned for display, so I went in and tried several of the related positions before finally settling on the following line:
JavaScript:
const frm = frames % 60;
which I then changed so that it would display the millisecond equivalency off the additional calculations:
JavaScript:
const frm = Math.trunc((frames % 60) * 1.65);
TECHNICAL NOTE: For reference purposes, Math.trunc is a standard scripting function which detects the presence of trailing fractional portions and strips them out (basically negating any decimal-based output in favor of the whole integer), much in the same way that Math.floor is for the normal calculation method (which returns the nearest whole integer). Technically you can either/or between the two as a consequence of that, however I actually started off with Math.trunc as it was the first option that was listed in my Google results (and because I only checked against Math.floor after the fact, if only so I'd have the additional reference to back it up).