Inform 7 question: using a new type of text in a room

I think I have this almost figured out, but not quite.

What I want is to have night fall after a certain point in the game, after which some room descriptions will be different. I will make a scene called “nightfall” start when this has happened. Some room descriptions will stay the same. For the others, what I’d like to do is to give them a “night description” text, which prints instead of the description during the nightfall scene. Does this sound like a reasonable way to do things?

What I can’t quite get to is how to make the switch. Is there some simple thing I can do to alter the room-describing action so it draws from the “night description”, if there is one, during the “nightfall” scene?


[code]Nightfall is a recurring scene. Nightfall begins when the time of day is 7:00 PM. Nightfall ends when the time of day is 6:00 AM.

Forest Meadow is a room. “A wide forest meadow stretches out in all directions. [if Nightfall is happening]The full harvest moon hovers overhead.[otherwise]The orange sun casts lazy beams of shifting light through the rustling canopy of leaves overhead.[end if]”[/code]
You can get more fancy with it. I am pretty sure “is happening” is the phrase you want. Check the documentation on scenes to be sure.

Couple of other ways to do this: (not tested)

A room has a text called the night-description.

Nightfall is a scene.
When nightfall begins:
  repeat with R running through rooms:
    if the night-description of R is not "":
      now the description of R is the night-description of R.

If you want to get lower-level, you can redefine the “print the location’s description” phrase to print either the description or the night-description of the location, depending on time.

Thanks, both of you!–Zarf’s code works perfectly for what I had in mind (which was to avoid complicated descriptions with conditions, mainly for ease of revising and changing my mind and reading things myself) but there are a few more complicated spots where “[if nightfall is happening]” will be just ticket as well.