So, Inform has a really neat, included system of time, which works marvelously…the first time. If, for example, I set something up a variable to increment at 11:59, it increments whether the time ever actually “lands on” 11:59 or not. (That is, if I have an action that takes an “hour” to complete, and undertake it at 11:30, the day will still properly increment, even though the player never takes a turn on 11:59 precisely.). But this only works once. If the clock reaches 11:59 again, nothing happens. I’ve scripted a clumsy workaround (in case anyone finds this thread by googling):
[code]Days elapsed is a number that varies. Days elapsed is usually 0.
A weekday is a kind of value. The weekdays are Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday. The current weekday is a weekday that varies. The current weekday is Friday.
DayToggle is a number that varies. DayToggle is usually 0.
Every turn:
If the time of day is after 11:59 PM and DayToggle is 0:
now DayToggle is 1;
now Days Elapsed is Days Elapsed + 1;
now Current Weekday is the weekday after Current Weekday;
If the time of day is before 2:00 PM and DayToggle is 0:
now DayToggle is 1;
now Days Elapsed is Days Elapsed + 1;
now Current Weekday is the weekday after Current Weekday;
If the time of day is after 2:00 PM and the time of day is before 11:59 pm and DayToggle is 1:
now DayToggle is 0;
Hourtesting is an action out of world. Understand “HOURTEST” as Hourtesting.
Carry out Hourtesting:
Increase the time of day by 1 hour.
6Hourtesting is an action out of world. Understand “6HOURTEST” as 6Hourtesting.
Carry out 6Hourtesting:
Increase the time of day by 6 hours.
[/code]
But while this should work in my game, (I think) it’s very ugly relative to the elegant simplicity of “at 11:59, do X,” and it does have the potential to break, in theory, if the player were somehow to undertake an exceptionally long action. While I don’t intend to allow any such actions, it still feels like there must be something simpler and surer that I’m missing. Is there a way to make the native scheduling language work on all days, rather than just the first time the appointed hour arrives?