Conversation Responses and tables

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:
	say "[response]";

With a table defined like this:

Table of bob's responses
item	response
Bob	"blah, blah, blah"

But I can’t seem to get inform to understand it.

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!

Next version of Inform? Or the next version of the extension?


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; end if; 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?

Sorry I haven’t actually tried out your code - and right now I can’t because I’m not at my Mac.

What exactly happens with your source? Does it compile? Do you get the default “There is no reply” response?

So is this the code you’re using now?

Response of Bob when asked about an item listed in table of bob's responses: say "[response entry]";

Sometimes there are namespace issues with table columns. “item” is a commonly used variable name. I don’t think that’s the problem, but you could try changing it and see what happens.

It doesn’t compile:

I tried a number of names for the column other than item and none of them worked either

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]".

That’s not actually necessary. The special case only happens when using the phrase “asked about [something]”. This also works:

Response of Bob when asked about something and the second noun is an item listed in table of bob's responses: say "[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]