can't get stopEventList to work inside an adv3lite ConvNode

Getting some good results with ConvNodes and character dialog, but it’s not entirely smooth sailing yet. :slight_smile:

My immediate problem is with an EventList inside a ConvNode.

Harry gets a phone call from Mona. Topic suggestion list says he could ask about the call, so he does and Mona responds as expected. Her response is defined as item one of a StopEventList. The expectation is that when Harry asks her again about the call, item two will be displayed, ask again and item 3 on the list will be displayed, and so on.

This appears to work as expected if it’s not implemented within a ConvNode block, but when it is, only the first item gets displayed, then when the query is asked a second time the DefaultAskTopic gets displayed.

The exchange between Harry and Mona quoted above is defined as the default HelloTopic.

The exchange following an ask about the call query is defined as item one of the StopEventList.

But when the 2nd ask about… query is submitted, the DefaultAnyTopic text is displayed.

Zipped source file is attached as reference.
test_bed.zip (3.44 KB)

I’m not a machine I can test any of this on right now, so this reply is based simply on inspecting your code.

The AskTopic defined in your ConvNode begins:

++ AskTopic, StopEventList @tNewClient
    eventList = 
    [
        {: "<q>Mona, babe, what's happening</q> Harry said. \b
            <q>Where are you? Why aren]t you here, in the office? There's
            someone looking for you, a prospective new client</q> she replied 
            coldly. <.convstay> "},
        
        {: "<q>Babe, I love you, you know I do, but come on, I've got a life.
        You should get one, too,</q> he replied. \b
        <q>Life is one thing, work is another,</q> she replied coldly.
        <q>And it's a work day. Speaking of...</q> <.convstay>"},

In turn, tNewClient is defined as:

tNewClient: Topic 'new client';

So your AskTopic will respond to ASK ABOUT NEW CLIENT, not ASK ABOUT THE CALL as in your transcript below. Since ASK ABOUT THE CALL doesn’t match the AskTopic you’ve defined, the DefaultAnyTopic picks it up.

A couple more points.

First, the AskTopic template recognizes an EventList, which can contain single-quoted strings, so you could define your AskTopic as:

++ AskTopic, StopEventList @tNewClient    
    [
        '<q>Mona, babe, what's happening</q> Harry said. \b
            <q>Where are you? Why aren\'t you here, in the office? There\'s
            someone looking for you, a prospective new client</q> she replied 
            coldly. <.convstay> ',
        
        '<q>Babe, I love you, you know I do, but come on, I\'ve got a life.
        You should get one, too,</q> he replied. \b
        <q>Life is one thing, work is another,</q> she replied coldly.
        <q>And it\'s a work day. Speaking of...</q> <.convstay>',

Of course you may just prefer the style you’ve used, but I thought I’d mention that you can write this a bit more concisely (except for the final item in the StopEventList which does need to be written the way you’ve written it, with an anonymous function, because of the <> … <> construction you’ve used):

 {:"<<first time>>\"Yeah, that\'s right, I do,\" he answered. \"So, we\'ll mix business
        with family. Tell her to meet me at the <<only>>Maritime Museum tomorrow
        at 2<<first time>>
        p.m<<only>>.\" \b
        \"Okay<<first time>>, Harry, I\'ll pass it on<<only>>.\"<.reveal
            newClient> "}

But see below; the <> … <> construction is probably redundant here.

Secondly, the two DefaultTopics you’ve defined at the end of your ConvNode may or may not do what you want:

++ DefaultTellTopic
    "<q>Sometimes, Harry, I think you're not quite right in the head, you know
    that?</q> Mona said with a sigh. <q>I just don't understand you
    sometimes.</q> "
;
++ DefaultAnyTopic
    "<q>Harry, this is important! You don't want your business to fail, do
    you?</q> Mona said. "
;

There are no <.convstay> tags in either of these, so if your intention was that these DefaultTopics should keep Harry in the ConvNode until he’s seen all the items in the StopEventList, then they won’t work as expected unless you add a <.convstay> tag to each of them.

Which brings me back to this one:

 {:"<<first time>>\"Yeah, that\'s right, I do,\" he answered. \"So, we\'ll mix business
        with family. Tell her to meet me at the <<only>>Maritime Museum tomorrow
        at 2<<first time>>
        p.m<<only>>.\" \b
        \"Okay<<first time>>, Harry, I\'ll pass it on<<only>>.\"<.reveal
            newClient> "}

Since there’s no <.convstay> tag here this will be displayed only once, which is probably what you want to happen, since it’s presumably appropriate to leave the ConvNode at this point (and you need to ensure that there’s some way out of it!). That being the case, you don’t need the <> … <> construction since this item will never be displayed a second time; Harry will leave the ConvNode the first time this item is displayed.

Okay, thanks. That fixed things up, it’s working correctly.

I had one too many topics and got twisted up in which topic name for what piece of code. So now there’s just “the call” and it’s working. I’ve also added the <.convstay> tags that were missing.

As for list item style—’ ', vs. {: “”}—I just got tired of juggling between the two in the same list (I’ve rewritten the text several times, trying to get things right), so I settled on one style. (I also didn’t realize I could use html tags for quote marks— and —in single-quoted strings, and was getting a bit cross-eyed at the mix of ’ and " throughout the list; the {: “”} construction just made it easier on the eye; well, my eye, anyway.)

But you are correct, the <> embedded expressions aren’t necessary here, since it is the last item on the list and the conversation ends when it’s been seen.

I’m back on track. Thanks for the tips.