Basic Game Time + Night/Day

Ah that's what you want. That sort of feature is already present in Advanced Game Time.


http://forums.rpgmakerweb.com/index.php?/topic/3851-advanced-game-time/
First off, hi, I'm new. Nice to meet you all.

Second off, Vlue, this script is awesome. The only thing I'm finding is that the clock always hides when I open the menu. No matter what, it will turn invisible if I go into the menu screen. Is there possibly a way to change this?
Basic Game Time is soooooo basic, that it doesn't have a clock menu! 

Advanced Game Time does have a menu clock feature though (along with lots of others) which you can look at here: http://forums.rpgmakerweb.com/index.php?/topic/3851-advanced-game-time/
Thank you for the quick reply!
Hi Vlue. I'm very new to this, but having a great time with your script.

Recently I've encountered an error that I haven't been able to reslove

Spoiler
Eh0mUPf.gif
This occures on a map where I have the clock hidden (using the GameTime::clock(false) script ) and when I activate a battle sequence event.

I'm also using Yanfly Ace Battle Engine v1.22 script

Any ideas? 🤔

Thanks for your time.
Yup, updated the pastebin to avoid that problem, try it out.
👍 Yeah! Seems to be working fine now! 👍

Thank you!
So I'm having some trouble with the variables. I'm trying to add an eat/sleep cycle.

I tried this as a common event

$game_variables[2] = GameTime.hour? I put this in a loop on parallel process but it won't change the variable.

Any ideas?
Did you turn the switch for the common event on? (I make that mistake a lot)
Did you turn the switch for the common event on? (I make that mistake a lot)
Yeah I have a ruglar event set up to turn it on.
Did you turn the switch for the common event on? (I make that mistake a lot)

I think it works when I set the switch event to work on action button but when it activates the game freezes.
Try using Control Variable and just putting GameTime.hour? in the script box.
Gave it a shot still freezes up when it loads in
Is your event turning on the switch an autorun with no shut off?
Actually it was so I fixed that and it still didn't work but then I removed the loop from the common event and now it works. Thanks for the help! and your script works great thanks!

Just have one more quick question, when you set the script to add the time to a variable does it reset at the end of a day or does it just keep track of the total time?
The TIME_VARIABLE option in the script is just always equal to the current minute in the day, so it resets at the end of day~
Cool, that will work well with what I want to do. Thanks for all the help!
Is there any way I can set a specified start time for the clock when the game is first ran? Also, is there any way I can disable it and enable it?
Change line 90 from 0 to whatever minute you want it to start as.

Script call, GameTime.clock(true/false) hides and shows the clock

and GameTime.pause_time(true/false) stops and starts time.
I love the script.

But I've run into a problem. When I playtest, and start a new game, it runs fine, but once I save and exit out and go to continue the saved game it pops up with

"Script 'Basic_DayNight' line 120: NoMethodError occured

undefined method '/' for nil:NilClass"

I don't know what to do...

Here is the line of the script:

119  def self.hour?

120      return $game_time / 60

121    end

Original thread: https://forums.rpgmakerweb.com/threads/basic-game-time-night-day.1079/