Orange Time System

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV

Orange Time System
Hudell




Introduction
This plugin provides a Time System framework for your game. You need other plugins to make use of this time system core in order to effectively use it.


Params

useRealTime:
If you set this to true, the plugin will load the computer time instead of calculating it's own. All of the *Length params will be ignored.
Default is false


secondLength:
How many real-life milliseconds should an ingame second be?
Default is 1000

secondLengthVariable:
You can use a variable ID here to use the value of that variable instead of the fixed value of secondLength.
Default is 0
Every time you change this variable, you have to call the following plugin command:


restart time system




minuteLength:
How many ingame seconds should a minute be?
Default is 6

hourLength:
How many ingame minutes should an hour be?
Default is 6

dayLength:
How many ingame hours should a day be?
Default is 24

weekLength:
How many ingame days should a week be?
Default is 7

monthLength:
How many ingame days should a month be?
Default is 31

yearLength:
How many ingame months should a year be?
Default is 4

dayPeriod1Hour:
At what hour does the "morning" day period starts?
Default is 6

dayPeriod2Hour:
At what hour does the "day" day period starts?
Default is 9

dayPeriod3Hour:
At what hour does the "evening" day period starts?
Default is 18

dayPeriod4Hour:
At what hour does the "night" day period starts?
Default is 20
 
pauseClockDuringConversations:
If true, the clock will be paused while text is being displayed with the Show Text command.

insideSwitch:
If you set the number of a switch here, the screen tint effect of the OrangeDayAndNight will be disabled when the switch is ON (other add-ons will use the same information to determine if the player is inside a closed space or not)

tilesetList:
You can set a list of comma separated tilesets that will always be treated as "inside", regardless of the switch value.
Example value: 1, 2, 3


mainSwitchId:
Set this to the number of a switch to be able to pause / unpause the time system with that switch.

If you don't use a switch, you can pause/unpause with the following script calls:


OrangeTimeSystem.paused = true;OrangeTimeSystem.paused = false;


This plugin uses Orange Event Manager to enable event listeners on the passage of time. This is a list of available events:


changeSecondchangeMinutechangeHourchangeDayPeriodchangeDaychangeMonthchangeYear


You can also attach a method or a common event to a specific time. The following example will trigger the common event 10 every day at 10:00:00 AM:


var commonEventId = 10;OrangeTimeSystem.onTime(commonEventId, 10, , );


The following example will trigger common event 15 on day 20 of month 2:


var commonEventId = 15;OrangeTimeSystem.onDate(commonEventId, 20, 2, );


You can also attach a common event to a day of the week:


OrangeTimeSystem.onWeekDay(commonEventId, 5);


Now with plugin commands. Some example of commands:


run common event 10 every hour
run common event 1 every minute
run common event 2 every second
run common event 3 every day
run common event 4 every month
run common event 5 every year


New Feature: Run common events after some time.
Those instructions will be saved on the save file, so the common event will be executed even if the player stops plaing and comes back another day.


run common event 6 in 5 minutes
run common event 7 in 2 hours
run common event 8 in 10 seconds
run common event 9 in 20 days


New Feature: Enable / DIsable / Toggle Switches and self switches. Some examples:


toggle self switch A in 10 seconds
toggle self switch B every second
enable switch 40 on hour 10 minute 20
disable self switch D in 1 hour




Plugin
Get it from here

Dependencies
None



Add-Ons
Variables
Events
Day and Night

License
- Free for any game


- No credits required
 
Last edited by a moderator:

Joronjo

Veteran
Veteran
Joined
Sep 17, 2015
Messages
155
Reaction score
29
First Language
English Spanish
Primarily Uses
With this plugin\, would it be possible to "push" time a few hours after certain events like sleeping?
 

xein

A stranger in a strange world
Veteran
Joined
Mar 17, 2012
Messages
306
Reaction score
15
Primarily Uses
I'm trying to make an event run when the computer/real time hits 10am daily. How should I set this?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
With this plugin\, would it be possible to "push" time a few hours after certain events like sleeping?
I've updated the plugin, you can now use the following script call:

I'll also create an add-on to do those things with plugin commands.

OrangeTimeSystem.addHours(8);
I'm trying to make an event run when the computer/real time hits 10am daily. How should I set this?
OrangeTimeSystem.onTime(1, 10);
This will run common event 1 at 10am every day.
 

Serpent

Villager
Member
Joined
Oct 26, 2015
Messages
5
Reaction score
3
First Language
English
Is there a way to change to a specific time? I can see you provided something for adding hours, but suppose I want to make an event that will always change the time to 6am, regardless of what time it's triggered?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
Is there a way to change to a specific time? I can see you provided something for adding hours, but suppose I want to make an event that will always change the time to 6am, regardless of what time it's triggered?
Yup:

Code:
OrangeTimeSystem.hour = 6;
 

tati light

Veteran
Veteran
Joined
Aug 15, 2015
Messages
160
Reaction score
110
First Language
English
Primarily Uses
useRealTime:

If you set this to true, the plugin will load the computer time instead of calculating it's own. All of the *Length params will be ignored.

Default is false
Wow, this sounds just like what I was looking for... but I need to ask something.

Can this plugin accept day of the week? Like, is it possible to get the weekday (realtime) from the user device?

On another note, it's really impressive you are doing all this kind of plugins for free! I was just thinking in paying someone to do a plugin like this for me in the near future... Your plugins have outstanding potential, please let me know if you have any donation links!
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
Wow, this sounds just like what I was looking for... but I need to ask something.


Can this plugin accept day of the week? Like, is it possible to get the weekday (realtime) from the user device?
Yup, the weekDay property should have the user day of the week. You can put it in a variable with the "Variables" add-on. (0 is sunday, 1 is monday ... 6 is saturday)
On another note, it's really impressive you are doing all this kind of plugins for free! I was just thinking in paying someone to do a plugin like this for me in the near future... Your plugins have outstanding potential, please let me know if you have any donation links!
Thank You! I don't have any donation link at the moment, but I may create one at some point.
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,805
Reaction score
1,052
First Language
English
Primarily Uses
I planned to make something similar to this back before MV was released, but I guess I got beaten to it :p
 

Luiiferu

Flying kiwi
Member
Joined
Apr 18, 2015
Messages
11
Reaction score
8
First Language
Sumerian
Sounds great!

Can I set a clock somewhere for the player to check?
 

Marvelous TK

Veteran
Veteran
Joined
Jun 23, 2012
Messages
23
Reaction score
6
First Language
English
Primarily Uses
So, say you wanted a specific event to run on a specific day, like - hell, let's say Halloween, that's close - could you set an event to show up during that day? Or more complicated, could you set an event to show up, like, between 7PM and 10PM on a specific day? Is that level of control in here?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
Sounds great!

Can I set a clock somewhere for the player to check?
Yes, I'm preparing a demo with one of those, I'll upload it shortly.

Edit: Demo uploaded.

So, say you wanted a specific event to run on a specific day, like - hell, let's say Halloween, that's close - could you set an event to show up during that day?
If you want something to run on Halloween, you can do this:

OrangeTimeSystem.onDate(1, 31, 10);And it will trigger the common event 1 on halloween. The event will be triggered again every second of that day. If you want to call it on a specific time, you can do:

OrangeTimeSystem.onDateTime(1, 31, 10, undefined, undefined, undefined, 0);
The order of the params are:

  • number of the common event
  • day,
  • month,
  • year,
  • hour,
  • minute,
  • second
When you pass "undefined" to one of the params, you're saying that you don't care about the value of that variable.

On the example I gave, we're ignoring the year, the hour and the minute. This means that the event will be triggered every time the "seconds" variable is 0, the "day" is 31 and the "month" is 10.

Basically: once a minute on october 31st, every year.

Currently there's no way to make it automatically run only once at any time of the day, but I'll add this feature today.

If you want to run it only once at a specific time (say: 15:34:20), you can call:

OrangeTimeSystem.onDateTime(1, 31, 10, undefined, 15, 34, 20)
So, say you wanted a specific event to run on a specific day, like - hell, let's say Halloween, that's close - could you set an event to show up during that day? Or more complicated, could you set an event to show up, like, between 7PM and 10PM on a specific day? Is that level of control in here?
Hmmm, that's a nice feature to add!

Currently you would have to do it this way:

OrangeTimeSystem.on('changeMinute', 1);
This would trigger the common event 1 every time the minute changes. You'd then have to check for the hour variables manually inside it.

When you say "show up between 7PM and 10PM" you mean you want it to randomly appear once within that time frame? I can add a feature like that too! :)
 
Last edited by a moderator:

Luiiferu

Flying kiwi
Member
Joined
Apr 18, 2015
Messages
11
Reaction score
8
First Language
Sumerian
Yes, I'm preparing a demo with one of those, I'll upload it shortly.

Edit: Demo uploaded.
Thanks, that was fast!

 When you say "show up between 7PM and 10PM" you mean you want it to randomly appear once within that time frame? I can add a feature like that too! :)
Maybe an npc that only shows up from 7PM till 10PM every night?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
Thanks, that was fast!

Maybe an npc that only shows up from 7PM till 10PM every night?
You can do that with variable conditions :)
 

gekigengar

Villager
Member
Joined
Oct 27, 2015
Messages
23
Reaction score
5
First Language
English
Hello, I wanted to request an option to pause time when a dialogue box is open. (Conversation, choices, etc)

I think this might be very useful, instead of having to have $.paused = true on every NPC with dialogues~
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
Hello, I wanted to request an option to pause time when a dialogue box is open. (Conversation, choices, etc)

I think this might be very useful, instead of having to have $.paused = true on every NPC with dialogues~
Ah, indeed, I should've though of that. I'll add that feature tonight.
 

Ruff_Demon

Villager
Member
Joined
Jun 18, 2015
Messages
11
Reaction score
1
First Language
English
Primarily Uses
I finally got this to work in my project, thanks to your demo. I love it! It's exactly what my project needed. Thank you so much! :D
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
I've updated the plugin. Now it no longer needs any other plugin installed.

I've also added a new param: pauseClockDuringConversations.

The demo and the thread were also updated.
 

Kane Hart

Elmlor.com
Veteran
Joined
Jun 27, 2014
Messages
656
Reaction score
166
First Language
English
Just checking to see if that idea was added I'm in no rush did not want to miss it.

The idea again was that you could add a reset type switch (sorry about I'm sure the wrong terminology) so when you say run an event like remove something from a chest you can say 100 in game hours (60min?) it would reset it back again.

Thank you so much in advance :)
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
Just checking to see if that idea was added I'm in no rush did not want to miss it.


The idea again was that you could add a reset type switch (sorry about I'm sure the wrong terminology) so when you say run an event like remove something from a chest you can say 100 in game hours (60min?) it would reset it back again.


Thank you so much in advance :)
It's on the oven right now! :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

There's another Humble Bundle available now for RPG developer assets, this time focused somewhat more towards pixel art style games.
Ive got a long lost half uncle. Thats real cool.
I forget what is bumping rule in this forum. Is anyone know? Thank you.
BCj
Ew, why does my blogpost on the rpgmaker.net site look like a garbled mess? Are html codes disabled or something?
I feel that I should cut down on my order queue so I can get some more time for my projects, its been quite a longggg while since I worked on them LOL

Forum statistics

Threads
97,899
Messages
947,698
Members
129,128
Latest member
CRThater777
Top