Jump to content
Sign in to follow this  

Clock and Time with events

Recommended Posts

Okay! It's been a while since I've written one of these, but lets dive right in shall we?


This tutorial is going to show you the basics of how to control time, time of day, days of week and so on with a few simple variables and common events!


The first thing you will need to do is create three events; TimeTime of Day and Day of Week as I chose to call them. The first one acts as a clock, counting time. You will need to create a common event, the very first step is to set a variable of Time and have it constantly add 1. This will count as a timer with each 60 variable counting about roughly 1 second, similar to the wait event.


Secondly you will need to create a conditional branch, this will check for Time to have hit a certain point, and will allow you to change the Time of Day. I chose 3000 for testing purposes, giving about 1 minute per change. Now within that conditional branch you will Add a set +1 to Time of Day, this causes the time of day to change, night, morning and so on. Next you will wait 5, this allows the variable to change before you reset the Time by setting it to 0, which causes the process for the next time of day to restart.


Next you will have another conditional branch, this one checks the Time of Day to allow it to reset. I set mine to 5, for sunrise, morning, daytime, sunset and dark, this is done using variables of 0 - 4. Once it hits 5 it resets to 0 and becomes sunrise again. I then increase Day of Week changing the day as it indicates.


The following step is to have another conditional branch, this one checking the Day of Week variable, once it hits 7 it simply resets Day of Week back to 0.


Now for flavor I have multiple conditional branches to check the Time of Day so that I can adjust the tint of the screen for effect. Look below for the event itself.






Now you can use this for a variety of things, simply have your events through out the game check the variables to see the Time of Day, or Day of Week or even both to allow your entire to game to really live! Feel free to add on, you can make more variables to do weeks of the month, month of the year and even year itself! It just depends on how much detail you want to control!


Next I actually created an event to display the day of week and time of day. I attached this common event to an item, but you can also set it to do a button press by adding the following event into a conditional branch to check for that button being pressed. This one is pretty simple so all I am doing is going to display the event.






I hope this was easy to follow as I am a bit rusty in the tutorial department. Enjoy!

Edited by Shaddow

Share this post

Link to post
Share on other sites

Your content will need to be approved by a moderator

You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.