Help with variables - Time related events and timed variables

The other day, I was searching for a day, night, clock, and calendar system without using scripts. Thanks to the power of the internet, I found what I was looking for.

To simply put it, I just basically set variables as seconds, minutes, hours, days, etc. But what I want to do is have "timed" events. Examples are:

You have 5 days remaining to pay rent.

You have 30 minutes to complete the puzzle.

You have a month to complete this expedition.

The monthly festival has begun!

It's Friday the 13th! Hide from Jason Voorhees!

and so forth.

So, say it's "Day 45" and you interact with a quest and you have 5 days to complete it. Once it says "Day 50" you fail. How would I make something like this work? Any ideas?

How I made the clock and calendar system is in this video

How I made the Day and Night system is in this video
Basically you store the time limit in a variable for the quest, and then check if the time has passed or not by comparing the general time variable with the target time stamp in a conditional branch.


Most effective if the quest solver event checks that, but if you need a message during gameplay you have to check that in a parallel process.
In the event that starts the quest, turn on a switch and set a (new) variable to the same variable you use for the days. Create a common event, that runs on a parallel process (with the same switch you used before). In it, set another (new) variable to the variable for the days. Then use your previous variable and subtract it from the newer one. Using a conditional branch that checks if that variable is equal to or greater than 5, you can determine whether or not 5 days have passed.


It would probably be a good idea to add in a 60 frame wait command, so that it doesn't end up lagging your game, and you don't need to check every millisecond whether or not 5 days have passed.
That sounds like a cool idea, but, I'm a little loss xD Is it alright if you throw up a screenshot? I apologize, I'm more of a visual type xD

And yeah, I have the whole 60 seconds thing so the game doesn't lag terribly. 
I made a Time System Prototype which could fit your needs.

Functions:

You got  Variables to Add or Sub Values to the Total Game Time.

Variable for Secconds, Mins, hours, days, weeks,month,years.

Just set the Variable to the amount  and will automatically change the total time.

thought it will be userfriendlier this way.

Than you got Variables calculated from total game time for:

total secconds, mins... weeks to years.

This alklows you to set time stamps in a easier way. if you need a month time stamp you dont need to calculate it up to secconds.

and  you got the ingame time variables,

these are for showing the clock or for setting eventpages, so events apear just to specified hours or weeks or special days.

The System isnt finished in my opinion and i will try to implement more stuff functions and possibilities for easier user acess.

And Info Help Texts.

Sorry my english isnt the best to explain such stuff, but i thought i share it.

@Bex: this is not what the OP is asking for. They already have an existing time system.


@DrakeLovesNekos: here you go, this is what the events would look like.


event_passingdays1_zpsgsefsoey.png



event_passingdays2_zps9daxhpna.png
But in his System he will activate the quest at day 26 for example, and 5 days later his variable will show him Day1 again.

And that would mess up the Conditional Branch.

But he could add into his System Variables for total Hours and stuff. Would work.But without Edit your solution isnt possible at the Moment

because the Values are missing.

But that change would make it even difficulter if he wants to turn the clock forard or backward for some hours, if he want such stuff for a Inn Event for example.

Than he will need to change his System once again 🙂 . Thats why i posted my Idea with that prototype, its up to Op to say Nay or Hey 🙂 .
@Bex: That sounds like a complex handy setup... I took a look at it and like I said, I'm not used to fully using variables yet. What got me was that "%" thing... xD Although I'm not abandoning it, it'll certainly come in handy another time I hope.

@Celianna: I tested out what you suggested and it worked pretty darn well for me so far xD What Bex said was something about my "Day" variable changing back to zero. What I did get was some other weird stuff so by using your little 'template', this is what happened:

Instead of setting 'Temp' and 'StarQuestDay' to the actual 'Days' variable, I made a new one called 'Day Tracker'. It works just like the day variable but it doesn't get reset to 'Day 1' (After the 7th day [sunday] is goes back to 1 [Monday]), instead it keeps goin' and going. So I set 'Temp' and StartQuestDay' to the Tracker instead and it worked pretty nicely for me =w= Thanks a lot for the help~! If I run into a problem or something, I'll come back to here and let you all know. For now, thank you Celianna and Bex for helping me through this, time is an essential thing for me project 😀
Sounds good.

This sign % is called modulo. it tells you what the rest value is.

For example 10 modulo 3, = 1 (3goes 3 times into ten =9 and the rest is 1)

But i recogniced that i overcomplicated the Eventcode maybe a little.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-variables-time-related-events-and-timed-variables.44619/