My In-Game Clock Won't Function as Intended

Okay so I followed a tutorial from Youtube about making an in-game clock using common events. rpgmaker hata.png
There is an event that turns the clockstart switch on and it's kinda working. I also made another common event so a clock screen would appear when i press a certain button. But I just realized these all working until hours reaches 24. Minutes and seconds work perfect but days or weeks or months doesn't get affected when hour reaches 23. I hope someone can help me. Thank you
The loop is unnecessary, parallel process will continue to operate the process so long as the correct switch is on. You don't need to stack your conditionals like that, it's simpler to link the reset of the primary variable & the increase of the subsequent variable to particular trigger amounts. It's also prefer to have the variable amount conditionals as equal to or greater to the trigger number.

Here is how I set up the clock in my own project as an example. I haven't had any issues since I set mine up.

◆Wait:300 frames
◆Control Variables:#0001 Minutes += 1
◆If:Minutes ≥ 60
◆Control Variables:#0002 Hours += 1
◆Control Variables:#0001 Minutes = 0
◆
:End
◆If:Hours ≥ 24
◆Control Variables:#0003 Days += 1
◆Control Variables:#0002 Hours = 0
◆
:End
◆If:Days ≥ 29
◆Control Variables:#0004 Months += 1
◆Control Variables:#0003 Days = 1
◆
:End
◆If:Months ≥ 14
◆Control Variables:#0005 Years += 1
◆Control Variables:#0004 Months = 1
◆
:End
If that isn't enough to help you figure it out, I'd also like to see what's in the Check Clock common event, and what's in the event that controls showing the clock when you press a certain button.

I would also look for map events, or plugins, that use variables as conditions, because if you use your Day variable (7) in any of them, you could be triggering something unexpected to turn on when the Day changes to 1. Similarly, look for anything else that uses switch 4, because it might just be getting turned off. One way to tell is to go into the debug window (F9) and see if that switch is on, and what the variable is set to.

It could also be that your 'show time' event is just wrong, and the clock logic is actually working perfectly.
If that isn't enough to help you figure it out, I'd also like to see what's in the Check Clock common event, and what's in the event that controls showing the clock when you press a certain button.

I would also look for map events, or plugins, that use variables as conditions, because if you use your Day variable (7) in any of them, you could be triggering something unexpected to turn on when the Day changes to 1. Similarly, look for anything else that uses switch 4, because it might just be getting turned off. One way to tell is to go into the debug window (F9) and see if that switch is on, and what the variable is set to.

It could also be that your 'show time' event is just wrong, and the clock logic is actually working perfectly.
Adsız.png
I solved the problem thanks to XIIIthHarbinger, but still here is my Check Clock event, I don't know what I did wrong. While it is certainly not necessary, it would be really helpful if you can explain what I did wrong. Thank you all.
You checked all the conditional branches variables with a 'greater than or equal to' condition, which means everything will reset just before it reaches the amount you want. You either need to use 'greater than' 59/59/23/6/3/11 or 'greater than or equal to' 60/60/23/7/4/12. Also all those elses serve no purpose whatsoever.

You don't need to embed all the conditional branches either, you can put them after each other to check their content like XIIIthHarbinger did, so they will never bother each other's processes.

I just noticed something else: ALWAYS add some wait frames into a parallel process, at the beginning of Time to let it know how much frames is a second (I guess you don't expect us to play your game during several years, so it's some sort of accelerated time?), and after that conditional branch in Check Clock (what is it even for, the messages are the same?) so it doesn't loop into nothingness and overload the system when you don't press A.

One last thing: Day/Week/Month should reset to 1, not 0, there's no day 0/week 0/month 0 in a calendar, but there is second 0/minute 0/hour 0. You should set those three to 1 at the beginning of your game before you start the timer if you want a calendar thing, a day 0 is only used in true game time.
You checked all the conditional branches variables with a 'greater than or equal to' condition, which means everything will reset just before it reaches the amount you want. You either need to use 'greater than' 59/59/23/6/3/11 or 'greater than or equal to' 60/60/23/7/4/12. Also all those elses serve no purpose whatsoever.

You don't need to embed all the conditional branches either, you can put them after each other to check their content like XIIIthHarbinger did, so they will never bother each other's processes.

I just noticed something else: ALWAYS add some wait frames into a parallel process, at the beginning of Time to let it know how much frames is a second (I guess you don't expect us to play your game during several years, so it's some sort of accelerated time?), and after that conditional branch in Check Clock (what is it even for, the messages are the same?) so it doesn't loop into nothingness and overload the system when you don't press A.

One last thing: Day/Week/Month should reset to 1, not 0, there's no day 0/week 0/month 0 in a calendar, but there is second 0/minute 0/hour 0. You should set those three to 1 at the beginning of your game before you start the timer if you want a calendar thing, a day 0 is only used in true game time.
THANK YOU so much for your help, it really helps to know that there are several ways to solve a problem, btw there was a wait event at the bottom but I couldn't fit it in the screenshot. This thread is solved, I don't actually know how to close it but it is solved. Thank you again.
There's a problem with putting that wait at the bottom: the first second of the variable will be set immediately and won't be equal to one true second of game time, if this makes any sense to you. You'd need to reset the variable at 61 to have one true minute elapsed, which is weird.
@SinanAydin To close a thread, Report your opening post and ask for it to be closed. The Report button is at the bottom left of your post. Mods may not see a post, but we will see a Report.

Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/my-in-game-clock-wont-function-as-intended.80457/