Is there a way to make the time affect what happens. I.E. A shop will be open from 7:00 AM till 7:00 PM.
Advanced Game Time
RGSS3 Scripts (RMVX Ace)- removed -
Hello!
Can i make shops close at night???
I don't know how to do that!! >.< please help!!
Can i make shops close at night???
I don't know how to do that!! >.< please help!!
If I recall correctly, the script stores the time as a variable number. Simply have a second page in the events that transfer to the shops; in the conditions box of the events, set the variable to the number that happens when the shops should close, and have a message that says 'This shop is closed.'
So, if for instance the shops close at 6:00 P.M. and the variable is 200, you set the variable that time is saved on to '200', and in theory it should prevent the player from entering the shop. (And if you were extra creative, you could have a key item that allows the player to break in and steal things.)
So, if for instance the shops close at 6:00 P.M. and the variable is 200, you set the variable that time is saved on to '200', and in theory it should prevent the player from entering the shop. (And if you were extra creative, you could have a key item that allows the player to break in and steal things.)
small bump as I'm also trying to face this problem. I'm pretty bad at programming but generally once I "get it" I go smooth
I'm reading every single page on this thread and I found this answer
I'm getting a Script 'Game interpreter' line 449:Syntax error
unexpected '='
GameTime.hour? = 8
edit2:
Alright, this example seems to work (as in: it's not giving me an error)...
GameTime.hour? >= 6 and GameTime.hour? < 11
could it be that it wants == when it's alone ?
I'm reading every single page on this thread and I found this answer
however, it doesn't work to me :/
I'm getting a Script 'Game interpreter' line 449:Syntax error
unexpected '='
GameTime.hour? = 8
edit2:
Alright, this example seems to work (as in: it's not giving me an error)...
GameTime.hour? >= 6 and GameTime.hour? < 11
could it be that it wants == when it's alone ?
Problem solved, for everyone having this problem, just make a conditional branch inside another conditional branch with GameTime.hour?
I used your Basic Game Time script, but it's not compatible with Khas Light Effects, so i have to use this one.
How do i set variable to store current game time?
I saw this section, but it's not updating my variable.
How do i set variable to store current game time?
I saw this section, but it's not updating my variable.
Code:
#Variables that count down each gametime second/minuteTIMER_VARIABLES = [1]
Hello Sir Vlue.. Thank you for this script its Awesome....
But I have a question regarding Inn. I have setup my Inn with a conditional branch using GameTime.change(nil,nil,7) and GameTime.set("addday",1). Now when I rest
at the Inn at 9PM Example Aug 6. I will wake up 7 AM , Aug 7 which is right. But If I sleep at 1 AM , Aug 7 then I will wake up at 7 AM of Aug 8. which is wrong. My Hero should wake up at 7 AM of Aug 7. I'm I right or wrong? Can you please help me.. I'm not that good at scripting and sorry for my english. Not that fluent.. 🤘 😀 🤘
But I have a question regarding Inn. I have setup my Inn with a conditional branch using GameTime.change(nil,nil,7) and GameTime.set("addday",1). Now when I rest
at the Inn at 9PM Example Aug 6. I will wake up 7 AM , Aug 7 which is right. But If I sleep at 1 AM , Aug 7 then I will wake up at 7 AM of Aug 8. which is wrong. My Hero should wake up at 7 AM of Aug 7. I'm I right or wrong? Can you please help me.. I'm not that good at scripting and sorry for my english. Not that fluent.. 🤘 😀 🤘
Try making a Conditional branch in the inn event with "Set handling for when conditions doesn't apply" ticked.
The conditional branch should have a script as condition, in your case:
GameTime.hour? < 7 (If hour less than 7, condition applied)
And there you add: GameTime.change(nil,nil,7)
In the ELSE, add: GameTime.change(nil,nil,7) and GameTime.set("addday",1)
So if hour is less than 7, it will only change the hour of the day, and if the hour is 7 or more, it will change hour AND day.
Hi Torqus..
Thank you for the quick response. I have edited my Conditional branch just the way you said and now its all ok. Oh.. I also change the "nil" to 0 too. SO that every time I wake up its 7:00 AM. If I have encountered a new problem I'll post it here. Thank you again and Vlue too for the awesome script.. 👍
Thank you for the quick response. I have edited my Conditional branch just the way you said and now its all ok. Oh.. I also change the "nil" to 0 too. SO that every time I wake up its 7:00 AM. If I have encountered a new problem I'll post it here. Thank you again and Vlue too for the awesome script.. 👍
Hello its me again.
I have a new question. How can I speed up the time? Because I want to test and adjust all of my custom tint. In the last "Basic Game Time and Night n Day v1.6.2" you can adjust the speed by changing the "Game Time Details at Time_Count" but in this new script "Advanced Game Time + Night/Day v1.6c" how can I adjust the time?
I have a new question. How can I speed up the time? Because I want to test and adjust all of my custom tint. In the last "Basic Game Time and Night n Day v1.6.2" you can adjust the speed by changing the "Game Time Details at Time_Count" but in this new script "Advanced Game Time + Night/Day v1.6c" how can I adjust the time?
Doesn't seem to be a script call for that... but you can create new events that add hours so every time you toggle the event you advance 1 hour, or 2 or 3.
Create a new event with this: GameTime.set("handle",n)
Where "handle" can be "addhour" and n the quantity of hours you want to add.
It says that in the commented section of the script, you just have to look for alternatives when you can't do something the way you know 😉
(Don't worry I'm bad at doing this too)
Ssh, I'm not actually here but...
You are looking for DEFAULT_TIMELAPSE around line 145.
In addition you can manipulate the variable defined by TIMELAPSE_VARIABLE (just below the above) to change the speed of time in game.
Wow totally missed that.
I also wanted to tell you, guessko2, that ctrl+F will be your friend when editing scripts. If you want to change speed of time just look for "speed", "velocity", "passes" things like that.
Ok i'll try it out.. Thanx for the quick response. 🤣
How can I make a shop that opens at 9:00AM?
This is probably an incredibly backwards way of doing this because I'm still pretty n00bish, but I created a system for my world through various common events that allows everything to open and close at certain times and also controls various aspects such as street lights turning on and off, & which NPCs are out and about depending on the time of day. It also causes two brief fade ins & outs, one at 7am and one at 10pm, so that it's not incredibly jarring and the lights and NPCs do not just appear and disappear.
Basically on my first map, there's a parallel process event that flips a bunch of switches, that last of which keeping it from looping. Because a certain switch is flipped, when the time equals a certain value, it does stuff, but also flips another switch so that when the time reaches another value later on, other stuff happens, and so on. I'm obviously terrible at explaining stuff, so here's a picture example.
Also a cool trick, the "debug time" common event makes it so that if you press a certain key, it instantly adds 5 seconds to the clock. It's a really good way to fast forward time to make sure stuff works without having to keep going back and editing how fast time moves. If these are incredibly obvious things I apologize, but I figure at least one or two n00bs who love this system might get some use out of it.

Basically on my first map, there's a parallel process event that flips a bunch of switches, that last of which keeping it from looping. Because a certain switch is flipped, when the time equals a certain value, it does stuff, but also flips another switch so that when the time reaches another value later on, other stuff happens, and so on. I'm obviously terrible at explaining stuff, so here's a picture example.
Also a cool trick, the "debug time" common event makes it so that if you press a certain key, it instantly adds 5 seconds to the clock. It's a really good way to fast forward time to make sure stuff works without having to keep going back and editing how fast time moves. If these are incredibly obvious things I apologize, but I figure at least one or two n00bs who love this system might get some use out of it.

Hello!
I've been looking through every single page om this thread but can't find answers.. and 3 days of trying to solve it myself hasn't worked either, this is why I just signed up here.
I've been trying to make a NPC appear and disappear from the map at different game times. Sounds simple! How very wrong I was...
I have this NPC with a hellova lot of event pages. (Different things to say during morning, day and night. Also there's a friendship system with variables, adding points to a variable and after the variable hits a certain level, Another dialouge appears for each timing of the day. If you have ever played Harvest moon, it's the very same idea).
OK, so I've tried to use a conditional branch on event page 1 of this NPC with no graphic (parallell process) that says:
@>Conditional Branch: Script: GameTime.hour? > 21 && GameTime.hour? < 11
@> Control Switches: [0001:] = ON
@>
: Else
@>
: Branch End
@>
Then, on page 2 with a condition that Switch 1 is ON and a graphic of the NPC (parallell process):
@>Conditional Branch: Script: GameTime.hour? > 11 && GameTime.hour? < 22
@>Control Switches: [0001:] = OFF
@>
: Else
@>
: Branch End
@>
All the other event pages also has the same switch ON as a condition. This will make the NPC appear invisible around the clock and also solid so I can't walk through the it.
I have also tried using another event "outside" the NPC event which turns the switch ON (deleting these on the NPC event ofc) and keep all the NPC's event pages on the condition to have the Switch ON. This'll make it possible to walk through the invisible NPC but it's still invisible 24/7 even on times that should turn on the switch..
So tell me guys, whan am I doing wrong? 🙂 The Pictures shows how it looks when I tried the event of switch-turning "outside" the NPC and the NPC:s condition on it's 1:st page. I might have misunderstood how conditional branches works?
Thanks!



I've been looking through every single page om this thread but can't find answers.. and 3 days of trying to solve it myself hasn't worked either, this is why I just signed up here.
I've been trying to make a NPC appear and disappear from the map at different game times. Sounds simple! How very wrong I was...
I have this NPC with a hellova lot of event pages. (Different things to say during morning, day and night. Also there's a friendship system with variables, adding points to a variable and after the variable hits a certain level, Another dialouge appears for each timing of the day. If you have ever played Harvest moon, it's the very same idea).
OK, so I've tried to use a conditional branch on event page 1 of this NPC with no graphic (parallell process) that says:
@>Conditional Branch: Script: GameTime.hour? > 21 && GameTime.hour? < 11
@> Control Switches: [0001:] = ON
@>
: Else
@>
: Branch End
@>
Then, on page 2 with a condition that Switch 1 is ON and a graphic of the NPC (parallell process):
@>Conditional Branch: Script: GameTime.hour? > 11 && GameTime.hour? < 22
@>Control Switches: [0001:] = OFF
@>
: Else
@>
: Branch End
@>
All the other event pages also has the same switch ON as a condition. This will make the NPC appear invisible around the clock and also solid so I can't walk through the it.
I have also tried using another event "outside" the NPC event which turns the switch ON (deleting these on the NPC event ofc) and keep all the NPC's event pages on the condition to have the Switch ON. This'll make it possible to walk through the invisible NPC but it's still invisible 24/7 even on times that should turn on the switch..
So tell me guys, whan am I doing wrong? 🙂 The Pictures shows how it looks when I tried the event of switch-turning "outside" the NPC and the NPC:s condition on it's 1:st page. I might have misunderstood how conditional branches works?
Thanks!



I don't imagine there's anyway to change the position of the clock within the menu? The only thing I see in the script is how to change the toggleable clock's position. Spectacular otherwise
I've been searching around everywhere but haven't found anything on it, so my last ditch attempt is to directly ask the source!
Basically it's a garden event, and I simply want to be able to water once, then have to wait the next day to water again. Basically the issue is if it's even possible to
let it know if a day has passed. Also I'm using In-game time, not (PC) real time, if that makes any difference.
Help from anyone would be greatly appreciated.
Basically it's a garden event, and I simply want to be able to water once, then have to wait the next day to water again. Basically the issue is if it's even possible to
let it know if a day has passed. Also I'm using In-game time, not (PC) real time, if that makes any difference.
Help from anyone would be greatly appreciated.
Original thread: https://forums.rpgmakerweb.com/threads/advanced-game-time.3851/