Version: 2.0
Introduction
And who said I only create scripts for battle systems, yeah that's right This is a map system. This allows your game to have time. Also includes a simple Day Night System. And Also you can setup events that happen at a certain time (ex. at 0 to 6 minutes past each hour, or on Tuesday March 20, 2007 at 3:00 PM to 4:00 the same day and year), This script wasn't meant to be an exact copy of our calendar (you can only set up a month to be 30 days and not vary by month), but well enjoy.
Features
- Simple
- Can Set Time to a certain hour, minute, month, day, year
- Can Speed up or slow down time
- Can Disable Tinting
- Tinting is disabled on inside maps
- Can Setup Initial time
- Can redefine the time system
- A whole lot of other stuff I am probably to sleepy to recall
- Can Stop Time for certain maps or whenever
- Can Speed up time on certain maps or whenever
- Can Pause Time flow when events are running
Look at one of the default maps, make it 11PM think of that as night, there you have your screenshot
Demo
Script
I shall leave the families trapped in a moment of time since they get no time script posted here and no script means they are stuck Haha
Instructions
Add the Script Above Main There is a setup section which I'll explain again below
Code:
#--------------------------------------------------------------------------
# * Minute Length
#--------------------------------------------------------------------------
Minute = 2
#--------------------------------------------------------------------------
# * Hour Length
#--------------------------------------------------------------------------
Hour = 60
#--------------------------------------------------------------------------
# * Day Length
#--------------------------------------------------------------------------
Day = 24
#--------------------------------------------------------------------------
# * Month Length
#--------------------------------------------------------------------------
Month = 30
#--------------------------------------------------------------------------
# * Year Length
#--------------------------------------------------------------------------
Year = 12
2 seconds in a minute
60 minutes in a hour
24 hours in a day
30 days in a month
12 months in a year
The only one you can modify in game is how many seconds in a minute which you can change by using this call script
Code:
$game_time.minute_length = <length>
Code:
#--------------------------------------------------------------------------
# * Starting Time
# - Year, Month, Day, Hour, Minute
#--------------------------------------------------------------------------
Time = 1207, 4, 13, 23, 0
This is just the starting time and this reads 11:00 PM May 4, 1207
Code:
#--------------------------------------------------------------------------
# * Days of the Week
#--------------------------------------------------------------------------
Days = %W( Sunday Monday Tuesday Wednesday Thursday Friday Saturday )
#--------------------------------------------------------------------------
# * Months of the Year
#--------------------------------------------------------------------------
Months = %W( Janurary Feburary March April May June July August September
October November December )
Days and Months of the year just type the names without '' or "" like I have done here if you need a space in the name replace the space in the name with \s
Code:
#--------------------------------------------------------------------------
# * Time Format
# 0 - HHMM 1 - HH:MM 2 - HH:MM AM / PM (Splits Day Rate in Half)
#--------------------------------------------------------------------------
Time_Format = 2
Time Format this is self-explanatory
Code:
#--------------------------------------------------------------------------
# * Morning
#--------------------------------------------------------------------------
Morning = proc {|hour| hour >= 5 && hour < 12}
#--------------------------------------------------------------------------
# * Afternoon
#--------------------------------------------------------------------------
Afternoon = proc {|hour| hour >= 12 && hour < 18}
#--------------------------------------------------------------------------
# * Evening
#--------------------------------------------------------------------------
Evening = proc {|hour| hour >= 18 && hour < 22}
#--------------------------------------------------------------------------
# * Night
#--------------------------------------------------------------------------
Night = proc {|hour| hour >= 22 && hour < 5}
Ok These effect the Time of Day it is Morning is considered to be from 5am to 12 pm Afternoon is from 12 pm to 6 pm Evening is from 6pm to 10 pm and Night is from 10 pm to 5am. Not really important options but you you'll see what they are for if you read below
Code:
#--------------------------------------------------------------------------
# * Time Effect
# 0 - Wait (In Map Only) 1 - Wait2 (In Map in Battle) 2 - Active
#--------------------------------------------------------------------------
Time_Effect = 2
Time_Effect is how the time updates 0 in map only 1 for map and in battle 2 for all scenes (provided if Scene_Base is used to create the scene)
Code:
#--------------------------------------------------------------------------
# * Tone Enabled (At Start of Game)
#--------------------------------------------------------------------------
Tone_Enabled = true
#--------------------------------------------------------------------------
# * Time Speed (At Start of Game)
#--------------------------------------------------------------------------
Speed = 1
#--------------------------------------------------------------------------
# * Time Stopped (At Start of Game)
#--------------------------------------------------------------------------
Stopped = false
#--------------------------------------------------------------------------
# * Time Stopped During Events
#--------------------------------------------------------------------------
Stopped_Events = true
These are options for at the start of the game these are self-explanatory
Code:
#--------------------------------------------------------------------------
# * Time Stopped Maps
# - syntax map_id => stopped flag true: stopped time false: otherwise
#--------------------------------------------------------------------------
Stopped_Maps = {}
#--------------------------------------------------------------------------
# * Time Stopped Maps Default
#--------------------------------------------------------------------------
Stopped_Maps.default = false
#--------------------------------------------------------------------------
# * Increase Speed up Time Maps
# - syntax map_id => speed
#--------------------------------------------------------------------------
Speed_Maps = {}
#--------------------------------------------------------------------------
# * Increase Speed up Time Maps Default
#--------------------------------------------------------------------------
Speed_Maps.default = 0
#--------------------------------------------------------------------------
# * Tone Disabled Maps
# - syntax map_id => disabled flag true: disabled false: enabled
#--------------------------------------------------------------------------
Tone_Disabled = {2 => true}
#--------------------------------------------------------------------------
# * Tone Disabled Maps Default
#--------------------------------------------------------------------------
Tone_Disabled.default = false
These are options for maps the in version 1.0 was deprecated for the Tone_Disabled Hash setup. These are also self-explanatory because of the comments telling how to set it up
On the page you want the event to have an extra time condition
Using an Event Comment Write a Comment that says Time_Setup
This activates the script
To Set the minutes the event is supposed to happen two comments that says
where is the minute as a number for example
The event will run from x:00 to x:06 every hour every day every year
If you leave one of these off then it will not be used for example
will do the exact same thing as the above
Except it means from any time where the minute is less than x:06
repeat for hours, days, months, and years their conditions are
There are two more conditions are that
The First, on_day, makes an event happen on a certain day and on_month makes an event happen on a certain month.
These are new as of V2.0 these check if the time is morning, afternoon, evening or night respectively (or not if you set them to false)
That is all
Using an Event Comment Write a Comment that says Time_Setup
This activates the script
To Set the minutes the event is supposed to happen two comments that says
Code:
start_minute <minute>
end_minute <minute>
Code:
start_minute 0
end_minute 6
If you leave one of these off then it will not be used for example
Code:
end_minute 6
Except it means from any time where the minute is less than x:06
repeat for hours, days, months, and years their conditions are
Code:
start_hour, end_hour, start_day, end_day, start_month, end_month, start_year, end_year
Code:
on_day, on_month
Code:
morning, afternoon, evening, night
That is all
To Disabled the Tinting just call this
and to enable tinting just call
To change the time just call
replace (value) with minute hour day month or year
and replace time with the new time
To advance the time just call
replace (value) with minutes hours days months or years
and replace time with the amount of time to move forward
To stop time just call
$game_time.stopped = true
and no unstop time just call
$game_time.stopped = false
To Speed up time (How many seconds passes) just call
$game_time.speed =
where speed is the speed of increasing
To check if its morning afternoon evening or night just call
the respective method call to check it
Code:
$game_time.tone_enabled = false
Code:
$game_time.tone_enabled = true
Code:
$game_time.(value) = time
and replace time with the new time
To advance the time just call
Code:
$game_time.(value) += time
and replace time with the amount of time to move forward
To stop time just call
$game_time.stopped = true
and no unstop time just call
$game_time.stopped = false
To Speed up time (How many seconds passes) just call
$game_time.speed =
where speed is the speed of increasing
To check if its morning afternoon evening or night just call
Code:
$game_time.is_morning?
$game_time.is_afternoon?
$game_time.is_evening?
$game_time.is_night?
FAQ
Awaiting FAQ
Compatibility
SDK 2.2 Compliant (Get it from this demo)
Requires Map Info Script
Credits and Thanks
This script is based on Deke's Time System
Author's Notes
Also this was coded in less than a few hours
This script's setup is not compatible with version 1.0 of this script