Inform 7 Home Page / Documentation


§16.13. Topic columns

When double-quoted matter appears in a column of a table, Inform will normally treat that as text for printing out. The exception is when the column is called "topic", where it is treated as text for comparing against what the player has typed. There is really only one operation allowed with topic columns, the "...listed in..." construction, but fortunately it is the one most often needed.

Let us suppose that the Sybil has a penchant for telling passers-by which is the Greek muse for what. We might write:

paste.png After asking the Sybil about a topic listed in the Table of Sybil's Replies, say "The Sybil declaims for a while, the gist being that the muse in question looks after [muse entry]."

We can then provide a simple table giving her responses:

Table of Sybil's Replies

Topic

Muse

"calliope"

"epic poetry"

"clio"

"history"

"erato"

"love poetry"

"euterpe"

"music"

"melpomene"

"tragedy"

"polyhymnia"

"sacred poetry"

"terpsichore"

"dancing"

"thalia"

"comedy"

"urania"

"astronomy"

"monica"

"tidiness"

"phoebe"

"massage"

"rachel"

"oval hair-cuts"

Topics can use the full range of abilities of the "understanding" system which Inform uses to parse text, and which will be the subject of a later chapter. For now, note that the Sybil's topics might equally include "flora/eve" (matching the single word "flora" or the single word "eve"), or something more elaborate such as:

"Bridget" or "Bridge" or "Bridget Jones"

* See Understand for the system Inform uses to parse text


arrow-up.png Start of Chapter 16: Tables
arrow-left.png Back to §16.12. Listed in...
arrow-right.png Onward to §16.14. Another scoring example

*ExampleMerlin
A REMEMBER command which accepts any text and looks up a response in a table of recollections.

***ExampleQuestionable Revolutions
An expansion on the previous idea, only this time we store information and let characters answer depending on their expertise in a given area.

***ExampleThe Queen of Sheba
Allowing the player to use question words, and using that information to modify the response given by the other character.