I’m trying to define a custom verb ‘use’ which will be used like ‘use X on Y’ where X and Y are any two nouns in scope of the current room. Here’s what I have so far:
[ UseSub; "There's no obvious way to use ", (address)noun, " on ", (address)second, "."; ];
Include "Grammar";
Verb "use" * noun 'on' noun -> Use;
...
Object -> FritzwigInbox "Fritzwig's inbox"
with name 'box' 'inbox' 'Fritwig inbox' 'Fritzwig^s inbox' 'mail' 'mailbox',
description ...,
before [;
...
Use:
print "You have used the ", noun;
if(noun=='Fritzwig') {
print "used inbox on fritz, stringily";
rtrue;
}
if(noun==Fritzwig) {
print "used inbox on fritz, symbolically";
rtrue;
}
],
...
the default handling prints out garbage for noun and second, even if the verb was used as expected e.g. use hammer on nail. When I ‘use inbox on fritzwig’, I see a non-zero address for noun, but neither condition is matched so I’m guessing it’s set with an unrelated value.
Why aren’t noun and/or second getting set with the relevant nouns in my verb definition above? Are there other variables that I should use to access the noun arguments of the use verb?