# Need some help on constructing puzzles.

Ok, I’m pretty sure there is a standard solution to my problem, but searchign the inform 7 docs is a nightmare. I’m trying to build a detective story and can’t figure out how to do the following:

• Initially the player is handcuffed to the radiator. While chained up, he obviously can’t move between rooms, take items or look inside containers. I got as far as putting handcuffs in his inventory and making them worn (the player has a concealed key, so he can trivially remove the cuffs).
• The room contains three objects that need to be examined for clues. Only when all three are examined, a conclusion is printed once. I got as far as using an “After examining…” rule that increases a counter variable. I check the counter every turn using something like “if cluecounter is 1 for the first time, say “Your head starts to clear up a bit, images from last night flash by, but you need more clues to grasp them.”;”. Problem: the message is not printed once, but every turn as long as the clue counter is 1.
1. easy enough: Instead of doing anything other than looking or examining when the player wears handcuffs, say “You’re a prisoner, dude.”

2. a puzzling question in itself…

1. When the clue is printed, just increase the number again?

Rephrasing 2)

The detective (the player) is handcuffed to the radiator with a terrible hangover. Naturally, the current objective is to find out how that happened. There are three objects in his office that will unlock his memories after all three have been inspected (I don’t want to spoil here, so I won’t go into details). The objects can be inspected in any order and the player can do anything in between inspecting them. Once the first object is examined, the game is suppose to say something like “Images of last night flash by, but nothing connects. You need more clues” after the normal item description. The second object should be a bit more concrete: “You get a foggy vision of what happened last night, but you need another clue” (of course, the normal item description is printed as well). When the third object is examined, the game is to tell the player the events that took place and led to the detective being chained up.

Oh yes: little extra challenge: when the play begins and the cluecounter is 0, the game should print “Your head spins. You got one heck of a hangover” right after, not before the room description.

I think “After looking for the first time:” will do that.

How about: set the clue counter to 0 to start off with, then once that message prints for the first time, increase it to 1?

When play begins: (or however you want to instantiate it)
Now the cluecounter is 0.

If the cluecounter is 0:
say “You have a massive hangover.”;
Now the cluecounter is 1. (Or, increase the cluecounter by 1)

If you use an extension which implements an “examined” property (which is not hard to code yourself if you aren’t), you can have an “after examining when the X is examined and the Y is examined and the Z is examined for the first time” rule.

I think I’ve learned enough I7 to be able to help people. So that’s a thing in my life.

Somewhere Kind of Familiar is a room. “[if unvisited]Your head spins. You got one heck of a hangover. Wait. Why are you wearing handcuffs?[otherwise]At least you think it’s kind of familiar.[end if]”.

A pair of handcuffs are a wearable thing. The description is “Pink and fuzzy and connecting you to the radiator.” The player wears the handcuffs.

The radiator is a thing in Somewhere Kind of Familiar. The description is “The immovable, unbreakable thing you are attached to.”

Instead of doing anything other than examining, looking, or taking inventory, say “Oh yeah. Handcuffs.”

The empty bottle is a thing in Somewhere Kind of Familiar. The description is “An empty bottle of Jager. Someone isn’t having a good morning.”

The magic marker is a thing in Somewhere Kind of Familiar. The description is “You can smell it from over here. Don’t people realize that if you leave the cap off, it’ll dry up?”

A men’s razor is a thing in Somewhere Kind of Familiar. The description is “It looks extremely used. Bits of hair are everywhere.”

The cluecounter is a number that varies. The cluecounter is 0.

After examining the empty bottle for the first time:
present a hangover clue.

After examining the magic marker for the first time:
present a hangover clue.

After examining a men’s razor for the first time:
present a hangover clue.

To present a hangover clue:
increment the cluecounter;
if the cluecounter is 1:
say “Your head starts to clear up a bit, images from last night flash by, but you need more clues to grasp them.”;
else if the cluecounter is 2:
say “That’s right. Shots. Lots and lots and lots of shots. You strain to remember more.”;
otherwise:
say “Yes, you remember the laughing! Laughing at you and whatever they drew on your head! That’s when you notice all the hair on the ground. Your hair. Oh man, pledging this fraternity was such a bad idea.”

test me with “look / x handcuffs / x radiator / x bottle / x bottle / take bottle / x marker / x razor”.[/code]

K, got it working now. Thanks for the advice. Now it’s cleanup and red herring stuffing time. Speaking of cleanup:

The player carries the plain key, the handcuffs and the breathmints.

inv
You are carrying:
a plain key
a handcuffs (being worn)
a breathmints

Is there any way of telling I7 that handcuffs is a plural noun? I could work around it by calling it a pair of handcuffs, but somehow I think the problem is so common that there has to be a build-in handler for it.

Give the object the “plural-named” property.