Eli Timer - More control over your timer's mechanics!

d02Q3Fz.png

Author: Hakuen Studio​

Introduction

We all know that the default timer is pretty basic. This plugin aims to add to it some new features that give you more control over your timer.

Features

• Pause/Resume timer.
• Start timer paused.
• Add/Remove seconds and minutes.
• You can change it to count upwards(1, 2, 3, 4...) instead of default count down.
• Turn on a switch when the timer is working.

How to use

The plugin parameters are self-explanatory.
If you choose to count up, you can still use the default timer command in the event tab.

• Script calls

$gameTimer.addSeconds(value)
$gameTimer.addMinutes(value)
$gameTimer.removeSeconds(value)
$gameTimer.removeMinutes(value)
$gameTimer.change(value, unit) - Change unit for seconds/minutes/hours. Any will work. In fact, it's just need to start with 's', 'm' or 'h'. Like:
$gameTimer.change(40, seconds) - Will add 40 seconds for the timer.
$gameTimer.change(40, sec) - Will also add 40 sec for the timer.
*Use negatives value to remove.
$gameTimer.countUp() - Changes the timer to count up.
$gameTimer.countDown() - Changes the timer to count down.
$gameTimer.flow() - Will return 'Up' or 'Down', according to the flow of the timer.
$gameTimer.pause() - Pause the timer.
$gameTimer.resume() - Resume the timer.
$gameTimer.isPaused() - Returns true if the timer is paused.
$gameTimer.minutes() - Return the current minutes count.
$gameTimer.maxSeconds() or maxMinutes() - Returns the max value that timer has when it started or it will have when it finishes.

* The arguments(words inside the parenthesis) are not case sensitive.

Plugin Commands:

• StartTimer value unit
• TimerChange value unit
• PauseTimer
• ResumeTimer
• TimerFlow countFlow
• StopTimer
Change the value to a number.
Change unit to Seconds/Minutes
Change countFlow to 'Up' or 'Down'.
*They are not case sensitive.

Spoiler
QBWrDbk.png


Terms of Use

https://www.hakuenstudio.com/rpg-maker/terms-of-use

DOWNLOAD
Eli_Timer.js
​
Update Log
Spoiler
Version 1.1 - 08/22/2020
- Code restructuring.
Version 1.0 - 08/11/2020
- Plugin release!
when looked into the code (while I had a small problem on the
SRD_TimerUpgrade (which I fixed) while it hadn't 3 options on it
which I really like.

but I think you made a small error in the code.
on line 500+ mostly at end around, you use this line:

if (imported.Eli.bitfont && imported.Eli.bitfontPro)

should it not be || or do you NEED both by than?
the plugin looks amazing further though, so no offend, it can work
out in many ways as well 🙂

but just letting you know if it is correct or not =)
when looked into the code (while I had a small problem on the
SRD_TimerUpgrade (which I fixed) while it hadn't 3 options on it
which I really like.

but I think you made a small error in the code.
on line 500+ mostly at end around, you use this line:

if (imported.Eli.bitfont && imported.Eli.bitfontPro)

should it not be || or do you NEED both by than?
the plugin looks amazing further though, so no offend, it can work
out in many ways as well 🙂

but just letting you know if it is correct or not =)
Hi there!
Glad you liked 🙂

The code you are talking about is right:
JavaScript:
    if(Imported.Eli_BitmapFont && Eli.BitmapFont.pro){
        this.setBitmapFont()
    }
It is checking if the user has installed Eli_BitmapFont and if the user has the Pro Version of this same plugin. Because there is the free and the Pro version.
".pro" is a property on the object Eli.BitmapFont.
On the free version, it returns false.
On the pro version, it returns true.
so basicly, you require both? if it has different objects?
if the code is correct, no worries, still learning here.

while I like SRD_TimerUpgrade, yours missing the font type,
but can be done with another plugin,
plugin location and or label text,
setCommonEventExpire ID.

while SRD plugin MISSES a nice option you do have,
which is the Timer UP, and midway if you want Timer DOWN,
now I dont know if Timer Flow = a toggle or need Timer Flow UP/DOWN
which isn't specified in the instruction, just a return value.

another option which is in NEITHER plugin, which could be usefull
is to start the timer, and when the timer is < than value, than it HIDES.

so timer is 20 sec,
if timer <= 15
Hide Timer
else
nothing here
end

same can when it counts UP, for a minigame like in Zelfde Majora's mask,
which has a funny glitch 😛

when it counts up, at 2 seconds, it dissapear, and your job is to "press OK"
when it hits EXACTLY 10 seconds to win a price.

I still hope, timer Hide is easy to implement or a small edit, in both or either
plugin, while I dont mess with timer, it can be trouble some, but it's a suggestion.

but it looks really nice further more, but keep up the nice work.

maybe I can use SRD and yours together if it doesn't conflict,
because I might know a nice mechanic where time goes down and
else where goes UP by max x seconds.
so basicly, you require both? if it has different objects?
if the code is correct, no worries, still learning here.

while I like SRD_TimerUpgrade, yours missing the font type,
but can be done with another plugin,
plugin location and or label text,
setCommonEventExpire ID.

while SRD plugin MISSES a nice option you do have,
which is the Timer UP, and midway if you want Timer DOWN,
now I dont know if Timer Flow = a toggle or need Timer Flow UP/DOWN
which isn't specified in the instruction, just a return value.

another option which is in NEITHER plugin, which could be usefull
is to start the timer, and when the timer is < than value, than it HIDES.

so timer is 20 sec,
if timer <= 15
Hide Timer
else
nothing here
end

same can when it counts UP, for a minigame like in Zelfde Majora's mask,
which has a funny glitch 😛

when it counts up, at 2 seconds, it dissapear, and your job is to "press OK"
when it hits EXACTLY 10 seconds to win a price.

I still hope, timer Hide is easy to implement or a small edit, in both or either
plugin, while I dont mess with timer, it can be trouble some, but it's a suggestion.

but it looks really nice further more, but keep up the nice work.

maybe I can use SRD and yours together if it doesn't conflict,
because I might know a nice mechanic where time goes down and
else where goes UP by max x seconds.
Oh no, you don't require both plugins.
This is only a compatibility patch, in case you are using the Timer and BitmapFont plugin together.
BitmapFont.js and BitmapFontPro.js have the same namespace/global object:

Eli.BitmapFont

But they overwrite each other. So in a project, you need to use only one of them.
If you have the Pro Version, you must disable the Free Version.

But the compatibility patch only works with the BitmapFontPro version.
And since .pro is a property of Eli.BitmapFont, I first need to check if the user has the BitmapFont plugin, then I can check if it is using the Free or Pro.

Another way of doing that would be:

if(Eli.hasOwnProperty("BitmapFont") && Eli.BitmapFont.pro === true)

About the HIDE request, I will see what I can do ^^

Original thread: https://forums.rpgmakerweb.com/threads/eli-timer-more-control-over-your-timers-mechanics.126207/