I’m shooting for a secret switch that is revealed when a certain CD is played in a boombox. This works fine. The secret switch is using the combination lock code from the “Safety” example in 17.6 in Writing with Inform.
I want to be able to enter a three digit code number and have a secret door revealed that is unlocked and open leading into the final prize room. I’ve tried modifying the code I’ve pasted below with a few different options, but nothing seems to help. The treasure room door is never revealed even if the proper code is entered. Also I can’t seem to get a “You got the code wrong” message to work. Not even sure how to report an unsuccessful action.
[code]The back wall is a secret switch in the Basement. The treasure room door is a secret door. The treasure room door is unlocked. The treasure room door is south of the Money Room. The treasure room door is north of the Basement.
The description of the back wall is "[if the back wall is revealed]You’ve clearly located the source of the scraping bricks you heard when you played the Buckaroo Banzai soundtrack. Twelve bricks in three rows of four all protrude from the wall. The mortar between and around the bricks is gone. You gingerly reach out and touch one of the bricks in the top row and find that it slides in easily. Pressing another brick in the top row causes both bricks to slide back out immediately after you push it in. Evidently, there’s a right way and a wrong way to press the bricks.
You distinctly remember a puzzle similar to this in an old text adventure game you and Corey played. It took both of you several hours of frustrating tries and retries before you figured out what to do. You had to create a three number combination indicating which brick in each row to press. Once you knew that, you had to say ‘press the bricks with’ the correct combination.
The funny part of this is that both of you raged about the ‘Brick Puzzle’ at every opportunity citing it as an example of cruddy game design. Eventually, any poorly designed anything was immediately labeled as a ‘Brick Puzzle’.[otherwise]You can’t see anything special."
Understand “bricks” as the back wall.
Pressing it with is an action applying to one thing and one number.
Understand “press [something] with [a number]” as pressing it with.
Check pressing it with:
if the noun is not the back wall,
say “[The noun] does not depress.” instead.
After pressing the bricks with 341:
now the treasure room door is revealed;
now the treasure room door is open.
Report pressing it with:
say “This time the bricks stay put. After a moment, an entire section of the brick wall slides noiselessly back on a swivel revealing an unlocked steel door.”
Understand “steel door” as the treasure room door.
The description of the treasure room door is “It’s a burnished, stainless steel door. It’s unlocked.”[/code]
I’ve included the Secret Rooms extension code as well in case you’re unfamiliar with it.
[code]Secret Doors by Andrew Owen begins here.
“Doors and switches that cannot be acted upon until they are
discovered.”
A secret door is a kind of door.
A secret door can be revealed or unrevealed.
A secret door is unrevealed.
A secret door is scenery.
A secret door is closed.
A secret switch is a kind of thing.
A secret switch can be revealed or unrevealed.
A secret switch is unrevealed.
A secret switch is scenery.
To print the you can’t go message:
say “[We] [can’t go] that way.”
To print the you can’t see message:
say “[We] [can’t see] anything special.”
Before going through a secret door which is unrevealed:
print the you can’t go message instead.
Before doing something to a secret door which is unrevealed:
print the you can’t see message instead.
Before doing something when a secret door is the second noun and
the
second noun is unrevealed:
print the you can’t see message instead.
Before doing something to a secret switch which is unrevealed:
print the you can’t see message instead.
Before doing something when a secret switch is the second noun and
the
second noun is unrevealed:
print the you can’t see message instead.
Secret Doors ends here.[/code]
Any help would be appreciated. Thanx in advance.