Changing descriptions

I’m having problems setting up the second room in my first game, any help would be appreciated:

I have a key in a wall, and I want the wall description to change as you examine the wall further.
However, I also want the wall description to reset when you remove the key from it.
It’s this second bit I can’t get to work, whatever I try, it keeps telling me that there might be a key in the wall.

An example of a failed attempt:

The walls are here.
The walls are scenery.
The walls contain a key.
The description is “The walls are … blah blah blah”

If we have not taken the key, instead of examining the walls for the second time, say “Is there something in the wall?”
If we have not taken the key, instead of examining the walls at least twice, say “Is that a key in the wall?”
If we have taken the key, instead of examining the walls, say “The walls are … blah blah blah”

Can anyone help? Thanks.

You can’t start a rule with an if-clause; you’ve got to do it the other way around and first tell Inform what kind of rule you’re writing (an instead rule or an after rule or …?), then you put any conditionals inside the rule. Like this:

[code]The walls are here.
The walls are scenery.
The walls contain a key.
The description is “The walls are … blah blah blah.”

Instead of examining the walls: if we have examined the walls and we have not taken the key, say “Is there something in the wall?”; otherwise continue the action.
[/code]

Please, please don’t make players examine something twice to find the hidden object!

I agree. This kind of puzzle, in which there’s no initial nudge that would lead the player to undertake further examination, is almost guaranteed to annoy your players.

On top of which, in most IF the walls are not important. Even if you mention the walls in the room description (something like “The walls are panelled in dark oak”), it won’t occur to many players that the walls should be examined even once.

Also … I hate to ask, but what is a key doing sticking out of the middle of a wall? I find that more than a bit odd. A key tucked into the dirt in a potted plant or hidden under a rug makes some kind of sense.

If the walls are brick, and if your room description, after mentioning the brick walls, says something like, “The grout holding the bricks in place is chipped and cracked,” the puzzle becomes much more reasonable, first because you’ve called the player’s attention to the grout and second because a little cranny where some grout has fallen out would be a natural hiding place for a key.

–JA

Thank you for all the help.

I agree, I hate examining things twice too, so I changed it so that the first examination hints at something, the second tells you what is there. Here is my successful, but incredibly long, solution:

Context: a tiny snail has been made sick by swallowing a key, and has left it behind in it’s now freakishly large slime trail. The snail tells you he feels sick which was supposed to make people look at the trail, but now I think they might try to break open the snail. This is okay, as killing the snail is punished by a negative score, and the player doesn’t need the key (they can break a window to get into the locked shed instead).

I guess, however, that if people don’t normally examine the walls, I should put the key in the ooze instead…

Thanks again

I figure that’s a wise choice.

Also, you actually don’t need those instead rules at all. Put it all inside the description of the ooze/trail instead:

The description of the ooze is: ”The wall is disgusting, the green ooze looks like its moving, reaching out to touch you.[if the key is in the ooze and we have not examined the key] There is some kind of thingy in the ooze.[if the key is in the ooze and we have examined the key] There is something in the ooze, it looks like a key.”

And players will appreciate it, if you put in a couple of synonyms for the ooze and for the key in the ooze (so they can type X TRAIL and X THINGY). (I’m pretty sure players will try to examine the something in the ooze rather than reexamine the ooze, after you tell them there’s something in it.)

[code]Understand “trail” as the ooze.

The description of the key is: "[if the key is in the ooze]There is something in the ooze, it looks like a key.[otherwise]Gee! This is the key to everlasting fortune!!!”
Understand “thingy” as the key when the key is in the ooze.[/code]

Thanks a lot! It looks like I have a lot to learn about the programming language (-: