Would it be feasible to make something that would require a certain amount of time to pass in the real world before in Rpg maker? For example, you accept a quest, then you have to wait 3 hours for the quest to become available, probably using the date and time function because it needs to work even when the program is closed.
Time based gameplay
RPG Maker MV Support'Tutorials' is where people who have made a tutorial for others to use can post them.
Moved to: RPG Maker MV
Moved to: RPG Maker MV
Yes, using a little scripting! Here's an example (source):
Here I've assigned a time value to a variable using Control Variables > Script:
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. 😤
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
Code:
Math.floor(Date.now() / 1000)
Original thread: https://forums.rpgmakerweb.com/threads/time-based-gameplay.111289/