DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
300
Reaction score
324
First Language
Russian
Primarily Uses
RMMV
Title: Game Time
Version: 2.4.1
Author: DKPlugins
Description: Time system.
Want to create a merchant that only appears on weekdays during certain hours? Easily!
Want to create holidays in the game? Easily!
Looking to create a time-based building system? Easily!

Compatibility:

  • RPG Maker MV: 1.5+
  • RPG Maker MZ: 1.0+
Features:
  • Use preset time or real time from the player’s device
  • Display a window with time while playing
  • Change time/date through plugin commands, script calls
  • Write time/date to variables
  • Control switches with time/date based conditions
  • Events wait using time instead of waiting with frame count
  • Change switches, self switches and variables with a time/date based timer
Planned features:
  • Support for Lighting
  • Support for Weather
Add-ons:
1. Game Time Calendar – Calendar system. Adds a calendar and event system.

Features:
  • Create holidays and events and view them in the calendar
  • When an event occurs, the specified switch is turned on
  • Ability to delete created events
  • Option to disable calendar via plugin command

ShooterScreenshot-104-28-11-20.png

ShooterScreenshot-105-28-11-20.png

Script calls:
You can create Game_Time type objects for their own needs

Constructor of Game_Time supports multiple parameter options:
1. Without parameters (it will be created based on current system time)
Example: var gameTime = new Game_Time();

2. With 1 parameter (object of Game_Time)
Example: var gameTime = new Game_Time($gameTime);
Example: var gameTime = new Game_Time(new Date());
Example: var gameTime = new Game_Time({
sec: 0, min: 0, hour: 0,
day: 1, month: 0, year: 0
});

# Get time and date #
$gameTime.ms - get milliseconds
$gameTime.sec - get seconds
$gameTime.min - get minutes
$gameTime.hour - get hour
$gameTime.day - get day
$gameTime.dayWeek - get day week
$gameTime.dayWeekName - get day week name
$gameTime.dayWeekShortName - get day week short name
$gameTime.dayYear - get day of the year
$gameTime.week - get week number
$gameTime.month - get month
$gameTime.monthName - get month name
$gameTime.year - get year
$gameTime.season - get season
$gameTime.seasonName - get season name
$gameTime.date - get date (day, day week, month, year)
$gameTime.time - get time (ms, sec, min, hour)
$gameTime.speed - get speed

# Set time and date #
$gameTime.year = year - set year
$gameTime.month = month - set month (starting at 0)
$gameTime.day = day - set day (starting at 1)
$gameTime.hour = hour - set hour (starting at 0)
$gameTime.min = min - set minutes (starting at 0)
$gameTime.sec = sec - set seconds (starting at 0)
$gameTime.ms = ms - set milliseconds (starting at 0)

# Add time and date #
$gameTime.addMs(value = 1) - add milliseconds. Default 1.
$gameTime.addSec(value = 1) - add seconds. Default 1.
$gameTime.addMin(value = 1) - add minutes. Default 1.
$gameTime.addHour(value = 1) - add hour. Default 1.
$gameTime.addDay(value = 1) - add day. Default 1.
$gameTime.addMonth(value = 1) - add month. Default 1.
$gameTime.addYear(value = 1) - add year. Default 1.
Chaining is supported. Example:
$gameTime.addDay(1).addHour(1).addMin(10)

# Subtract time and date #
$gameTime.remSec(value = 1) - subtract seconds. Default 1.
$gameTime.remMin(value = 1) - subtract minutes. Default 1.
$gameTime.remHour(value = 1) - subtract hour. Default 1.
$gameTime.remDay(value = 1) - subtract day. Default 1.
$gameTime.remMonth(value = 1) - subtract month. Default 1.
$gameTime.remYear(value = 1) - subtract year. Default 1.
Chaining is supported. Example:
$gameTime.remDay(1).remHour(1).remMin(10)

# Comparison methods #
1. gameTime > otherGameTime
1.1. Compare date and time
more(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.more(otherGameTime, false)
1.2. Compare only date
moreDate(otherGameTime)
otherGameTime - object of Game_Time
Example: $gameTime.moreDate(otherGameTime, false)
1.3. Compare only time
moreTime(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.moreTime(otherGameTime, false)

2. gameTime < otherGameTime
2.1. Compare date and time
less(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.less(otherGameTime, true)
2.2. Compare only date
lessDate(otherGameTime)
otherGameTime - object of Game_Time
Example: $gameTime.lessDate(otherGameTime)
2.3. Compare only time
lessTime(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.lessTime(otherGameTime, true)

3. gameTime >= otherGameTime
3.1. Compare date and time
moreEquals(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.moreEquals(otherGameTime, false)
3.2. Compare only date
moreEqualsDate(otherGameTime)
otherGameTime - object of Game_Time
Example: $gameTime.moreEqualsDate(otherGameTime)
3.3. Compare only time
moreEqualsTime(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.moreEqualsTime(otherGameTime, false)

4. gameTime <= otherGameTime
4.1. Compare date and time
lessEquals(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.lessEquals(otherGameTime, true)
4.2. Compare only date
lessEqualsDate(otherGameTime)
otherGameTime - object of Game_Time
Example: $gameTime.lessEqualsDate(otherGameTime)
4.3. Compare only time
lessEqualsTime(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.lessEqualsTime(otherGameTime, true)

5. gameTime == otherGameTime
5.1. Compare date and time
equals(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.equals(otherGameTime, false)
5.2. Compare only date
equalsDate(otherGameTime)
otherGameTime - object of Game_Time
Example: $gameTime.equalsDate(otherGameTime)
5.3. Compare only time
equalsTime(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.equalsTime(otherGameTime, false)

6. Define sort order
6.1. Compare date and time
compareTo(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.compareTo(otherGameTime, true)
6.2. Compare only date
compareToDate(otherGameTime)
otherGameTime - object of Game_Time
Example: $gameTime.compareToDate(otherGameTime)
6.3. Compare only time
compareToTime(otherGameTime, blockSeconds = false)
otherGameTime - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.compareToTime(otherGameTime, true)

7. Range check
7.1. Compare date and time
inRange(gameTime1, gameTime2, blockSeconds = false)
gameTime1 - object of Game_Time
gameTime2 - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.inRange(gameTime1, gameTime2, true)
7.2. Compare only date
inRangeDate(gameTime1, gameTime2)
gameTime1 - object of Game_Time
gameTime2 - object of Game_Time
Example: $gameTime.inRangeDate(gameTime1, gameTime2)
7.3. Compare only time
inRangeTime(gameTime1, gameTime2, blockSeconds = false)
gameTime1 - object of Game_Time
gameTime2 - object of Game_Time
blockSeconds - block seconds comparison (true/false)
Example: $gameTime.inRangeTime(gameTime1, gameTime2, true)

8. Formatted string
format(formatString)
Use special symbols from the "Date and time format" section
Example: $gameTime.format("%HH:%mm")

# Other functions #
clone() - clone an object
copyFrom(object) - Copy data from an object (Game_Time, Object or Date)
pause(duration = -1) - Stop time. Pause duration in frames. -1 for unlimited pause
resume() - Resume time
print() - Print time and date to console
setTime(object) - Set time (ms, sec, min, hour)
setDate(object) - Set date (day, dayWeek, month, year)
isUpdated() - Returns true if the time is updated
isPaused() - Returns true if time is paused
isRealTimeUsed() - Returns true if real time is used
isLeapYear() - Leap year
isDayOff() - Day off
add(type, value) - Add parameter (sec, min, hour, day, month, year)
rem(type, value) - Subtract parameter (sec, min, hour, day, month, year)
getDaysInMonth() - Days in current month
getDaysInYear() - Days in current year
getDayStart() - Returns start of the day
getDayEnd() - Returns end of the day
getFirstDay() - Returns first day of the month
getLastDay() - Returns last day of the month
toDate() - Returns a Date object
useRealTime(use = true) - Use real time

# Static methods #
Game_Time.checkVersion(version) - Check Game_Time plugin version
Game_Time.getMillisecondsInSecond() - Milliseconds in one second
Game_Time.getSecondsInMinute() - Seconds in one minute
Game_Time.getMinutesInHour() - Minutes in one hour
Game_Time.getHoursInDay() - Hours in one hour
Game_Time.getDaysInWeek() - Days in one week
Game_Time.getDaysInMonth(month, year) - Days in a month
Game_Time.getDaysInYear(year) - Days in a year
Game_Time.getMonthsInYear() - Months in a year
Game_Time.getDaysDifference(gameTime1, gameTime2 = $gameTime) - Difference in days between 2 dates
Game_Time.isDayOff(dayWeek) - Day off
Game_Time.isLeapYear(year) - Leap year
Game_Time.save(slot, gameTime = $gameTime) - Save Game_Time object to slot
Game_Time.load(slot) - Load Game_Time object from slot
Game_Time.addTime(gameTime, action) - Add a timer. When $gameTime >= gameTime, action will be executed

# Static properties #
Game_Time.months - Number of days in each month
Game_Time.window - Get time window
Game_Time.frameDuration - Frame duration

"Help" languages: English, Russian

Terms of use
You can:
-To use the plugin for your non-commercial projects
-Change code of the plugin

You cannot:
-Delete or change any information about the plugin
-Distribute the plugin and its modifications

Details on obtaining a commercial license on my website

Plugin page:
https://dk-plugins.ru/game-time/
 
Last edited:

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
300
Reaction score
324
First Language
Russian
Primarily Uses
RMMV
Version 2.2.1
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
300
Reaction score
324
First Language
Russian
Primarily Uses
RMMV
Version 2.3.1:
  • Fixed bug with plugin commands

Version 2.3.0:
  • Added plugin command SetGameTimeMapButtonEnabled to control button availability on the map
  • Some code fixes
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
300
Reaction score
324
First Language
Russian
Primarily Uses
RMMV
Calendar add-on updated!

Version 1.1.2:
  • Added the ability to hide holidays from the calendar.

Version 1.1.1:
  • Fixed bug with monthly holidays.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
300
Reaction score
324
First Language
Russian
Primarily Uses
RMMV
Version 2.4.0:
  • Added 4 new settings that are responsible for the periods of the day: morning, day, evening, night. For each period, you can specify the name, start hour and end hour.
  • Added new format %DP for displaying the name of the period of the day in the time window.
  • Added new format %dd for displaying the short name of the day of the week in the time window.
  • Added a new property dayPeriod - the period of the day. It can be used in scripts like other time and date properties.
  • Removed properties dayWeekName, dayWeekShortName, monthName, seasonName.
  • Added constants for convenience (more details in the help).
  • Added new methods (more details in the help).
  • Added a new setting that is responsible for the change timer number. When using the GameTimeChangeSwitch, GameTimeChangeSelfSwitch, GameTimeChangeVariable commands or script calls, an internal timer is created, its number is stored in the variable that you specify in this setting.
  • Added plugin command to remove change timer.
  • Added the ability to specify note tag items, weapons, armor, skill, which sets the rules of use.

Version 2.4.1:
  • Fixed a bug with %dddd format.
 

thenerdmansion

Graphic Design/Complex Eventer
Veteran
Joined
Jan 5, 2015
Messages
241
Reaction score
71
First Language
Spanish
Primarily Uses
N/A
is it just me or am I the only one who can't access the website fomr DKP plugins?
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
300
Reaction score
324
First Language
Russian
Primarily Uses
RMMV

MetalGearPearl

Villager
Member
Joined
Jun 30, 2021
Messages
7
Reaction score
0
First Language
Spanish
Primarily Uses
RMMZ
Can I use this plugin on a commercial game?
 

KnyaZZ

Warper
Member
Joined
Sep 29, 2021
Messages
2
Reaction score
1
First Language
Russian
Primarily Uses
RMMZ
I have a problem witch plugin. When i start the game, an error occurs1633075760306.png1633075749739.png
 

KnyaZZ

Warper
Member
Joined
Sep 29, 2021
Messages
2
Reaction score
1
First Language
Russian
Primarily Uses
RMMZ
Try to go to the plugin settings to apply the standard settings for the new parameters (periods of the day) that were added in the last update
It works, thanks
 
  • Like
Reactions: DK

Latest Threads

Latest Posts

Latest Profile Posts

Something might be coming...
Hallo.png
A new day for creating :)
2021 has been the runner-up for the worst year of my life. 2015 may take that title, but '21 is pushing it. Excuses really don't justify how much of a jerk I've been this year to a lot of people.

I'm sorry. I don't intend to be a jerk forever, but I'd rather back up my intent with actions, not words.
"Another hundred habaneros... a teaspoon of tumeric... and a heaping helping of nitroglycerin!" The kitten in a chef's hat laughed maniacally as the pot he was stirring promptly exploded.

Forum statistics

Threads
116,019
Messages
1,094,956
Members
151,333
Latest member
QpQp
Top