Story file see two rooms only as an apartment

(I am not using quotation for the code as it will be very confusing)

I have created two rooms “Lobby and Apartment-1”
The printed name for Apartment-1 is declared as “Apartment 1”
I have created the Hallway (not as a room) only as west of the Apartment-1
The lobby is on ground floor.

Above the lobby (up command) is the Hallway.
To the east of the Hallway is Apartment-1.
(Hope this make sense as it will be very difficult to post the code as it is scattered around in a few places)

I can enter the lobby from the road by using the command “e”, “east” or “enter lobby” (works fine)
I can go up to the hallway by using the “up” command (works fine)

This is where the problem starts.

I can only enter Apartment-1 by using the command “enter apartment” or “e” or “go east”
When I try to use the command “enter apartment-1” or “enter apartment 1” the message say “You can’t see any such thing”

The same happen when I am in apartment-1 and wants to enter the Hallway.
I can only enter the Hallway by using the command “enter apartment” or “w” or “go west”
When I try to use the command “enter hallway” the message say “You can’t see any such thing”

I have checked my code over and over again to see if I have declared “Apartment-1” or “Hallway” as “apartment” and I found nothing.

When I add the testing code "Understand “door” as Apartment (to see if Apartment exists) I receive and error in the results tab.
So I take it the wording Apartment does not exist as my search through the code suggested.

Now I am in the dark as I can’s seem to figure out what went wrong.

The only thing I can think of is the fact that I haven’t declare the “Hallway” as a room but only as an area west of the room.

If that is the case I don’t know how to fix it other than creating the “Hallway” as its own room.

Before trying that I first wanted to find out if there might be an easy fix as I planned to use this method a lot in the future development of my project.

Any advice or ideas other than create a room. :grinning: :grinning: :grinning:

This is a little hard for me to follow – honestly, when posting an issue it usually is worth the trouble to pull together all the relevant code to create a small example that demonstrates the problem, both because it makes it easier for folks to troubleshoot and also because many times in doing that, you’ll figure out what’s going on!

Anyway, couple things:

  • Hallway is its own room – if you tell Inform that something is a compass direction from another room, it deduces that that other thing must also be a room (in fact, you don’t even need to explicitly create the first room – the line “Lab is east of Closet” will compile and create two new rooms). So implicitly creating new rooms just via setting the compass directions is a fine approach.

  • By default, ENTER [ROOM] doesn’t do anything – the entering action is for movement within a room, like getting on a supporter or into a container. The one exception is ENTER DOOR, which the Standard Rules automatically convert into a going action. So the “you can’t see any such thing” errors are expected behavior. Now, from the fact that ENTER LOBBY moves you from the road to the lobby indicates that maybe you’ve written some code to change that default behavior – or there’s a door down there – but without seeing what you’ve done it’s hard to know exactly what’s going wrong. Are you looking for a generalized approach so that ENTER ROOM will move the player into an adjoining room? If so, that’s pretty easy to pull together!

  • By default, Inform recognizes the actual name of an object as how the player might want to refer to it – so if you create a big orange ball, the adjectives will automatically be recognized (X ORANGE will examine the ball). But it doesn’t do the same thing with a printed name, so if you create a ball with the printed name “big orange ball” X ORANGE will get you “You can’t see any such thing.” So if you want the parser to recognize “Apartment 1” as referring to apartment-1, you need to manually set that up (though note that by default rooms aren’t in scope from neighboring rooms).

Hope this is useful!

3 Likes

Thanks much appreciated

I know without code it is more difficult, and I usually put in code but in this case it was really difficult to add the code so that the reader could understand. I have tried it but thought it was very confusing. (Just my few cents on this topic)

I understand your explanation and I does make sense.
I will need to go check how and where this could be relevant in my code not sure where but hopefully I found it sooner than later.
.

1 Like