• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Game Time

Resource Game Time 1.0

Luka S.J.

Wastage of Time
Member
Joined
Mar 27, 2017
Posts
105
Luka S.J. submitted a new resource:

Game Time - Separate your game world from the real life.

Adds an "unreal time" engine to your game.

Manipulating time

You can use existing methods to skip ahead in time:

GameTime.move_to_morning skips the time to 06:00.
GameTime.move_to_afternoon skips the time to 12:00.
GameTime.move_to_evening skips the time to 19:00.
GameTime.move_to_night skips the time to 22:00.


Additionally, you can explicitly define which time to jump to...

Read more about this resource...
 
Just out of curiosity, is there something that makes this different than FL's Unreal Time system, or is it about the same?
 
Before I download this, I need to know. Does it still mark everything based on your device's date, or does it use its own calendar, where you set the date?
 
just to take away y'all curiosity, no, it is not compatible with the Volteon's Pause Menu (since most use it) or any other plugin that involves messing with the game's Time
 
Just out of curiosity, is there something that makes this different than FL's Unreal Time system, or is it about the same?
As far as I've seen, the syntax of this script better (I made mostly of my script in 2013) and have some extra methods to skip time (like move_to_night instead of manually typing move_to_hour(22)). It also skips leap years. Besides this, looks the same.
 
Just out of curiosity, is there something that makes this different than FL's Unreal Time system, or is it about the same?

It achieves the same thing, just in a slightly different way.

Before I download this, I need to know. Does it still mark everything based on your device's date, or does it use its own calendar, where you set the date?

It uses its own internal calendar. Which impacts the in-game seasons.

just to take away y'all curiosity, no, it is not compatible with the Volteon's Pause Menu (since most use it)

Not sure what that script does with time, but anything that uses pbGetTimeNow will work normally.
 
just to take away y'all curiosity, no, it is not compatible with the Volteon's Pause Menu (since most use it) or any other plugin that involves messing with the game's Time
To make it compatible with voltseons pause menu add in game time this


Ruby:
Expand Collapse Copy
# Add the strftime method to format the time
    def strftime(format)
      time = Time.new(@year, @month, @day, @hour, @minute, @second)
      return time.strftime(format)
    end

so its look like this


Code:
Expand Collapse Copy
#===============================================================================
#  Game Time module
#    New components for an unreal-like time engine.
#    Bypasses the real-world `Time.now` components and
#    allows the game to keep track of its own in-game
#    time.
#===============================================================================
module GameTime
  #  Main class for the current time
  class Now
    #  Public attributes
    attr_accessor :hour
    attr_accessor :minute
    attr_accessor :second
    attr_accessor :day
    attr_accessor :month
    attr_accessor :year

    # Add the strftime method to format the time
    def strftime(format)
      time = Time.new(@year, @month, @day, @hour, @minute, @second)
      return time.strftime(format)
    end

    #  How many days in a month.
    #  Does not take leap years into consideration as year is constant
    #  and not taken into account.
    MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31].freeze
 
There seems to be a couple problems with this plugin. It was noticed by someone reporting a crash that when planting a berry where the time being assigned to the berry via pbGetTimeNow was resulting in floats all over the place where ints were expected (even if .to_i was used on the value). Removing this plugin fixed the problem. FL's Unreal Time System doesn't have this issue (I use and test with that all the time).

I tried to dig in a bit on a fresh copy of v21, but installing this plugin just gives a crash: Exception `ArgumentError' at [Game Time] Script.rb:63 - wrong number of arguments (given 0, expected 4..5), with your usage of lerp looking to the one defined in essentials:
Ruby:
Expand Collapse Copy
Backtrace:
RubyUtilities:399:in `lerp'
[Game Time] Script.rb:63:in `progress'
 
Back
Top