Listing all possible topics from table

Hello. I am really new here, hope i won’t have many dumb questions.

I started learning Inform7, and as a learning project i am creating small scene and got stuck (of course) at conversation with npc (of course).

I tried doing conversation as a table with topics and responses, which works fine.

My only problem is what happens when character asks npc about topic that isn’t listed, or doesn’t ask anything. The code looks like this:

A person has a table name called conversation.

Instead of asking someone about something:
let the source be the conversation of the noun;
if topic understood is a topic listed in source:
say “[reply entry][paragraph break]”;
otherwise:
say “[The noun] stares at you blankly.
You could ask [The noun] about [topic entry]”

At the end “You could ask [The noun] about…” i would like it to list topics from a table. Is it possible to do?

Thanks for your help.
Cheers.

Topics themselves can’t be printed. This is a little counterintuitive, but the thing is that a topic can be not only a simple text like “oysters” but a routine like “oysters/clams/lobsters,” which matches “oysters” or “clams” or “lobsters.” If you had a topic like that, Inform wouldn’t know what to print.

The way to do what you want would be to make a separate text column and print that. So you’d have one column labeled “Topic,” and another column labeled something like “Printed Text” which would contain text entries that looked just like the topic or whatever you wanted to print, and then you could print the printed text entry.

1 Like