NPC-initiated conversation not working right (adv3Lite)

I am trying to craft a two-tiered NPC-initiated conversation between Harry and his son Max. When they go below deck on the museum ship Jeremiah O’Brien, Max (the NPC) initiates a conversation by gushing about the cool stuff. Harry sees an opening, and the game helps out with a suggestion to talk about “way cool” stuff.

I want to suppress a suggestion to talk about a second topic until after the first topic (the way cool suggestion) has been seen.

The Actor chapter of the adv3Lite manual seems to say, in the Suggesting Conversational Topics section, that it can be done.

But I can’t get it to work.

I started with a ConvAgendaItem with two ConvNodes—the first, way cool topic, and the second, libertyShips. Both topics are listed as possible topics immediately, as soon as Max initiates the conversation…

All well and good, Max initiates the conversation and Harry is able to respond. But I don’t want the liberty ships topic suggestion just yet.

Here’s the code that does the above (minus all the default ask/tell/yes/no topics and the NodeContinuationChecks)…

[code]// max actor state

  • atOBrienExhibit: ActorState
    ;

  • ConvAgendaItem
    isReady = (harrysSonMax.isIn(belowDeckOBrien))
    invokeItem()
    {
    “Wow, cool! \b
    Harry was surprised to hear Max enthuse about the exhibit hall. Max?
    Enthuse? \b
    That’s what’s way cool, Harry thought.
    <.p> <.convnodet maxInOBrienExhibit>”;
    isDone = true;
    }
    initiallyActive = true
    ;

  • ConvNode ‘maxInOBrienExhibit’
    ;
    ++ AskTopic @tMaxAsksAboutOBrien
    “You like this stuff, do you, Max? Harry sensed an opportunity to
    get his son to open up. \b
    'Sokay, I guess, Max answered. Then, after a pause, he
    continued, with what Harry perceived as, for Max, some enthusiasm.
    We studying this stuff in school, ya know? 'Swhy I'
    all here and shit, ya know? Doing a, whaddyacallit,
    term…term…
    <.convnode libertyShips>”

    name = ‘way cool’
    convKeys = ‘wayCool’
    ;
    ConvNode ‘libertyShips’
    ;
    ++ TellTopic, StopEventList @tTellAboutLibertyShips
    eventList =
    [
    ‘Don't play that dumbbell card with me, buddy, I'm not one of your
    homey's, man, and I know you're smarter than that…blah blah\b
    Whatchou mean by'at? Max asked. Aha, thought Harry, an
    opening!
    <.convstayt>’,

      '<q>Well, blah blah blah</q> \b
      <q>Yeah, blah blah blah</q> Max puffed up a
      bit as he said it. <.convstayt>',
      
      'Harry...blah blah.</q>\b
      <q></q> <.convstayt>',
      
      '<q>Blather and blither some more...<q> \b
      <q>Etc...</q> <.convstayt>'
    

    ]
    name = ‘liberty ships’
    convKeys = ‘libertyShipHistory’
    ;[/code]

I then tried to suppress the second topic from the suggestion list until after the way cool node has been played.

I followed the directions in the manual for adding a keyTopics list which first activates an inactive Liberty Ship topic then adds the topic to the suggestion list. But this results in no topics being suggested, not even the way cool topic.

I have tried various things to make it work, including following the directions for using suggestionsKey = ‘top’ and even using a Doer for talk to Actor. Nothing I’ve tried works.

After adding keyTopics

[code]++ AskTopic @tMaxAsksAboutOBrien
“You like this stuff, do you, Max? Harry sensed an opportunity to
get his son to open up. \b
'Sokay, I guess, Max answered. Then, after a pause, he
continued, with what Harry perceived as, for Max, some enthusiasm.
We studying this stuff in school, ya know? 'Swhy I'
all here and shit, ya know? Doing a, whaddyacallit,
term…term…
<.convnode libertyShips>”

name = 'way cool'
convKeys = 'wayCool'
keyTopics = ['<.activate LibertyShipHistory>', 'libertyShipHistory']

;[/code]

…I get this:

I can get the way cool topic suggestion back by moving the keyTopics up to the ConvAgendaItem and changing it to point to the wayCool node–-[‘<.activate libertyShipHistory’, ‘wayCool’]—but I still don’t get a topic suggestion for the liberty ship history.

So, here’s the full test-bed code, with the keyTopics in place on the ConvAgendaItem…

[code]#charset “us-ascii”

#include <tads.h>
#include “advlite.h”

versionInfo: GameID
IFID = ‘243748b1-5310-4916-8436-890e9ccc16fd’
name = ‘test’
byline = ‘by Jerry Ford’
htmlByline = ‘by
Jerry Ford

version = ‘1’
authorEmail = ‘Jerry Ford jerry.o.ford@gmail.com
desc = ‘Testing adv3lite character conversations.’
htmlDesc = ‘Testing adv3lite character conversations.’
;

gameMain: GameMainDef
/* the initial player character is ‘harry’ */
initialPlayerChar = harry
paraBrksBtwnSubcontents = nil
usePastTense = true
;

// harry, main character
harry: Actor ‘Harry;;man self’ @jeremiahOBrien
“”
globalParamName = ‘harry’
isHim = true
isInitState = true
person = 3
proper = true
;

fishermansWharf: Room ‘Fisherman's Wharf’ ‘fisherman's wharf’
“Harry and Max are aboard the Jeremiah O’Brien at Fisherman’s Wharf. \b
Their only option is to go below.
<.p>”

;

  • jeremiahOBrien: Booth, Fixture ‘the Jeremiah O'Brien;jeremiah o'brien obrien
    liberty;ship’
    “The Jeremiah O’Brien was built in 1943…blah blah blah. \b
    A ship’s ladder (That’s a stairway, to landlubbers, Harry explained to
    Max) led down to an exhibit hall on the deck below, inside the ship.
    Harry and Max could go below (to enter the exhibit hall) or go down to the pier
    (leaving the ship).
    <.p>”

;

  • belowDeckOBrien: Booth, Fixture ‘below deck;inside down exhibit;below hall’
    “The ladder descended into an open room with exhibits lining the walls
    (bulkheads, to old salts Harry nudged Max; Dad, knock if off,
    will ya? Max retorted; When were you ever an old salt?) and
    occupying table space around the room.
    <<harrysSonMax.moveInto(belowDeckOBrien)>>
    <<harrysSonMax.setState(atOBrienExhibit)>><.p>”

    dobjFor(Enter)
    {
    action()
    {
    desc;
    inherited;
    }
    }
    ;

// max character
harrysSonMax: Actor ‘Max;teenager teen age ager;son;him’ @jeremiahOBrien
“”

globalParamName = 'max'
person = 3   
bulkCapacity = 5000

;

  • atOBrienExhibit: ActorState
    ;

  • ConvAgendaItem
    isReady = (harrysSonMax.isIn(belowDeckOBrien))
    invokeItem()
    {
    “Wow, cool! \b
    Harry was surprised to hear Max enthuse about the exhibit hall. Max?
    Enthuse? \b
    That’s what’s way cool, Harry thought.
    <.p> <.convnodet maxInOBrienExhibit>”;
    isDone = true;
    }
    initiallyActive = true
    keyTopics = [‘<.activate LibertyShipHistory>’, ‘wayCool’]
    ;

  • ConvNode ‘maxInOBrienExhibit’
    ;
    ++ AskTopic @tMaxAsksAboutOBrien
    “You like this stuff, do you, Max? Harry sensed an opportunity to
    get his son to open up. \b
    'Sokay, I guess, Max answered. Then, after a pause, he
    continued, with what Harry perceived as, for Max, some enthusiasm.
    We studying this stuff in school, ya know? 'Swhy I'
    all here and shit, ya know? Doing a, whaddyacallit,
    term…term…
    <.convnode libertyShips>”

    name = ‘way cool’
    convKeys = ‘wayCool’
    ;
    ++ DefaultTellTopic
    “Ah, man…? Max whined like the teenager he was<.convstay>”
    ;
    ++ DefaultAnyTopic
    “This place is full of cool stuff, man! <.convstay>”
    ;
    ++ NodeContinuationTopic
    “Dad, yeah, sure, but… Max said.<.convstay>”
    ;
    ++ NodeEndCheck
    canEndConversation(reason)
    {
    switch(reason)
    {
    case endConvBye:

    Ah, c’mon, Dad!”;
    return blockEndConv;
    case endConvLeave:
    “Why you go walking off like that?
    <.p>”;
    return blockEndConv;
    default:
    return nil;
    }
    }
    ;
    ConvNode ‘libertyShips’
    ;
    ++ TellTopic, StopEventList @tTellAboutLibertyShips
    eventList =
    [
    ‘Don't play that dumbbell card with me, buddy, I'm not one of your
    homey's, man, and I know you're smarter than that…blah blah\b
    Whatchou mean by'at? Max asked. Aha, thought Harry, an
    opening!
    <.convstayt>’,

      '<q>Well, blah blah blah</q> \b
      <q>Yeah, blah blah blah</q> Max puffed up a
      bit as he said it. <.convstayt>',
      
      'Harry...blah blah.</q>\b
      <q></q> <.convstayt>',
      
      '<q>Blather and blither some more...<q> \b
      <q>Etc...</q> <.convstayt>'
    

    ]
    name = ‘liberty ships’
    convKeys = ‘libertyShipHistory’
    activated = nil
    ;
    ++ DefaultTellTopic
    “Ah, man…? Max whined like the teenager he was<.convstay>”
    ;
    ++ DefaultAnyTopic
    “This place is full of cool stuff, man! <.convstay>”
    ;
    ++ NodeContinuationTopic
    “Dad, yeah, sure, but… Max said.<.convstay>”
    ;
    ++ NodeEndCheck
    canEndConversation(reason)
    {
    switch(reason)
    {
    case endConvBye:

    Ah, c’mon, Dad!”;
    return blockEndConv;
    case endConvLeave:
    “Why you go walking off like that?
    <.p>”;
    return blockEndConv;
    default:
    return nil;
    }
    }
    ;

belowDir: CompassDirection
name = ‘below’
dirProp = &below
sortingOrder = 1450
;

grammar directionName(below): ‘below’ : Production
dir = belowDir
;

Doer ‘go belowDir’
direction = belowDir
where = jeremiahOBrien
exec(curCmd)
{
doInstead(Enter, belowDeckOBrien);
}
;

tTellAboutLibertyShips: Topic ‘liberty ships’;
tMaxAsksAboutOBrien: Topic ‘way cool’;[/code]

The main problem here is that you’re missing a + sign before ConvNode ‘libertyShips’ (so it’s not associated with the Max NPC in any way). I suspect this is just a typo since you use ++ thereafter.

After adding the + sign you need to remove the following two lines from the TellTopic that immediately follows, since they’re both effectively disabling it:

    convKeys = 'libertyShipHistory'
    activated = nil

An additional change you might want to make is to the definition of VerbRule(TellVague) in grammar.t:

VerbRule(TellVague) ('tell'|'t') singleDobj topicIobj : VerbProduction action = TellAbout verbPhrase = 'tell/telling (whom)' missingQ = 'whom do you want to tell;what do you want to tell it about' priority = 40 // ADD THIS LINE ;

This will prevent the parser from matching this line to the command T LIBERTY SHIPS and interpreting as a command to talk to the Jeremiah O’Brien.