I have a problem with scenes : it seems like a scene which ends after a long time… never ends, in fact.
I tried this :
[code]“TimeTest2” by Stephane F
World is a room.
The DayNumber is a number that varies. The DayNumber is 1.
Instead of sleeping :
say line break ;
let Z be a random number between 300 and 600 ;
repeat with X running from 1 to Z
follow the turn sequence rules ;
Noon is a recurring scene.
Noon begins when the time of day is 12:00 pm.
Noon ends when the time since Noon began is 1 minute.
When Noon begins :
say “[time of day] : Noon[roman type].”.
When Noon ends :
say “[time of day] : A new afternoon begins[roman type].”.
Midnight is a recurring scene.
Midnight begins when the time of day is 12:00 am.
Midnight ends when the time since Midnight began is 1 minute.
When Midnight begins :
increment the DayNumber ; say “[time of day] : Midnight.”.
When Midnight ends :
say “[time of day] : A new day begins (day [DayNumber]).”.
Night is a recurring scene.
Night begins when the time of day is 10:00 pm.
Night ends when the time since Night began is 960 minutes.
When Night begins :
say “[time of day] : Night falls.”.
When Night ends :
say “[bold type][time of day] : The sun rises.”.
You can sleep and pass hours and days, the scene " night " (supposed to end after 960 minutes) never does. While the other scenes work.
Beside that, when I type " scenes " it gives crazy sh*t like that :
6:26 am (day 2) > scenes
Scene ‘Entire Game’ playing (for -154 mins now)
Scene ‘Noon’ ended
Scene ‘Midnight’ ended
Scene ‘Night’ playing (for -934 mins now)
(Scene monitoring now switched on. Type “scenes off” to switch it off again.)
How can a scene have a negative length ?
“time since” is clock time, so it can’t be more than 24 hours and it can be negative. (Actually I’m not sure the modulo is handled right. It would be more useful if the result were 0-to-24-hours, or else -12-to-12-hours.)
There’s no “turns since scene began”, so you’ll want to record the turn count in a “when scene begins” rule and then make comparisons to that.
I’m … sorry but I don’t understand your answer.
960 minutes equals 16 hours, so, my scene " Night " should run from 10 pm to 6am then stop. But it doesn’t !
and I don’t understand why the game tells me " Scene ‘Entire Game’ playing (for -154 mins now) ". Why is the number negative ?
6 am is before 10 pm on the clock. So if the scene started at 10 pm and it’s now 6 am, then the “time since the scene began” is negative.
Right - Inform’s clock starts over each day, it has no actual built in concept of “Yesterday” or “Tomorrow”. I’ve worked around this by having it keep a “daycount” every time the clock hits 00:00 and consulting that in the rules as well as the “time of day”.
I think I should mention that Stéphane worked it out now! Thanks to you all!