Combination of Keyword Interface and Conversation Suggestion

Hello everyone.

I have discovered Inform 7 within the last few weeks and since then have tried different extensions and approaches for controlling the various games.

I really like the way Blue Lacuna handles the controls and would like to integrate the same into my own game.

The extension Keyword Interface by Aaron Reed supports nearly everything I need, with the exception of conversation topics. Therefore, I want to combine Conversation Suggestions by Eric Eve with this plugin.

I have already modified parts of Conversation Suggestions so that it prints the various ask- and tell-suggestions in the appropriate topic color, but in a very basic way:

if ask-suggs > 0 begin;
[let sugg-rep be “[sugg-list-ask with definite articles]”;
replace the regular expression “\band\b” in sugg-rep with “or”;]
say “ask [it-them of the current interlocutor] about [t][the entry 1 of sugg-list-ask][x][if ask-suggs > 1] or [t][the entry 2 of sugg-list-ask][x][end if][if ask-suggs > 2] or [t][the entry 3 of sugg-list-ask][x][end if][if ask-suggs > 3] or [t][the entry 4 of sugg-list-ask][x][end if][if ask-suggs > 4] or [t][the entry 5 of sugg-list-ask][x][end if][if ask-suggs > 5] or [t][the entry 6 of sugg-list-ask][x][end if][if ask-suggs > 6] or [t][the entry 7 of sugg-list-ask][x][end if][if ask-suggs > 7] or [t][the entry 8 of sugg-list-ask][x][end if][if ask-suggs > 8] or [t][the entry 9 of sugg-list-ask][x][end if][if ask-suggs > 9] or [t][the entry 10 of sugg-list-ask][x][end if][if tell-suggs > 0]; or [end if]”;
end if;

I completely got rid of the “sugg-rep” indexed text (that’s why it is commented out) as I couldn’t modify it in a way to only print certain topic words highlighted without also printing words like “or” in highlighted color. The method above works (at least for up to 10 keywords) but I’m sure there is a more efficient way of achieving this.

Another problem I have with the integration are the “other-suggestions”. These are commonly used for things like “show him your sword” or “give him the key” within a conversation. The problem with these is also that only certain words should be highlighted, not the whole phrase. (in the example above, the output should be like: “show him your sword”)

I would appreciate any help with these problems. As soon as these things are worked out, I can release this Extension as an add-on for Eric Eve’s Conversation Suggestions.

Thanks

Have you come across Matt Wigdahl’s article, which seems to be discussing much the same thing as you’re attempting, and may save you from trying to reinvent this particular wheel?

I have in fact put together a new version of Conversation Suggestions which incoporates some of Matt’s ideas. I’ve just sent it to the I7 Extensions site.

– Eric

Thanks a lot, didn’t know that anyone was already working on this. I will regularly check the Extensions site from now on as I’m also working on a German translation of your fantastic conversaton package. Thanks for all your work.

Strainer

I’m currently working on the translation of Version 3 of your Conversation suggestion and have a problem:

All the replacements seem to work fine, the only problem I have is that the parts “Chapter 1a - Listing Suggested Topics (for use with Complex Listing by Emily Short)” and “Chapter 1b - Listing Suggested Topics (for use with Complex Listing by Emily Short)” don’t work, as soon as I start a game without Complex Listing I’m running into errors and as soon as I use it, both topic suggestion lists are printed.

I have uploaded the extension here:

Download

I really don’t know why the conditional Chapters 1a and 1b don’t work in my translation.

Greets

Strainer

From this statement I’m guessing that the problem is in this Chapter heading:

Chapter 1b - Listing Suggested Topics (for use with Complex Listing by Emily Short)

This should be:

Chapter 1b - Listing Suggested Topics (for use without Complex Listing by Emily Short)

(Note change: with -> without

In your version, both Chapter 1a and Chapter 1b are compiled into the game when Complex Listing is present, and neither is when it isn’t.

– Eric

Thanks Eric, but the bug still exists.

Here is the code as it is atm:

[code]Part 2 - The Listing Suggested Topics Action (in place of Part 2 - The Listing Suggested Topics Action in Conversation Suggestions by Eric Eve)
(…)

Chapter 1a - Listing Suggested Topics (for use with Complex Listing by Emily Short)

Section 1 - Carry Out Listing

Carry out listing suggested topics:
consider the suggestion list construction rules;
let ask-suggs be the number of entries in sugg-list-ask;
let tell-suggs be the number of entries in sugg-list-tell;
let other-suggs be the number of entries in sugg-list-other;
if ask-suggs + tell-suggs + other-suggs is 0 begin;
say “[nothing specific]”;
rule succeeds;
end if;
say "[if topic-request is implicit]([end if]Du könntest ";
if other-suggs > 0 then
say “[sugg-list-other in topic format][if tell-suggs + ask-suggs > 0]; oder [end if]”;
if ask-suggs > 0 then
say “[ihn the current interlocutor] über [sugg-list-ask in topic format] fragen[if tell-suggs > 0]; oder [end if]”;
if tell-suggs > 0 then
say “[ihm the current interlocutor] von [sugg-list-tell in topic format] erzählen”;
say “[if topic-request is implicit].)[paragraph break][otherwise].[end if]”;

Section 2 - Carry Out Listing Support Routines

To say (l - a list of objects) in topic format:
set up l for topic printing;
say “[the prepared list delimited in disjunctive style]”;

To set up (l - a list of objects) for topic printing:
repeat with item running through l:
now the item is marked for special listing;
register things marked for listing.

Chapter 1b - Listing Suggested Topics (for use without Complex Listing by Emily Short)

[ This version uses regular expression substitution in indexed text to end the list with “or” rather than “and” ]

Carry out listing suggested topics:
consider the suggestion list construction rules;
let ask-suggs be the number of entries in sugg-list-ask;
let tell-suggs be the number of entries in sugg-list-tell;
let other-suggs be the number of entries in sugg-list-other;
if ask-suggs + tell-suggs + other-suggs is 0 begin;
say “[nothing specific]”;
rule succeeds;
end if;
let sugg-rep be an indexed text;
say "[if topic-request is implicit]([end if]Du könntest ";
if other-suggs > 0 begin;
let sugg-rep be “[sugg-list-other]”;
replace the regular expression “und” in sugg-rep with “oder”;
say “[sugg-rep][if tell-suggs + ask-suggs > 0]; oder [end if]”;
end if;
if ask-suggs > 0 begin;
let sugg-rep be “[sugg-list-ask with definite articles]”;
replace the regular expression “und” in sugg-rep with “oder”;
say “[ihn the current interlocutor] über [sugg-rep] fragen[if tell-suggs > 0]; oder [end if]”;
end if;
if tell-suggs > 0 begin;
let sugg-rep be “[sugg-list-tell with definite articles]”;
replace the regular expression “und” in sugg-rep with “oder”;
say “[ihm the current interlocutor] von [sugg-rep] erzählen”;
end if;
say “[if topic-request is implicit].)[paragraph break][otherwise].[end if]”
[/code]

Any idea why this still doesn’t work without complex listing and prints double when using it?

Thanks

Strainer

Any idea why this still doesn't work without complex listing and prints double when using it?

What happens if instead of using “(in place of Part 2 - The Listing Suggested Topics Action in Conversation Suggestions by Eric Eve)” you make a copy of the my extension and physically replace my Part 2 with your version in that copy?

What I’m wondering is whether the compiler might be getting confused by “for use with” and “for use without” sections within an “in place of” section.

– Eric

I guess it’s just that, but it’s not so bad as I can just comment out the part I don’t need in my extension for the moment.

I’ve just tried constructing a simple test case to verify that the cause is indeed as I suggested (namely that ‘for use with/without’ directives are ignored in ‘in place of’ sections). This does indeed seem to the be the case, so I’ve sent in a bug report to Graham Nelson (which may or may not be too late for it to be fixed in the next release).

– Eric

Thanks Eric. Is there already a probable release date announced?

Well, the word on RAIF last month was that the next I7 release would probably be in a few weeks time, which would make it some time this month, but that was with the caveat that no-one knew for sure, since it wasn’t certain how long various things would take to do (such as checking the release for bugs and fixing them, I imagine). So, the next release seems to be due in the not too distant future, but there’s no actual release date announced; I guess we’ll just have to wait and see.

– Eric

Just FYI, my extension linking Keyword Interface and Conversation Package has been released and is up at the Inform 7 webpage. Thanks to Strainer for the kick in the pants to get it completed!