I can’t get this to work because I’m missing the proper code.
What I want is an NPC giving the same response when I SHOW a thing to him, when i ASK him ABOUT the thing, and when I ANSWER him THAT the thing.
Here’s some example code that doesn’t work. The part between brackets gives an error, the part about Asking about does nothing. ATM I can only show things to.
[code]Before showing an Object listed in the Table of Shows to NPC:
say “’[Analisys entry].’”;
stop the action.
Instead of asking NPC about something:
if the second noun is an Object listed in the Table of Shows: <— or “noun”
say “’[Analisys entry].’”;
else:
continue the action.
[Instead of answering NPC that something:
if the topic understood is an Object listed in the Table of Shows:
say “’[Analisys entry].’”;
else:
continue the action.][/code]
The table has ofc the Object column with named objects and the Analisys column with some text.
The problem is Inform won’t let you write understand texts with commas inside. Perhaps there is a way round it, but then it wouldn’t be any obvious way; I know that the issue has come up on the forum before.
I think Eric Eve’s conversation extensions had a way of handling it. I’ve tackled the problem in a couple different ways. Check out my Speech Motivations extension, which was originally inspired by Dr. Eve’s extensions:
The comma is difficult, but I work around it by parsing the topic understood using my Disambiguation Override extension:
Check answering someone that (this is the convert answering it that to exclaiming rule):
Let the subject matter be the most likely match between the topic understood and "[any known thing]";
if the subject matter is not nothing, instead try exclaiming the subject matter to the noun;
It provides some utilities for making sure everything works out nicely when you try to match a topic against an object - including a means of finding out which objects matched, and a method of preventing weird “which do you mean” questions.