>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