Problem with conversations/tables

This is kind of a weird behavior of text tokens in topics. I don’t think there’s any obvious way to get Inform to be able to parse a topic token like “[big blue book]” when the book is not in scope. A little background on that here.

One way to solve this might be to add all the relevant things to scope when asking it about, which I think can be done without putting them in scope for other actions. But you’d have to loop over all the relevant things to do it.

Maybe a better way to do this, as Hanon says, would be to define a new action that works on the ASK verb but that takes a thing rather than a topic as indirect object. Then you can have that action accept objects out of scope. Eric Eve’s Conversation Framework and related extensions use this, but a simple implementation might look like this:

Quizzing it about is an action applying to one thing and one visible thing. Understand "ask [someone] about [any thing]" as quizzing it about.

“Visible thing” means that the second noun doesn’t have to be touchable (it’s actually less restrictive than just saying “a thing”). The “[any thing]” token tells the parser not to bother with scope restrictions but just to check every thing in the game as a possible second noun. I think this action has to have a different name than “asking,” though maybe that’s just to avoid confusion.

Then you could make a table with a column of things instead of topics, and look up Bob’s replies there.

If you want some of the conversation topics to be real text rather than strings, that’ll work too. If you type “ASK BOB ABOUT XYZZY” when xyzzy isn’t a thing in the game, the parser will first try to find a thing called xyzzy, and when that fails, redirect this to the asking Bob about “xyzzy” action.