intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Jul 29, 2010 6:07 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Tue Feb 16, 2010 12:39 pm 
Offline

Joined: Tue Feb 16, 2010 12:26 pm
Posts: 6
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


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Tue Feb 16, 2010 1:03 pm 
Offline

Joined: Thu Jan 28, 2010 3:57 am
Posts: 10
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


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Tue Feb 16, 2010 1:06 pm 
Offline

Joined: Tue Feb 16, 2010 12:26 pm
Posts: 6
Eric Eve wrote:
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


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Thu Feb 18, 2010 4:31 pm 
Offline

Joined: Tue Feb 16, 2010 12:26 pm
Posts: 6
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


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Fri Feb 19, 2010 3:22 am 
Offline

Joined: Thu Jan 28, 2010 3:57 am
Posts: 10
Quote:
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.


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

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


This should be:

Code:
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


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Fri Feb 19, 2010 7:19 am 
Offline

Joined: Tue Feb 16, 2010 12:26 pm
Posts: 6
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]"


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

Thanks

Strainer


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Fri Feb 19, 2010 12:36 pm 
Offline

Joined: Thu Jan 28, 2010 3:57 am
Posts: 10
Code:
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


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Fri Feb 19, 2010 5:25 pm 
Offline

Joined: Tue Feb 16, 2010 12:26 pm
Posts: 6
Eric Eve wrote:
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.


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Sat Feb 20, 2010 10:34 am 
Offline

Joined: Thu Jan 28, 2010 3:57 am
Posts: 10
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


Top
 Profile Send private message  
 
 Post subject: Re: Combination of Keyword Interface and Conversation Suggestion
PostPosted: Sun Feb 21, 2010 7:43 am 
Offline

Joined: Tue Feb 16, 2010 12:26 pm
Posts: 6
Eric Eve wrote:
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?


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: matt w and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group