Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Trickster's Time System V2.2

Status
Not open for further replies.
Trickster's Time System
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
Screenshots

Look at one of the default maps, make it 11PM think of that as night, there you have your screenshot

Demo

http://www.rmxp.org/forums/downloads.php?do=file&id=719

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

 
These control the lengths of time
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>
where length is the number of seconds in a minute

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

Code:
start_minute <minute>

end_minute <minute>
where is the minute as a number for example

Code:
start_minute 0

end_minute 6
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

Code:
end_minute 6
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

Code:
start_hour, end_hour, start_day, end_day, start_month, end_month, start_year, end_year
There are two more conditions are that

Code:
on_day, on_month
The First, on_day, makes an event happen on a certain day and on_month makes an event happen on a certain month.

Code:
morning, afternoon, evening, night
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

To Disabled the Tinting just call this
Code:
$game_time.tone_enabled = false
and to enable tinting just call
Code:
$game_time.tone_enabled = true
To change the time just call
Code:
$game_time.(value) = time
replace (value) with minute hour day month or year
and replace time with the new time

To advance the time just call
Code:
$game_time.(value) += time
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
Code:
 

  $game_time.is_morning?

  $game_time.is_afternoon?

  $game_time.is_evening?

  $game_time.is_night?

 
the respective method call to check it

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
 
Sleepy trickster?
I love your screenshot more and more XD
I'll give it a try tough i already use a KTS identical to yours... (but withouth years ya)
 
uzumakishade;178973 said:
this is cool, does it go from day to night instantly? or can you make it so that it gets slightly darker over time?
Its a smooth effect that updates each frame, you can edit it though by looking at method tone of class Game_Time

Denko;179040 said:
Is it possible to stop time on certain maps and then have time keep going again on others?

Hmm, well you could set the minute length to a very high value for now

I will add this into a future update
 
Trickster;178415 said:
(you can only set up a month to be 30 days and not vary by month)

Might you do that in a future version? Could be implemented through hashes, i.e.
Code:
'month' => 'days'

Just a suggestion. And great work. Glad to know you're on the verge of releasing that RTAB replacement too.
 
Thanks for you saying you're going to add that Seph! I do believe it is essential to a day/night script.
And I think yours is pretty good.
 
MasterMind5823;179058 said:
Might you do that in a future version? Could be implemented through hashes, i.e.
Code:
'month' => 'days'

Just a suggestion. And great work. Glad to know you're on the verge of releasing that RTAB replacement too.

Well the thing with that is that I have to change some calculations and it is a bit harder to do it that way, but well I'll think of something and if I implement leap years then this script will be a pretty accurate (if not 100% accurate) time script

Neonyo;179064 said:
Nice sweet and simple. Nice to see you are not limited to battle system addons :D

I have more non-battle scripts to name a few

Event-Tile Indicator (Unreleased)
View-Range (Unreleased)
Animation Display
Damage Display

and get it right CBSes CBS addons and minigames :p

Denko;179067 said:
Thanks for you saying you're going to add that Seph! I do believe it is essential to a day/night script.
And I think yours is pretty good.

Yes check back in a couple of days if not today I will have updated the script by then with the stop time feature
 
Create a window that displays it

I did create a method for returning then time just do $game_time.time

Also I was too sleepy at the time to create one for this myself, so there

EDIT: I will be doing one for the update though

Also Please only post if you have actual comments/bug reports/support on the script that's why you would be making a post here
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top