Midnight increses day

I’ve been using this scriptto try and make it so that shops open and close at certain times in my game , but I have a huge problem - it only works if the time is exactly closing time. If the player waits an hour the time never reads 6pm so my “At 6pm” script never runs! And if they sleep at night, it’s ground hog day every day! Is there a way to track if the player goes over? Like for example:

[code]
Before Waiting:
Store time;

After waiting:
If Time is less than stored time:
Increase days;[/code]

Or

Between 6pm and 7pm:

Can anyone help me do this? :stuck_out_tongue:

How did you implement “waiting an hour”?

Some possibilities are given in this previous post: [url]https://intfiction.org/t/is-there-a-way-to-make-scheduled-actions-trigger-every-day/8600/1].

Wow, thanks a lot! That really works! :smiley: I’ll post the full modified script so everyone can use it.

Draconis, here you go, the extended waiting script is created by the ‘Waiting more’ rules:

[code]A timepiece is a kind of thing.

A watch is a portable timepiece. A clock is a timepiece.

A general time is a kind of value. The general times are defined by the Table of Apparent Time.

Table of Apparent Time
general time start time
early morning 4:00 AM
dawn 6:00 AM
morning 7:00 AM
mid-morning 9:00 AM
mid-day 11:00 AM
lunch-time 12:00 AM
afternoon 1:00 PM
mid-afternoon 3:00 PM
early evening 5:00 PM
dusk 7:00 PM
evening 9:00 PM
night 11:00 PM
late night 2:00 AM

Time-checking is an action applying to nothing.

Report time-checking:
if no timepiece is visible:
say “It feels about [the current general time].” instead;
otherwise:
say “The time is [time of day + 1 minute].”;

Report time-checking:
if no timepiece is visible,
say “It feels about [the current general time].” instead;
otherwise say “The time is [time of day + 1 minute].”

Understand “check time” and “time” as time-checking.

To decide what general time is the current general time:
let T be a general time;
repeat through the Table of Apparent Time:
unless the time of day is before the start time entry, now T is the general time entry;
decide on T.

Waiting more is an action applying to one number.

Understand “wait [a time period]” or “wait for [a time period]” or “wait for a/an [a time period]” or “wait a/an [a time period]” as waiting more.

Carry out waiting more:
let the target time be the time of day plus the time understood;
decrease the target time by one minute;
while the time of day is not the target time:
follow the turn sequence rules.

Check waiting more:
if the time understood is greater than 4 hours, say “You really don’t feel like waiting around that long.” instead.

Report waiting more:
say “You wait…”

[After going:
increase the time of day by 10 minutes;]

Day is a kind of value. The days are Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday. The current day of week is a day that varies.

The current day is a number that varies.

Month is a kind of value. The months are defined by the Table of Months. The current month is a month that varies.

When play begins: the DayRollsOver at 12:00 am.

At the time when the DayRollsOver:
increase the current day by 1;
we need to enqueue the timed event in 30 minutes from now;
if the current day is greater than the length of the current month:
now the current day is 1;
now the current month is the month after the current month;
Say “[line break]A new day comes…”;
if the current day of week is Saturday:
now the current day of week is Sunday;
Say “[line break]A new day comes…”;
otherwise:
now the current day of week is the day after the current day of week;
Say “[line break]A new day comes…”;
At the time when we need to enqueue the timed event:
the DayRollsOver at 12:00 am.

Table of Months
month length
January 31
February 28
March 31
April 30
May 31
June 30
July 31
August 31
September 30
October 31
November 30
December 31

To say CurrentDate:
say “[current day of week], [current month] [current day]”.
[/code]

Yeah, it looks like that should do it. I was wondering whether you were using the “while the time of day is not the target time: follow the turn sequence rules” method or not–if you just set the time of day directly, it skips over everything in between.