another converstation topic problem (adv3lite)

Thanks, Eric, for you help even while on the road. Much appreciated.

Your suggestion seems to have fixed the problem.

Which leads me to the next problem :slight_smile:

When Harry engages in conversation with one or another actor, the prompt often as not is on the order of Harry could ask him about XXX and I can enter ask him about XXX and get the expected reply.

But I have seen on occasion ask him aboutā€¦ produces a generic ā€¦has nothing to say about XXXā€¦ reply. I can then follow up the either ask aboutā€¦ or ask (characterā€™s name) aboutā€¦ and get the expected conversational reply.

I expect the command exactly as the prompt shows it to work. But it does not.

For example, at one point Harry is prompted to ask Max about the danger Max sees, the game window prompts (Harry could ask him about the danger) and entering ask him about the danger produces the expected replyā€¦

But later in the game, when Harry engages in conversation with Grace and the prompt displayed is (Harry could ask her about Mike and Grace) entering the command exactly as shown in the promptā€”ask her about mike and graceā€”generates the generic nothing to say about that response while ask aboutā€¦ or ask Grace aboutā€¦ works as expectedā€¦

The AskTopic is defined asā€¦

[code]

  • ConvNode ā€˜mikeAndGraceā€™
    ;
    ++ graceTalksAboutMikeAndAaron: AskTopic, StopEventList @tMikeAndGrace
    eventList =
    [
    ā€˜What about you and Mike? Harry asked. \b
    I mean, he's your father and all that, but, Grace, he sold me out to
    Hernandezā€¦
    <.p> <.convstayt>ā€™,

      'etc.'
    

    ]
    name = ā€˜Mike and Graceā€™
    ;[/code]

ā€¦while the Topic is declared asā€¦

tMikeAndGrace: Topic 'Mike and Grace';

I suspect this will be impossible for me to resolve until Iā€™m back home at my own machine and I can try to work out whatā€™s going on. The response youā€™re getting is very odd, if itā€™s really ā€œGrace Oscuro didnā€™t appear to have any about mike and graceā€ rather than ā€œGrace Oscuro didnā€™t appear to have anything to say about mike and grace.ā€ At any rate I canā€™t see where this would be generated in the library; is it coming from a DefaultTopic youā€™ve defined?

Iā€™m also wondering how the parser is actually interpreting ASK HER ABOUT MIKE AND GRACE at this point. Could you try issuing a DEBUG ACTIONS commands immediately before the ASK command and let me know what the debugging output says?

Iā€™d also be interested to know what you get in response to ASK HER ABOUT MIKE.

The most obvious problem would be if Grace wasnā€™t the pronoun antecedent for HER because youā€™d referred to some other woman in a command just prior to your asking her about mike and grace.

Actually, from the response youā€™re getting, Iā€™m beginning to think that the parser is probably interpreting HER as the possessive pronoun and is trying to find an object called ABOUT MIKE AND GRACE in her possession to ask, an interpretation thatā€™s obviously silly to a human being but grammatically plausible to the parser. This would explain why you donā€™t get the problem with ASK HIM ABOUT so-and-so. Right now I have no means of testing this, but you could experiment to see whether this appears to be a plausible explanation for what youā€™re getting.

Obviously I have no means of fixing this right now, and Iā€™m not even sure if itā€™s readily fixable (in the sense of getting the parser to make a consistently sensible choice between HER as the objective and possessive pronoun). The only workaround I can come up with is to change the way topic suggestions are listed so you see ā€œYou could ask Grace aboutā€¦ā€ and so forth. You could do this by looking at th3 definition of suggestedTopicLister in actor.t and changing ever occurrence of {him interlocutor} to {the interlocutor} (or doing the equivalent via a CustomMessages object).

But if Iā€™m right about the cause of this problem I canā€™t really do anything about it until Iā€™m back home and can investigate it properly.

Yes, Grace Oscuro didnā€™t appear to have any about mike and grace is what I get in the game window. That is a cut and paste.

No, nothing in any topic suggests ā€œabout mike and graceā€ as a valid response.

Hereā€™s what I get for debug actions, followed by an ask her about mikeā€¦

No previous conversation for several turns. The last conversation Harry participated in was with Aaron, a him, thought there was a ConvAgendaItem interjected by Lolita, a her, after the Aaron conversation.

However, it is not something exclusive to the pronoun her. I have seen this problem previously, in a conversation with a him, I think it might have been Aaron, not sure, been a while since I saw it last, it went away while I was doing some cleanup work on the game code having finally gotten through from start to finish. (Thatā€™s what Iā€™m doing now, cleaning up and fine tuning.)

I modified the DMsg for ask about, using a new custom message stringā€¦

        Msg(ask about, 'ask {the interlocutor} about '),

ā€¦change {him interlocutor} to {the interlocutor} resulting in Graceā€™s name in the prompt instead of her, but the response is the sameā€¦

I tried intercepting the AskAbout command in a dobjFor(AskAbout) in the grace object, with breakpoints in the check(), verify(), and action() methods.

When I issue ask her about mike and graceor ask about mike and grace, no breakpoints get hit.

When I issue ask Grace about mike and grace, the breakpoint in verify(){ illogical(ā€˜xxxā€™);} gets hit, but that doesnā€™t do me any goodā€”that command produces a valid response. Itā€™s when the command is ask her about mike and gracethat the response is incorrect.

I also tried dobjFor(AskAboutImplicit) and no breakpoints get hit no matter what I enter.

Well, yes it would be. Changing the prompt was never going to change the way the parser interprets player input; it was simply a way of not prompting the player to enter a command the parser might misinterpret, which was part of your original point.

The next think you could try is adding the following to your game code somewhere:

modify VerbRule(AskAboutWhat)
   '$*'
    :
;

(The point is simply to make sure itā€™s never matched, since I suspect it may be this VerbRule thatā€™s causing the problem, though Iā€™m not in a position to test it myself right now).

Well, yes it would be. Changing the prompt was never going to change the way the parser interprets player input; it was simply a way of not prompting the player to enter a command the parser might misinterpret, which was part of your original point.

The next think you could try is adding the following to your game code somewhere:

modify VerbRule(AskAboutWhat)
   '$*'
    :
;

(The point is simply to make sure itā€™s never matched, since I suspect it may be this VerbRule thatā€™s causing the problem, though Iā€™m not in a position to test it myself right now).

If that doesnā€™t do the trick, an alternative might be to define a StringPreParser somewhere:

StringPreParser
  doParsing(str, which)
  {
       if(str.toLower.startsWith('ask her') && gPlayerChar.currentInterlocutor != nil)
          str = str.toLower.findReplace('ask her', 'ask ' + gPlayerChar.currentInterlocutor.theName);
  }

;

Again, I canā€™t test this right now, and itā€™s a bit of hack, but it may do the trick for now.

Okay,thanks.

Had no effect. Response identical with or without this code.

Prevents game from responding to any command.

So I added else inherited; and I get a runtime error, wrong number of arguments.

Aargh! Comes of posting code without any means to test it. There should, of course, have been a return str; in there:

[code]StringPreParser
doParsing(str, which)
{
if(str.toLower.startsWith(ā€˜ask herā€™) && gPlayerChar.currentInterlocutor != nil)
str = str.toLower.findReplace(ā€˜ask herā€™, 'ask ā€™ + gPlayerChar.currentInterlocutor.theName);

   return str;

}

;[/code]

Sorry about that, but I did warn you that my ability to provide support is a bit limited right now!

Iā€™m a bit surprised that modifying that VerbRule had no effect, but maybe the parser is deciding on the possessive interpretation of ā€œherā€ before it even attempts to match a VerbRule. Iā€™d really need to set a breakpoint in Parser.parse() to step through the code and try to work out just what the parserā€™s doing, but Iā€™m afraid I shanā€™t be in a position to do that for at least a week.

In the meantime there is one more experiment you could try (before trying the corrected StringPreParser above):

modify VerbRule(AskAboutImplicit) ('a' | ('ask' | 'tell' 'me') 'about' topicIobj : ;

Even if that works, Iā€™m not sure itā€™s the best fix, but at least if it does work it we would be a pretty good clue as to whatā€™s going wrong.

If that does work, then you could also try this variant:

VerbRule(AskAboutImplicit) ('a' | ('ask' | 'ask' 'her' | 'tell' 'me') ('about' |)) topicIobj : ;

No guarantees; these are just experiments Iā€™m not able to carry out myself right now.

Okay, progress!!!

This works:

Neither of the other two suggestions (adding return str to doParsing(), or the VerbRule mod variant) worked.

Jerry

Okay, at least that confirms my guess about the cause of the problem and points to one way it could be resolved in the library, though Iā€™m a bit surprised neither of the other two suggestions worked. The downside of the method that does is that it could disable some phrasings for questions that game authors might like to use, so I shall have to investigate further once Iā€™m back home. But at least you have a fix for now.

Yes, thanks, working now.

As you ponder a long term fix, note that this does not happen with all characters.

Currently, I see it only with the Grace character.

I do not have definitive proofā€”no code to point toā€”just a recollection that I have seen this with other characters in the past and ignored the problem at the time because I had more pressing concerns and the finish line was still some distance away. Those gambles seem to have paid off. Whatever was triggering the problem went away as I move code around. I just donā€™t know what code, so I am not able to apply the fix to Grace, hence the need for your work around.

But, bottom line, it does not appear to be a universal problem. Something in my game is triggering it.

Jerry

I suspect thatā€™s because sheā€™s female, so you get the ambiguity over whether ā€œherā€ is possessive or objective, although itā€™s possible you may see a slightly different problem with ā€œhimā€. Now Iā€™m back at my own machine Iā€™ve been experimenting a bit, and managed to get inconsistent behaviour with Grace.

The fix Iā€™ve now tried which appears to work is to change the definition of VerbRule(AskAboutImplicit) in grammar.t so that the line that read:

priority = 60

Now reads:

priority = 45

This should make the parser attempt to match ASK SOMEONE ABOUT SOMETHING before ASK SOMETHING, and so select the correct interpretation over the spurious one in the case of ASK HER ABOUT SOMETHING.

If youā€™d like to comment out the previous temporary fix I gave you and try this proposed permanent one, we can check that it actually work without causing other problems elsewhere (there may be some reason I prioritized AskAboutImplicit over AskAbout in the past, even if I canā€™t now recall what it is or whether itā€™s likely to have been valid).

Yes, it appears to work.

With either priority = 45 or with your previous temp fix, here is the outputā€¦

With priority = 60 (default), & your previous temp fix removedā€¦

Iā€™ll also run through some complete conversations and see what happens there.

Jerry