Re: Help with Inform character interactions


Sun, 13 Aug 1995 07:31:53

In article <1995Aug12.025450.36157@rs6000.cmp.ilstu.edu> ceforma@rs6000.cmp.ilstu.edu (Christopher E. Forman) writes:
>From: ceforma@rs6000.cmp.ilstu.edu (Christopher E. Forman)
>Subject: Help with Inform character interactions
>Date: Sat, 12 Aug 1995 02:54:50 GMT

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

>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;

>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).

This is because the variable noun is equal to baker, not nuts. In the request:

ask baker about nuts

'noun' equals baker. 'second' equals nuts. If you change line 5 of the first
chunk to:

Ask: if ((second == nuts) && (self hasnt general)) {

it should work.

Vikram Ravindran