RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

[RPGXP] Real 24-hour clock system, how do I make this work?

Started by neutral12, May 03, 2011, 01:35:39 AM

0 Members and 1 Guest are viewing this topic.

neutral12

Hello. I was looking into this for quite some time now. I wanted to make a clock system in my game where it tells you the real time in 00:00 format. For example, lets say you click a clock in somebody's room. It would find the system time and display that in 00:00 format (for example, 8:33 pm). I'm assuming this might be a script. But either way. I was hoping to find a working system for this feature. I have looked all over the place (including google/youtube) and I haven't found one that works. Perhaps someone here has made it possible? One that works? It has been bugging me for quite some time now, and I never found a working one. Nor do I have the scripting knowledge to figure it out (I hope some time I have the knowledge in the future, at least).

~Neutral

ForeverZero

You use this script call:

t = Time.now
s = "#{t.hour}:#{t.minute}"
$game_variables[ID] = s


Replace ID with whatever ID of a game variable you want to use for it.
You can then make a normal evented message with this:

"The current time is \v[ID]."

neutral12

Uhh, i'm having a problem with this code at the moment.

http://i176.photobucket.com/albums/w177/Neutral12/error.png

Every time I run the event when I click it, I get this error message. I included the coding for the event.

game_guy


ForeverZero

Yeah, gg's right. I don't know why I wrote "minute", its "min".

neutral12

Thank you so much, this solved my issue with the clock. I appreciate it so much.

One more question though. I was also interested in adding day and night. Is it possible to make it so the game will check for a certian time on your system clock; then depending on that time, it will tint your screen darker for night. Then check your system clock for another time which makes it morning? How can I accomplish this?

ForeverZero

You could use a Common event with a parallel trigger.

Use variations of this little snippet:
Time.now.hour == HOUR

Replace HOUR with an actual number, and use this as a conditional branch.
Then have a command set the screen tone accordingly.

That's your most basic way of doing it. There are multiple time system scripts around, though they are usually a little more in-depth than just doing what you asked.