Help with Inform character interactions


Sat, 12 Aug 1995 02:54:50 GMT

I could use some assistance getting the "Ask" verb in Inform to work.

Here's the basic scenario: One of the earliest actions the player can take
is obtaining a handful of nuts from the town baker. The nuts are on the
counter in the bakery, and attempting to take them without permission gives
the standard error message. If the player chooses to "ASK ABOUT" or
"ASK FOR" the nuts, however, the baker will give permission to take them.

Here's the general code I have so far (only the text to print has been
changed so as not to give anything away):

Nearby Baker "baker"
with name "baker" "cook" "man",
description "Blah blah blah blah...",
life [;
Ask: if ((noun == 'nuts') && (self hasnt general)) {
print "Player can now take nuts.";
give self general;
}
"Default reply for asking about anything else.";
],
has animate;

This way, the player should logically be able to type "ASK BAKER ABOUT NUTS,"
and the baker will reply that he doesn't need them and the player can have
them. Then I give the baker the 'general' attribute, which is checked for
in the code of the nuts before the 'Take' action can occur:

Nearby Nuts "handful of nuts" Counter
with name "nuts",
description "Blah blah blah...",
before [;
Take: if (Baker hasnt general) "Maybe you should ask first.";
],
has edible scored;

Make sense so far? The problem is that, when I actually compile it and
type "ASK BAKER ABOUT NUTS," it always drops through to the default for some
reason. Same problem with the "AskFor" verb (which I've left out here).

Similar problems occur when I try to compile the "sullen snake" example from
the Inform manual -- some of the text Graham has programmed simply will not
appear.

Suggestions, anyone?