I’m playing around with Conversation Responses by Eric Eve and it seems like a very tidy way to handle conversation, but I also like the table of responses that is illustrated in several places in the manual. What I can’t figure out is how to combine these approaches. Is it possible?
For example, I tried variations this:
Response of Bob when asked about an item in table of bob's responses:
With a table defined like this:
Table of bob's responses
Bob "blah, blah, blah"
I think the correct phrase is “listed in…” but unfortunately a bug in I7 has prevented this from working as expected. You’ll either have to hack the extension or loop over the entire table to find your entry. The good news is, it has been fixed for the next version - I just got notice of that this week!
Reviewing my experience with this issue, I see that the problem only comes up within an extension if you use Conversation Rules. If you are creating the tables yourself, the solution is in your hands.
Here’s how I hacked Conversation Rules to make the example (The Tribune’s Report) work correctly:
Table of Null Response
subject (object) response rule response table suggest
yourself default no response rule table-name 0
The (object) specification for the subject column is all I added. If you create tables yourself, make sure to include that for any column that has a “listed in” phrase in your source. Then this sort of thing (also from Conversation Rules) will work:
Report informing someone about something known when the second noun is a subject listed in the informing table of the noun (this is the standard informing report rule):
if there is a suggest entry and the suggest entry is -1, continue the action;
if there is a response rule entry, consider the response rule entry;
if there is a response table entry, show the next response from the response table entry;
if there is a suggest entry and the suggest entry > 0 begin;
let sug be the suggest entry;
decrease sug by 1;
now the suggest entry is sug;
stop the action.
I apologize in advance for being dense here, but I’ve tried 100 and 1 different combinations of my original question (including adding “listed in”) and none of them worked, but okay whatever. It sounds like it’s broken.
I haven’t used the Conversation rules at all, but since you mentioned it, I took a look at it. It looks interesting and maybe it’s what I need, but what exactly is supposed to be wrong with the example that is fixed by the above code?
Well, the error message tells you what the problem is: You can’t use a table entry there. It seems a bit capricious, but I think part of the problem is the way Conversation Responses is set up. “asked about [something]” is a to decide whether phrase. I believe there are two forms of it - one takes a specific object as an argument, the other takes a description of objects. A table entry doesn’t seem to count as either of those.
When I’m writing in I7, I try to avoid a “to decide whether” phrase when I can define an adjective instead. I’m actually working on a conversation extension and I’ve been a bit stumped on how to name these adjectives. Perhaps the simplest thing would be:
Definition: A thing is asked-about when asked about it.
Using that you might be able to say “response of Bob when an item listed in table of bob’s responses is asked-about.”
Or you can get avoid the special case handling of ``listed in’’ entirely if you move the condition inside the rule:Response of Bob when asked about something:
unless the second noun is an item listed in the Table of Bob's Responses:
make no decision;
say "[the response entry]".
I finally got to try this out. It still doesn’t work because you can’t use a description with “listed in” - it has to be a specific object. I finally figured out what the error message is really telling you: it can only loop over the table [O(n)] - it can’t do a nested loop over all objects and all table rows [O(n^2)].
You could do it like this, though:
[code]To decide which object is the subject asked about:
unless quizzing someone about, decide on nothing;
Decide on the second noun.
Response of Bob when the subject asked about is an item listed in Table of Bob’s responses:
say “[response entry]”;[/code]