Well, I’m stumped. I don’t know why it’s allowed to write “if [snippet] includes [text]”, even though it appears that it’s impossible for those two things to ever match. For reference, here’s a compilable example that I was trying:
[spoiler][code]Study is a room. The player carries a notebook.
Table of Notes
timestamp item detail
a time some text some text
with 50 blank rows
[ Items in the notebook will be stored by unique item and only recorded once.
This makes it easier to have multiple sources giving the same clue.
First time, alert the reader that player he has found a clue. ]
To note (t - some text) with (d - some text):
if the number of blank rows in the Table of Notes is 0:
say “>>Warning: the notebook is now full. (Please file a bug report.)”;
rule succeeds;
[ Note: Check to see if the clue is already in the notebook, if so, disregard. ]
if there is an item of t in the Table of Notes:
rule succeeds;
else:
if the number of filled rows in the Table of Notes is 0:
say “You decide to take a note of this in your notebook.”;
increase score by 1;
choose a blank row in the Table of Notes;
change timestamp entry to the time of day;
change item entry to t;
change detail entry to d.
[ Examine or Read notebook willl display a list of times, items, but omits detail ]
Instead of examining notebook:
if the number of filled rows in the Table of Notes is 0:
say “Alas your notebook is empty. You still need to find some clues.”;
else:
say “The notebook contains [the number of filled rows in the Table of Notes] entries:[line break]”;
repeat through the Table of Notes:
say " [timestamp entry] - [item entry] - [detail entry][line break]".
Instead of consulting notebook about something:
Repeat through Table of Notes:
if the topic understood includes item entry:
say “[item entry] - [Detail entry][line break]” instead;
[
[ enable user to look up by time, just in case ]
[ Every wording I can think of for this produces an error: ]
if the player’s command includes timestamp entry:
say “[timestamp entry] - [item entry] - [Detail entry][line break]” instead;
]
[ This never matches! ]
say “There’s nothing that matches that item exactly.”
When play begins:
Note “matchbook” with “Has Tony’s phone number CH 2481.”;
test me with “look up matchbook in notebook”[/code][/spoiler]
And here’s the relevant lines, unspoilered:
Instead of consulting notebook about something:
Repeat through Table of Notes:
if the topic understood includes item entry:
say "[item entry] - [Detail entry][line break]" instead;
I would love it if someone could explain why this doesn’t work, or how to make it work, or how to write a “topic literal” in order to add it to a table.