Mentioned: I don't understand why this isn't working

Hi everyone. I’ve got fairly involved room descriptions, and I’d like to avoid “You can see thing thing and thing here.”

I’ve searched the forums, and everything I’ve seen about the Mentioned property says I should be putting things I don’t want to turn up in the “You can see…” in brackets.

However,

The office is a room. The description of the office is "The office contains a [desk]."

The desk is in the office. The description of the desk is "The desk is brown wood."

consistently gets me

The office contains a desk.

You can see a desk here.

when the player walks into the office.

I feel like I’m going crazy. Can you help me understand what I’m missing here, please?

Well, the good news is that the code you posted doesn’t have the problem–if you compile it you just get “The office contains a desk.” Similarly if you add another room and have the player walk in and out.

The bad news is that that means that you’re having another problem. Is there anything else that might be interfering–like another thing called a “desk,” perhaps?

1 Like

Those lines, in a project by themselves, work as expected.

Is it possible you’ve accidentally created two desk objects in the game? (The TREE debug command may help here.)

2 Likes

Thanks for the quick replies! I’m at the very beginning of my work, so while I had planned on adding a second desk, it’s not built yet. The more complete version of the things in this particular chapter, with a line about the players characters to make it compilable, is below:

The yourself can be John or Mary. The player is John.

The Office is a room. The description of the office is "[if unvisited]This is the answering machine message.[paragraph break][end if][if the player is Mary]The room is practically empty - you don’t know how John can live like this. The view from the window certainly is lovely, and you can see how one could grow fond of objects d’arte like the bird sculpture and the ewer on pedestals in the corners, but it’s so...bare. The large television panel practically blends into the wall, and the monochrome painting hardly brightens things up. The [desk] and chair stand out in bright contrast to the sharp concrete angles of the rest of the space, the way John stands out in any room.[end if][if the office is visited and the player is John]The office is where you do all your best thinking. Just lounge in the chair, put your feet up on the [desk], look out the picture windows at the view, and...ruminate. The television and the painting are just distractions from the view, really. There’s a are a few other art pieces around, like the bird sculpture and the ewer on their pedestals, but nothing you’re sentimental about.[end if]"

A desk is in the office. The desk is a supporter. The description of the desk is "[if the player is John and John does not have the sunglasses]You picked out this [desk] with its red-marble top and gold scrolling at Harrods because you like the way it stands out against the brutalist concrete of the rest of the flat. The old-fashioned land-line telephone and answering machine you keep because Mary has proven psychologically incapable of calling your mobile sit on the desktop next to a little keepsake box. Your [sunglasses] rest on the corner of the [desk] where you laid them last night.[end if][if the player is John and John has the sunglasses]You picked out this [desk] with its red-marble top and gold scrolling at Harrods because you like the way it stands out against the brutalist concrete of the rest of the flat. The old-fashioned land-line telephone and answering machine you keep because Mary has proven psychologically incapable of calling your mobile sit on the desktop next to a little keepsake box.[end if][if the player is Mary]The style of the [desk]’s gold decorations and embellishments can be triangulated somewhere between 'Rococo,' 'Baroque' and 'Thing You’d Pay Far Too Much For At Harrods.' John's sleek telephone and new-fangled answering machine sit on the red-marble top alongside an a little box that’s somehow ornate and understated at the same time. Anything would look understated atop this [desk], you suppose. [end if]"

Some sunglasses are on the desk. The sunglasses are wearable. The description of the sunglasses is "[if the player is John and John is not wearing the sunglasses]They’re the height of fashion. [end if][if the player is John and John is wearing the sunglasses]They’re hard to see when they’re on your face, but they certainly make you feel more secure when you’re wearing them. You look damned good in them, too.[end if][if the player is Mary]The [sunglasses] are probably expensive and stylish in equal measures. You’re glad you’ve known John long enough to get a bead on his mood even when you can’t see his eyes.[end if]"

This is giving me:

Office
This is the answering machine message.

You can see a desk (on which are some sunglasses) here.

These are the only places in my entire game text so far that contain the word “desk.” “Sunglasses” appears in one of the character descriptions, but that’s not in this chapter.

Here’s your problem. You’re defining a property here: the “yourself” object has a property that can be set to either “John” or “Mary”. But then you check whether “John does not have the sunglasses”, which requires an object named “John”.

What you probably want to do is change the variable “the player” to point to an object named “John”. (By default, as you’ve seen, it points at the object named “yourself”.)

John is a man. Mary is a woman. The player is John.

Ah, you’re running into the “Nonempty supporters are always shown in the room description” surprise. See chapter 3.8. And, for one way to change this, chapter 18.28.

Thanks, draconis and zarf! Two things that certainly would have caused problems.

But when I change my sample game text to start with

John is a man. Mary is a woman. The player is John.

The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook. 

and continue with all the rest of the code in my post above, I’m still getting

Office
This is the answering machine message.

You can see a desk (on which are some sunglasses) here.

Is there some kind of refresh or cache to clear? I feel like I’m doing this properly now, but it’s being stubborn.

On the initial turn, the room is ‘unvisited’, which will print only the ‘this is the answering machine message’. I assume you want Mary to be the one to hear the answering machine upon her first visit? You might want to change [if unvisited] to [if the player is Mary and Mary had not been in Office]. If you want the sentence to be at the end of the room description, in its own neat little paragraph, move the whole sentence to the end and put [paragraph break] before it.

Probably the root of your presented problem is that you need to define the desk as ‘scenery’, and a supporter. Being a supporter, it’s already fixed-in-place, and can’t be moved, but you need to –

A desk is here.  It is a supporter and scenery.  etc etc

Supporters aren’t automatically scenery, though they are automatically fixed-in-place.

This will nicely eliminate the desk from the you-can-also-see list.

I hope this helps!

Ok, thanks. Making the desk scenery got rid of the “You can see” line. That’s awesome! But I have sunglasses in brackets in the description of the desk, and when I look desk, I get

You picked out this desk with its red-marble top and gold scrolling at Harrods because you like the way it stands out against the brutalist concrete of the rest of the flat. The old-fashioned land-line telephone and answering machine you keep because Mary has proven psychologically incapable of calling your mobile sit on the desktop next to a little keepsake box. Your sunglasses rest on the corner of the desk where you laid them last night.

On the desk are some sunglasses.

And I added a painting to the room and put its mentions in brackets in the room description. I don’t want to make the painting scenery, because it has to be moved later. I got

Office
This is the answering machine message.

You can see a painting here.

(For the record, “This is the answering machine message” is just a stand-in for a longer passage that describes several things happening and a change in the game state. I don’t want the player to get the description of the room until they look.)

So I feel like I’m back at square one. Scenery isn’t showing up in “You can see,” but anything else I put in brackets still is.

For the record, this is my current test code:

John is a man. Mary is a woman. The player is John.

The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook. 

The Office is a room. The description of the office is "[if unvisited]This is the answering machine message.[paragraph break][end if][if the player is Mary]The room is practically empty - you don’t know how John can live like this. The view from the window certainly is lovely, and you can see how one could grow fond of objects d’arte like the bird sculpture and the ewer on pedestals in the corners, but it’s so...bare. The large television panel practically blends into the wall, and the monochrome [painting] hardly brightens things up. The [desk] and chair stand out in bright contrast to the sharp concrete angles of the rest of the space, the way John stands out in any room.[end if][if the office is visited and the player is John]The office is where you do all your best thinking. Just lounge in the chair, put your feet up on the [desk], look out the picture windows at the view, and...ruminate. The television and the [painting] are just distractions from the view, really. There’s a are a few other art pieces around, like the bird sculpture and the ewer on their pedestals, but nothing you’re sentimental about.[end if]"

A desk is in the office. The desk is a supporter and scenery. The description of the desk is "[if the player is John and John does not have the sunglasses]You picked out this [desk] with its red-marble top and gold scrolling at Harrods because you like the way it stands out against the brutalist concrete of the rest of the flat. The old-fashioned land-line telephone and answering machine you keep because Mary has proven psychologically incapable of calling your mobile sit on the desktop next to a little keepsake box. Your [sunglasses] rest on the corner of the [desk] where you laid them last night.[end if][if the player is John and John has the sunglasses]You picked out this [desk] with its red-marble top and gold scrolling at Harrods because you like the way it stands out against the brutalist concrete of the rest of the flat. The old-fashioned land-line telephone and answering machine you keep because Mary has proven psychologically incapable of calling your mobile sit on the desktop next to a little keepsake box.[end if][if the player is Mary]The style of the [desk]’s gold decorations and embellishments can be triangulated somewhere between 'Rococo,' 'Baroque' and 'Thing You’d Pay Far Too Much For At Harrods.' John's sleek telephone and new-fangled answering machine sit on the red-marble top alongside an a little box that’s somehow ornate and understated at the same time. Anything would look understated atop this [desk], you suppose. [end if]"

Some sunglasses are on the desk. The sunglasses are wearable. The description of the sunglasses is "[if the player is John and John is not wearing the sunglasses]They’re the height of fashion. [end if][if the player is John and John is wearing the sunglasses]They’re hard to see when they’re on your face, but they certainly make you feel more secure when you’re wearing them. You look damned good in them, too.[end if][if the player is mary]The [sunglasses] are probably expensive and stylish in equal measures. You’re glad you’ve known John long enough to get a bead on his mood even when you can’t see his eyes.[end if]"

A painting is in the office. The description of the painting is "[if the player is John]John hates this painting.[end if] [if the player is Mary]Mary loves this painting.[end if]"

You can eliminate the ‘on the desk…’ message by saying

The examine supporters rule does nothing when the noun is the desk.

The examine supporters rule lists anything that might be on a supporter when you examine it. The thing you need to do is make sure you have some other way for the player to see what’s on the supporter, such as placing a list of those items in brackets within the description–

The description of the desk is "You like to put a lot of things on this desk, which now has [the list of things which are on the desk] on it, as it's the only surface in the room."

To prevent the ‘you can also see’ message, you can also give the object an ‘initial description’ paragraph–

A painting is here.  "Hanging on the wall is the notorious painting".  The description is "[if the player is John]You hate this painting, but Mary loves it[otherwise]You love this painting, but John hates it[end if]."

Initial descriptions are put in quotes just like a room description, without a ‘the description is’ (which would make the sentence the description of the object when examining it). When the item is picked up, however, the initial description is no longer displayed when the object has been dropped (after which you will get the ‘you can also see’ message).

But as you stated, you want it only in the room description. You’re getting that message because the room description is printing only the ‘unvisited’ message–so the painting is still ‘unmentioned’ when the parser gets to the ‘you-can-also-see’ stage, where it prints the list of take-able objects in the room. It won’t get to the [painting], because your [if] tokens skip over it in the initial turn, so the painting goes ‘unmentioned’ and gets mentioned at the you-can-also-see stage. So what you can do here is say

Before listing nondescript items in The Office:
    if the painting is marked for listing:
        now the painting is not marked for listing.

That will discount the painting from the list of nonscenery items in the room, which are not on or in something. The thing about this is that you will want to change your room description to reflect the painting (and other objects like this) having been taken or moved.

You don’t have to say ‘A painting is in the Office.’ You can make it ‘A painting is here.’, as long as the Office is the most previously mentioned room as a subject of a sentence (such as ‘Office is a room’ or ‘Office is south of Tipperary.’).

I hope that this helps!

You can also do the ‘Before listing…’ thing with other objects like that, by simply saying, within the rule above–

….
   if the ewer is marked for listing:
        now the ewer is not marked for listing;
….

Just be careful to make sure you alter the room description accordingly when they are moved.

You can also simply replace the examine supporters rule (the Standard Rules code that handles listing the contents of supporters when examining them) with one of your own that honors the mentioned property.

This is the relevant code in the Standard Rules (line 2835):

Carry out examining (this is the examine supporters rule):
	if the noun is a supporter:
		if something described which is not scenery is on the noun and something which is
			not the player is on the noun:
			say "On [the noun] " (A);
			list the contents of the noun, as a sentence, tersely, not listing
				concealed items, prefacing with is/are, including contents,
				giving brief inventory information;
			say ".";
			now examine text printed is true.

You can replace this by adding something like this to your own code:

Carry out examining (this is the new examine supporters rule):
	if the noun is a supporter:
		if something described which is not scenery which is not mentioned is
			on the noun and something which is not the player is on the noun:
			repeat with possibility running through described things on the noun:
				now the possibility is marked for listing;
				if the possibility is mentioned:
					now the possibility is not marked for listing;
			say "On [the noun] " (A);
			list the contents of the noun, as a sentence, tersely, not listing 
				concealed items, prefacing with is/are, including contents, 
				giving brief inventory information, listing marked items only; 
			say ".";
			now examine text printed is true.

The new examine supporters rule is listed instead of the examine supporters rule in the carry out examining rules.

The same thing can be done for containers by replacing the examine containers rule.

It seems to me that if you want this to preempt the entire description, you-can-see and everything, the way to cut the Gordian knot is to write a rule that cuts off the looking action the first time you do it. Like this:

This is the describe the office for the first time rule: 
	say "[bold type]Office[roman type][line break][run paragraph on with special look spacing]";
	say "This is the answering machine message.";
	now the office is visited. 
	
The describe the office for the first time rule substitutes for the describe room gone into rule when the location is the office and the actor is the player and the office is unvisited.

This is on the assumption that the Office isn’t the starting location and that the player will be going to the office rather than being sent there as the result of another action (like “Instead of jumping in the crawlspace: move the player to the office.”) If that’s going to happen, things get a bit more complicated.

Anyway, the rule for printing the room description after going isn’t actually a rule for looking, so I tried a special rule to substitute that. The good thing about this approach is that it completely cuts off the production of the room description that prints all the you-can-also-see business, so you don’t have to play whack-a-mole with any new things you might create that would affect the room description; you can just be sure that this text and only this text will show up the first time you go to the office, and only then.

BTW I noticed that your code for the sunglasses in the description of the desk checked to see whether the player had the sunglasses. It’s a good idea to make that check whether they’re on the desk instead–if the player has picked up the sunglasses and put them somewhere else, you don’t want them to wind up back in the desk’s description!

1 Like

Thank you so much, everyone. I think I have it working the way I’d like now. Your advice and expertise are all much appreciated as I start off this journey with Inform! :slight_smile:

2 Likes

I remember all the headaches I had when I made my first game. I hope you will stay with it. If you have any more questions, don’t hesitate to ask us.

1 Like