Scheduling problems (and "now scene is happening")

Seems like I’m always asking questions these days. :slight_smile: This time, the issue is with scheduling events. Or rather, with what happens when I turn back the clock, expecting an event to repeat itself.

This code will illustrate my problem.


Bigroom is a room. The description is “Nothing to do but wait for 5 o’clock…”.

When play begins:
now the time of day is 3 PM.

At 5 PM:
say “Congratulations, it’s five o’clock! Do it again!”;
now the time of day is 3 PM.

At 4 PM:
say “Halfway there!”.

Carry out waiting:
increase the time of day by 20 minutes;
say “You wait a bit. It’s now [time of day]”.[/code]

On my first playthrough, everything fires as correctly. But when the clock is set back to 3 PM, none of the schedule events re-fire. I can sort of understand why this would be a design choice, but I would very much like the ability to reset certain scenes in the project I’m working on - scenes which rely heavily on scheduling.

Of course, maybe I’m just missing something in the manual where it said “Scheduled events will only fire once. If you want to override this behaviour, here’s the magic word.”

Incidently, on the off-chance that this is a bug - could I ask that someone report it? I’m having trouble logging onto the bug reporter thingamajig. Through a CAPTCHA error and it being late at night, I ended up registering two usernames and receiving no confirmation e-mail for either.

And PS - could I ask about whether some syntax like “now scene X is happening” and “now scene X ends” is likely to be implemented? I’ve always sorely missed its existence. Since time and again it is a problem that doesn’t seem to be addressed, I was wondering - why? Is it hard to implement? Does it bring other sort of problems? I can understand that. It’s just that if you think there’s no demand - well, there’s demand. :slight_smile:

This is either a bug or undocumented feature. There’s discussion and workarounds in this thread:

It is not likely because it would encourage bad design. The manual chapter 10.9. explains the reasoning behind this.

Thank you imensely for your help. That other thread did shed light, and so did re-reading 10.9 with a more careful eye.

The time issue might be worth reporting as a bug. Unfortunately, I can’t do it myself, as I said…

Incidently, regarding the scenes, if anyone of the development team is interested: I’ve tried to use scenes as a way to see what is going on, and act upon that information. I’ve tried to use scenes to replace a variable I always used - something like story=0 for the game’s beginning, story=1 for the next day… and then simply check “if story==1 then etc etc etc”.

I suppose I can’t do it like this with scenes. Sure, I can check if a certain scene is happening, but changing a scene involves changing other things - whereas I want other things to change because of the scene changes. Heh, I’ve been fooling myself all this time. :slight_smile: Ah well, just in case you’re interested in my experience with “scenes”, developers.


Dreadfully sorry, but the method I was using, which is saying “Every turn when the time of day is X:XX”, doesn’t work. I mean, it works, but I have actions which take longer than others, and therefore it’s possible - even likely - that although I may schedule events for five o’clock, the ingame clock may well jump from 4:56 to 5:06, thus skipping this entirely.

So I still need help…

If you want to, you can have a variable attached to a scene that tells it to be over, and change that. (“The Long Vacation Scene ends when the endflag of Long Vacation Scene is true.”)

This is still different from allowing “now the Long Vacation Scene is over”, because it forces scene changes to occur at specific places in the action sequence; otherwise, things can get pretty tangled up.

Hmmm, what a curious thought. Of course, it’s not really different from just having a numeric variable, and yet it is a nice compromise that allows me to take full advantage of Inform’s features. Thanks for the tip!

Incidently, my original problem is still unsolved. I point this out because, since I edited my post, it might not have been obvious…

You can take Emily’s suggestion one step further and write your own phrase that will set the scene’s flag. As Emily mentioned, the scene won’t end immediately, but it will end as soon as the scene-changing mechanism allows it to. This is what I mean:

[code]A scene has a truth state called the endflag.

To end (S - a scene) as soon as possible:
now the endflag of S is true.[/code]

So now you can say “end the Long Vacation Scene as soon as possible” (substitute your preferred phrasing).


If you mean the events not firing twice, you have to re-schedule them from within the event itself (coding from memory): At the time when all heck breaks loose: say "The fan, the feces, the flinging it at action."; All heck breaks loose at 4 pm.

Oh my, what an ingenious workaround - I never would have thought of that. Not as convenient as “At 4PM”, of course, but then, it is a workaround.

It’s too late right now, but I’ll be sure to try it tomorrow and edit this post with the results.

EDIT - How curious. It sort of worked.

I mean, what happened was, if I edited my the code on my first post to implement Ron’s suggestions, I ended up with odd behaviour… the timer fired every turn after 4 PM, with the 4 PM warning, instead of just at 4 PM.

But a simple flag took care of that, and as far as I can see, it’s working wonders. :slight_smile: Whew, this was a lengthy process. Thanks to everyone for their input.