I have a fence

First I define a kind of thing called a fence, then make an instance of it.

Fence is a kind of door. Fence is closed. Fence is not openable. 
Fence is either opaque or transparent. It is transparent.
Description of the fence is "A rock wall at the base of vertical wrought iron bars. The wall is four feet high; the bars are another five feet above that, tipped by pointy barbs."
Understand "fence" or "rock wall" or "wall" or "bars" or "iron bars" as fence.

S_Fence is a fence. It is closed. S_Fence is transparent.
The S_fence is west of Thentis Road and east of SE_Graveyard.
Printed name of S_fence is "a rock wall and wrought iron fence".
Understand "fence" as S_fence.

I have a fence that can been looked through but the graveyard on the other side of the fence is not in scope, so although

look through fence

works fine to output a fixed text of the other side of the fence, which is a graveyard.
Since a graveyard is mentioned, I want

x graveyard

to give the description of that graveyard, but it gives me the default response that graveyard cannot be found. I tried placing it in scope but to no avail:

Instead of searching the fence: 
	say "Through the wrought iron fence, you see an ancient graveyard with an old        building in the middle of it. Perhaps architected around the Gothic style? The iron fence runs the entire perimeter of the graveyard. An eerie feeling causes you to shudder as you peer into the graveyard.";

Before examining SE_graveyard in Thentis Road:
	place SE_graveyard in scope;
	say "[the other side of S_fence]";

“Place X in scope” can’t be used like that. It only works within a “
deciding the scope of
” activity. See examples and exercises in 18.29.

Or to put it another way, scope is used by the parser.

By the time an “examining SE_graveyard” action exists, the parser has already needed to check if the word “graveyard” refers to anything the player can see—which means it’s too late to change the scope now.

I’ve read through the scope section in the document, even ran the example verbatim. I get a misused ‘while’ clause. I think the problem is that graveyard is a room, and scope works with objects. As a test, I entered this from the IF manual verbatim (changing the nouns) on a line by itself:

After deciding the scope of the player while at Thentis Road: 
     place the SE_graveyard in scope.

It’s okay to place a room in scope; I think the problem is actually a wrong syntax example in the documentation.

The docs suggest in 18.29 that one can do:

After deciding the scope of the player while in the Cloakroom: place the Beyond in scope.

But the given example (the one with the cloakroom and Johnny Depp) doesn’t compile.

The right wording is “while the location is”:

After deciding the scope of the player while the location is the Cloakroom: place the Beyond in scope.
1 Like

This syntax (“while in”) used to be part of Inform, but was removed a long time ago. Unfortunately the documentation wasn’t changed consistently to reflect this. Similar documentation bugs have been reported before.

This is frustrating. All I want to do is get the same response when the player LOOKS THROUGH DOOR as he does when he examines what he sees through the door. They should be synonyms. It seems that Inform leads one right up to that point, but then drops the ball. Any help as to how I can give the description of the graveyard from both LOOKING and EXAMINE commands? The big difference is that the graveyard is a room that seems to be out of scope.

St John,
Can you direct me to how a room can be placed into scope? I didn’t find it in the docs, and the compiler continues to give me an error on that point.

You almost had the right syntax in your post above. As mentioned, the documentation is unfortunately wrong where it says “while in the Cloakroom”; the right syntax is “while the location is”.

So, this works as a basic version or foundation:

Thentis Road is a room. "This is Thentis Road. Over in the graveyard, you see [a list of things in SE_Graveyard]."

SE_Graveyard is east of Thentis Road. "The graveyard is a gloomy place."
Understand "graveyard" as SE_Graveyard.

The tomb is in SE_Graveyard. The description of the tomb is "A big family tomb."

After deciding the scope of the player while the location is Thentis Road:
	place SE_Graveyard in scope.

Test me with "x graveyard/x tomb".

The player can examine the graveyard and the tomb from Thentis Road, because we have placed the graveyard and its contents in scope.

This can be extended or changed in various ways, depending on whether you need to display the exact state of the graveyard dynamically, including mobile objects.

For example, you can add something like this:

Instead of examining SE_Graveyard, describe locale for SE_Graveyard.

See also the other examples beneath section 18.29 in the docs.

1 Like
The view of the graveyard is scenery in Your Room Here.
Instead of examining the view of the graveyard or searching the gate


That’s the standard way to do it, rather than putting the room in scope directly.

1 Like

St John,

After deciding the scope of the player while the location is Thentis Road:
	place SE_Graveyard in scope.

seems convoluted. I never would have worked that one out. Thanks.

Thanks for these tips. I never would have thought ‘view’ was a thing, but I can try the scenery approach. Also, I am not familiar with ‘locale’. I’ll look into that.
Thanks all.

Nothing special about “view” here—it’s just the name I’m giving to a new object.

In other words, I’m creating a piece of scenery called the “view of the graveyard”. Since this bit of scenery is in Thentis Road, it’ll automatically be in scope, and the player can examine it. Then you can make that examining do whatever you want.

Daniel,
The problem isn’t the description. It is that there is no noun for examining. Players are not going to say “view of graveyard”, they’re going to say “examine graveyard” or look at graveyard". Even if they knew about “view”, they should still be able to “examine graveyard” since they were told there was a graveyard when they entered “look through fence”. Since the noun can’t be found, the parser kicks out and nothing gets executed except the default “can’t find a noun” error message.

St John,
This worked as I hoped:

After deciding the scope of the player while the location is Thentis Road:
	place SE_Graveyard in scope;
	say "[description of SE_graveyard]"

I will check but I might have to put the graveyard back when the player leaves Thentis Road.

Thanks much to all you who helped me think through this for your time and effort.

Players are not going to say “view of graveyard”, they’re going to say “examine graveyard” or look at graveyard".

If the player types EXAMINE GRAVEYARD, Inform will understand that as examining the “view of graveyard” item, unless there is another conflicting graveyard in scope.

You can also add The printed name of the view of the graveyard is "graveyard" to make sure that the “view of the graveyard” is always referred to as “the graveyard” in any output text. That way you get “You see nothing special about the graveyard” rather than “You see nothing special about the view of the graveyard.”

1 Like

Yep, as Petter says, the players can use any word in an object’s name to refer to it. So having “a view of the graveyard” lets the player X GRAVEYARD.

Thentis Road is a room. The Graveyard is a room. The iron gate is a door. It is north of Thentis Road and south of the Graveyard.

A view of the graveyard is scenery in Thentis Road. "This is the description of the graveyard as seen from the road."
Instead of searching the gate, try examining the view.

Thentis Road
In Thentis Road you can see an iron gate.

>x graveyard
This is the description of the graveyard as seen from the road.

In general, scenery is a good way to make something that can be examined, but doesn’t show up in room descriptions or TAKE ALL or the like. Very convenient for background things.