Clock time system like animal crossing in rpg maker mv

Hi is it possible to make a time (clock system) that follows real world time? so when the player played at night, the game just turned into nighttime, is this can be done by plugin or someone might wanna help me
Yeah it can be done, and you are correct that it can be done via plugin.

So if you ever wonder about if something can be done in the maker that isn't their by default, then google whatever you want followed by plugin, and 9/10 you'll be directed to a plugin for it.

Hope you find the one your looking for ^^
It can be done pretty easely I think.
No need for plugins either (though you can automate it with a plugin)

Just create a common event that runs in parrallel
In that event, you want to create a script with :

JavaScript:
let now = new Date();

let hours = now.getHours();     // Returns the hour (0-23)
let minutes = now.getMinutes(); // Returns the minutes (0-59)
let seconds = now.getSeconds(); // Returns the seconds (0-59)

$gameVariables.setValue(1, hours);
$gameVariables.setValue(2, minutes);
$gameVariables.setValue(3, seconds);

Change 1, 2, 3 into the variable ID in which you store the time.


You now have the local time stored in variables and can setup your logic for morning, afternoon, night, etc...

For example, in the parrallel event you can add, after the script :
Code:
♦ If : Hours >= 6
  ♦ If : Hours < 12
    ♦ Text : Good morning! (6 AM to 12 PM)
  ♦ End
  ♦ If : Hours >= 12
    ♦ If : Hours < 18
      ♦ Text : Good afternoon! (12 PM to 6 PM)
    ♦ End
    ♦ If : Hours >= 18
      ♦ Text : Good evening! (6 PM to 12 AM)
    ♦ End
  ♦ End
♦ Else
  ♦ Text : Good night! (12 AM to 6 AM)
♦ End

You can add more in depth logic and change text by an event call that will alter your game filter for example, all up to you.
Here are two plugins with ready-made functions, maybe it will help:
It can be done pretty easely I think.
No need for plugins either (though you can automate it with a plugin)

Just create a common event that runs in parrallel
In that event, you want to create a script with :

JavaScript:
let now = new Date();

let hours = now.getHours();     // Returns the hour (0-23)
let minutes = now.getMinutes(); // Returns the minutes (0-59)
let seconds = now.getSeconds(); // Returns the seconds (0-59)

$gameVariables.setValue(1, hours);
$gameVariables.setValue(2, minutes);
$gameVariables.setValue(3, seconds);

Change 1, 2, 3 into the variable ID in which you store the time.


You now have the local time stored in variables and can setup your logic for morning, afternoon, night, etc...

For example, in the parrallel event you can add, after the script :
Code:
♦ If : Hours >= 6
  ♦ If : Hours < 12
    ♦ Text : Good morning! (6 AM to 12 PM)
  ♦ End
  ♦ If : Hours >= 12
    ♦ If : Hours < 18
      ♦ Text : Good afternoon! (12 PM to 6 PM)
    ♦ End
    ♦ If : Hours >= 18
      ♦ Text : Good evening! (6 PM to 12 AM)
    ♦ End
  ♦ End
♦ Else
  ♦ Text : Good night! (12 AM to 6 AM)
♦ End

You can add more in depth logic and change text by an event call that will alter your game filter for example, all up to you.
got a question, does to clock will be displayed on the screen with this?

thanks for answering
Here are two plugins with ready-made functions, maybe it will help:
thanks for the reply!
got a question, does to clock will be displayed on the screen with this?

thanks for answering
No, the solution I offered will only allow you to save local time in variables.

If you want a clock to show the time on screen you will need to represent it with an image or window base (custom overlay/menu).

You could also use a plugin such as YEP_MessageCore to draw text on screen and show the current time displaying hours, minutes and seconds (according to what you want)


There are multiple solutions to show current time on screen, but I'm not aware of a "ready to use" plugin for this.
No, the solution I offered will only allow you to save local time in variables.

If you want a clock to show the time on screen you will need to represent it with an image or window base (custom overlay/menu).

You could also use a plugin such as YEP_MessageCore to draw text on screen and show the current time displaying hours, minutes and seconds (according to what you want)


There are multiple solutions to show current time on screen, but I'm not aware of a "ready to use" plugin for this.
ok! thanks for the help

Original thread: https://forums.rpgmakerweb.com/threads/clock-time-system-like-animal-crossing-in-rpg-maker-mv.170581/