Two doors lead from a room. Opens one without asking which. Issue?

Hi again everyone.

It’s that time of year again and I’m making my annual Inform7 Christmas card. Thank you in advance for the help!

I have a hallway (I know this is just a room) and there are three ways a player can leave it, two of which are “blocked” by doors.

When I type “open door” it opens door1, without asking which door I’d like to open. If I specify “open door2” it opens. If I then type “close door” it closes door1 and if I type “close door” again it tells me the door is closed. If I specify close door2, it closes that door as well.

I feel like, despite there being nothing “wrong”, from what I read, it seems like the response to open door should be “which door?” or something like that. The fact it doesn’t, makes me worry something is untoward, and there may be a larger problem I’ll uncover later.

2 Likes

What you describe isn’t the behavior one would expect if one had done:

door1 is a door. door2 is a door. (in which case the parser wouldn’t recognize “door” as meaning either)

or

door 1 is a door. door 2 is a door. (in which case the parser would ask for disambiguation)

…at least, not without other things in the mix like understand assertions or does the player mean rules.

So we’re going to need source code. Could you please open a new project and create a minimal example story that demonstrates the issue and post it here?

I assume you’re using version 10.1.2?

Of course! Thank you for entertaining looking into it.

VOLUME 2 - THE SCHOOL

BOOK 1 - Arts Corridor

The Arts Corridor is a room.

The Arts Corridor is west of the Classdoor.

The description of the arts corridor is "a corridor".


Part 1 - Class door

The Classdoor is a door.

The printed name of the classdoor is "your new classroom door".

the classdoor door is a proper-named thing.



The description of the classdoor is "This is the door of your new classroom. You can tell that because of the way that it is."




Part 2 - Whip's Door

the Whip door is a door.

The printed name of the whip door is "Mrs. Whip's door".

the whip door is a proper-named thing.

the whip door is north of the arts corridor.


BOOK 2 - New Class

The newclassroom is a room.

the printed name of newclassroom is "Your New Classroom".

the newclassroom is a proper-named room.

The description of the new classroom is "your new class".



BOOK 3 - Whip's Room

whips room is a room.

whips room is north of whip door.

the printed name of whips room is "Mrs. Whip's room".

the whip room is a proper-named thing.

Only one of them (“Whip door”) has “door” as a word in its internal name, so only one of them gets recognized with the word “door”. The other one (“classdoor”) will only be recognized as “classdoor”, not as “class” or “door”.

1 Like

Ah, so it’s trying to be helpful?

So take out the spaces to “confuse it” and it will ask, or put gaps in all door names?

In general, players will only be able to refer to objects in two ways:

  • With the words used to define that object in Inform
  • With any words attached to the object via “Understand” lines

The printed name only controls what the game displays, not what the player can type. If you want the player to be able to type “door” to refer to the door, you’ll need to either:

  • Use the literal word “door” when defining the object (“class door” rather than “classdoor”)
  • Understand "door" as the classdoor.
1 Like

Thank you.

it creates lines like:

the class door door is a proper-named thing.

It runs fine but is this “correct”?

Why call it “the class door door” instead of just “the class door”?

Good question!

I think it is a find-replace artefact.