Real time clock?

Hey, my friends and I are working on a game and we desperately need an internal clock that corresponds to the computer clock and can cause certain actions to occur. Is there a plugin that allows this? Thank you in advance and have a great day.
lookup Orange Time System, one of it's options is to use real time.
We tried this, but the clock is stuck at 00:00:00 and won't change. Thoughts?
lookup Orange Time System, one of it's options is to use real time.
Not sure about Hudell's plugin, but you might find this helpful~
Yes, using a little scripting! Here's an example (source):
Code:
◆If:Self Switch A is OFF
  ◆Control Variables:#0001 timestamp = Math.floor(Date.now()/1000)
  ◆Control Self Switch:A = ON
  ◆Text:None, Window, Bottom
  :    :Come back in 10 seconds!
  ◆
:Else
  ◆Control Variables:#0002 check = Math.floor(Date.now()/1000)
  ◆Control Variables:#0002 check -= timestamp
  ◆If:check ≥ 10
    ◆Text:None, Window, Bottom
    :    :Such patience, much wow.
    ◆Control Self Switch:A = OFF
    ◆
  :Else
    ◆Text:None, Window, Bottom
    :    :I SAID WAIT!
    ◆
  :End
  ◆
:End
Here I've assigned a time value to a variable using Control Variables > Script:
Code:
Math.floor(Date.now() / 1000)
Date.now() gets the milliseconds since midnight on 1 Jan 1970. More details here: the Date object (MDN). Basically it simply stores the start time, then takes the difference between current and stored times to decide whether enough time has elapsed yet. 😤
Not sure about Hudell's plugin, but you might find this helpful~
Can you elaborate, brother?
First, just in case, a couple of things you likely already know:
  • By "Hudell's plugin" I meant the Orange Time System Zerothedarklord mentioned. 😴
  • The full thread for the quote I provided is here; alternatively, click the quote header.

There are two aspects to what you want to do: real-time measurement ("what"), and a trigger ("when"). A plugin might give you switches or something that can be used to trigger events at specific times. If you can figure out how to use that kind of plugin then that'd probably be the easiest solution; otherwise you'll need a different approach. 😅

Without a plugin, you'd need to have something running regularly in the background, checking how much time has elapsed and updating things as appropriate. Basically, this would mean a common event (so it's available on every map) with Parallel trigger (so it loops in the background)...something like this:
Spoiler: Parallel event suggestion
Code:
◆Comment:Get real time, rounded down to the second
◆Control Variables:#0017 check = Math.floor(Date.now()/1000)
◆Comment:Get difference between this and stamped time
◆Control Variables:#0017 check -= timestamp
◆Comment:Check if difference is positive (1+ real seconds elapsed)
◆If:check > 0
  ◆Comment:Call update event
  ◆Common Event:update game time
  ◆Comment:Update stamp
  ◆Control Variables:#0017 check += timestamp
  ◆Control Variables:#0016 timestamp = check
  ◆
:End
◆Comment:Update 5x per second (60 fps), just in case~
◆Wait:12 frames
In the update game time event you could have stuff like this:
Spoiler: Update event example
Code:
◆Comment:Can check seconds elapsed since last update
◆If:patience > 0
  ◆Comment:Separate counter for waiting for stuff
  ◆Control Variables:#0011 patience += check
  ◆If:patience ≥ 120
    ◆Text:None, Window, Bottom
    :    :Your party is ready to go!
    ◆Control Switches:#0005 Ready = ON
    ◆Control Variables:#0011 patience = 0
    ◆
  :End
  ◆
:End
◆Comment:Can check actual time
◆Control Variables:#0025 game hour = new Date().getHours()
◆If:game hour ≥ 9
  ◆Control Switches:#0006 Night = ON
  ◆
:Else
  ◆If:game hour < 5
    ◆Control Switches:#0006 Night = ON
    ◆
  :Else
    ◆Control Switches:#0006 Night = OFF
    ◆
  :End
  ◆
:End
◆Common Event:update day/night
Some notes, since I don't know how familiar you are with RMMV:
  • Parallel common events need a switch assigned to them and they'll only run while that switch is on. You can turn on this switch in your introduction sequence (assuming you have one), e.g. an event on your starting map with two pages, something like this:
    1. Trigger: Autorun, Conditions: (None), Contents:
      Code:
      ◆Text:None, Window, Bottom
      :    :Welcome to the game!
      :    :Have fun!
      ◆Control Switches:#0001 StartTheGame = ON
    2. Trigger: Action Button, Conditions: Switch StartTheGame is ON, Contents: (None)

  • Parallel events restart on map transition, so long wait times are not recommended unless you're OK with that time being cut short. However, wait times will be remembered when a player saves & loads their progress.

  • By default, common events with no trigger only run if they are called by the Common Event command.

  • Event/variable/switch names can be whatever you like, of course, these are just suggestions for event structure~
Hope that helps! 😂
you can use a variable to call in a window, and use the following:

JavaScript:
    const Time = today.toLocaleTimeString()
    let today = new Date();
    let day = today.getDate()
    let month = Months[today.getMonth()]
    let year = today.getFullYear()
 
    let TimeDate = day + "/" + month + "/" + year;
    $gameVariables.setValue(0, Time); // change 0 to current SaveDate variable
    $gameVariables.setValue(0, TimeDate); // change 0 to current SaveDate variable

you can also use only the time if you wish, change 0 to teh variable ID you like to use.
use this a scripcall, in parallel process (common event for continue use)

I use a tiny different variance for my game though with names of weeks.

Original thread: https://forums.rpgmakerweb.com/threads/real-time-clock.122786/