Door puzzle

I’m trying to figure out how to let the player finish three cryptic messages on the wall/door, which are supposed to be passwords that open a secret door in the wall. After the player finishes all three messages, three images are supposed to appear on the door, and then it opens. But I’m not certain how to program this and I’m having trouble messing with the secret doors. Inform 7 isn’t recognizing secret doors for some reason I think.

EDIT: I’m going to just make it a locked door. But I’m still trying to figure out the rest of this. Am I going to need to use the extensions for this?

My Easy Doors extension will let you create a door object you can move around, to a location from off-stage to make it appear, and doesn’t have to lead a direction.

Or more simply, make an enterable container that is described as a door you can move around, and write a rule to move the player to another location after entering it.

The Secret Doors extension was broken for a while. It may still be. (I seem to recall fixing it at some point and uploading a new version, but I may be having an old-guy brain fart.)

Here is my code so far.

[code]When play begins, say “Test.”

The Room of Rooms is a room. The description of the Room of Rooms is “The room looks like it’s made out of ancient stone and it completely surrounds all sides. There are no visible doors or windows, but there are some strange symbols and writing on the wall ahead.” The wall ahead is north of the room of rooms and south of the second room. The description of the wall ahead is “There are three circles on the wall. Each one has the same line written underneath it with ‘Here rests the…’ The end of it is blank. There is a cryptic message above the three circles.”

The first line is a part of the wall ahead. The second line is a part of the wall ahead. The third line is a part of the wall ahead. The description of the first line is “Here rests the…” The description of the second line is “Here rests the…” The description of the third line is “Here rests the…”[/code]

Is there some way for the player to edit the description of each wall part to the right combination and then have the door open with a message?

I’m trying out different pieces of code like the password run programs and the actions to try to pull this off. But so far I’m just getting lots of error messages.

Ah, I see. Try something like this?

A puzzle line is a kind of thing. A puzzle line has some text called the current state. The description of a puzzle line is usually "The line [if the current state of the item described is empty]is blank[else]says '[current state]'[end if]."

Instead of setting a puzzle line to a topic:
    now the current state of the noun is the substituted form of "[topic understood]"; [ Set the 'current state' property to what the player typed. ]
    say "You alter the line to read '[topic understood]'.".

Instead of pushing the doorbell: [ This opens the door if all three are correct. ]
    if the current state of the first line is "xyzzy" and the current state of the second line is "plugh" and the current state of the third line is "plover":
        say "You hear a satisfying clicking sound.";
        now the heavy door is unlocked;
    otherwise:
        say "Nothing much happens.";
        now the heavy door is locked.

The Antechamber is a room. The Dungeon is a room. The heavy door is a locked door. It is north of the Antechamber and south of the Dungeon. The first line, the second line, and the third line are puzzle lines incorporated by the heavy door. A doorbell is part of the heavy door.

Test me with "open door / x first / set first to xyzzy / x first / push doorbell / set second to plugh / set third to frotz / press doorbell / x third / set third to plover / x third / press doorbell / open door".

Output:
[rant]>[1] open door
It seems to be locked.

[2] x first
The line is blank.

[3] set first to xyzzy
You alter the line to read “xyzzy”.

[4] x first
The line says “xyzzy”.

[5] push doorbell
Nothing much happens.

[6] set second to plugh
You alter the line to read “plugh”.

[7] set third to frotz
You alter the line to read “frotz”.

[8] press doorbell
Nothing much happens.

[9] x third
The line says “frotz”.

[10] set third to plover
You alter the line to read “plover”.

[11] x third
The line says “plover”.

[12] press doorbell
You hear a satisfying clicking sound.

[13] open door
You open the heavy door.[/rant]

This is a pretty easy solution.

You can also create an object that is initially nowhere, and later becomes interactable by moving it into scope at the appropriate moment.

By the way, naming a location “Room of Rooms” is likely to give Inform hiccups. First because “room” already means a category of things, and second because duplicating a word in any object’s name causes parser problems.

For the sake of clarity, I would recommend coming up with a coding name for the place, and changing the printed name to “Room of Rooms”. Like so:

Junction is a room.  The printed name of Junction is "Room of Rooms".  Understand "room of rooms" as Junction.

Don’t forget to make your enterable door object fixed in place!

Thanks this helps Alot!

Actually I’ve run into a few errors with this and I’m not sure how to fix it. One error isn’t related to this puzzle directly but it has to do with the default messages.

  1. If I type:

I get:

How can I block out certain default messages?

  1. I found out that you can any of the puzzle lines to any combination. So you could the first line to read what the second line is supposed to read.

  2. The door for some reason won’t open despite the coding.

I’m not sure what’s going on.

Show your code?

Sorry I wasn’t sure if I needed to.

Here you go:

[code]The Room of Rooms is a room. The description of the Room of Rooms is “The room looks like it’s made out of ancient stone and it completely surrounds all sides. There are no visible doors or windows, but there are some strange symbols and writing on the wall ahead.” The description of the wall ahead is “There are three circles on the wall. Each one has the same line written underneath it with ‘Here rests the…’ The end of it is blank. There is a cryptic message above the three circles.”

The first line is a part of the wall ahead. The second line is a part of the wall ahead. The third line is a part of the wall ahead. The description of the first line is “Here rests the…” The description of the second line is “Here rests the…” The description of the third line is “Here rests the…”

A puzzle line is a kind of thing. A puzzle line has some text called the current state. The description of a puzzle line is usually “The line [if the current state of the item described is empty]is blank[else]says ‘[current state]’[end if].”

Instead of setting a puzzle line to a topic:
now the current state of the noun is the substituted form of “[topic understood]”; [ Set the ‘current state’ property to what the player typed. ]
say “You alter the line to read ‘[topic understood]’.”.

Instead of opening the door: [ This opens the door if all three are correct. ]
if the current state of the first line is “Here rests the eye” and the current state of the second line is “Here rests the screaming man” and the current state of the third line is “Here rests the star”:
say “The eye, the screaming man, and the star all appear in the circles.”;
now the wall ahead is unlocked;
otherwise:
say “Nothing much happens.”;
now the wall ahead is locked.

The wall ahead is a locked door. It is north of the room of rooms and south of the second room. The first line, the second line, and the third line are puzzle lines incorporated by the wall ahead.

Test me with “open door / x first / set first to here rests the eye / x first / open wall ahead / set second to here rests the screaming man / set third to here rests the star / x third / open wall ahead/ set third to here rests the star / x third / open wall ahead / open door”.

After going to the second room, say “Test.”

Junction is a room. The printed name of Junction is “Room of Rooms”. Understand “room of rooms” as Junction.[/code]

Uh, when I said you should make a room not named “Room of Rooms,” I didn’t mean “add yet another confusingly named location to your code.” :stuck_out_tongue: I meant you should have just one location with a title that is not “Room of Rooms.”

Two things I notice apart from the duplicate rooms: your text comparisons are case sensitive, and your instead rule intercepts all attempts to open the door whether it’s unlocked or not. If you want to do it that way you should put a “continue the action” at the end of that rule.