? descriptions that vary with player location

As part of learning the Inform7 language, I’m trying to define a room with a staircase leading to a landing and then to the second floor.

[code]The Mid Central Hall is north of the Central Hall. “You are in the middle of the central hall. The front door lies to the south, and the back door lies to the north. There is a staircase here that leads up to the second floor.”

A staircase is a kind of door. A staircase is usually open. A staircase is seldom openable. Understand “stairs” or “stair” or “staircase” as a staircase. Understand “upstairs” or “downstairs” as a staircase.

Instead of climbing a staircase:
try entering the noun.

Understand “ascend” and “descend” as climbing.

The Central Stairs is a staircase. It is above the Mid Central Hall and below the Landing. “The staircase leads up to a landing.”

The Landing is above the Central Stairs. “The landing has oil portraits of people you don’t know.”

The Upper Stair is a staircase. It is above the landing and below the Second Floor Hall. “The stairs continue to the second floor.”
The problem I’m having is, when on the landing, I see the following description

I’d rather it said something like “There are stairs leading up and down from the landing.”, of at least “the stairs lead down to the hallway. the stairs lead up to the second floor.”

I’m guessing there’s some kind of “say phrase” but I can’t suss out what it is.

I tried

The Upper Stair is a staircase. It is above the landing. "[if below the Upper Stair]The stairs continue to the second floor.[else]Stairs lead down to the landing.[end if]"

But got a translation error.

Any insight would be appreciated.

I’m not sure of the best way to handle this situation overall, but you can use “[if the location is X]” as a condition.

So probably the easiest way to do this would be to make the stairs scenery and put the text into the room descriptions. You could also write a special Rule for writing a paragraph about… that would list all staircases and mark them all mentioned but that’s overkill in this case.

FYI, re what’s happening, it’s - I believe - because the way that you defined the names of the staircases makes Inform believe it’s their, er, starting text, or whatever. Like if you said,

A hammer is in the toolshed. “A hammer is lying around, collecting dust.”

then when you entered the toolshed you’d see the room description AND this initial text, which is a nifty way of describing objects before they’re handled. If you then picked it up and dropped it, this text wouldn’t repeat, it’d just display “You can also see a hammer here”.

Which brings me to an important point, if you try to examine the staircases you’ve created in this fashion you’ll see only the generic description; because you have not actually written a description for them, only their initial text. You do have to say something like “The description is, yadda yadda yadda”. Or “Their description is”. To play it safe, you can just go “The description of the Central Stairs is”.

Apart from that detail, definitely make them scenery.

Since you declared staircases as a kind of door, you might as well go ahead and say that staircases are usually scenery. That should do the trick nicely, shouldn’t it?

EDIT - You allude to an automated way of making sensible text for describing where the staircases lead to. That is certainly possible, but I wouldn’t recommend it unless you’re planning to do seriously dynamic stuff (besides, it’s probably far too complex for your needs; it’s possible, but not trivial). For the VAST majority of cases, as Draconis said, you need only make them invisible (make them scenery) and then just write their existence yourself into the room description.

EDIT 2 - Also:

The Upper Stair is a staircase. It is above the landing and below the Second Floor Hall. “[if player is in Landing]The stairs continue to the second floor.[otherwise]Stairs lead down to the landing.”

Doing it this way is definitely feasible. It’s more automated. You can go that route if you want to (just remembr to add descriptions as well) Then if you change your mind you can add the line “A staircase is usually scenery.” and add the stairs to the room description.

You’ll note that you actually include the staircase in the room description for the Mid Central Hall in your example, and not on the other rooms. It’s a case of picking one way of doing it and sticking to it.

EDIT 3 - In case anyone’s wondering, yes, I did mis- and re-interpret the original post as I was writing various replies. Just to be safe, I left all of my replies in. The “kitchen sink” method; SOMETHING’ll be useful to the OP.

wow, thanks! Those are great suggestions. The scenery trick plus putting the descriptions of the stairs into the rooms they connect seems to work well.