Adding a Sun backdrop to Ex. 183 "The Hang of Thursdays"


Trying to add the Sun as a backdrop to the example 183. The Hang of Thursdays (Writing with Inform), I manage to start with the Sun, then get it to disappear at night, and never have it return.

I don’t understand why it doesn’t reappear in the morning… :frowning:

Here is the code:

[code]“The Hang of Thursdays”

The Stage is a room. Rule for printing the name of the stage: say “[current weekday] [current time period]” instead.

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 Saturday.

A time period is a kind of value. The time periods are morning, afternoon, evening, night. The current time period is a time period that varies. The current time period is afternoon.

The sun is a backdrop. The sun is everywhere. The description of the sun is “[sun phase]”.

To say sun phase:
if the current time period is:
– morning:
say "The fat sun shines gleefully on the fresh leaves. ";
– afternoon:
say "The sun, having just passed its culmination, still shows no intentions of setting—or settling. ";
– evening:
say "Red and tired, the sun slowly proceeds to its daily retirement. "

This is the new advance time rule:
if the current time period is less than night:
now the current time period is the time period after the current time period;
if the current time period is night, now the sun is nowhere;
now the current time period is morning;
now the sun is everywhere;
now the current weekday is the weekday after the current weekday.

The new advance time rule is listed instead of the advance time rule in the turn sequence rules.

Test me with “x sun / x sun / x sun / x sun / x sun / x sun” …


I have added “now the sun is everywhere” in the New advance time rule, but it doesn’t seem to do the work.


It does come back - if I’m not misunderstanding, what’s happening is that when you try to examine it when it’s not there, nothing “happens” so the turn doesn’t advance. Here’s what I got (I added a line to your source to print the time of day every turn, just to check) -

Oh, so when an action fails, the turn doesn’t advance?

That’s something fundamental that I totally missed… :laughing:

Hey, thanks!

No, time does usually advance when an action fails. But this is a case where the parser has failed to interpret the player’s command as any action; and that doesn’t cause time to advance.

Thanks for clarifying this, jrb!

FWIW, I would probably handle this not by having the sun disappear as an object, but by changing its description when night is active to note its absence.