Stating Direction(s) in description

First let me say, I have read all 34 pages of this forum (really) and looked at all the in editor docs to answer this before posting.

As I have seen in other worlds (such as Bronze) there is a way to give an items direction (N,S,E,W etc.)

In Bronze it looks like:

“An iron-barred gate leads [gate direction].” in the source, which produces:

“An iron-barred gate leads north.” in the game.

The best I can get without a compile error that states:

“Problem. In the line ‘The printed name of a door is usually “a door to [other side][door direction]”’ , I was expecting that ‘door direction’ would be something to ‘say’, but it didn’t look like any form of ‘say’ that I know. So I tried to read ‘door direction’ as a value of some kind (because it’s legal to say values), but couldn’t make sense of it that way.”

Is:

“You can also see a door to Berth 11 and a door to Berth 12 here.”

Using:

The printed name of a door is usually “a door to [other side]”.

I have tried placing the [door direction] in other places… such as in the description, but continue to get the same error. I picked Bronze apart looking for a clue, and I am sure I am missing something obvious. But I can’t seem to find it.

What am I missing here?

Thanks for any help.

The thread from a couple of days ago called “Making ‘go left’…” gave me a clue. Try something like this:

The Lab is a room. The iron door is a door. The iron door is south of the Lab and north of the Crypt. The printed name of the iron door is "door [direction of the iron door from the location]ward to [the other side]".

You may be able to adapt that idea to what you’re trying to do.

Thanks! That works if I put it in the individual door descriptions. The only thing I don’t like is then each is printed on a separate line with a blank line in-between.

Using ‘The printed name of a door is usually “a door to [other side]”.’ prints them all on one line with commas between them.

But hey, it works! It is what I will use if I can’t figure out how to do it the way I was trying to.

Thanks again!

First, you need to use “item described” rather than “door” in the printed name:

The printed name of a door is usually "door [item described direction] to [the other side]".

Second, Emily has defined a couple of custom phrases to do the job.

She has this say-phrase to say what direction a door is in:

To say (item - a thing) direction: let place be a random room; let the place be the other side of the item; if the place is visited, say "[way through the item] to [the place in lower case]"; otherwise say "[way through the item]".
And this phrase to decide what that direction is:

To decide what direction is the way through (threshold - a door): let far side be the other side of threshold; let way be the best route from the location to the far side, using even locked doors; if way is a direction, decide on the way; decide on inside.

If you haven’t done that already, add those, and you should be able to make it work (I think).

– EDIT
“[item described]” refers to the very object that has the text property that it occurs inside (very often, in other words, precisely the object that is described by that text).

After playing around a bit with what you posted, I found this works:

To decide what direction is the way through (threshold - a door):
let far side be the other side of threshold;
let way be the best route from the location to the far side, using even locked doors;
if way is a direction, decide on the way;
decide on inside.

To say (item - a thing) direction:
let place be a random room;
let the place be the other side of the item;
if the place is visited, say “[way through the item] to [the other side]”;
otherwise say “[way through the item]”.

The printed name of a door is usually “a door leading [direction of item described from the location] to [the other side]”.

Now when I enter the area I get this:

You can also see a door leading west to Berth 11 and a door leading east to Berth 12 here.

Perfect! Just what I was looking for. Thanks to both of you!