The Dialog docs are very clear about how to create a hyperlink for a specific fixed action (like “open the drawer”), or a hyperlink whose target is just the name of an object. But I can’t figure out how to make a link whose associated input contains both a fixed verb and a noun which can vary. For example:
You feel an inexplicable attraction to (link [kiss (the $Person)]) {(the $Person)}.
… so that when you click “the mysterious gentleman”, the input KISS THE MYSTERIOUS GENTLEMAN is produced. The code above fails with the error “Nested rules are only allowed inside rule heads”, presumably because [kiss (the $Person)] doesn’t actually produce a list by querying (the $Person).
I tried simplifying it to:
You feel an inexplicable attraction to (link [kiss $Person]) {(the $Person)}.
… which compiles, but when clicking the link, only the word KISS is produced, with no noun. It appears I don’t understand how to produce a list in Dialog clearly enough to get the effect I want; is this possible?
That’s basically the way to do it, yeah. You can clean it up slightly by putting the “kiss” inside the (collect words), but one way or another you’ve gotta assemble a list.
I normally write some utility predicates for that sort of thing so I don’t have to write it out. In Miss Gosling, for example, all the links for actions on specific objects are in the link bar, built with an easily-extensible system.
The parameter of (link $) needs to be a list of dictionary words that get turned into a command, and $Person is an object, not a dictionary word. Unfortunately, the only way to turn it into a list of words is (collect words).