Can't make my door work!

Sorry, probably a very simple fix, but I’m stumped.

I,m making an escape room; here’s the code:

"escape-room" by "TheTechRobo".
The Starting Place is a room.
In the Starting Place is a safe.   It is a closed, locked, opaque container.   The safe is fixed in place.
The description of the safe is "It's a small safe, about a cubic foot, with a keypad on the front, laid out the same as a cellphone keypad. It has four dots."
The safe has a number called the combo. When play begins, now the combo of the safe is 1234.  Understand "keypad" as the safe.

Typing on it is an action applying to one number and one thing. Understand "type [a number] on [something]" as typing on it.

Check typing on it:
        if the second noun is not the safe:
                instead say "You don't know how to do that to [the  second noun].";
        if the second noun is unlocked:
                instead say "[The second noun] is already unlocked."

Carry out typing on it:
        say "As you type each digit, the corresponding dot lights up.";
        if the number understood is the combo of the second noun:
                now the second noun is unlocked;

Report typing on it:
        if the second noun is unlocked:
                say "The lock clicks unlocked.";
                say "You type the number on the keypad, but nothing happens."

The Next Room Door is a locked door in the Starting Place. The matching key of the door is the key. The Next Room Door is east of Room 2.

The R1 Key is in the safe. The R1 key unlocks the Next Room Door.

Room 2 is a room. It is west of the Starting Place.

The Final Countdown is a room. "thanks to you for playing, and these resources:".

When I compile it, it says:

→ The Next Room Door seems to be a door which is present in a room to
which it is not connected, but this is not allowed. A door must be in one
or both of the rooms it is between, but not in a third place altogether.

When I add “and west of the Starting Place” to the door’s definition, it says

→ You wrote ‘It is west of the Starting Place’ (source text, line 31), but
in another sentence ‘The Next Room Door is east of Room 2 and west of the
Starting Place’ (source text, line 27): but this looks like a
contradiction, which might be because I have misunderstood what was meant
to be the subject of one or both of those sentences.

What am I doing wrong? Thanks!

Regular doors don’t go in rooms, they go between them.

The Next Room Door is a locked door. It is west from the Starting Place. It is east from Room 2.

Ah, that would explain it. Thanks! :smiley:

1 Like

…when declaring where they are, although you can ask if they are in a room they lie between with

if (door) is in (room) ...
  • which is true for the room adjacent to the door which was last occupied by the player
if (door) is enclosed by (room)...
  • which is true for either of the rooms adjacent to the door.
1 Like