Appending text to a room description

I want to append some dynamic text to room descriptions. For example, to include a description of the weather.

[code]
Weather-value is a kind of value. The weather-values are be clear, cloudy, light-rain, medium-rain, heavy-rain.

The weather is a weather-value that varies. The weather is medium-rain.

A region can be indoors or outdoors.

Definition: a room is outdoors if it is in an outdoors region.

[This doesn’t work:]
Rule for printing the description of an outdoors room (called the item):
say “[description of the item][weather-description][paragraph break]”.

[ This has a paragraph break before the weather description, which I want to get rid of: ]
Before printing the locale description of an outdoors room:
say “[weather-description][paragraph break]”

To say weather-description:
if the weather is light-rain:
choose a random row in table of light rain;
say “[Text entry]”;
if the weather is medium-rain:
choose a random row in table of medium rain;
say “[Text entry]”;
if the weather is heavy-rain:
choose a random row in table of heavy rain;
say “[Text entry]”.
[/code]

The “before printing the local description” part works, but it includes a paragraph break after the room description and before the weather description, which I’d like to get rid of.

The “rule for print the description…” part doesn’t work at all. I was trying to follow 17.20 in the manual but it doesn’t seem to work. I want to get rid of the paragraph break between the room description and the weather description but I don’t know how to do it.

One interesting thing about backdrop items is that they are usually scenery, but don’t have to be. Instead of fiddling around with the room description details (always a headache), why not just say:

The weather is a backdrop. The weather is not scenery. The inital appearance of the weather is “[weather-descriptor]”. The weather is everywhere. [or: The weather is in every outdoor room.]

Endosphere

edit: oops, suggested “description” rather than “initial appearance.”

Well that doesn’t really work, because the description is still printed with a paragraph break after the room description. ALso, inform seems to complain about statements like “The weather is in every outdoor room.”

Sorry, I misread you intention there. What you instead may want to do is make a text token for the description of each room, and append the weather description after that.

For example:

A room has some text called the roomstate. The roomstate of a room is usually “”.

OR:

To say roomstate of (x - a room):
if x is the vale:
say “Whatever.”

The description of a room is usually “[roomstate][weather-description]”

The Vale is a room.

Does that mean I can’t use a syntax like

West Field is a room. "You are in the west end of a large, grassy field. You see a dilapidated shack." 

to define a room and its description? I’d really like to keep that, after all I’m only going to write the weather code once but I will be writing a lot of room descriptions.

This seems to do what you want, though you’ll have to expand the weather-description code:

[code]The Lab is a room. “Here you are in the IF Lab.”

To say weather-description:
say “It’s raining.”

This is the with-weather rule:
let R be the location of the player;
say “[description of R] [weather-description]”.

The with-weather rule is listed instead of the room description body text rule in the carry out looking rulebook.[/code]
I figured it out by switching on rules in the game to see what rule was running just before the room description was printed. Then I looked up the room description body text rule in the Standard Rules. This procedure doesn’t always work, but in this case it did.

Is this the sort of thing that Room Description Control can help with?

I don’t know, what is that?

It’s an extension by Emily Short. I’ve never looked at it before, so I skimmed through the documentation just now. My guess is that it will not do what you want, but you might want to look it over anyway. Maybe the source will give you some ideas.