can actor return to interrupted conversation (adv3lite)?

Harry walks into a store, the clerk engages him in conversation by way of a ConvAgendaItem, that invokes ConvNode ‘specialsOnSale’ with a suggested topic of “specials on sale.” The AskTopic is a StopEventList consisting of half a dozen entries; the main reason for the conversation is revealed in the next to last item.

Harry engages in the conversation but breaks off before reaching the <.reveal> and leaves the store. When he returns, he tries to re-engage in the same conversation. But it’s gone. It’s no longer in the topic suggestions, and it cannot be reinvoked.

I’ve tried setting the curiousityAroused, curiositySatisfied, and timesToSuggestion properties as described in the Adv3Lite Manual (The Conditions Under Which Topics are Suggested) without success.

Can it be done? Can I leave a ConvNode midway through the conversation and then return to it later? I know I could use NodeEndCheck and NodeContinuationTopic, but I don’t want to force Harry to stay engaged, I just want him to have the option to leave and come back. Is that possible?

Also, how do I check the values of those properties? What are they being set on?

I have defined the ConvNode and AskTopic as…

+ ConvNode 'specialsOnSale' ; ++ AskTopic, StopEventList @tSpecialsOnSale eventList = [ 'text', 'more text' ] name = 'specials on sale' convKeys = 'specialsOnSale' curiosityAroused = !handCuffs.isIn(harry) curiositySatisfied = gRevealed('handcuffs') timesToSuggest = nil ;

…but I can’t find those properties in the debugger. tSpecialsOnSale.curiousityAroused doesn’t work; what’s the object I should be looking at?

Here’s the conversation in an isolated test-bed environment…

[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 topic active’
htmlDesc = ‘Testing topic active.’
;

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

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

;

// harv character (adult toy shop clerk)
harv: Actor ‘Harv;heavy heavyset hefty bearded shop;man clerk;him’ @roomB
“”
globalParamName = ‘harv’
person = 3
bulkCapacity = 5000

hasSeenHarrysLicense = nil
count = 0

actorSpecialDesc = "Harv, the shop clerk, sat on a stool behind the counter, eyes flitting
    back and forth as he closely watched for action within the floor displays. "

;

// ************ Default Topics ********************************************

  • HelloTopic
    “Hey, Harv. \b
    Hey, Harry.
    <.p>”
    ;

  • ByeTopic
    “Harry stepped away from the counter and turned towards the front door.\b
    See ya around, Harv.\b
    See ya around, Harry.”
    ;

  • DefaultAskTellTopic
    “Ah, jeez, Harry, I don’t know about anything like that, I’m just a
    simple store clerk, ya’know? Harv answered defensively.”
    ;

  • AskTopic @tWeather
    "Foggy again, huh?\b
    Yah, harv replied, Just another summer day in San Francisco. "

    name =‘the weather’
    ;

  • AskTopic @tGiants
    "How 'bout them Giants? Harry groused. \b
    Ah, you know I don’t follow baseball, Harv whined. "

    name=‘the Giants’
    ;

  • AskTopic @t49ers
    "How 'bout them Niners?\b
    Yeah, well, wait’ll next year. "

    name =‘the 49ers’
    ;

  • GiveTopic @TwentyDollarBill
    topicResponse()
    {
    gDobj.moveInto(harvsCashRegister);
    if(harv.count++ < 2)
    {
    acceptCash.doScript();
    }
    else
    {
    “Sixty bucks, Harry said.<.p>
    So it is, sir, and a most excellent purchase, I’m sure,
    Harv replied as he moved to wrap the box of handcuffs.
    <.p>
    Don’t bother. Harry removed the bracelets from their
    container and shoved them into his left pants pocket. Here, you
    can keep the box.
    <.p>”;

      }
    

    }
    ;

// *********** ConvAgendaItems *******************************************

// welcome to store

  • ConvAgendaItem
    isReady = (harry.isIn(roomB))
    invokeItem()
    {
    “Harry, my man, good to see you again, and so soon. Why, it’s almost
    like you live here, heh, heh, heh, bellowed the hefty, bearded man
    behind the counter. \b
    Harry glowered in his direction. \b
    Looking for something special today? or just browsing as usual?
    Harv asked, waiting expectantly.
    <.p>
    <.convnodet specialsOnSale>”;
    isDone = true;
    }
    initiallyActive = true
    keyTopics = ‘specialsOnSale’
    ;

// ************ ConvNodes ***********************************************

// specials on sale

  • ConvNode ‘specialsOnSale’
    ;
    ++ AskTopic, StopEventList @tSpecialsOnSale
    eventList =
    [
    ‘Hey Harv, what’s new in toys? \b
    Say, I got just the thing for someone in the law enforcement
    business such as yerself, Harv replied. <.convstayt>’,

      '<q>Pipe down, will you, Harv? How many times I got to tell you, I\'m
      not a cop.  Not a cop! I\'m a private investigator. Not! A! Cop! You\'re
      going to get me in trouble in this neighborhood if you
      don\'t shut that trap of yours.</q>  <.convstayt>',
      
      '<q>Yeah, okay, Harry, whatever you say. I\'m just yanking yer chain. 
      Still, I got just the thing every self respecting not-a-cop ought to
      have.</q>  <.convstayt>',
      
      '<q>Okay, I\'ll bite, whatta ya got?</q> Harry relented.\b
      "Here Mr. Private-investigator-not-a-cop. Take a look at these
      things. Ain\'t they beauts?</q>  <.convstayt>',
      
      'The clerk reached under the counter, brought out a small box, and 
      tapped a pudgy finger on a pair of chrome plated 
      handcuffs lined with bright pink faux fur. <q>You mark my words, in your line
      of work they\'ll come in handy someday, when you need to keep a bad
      guy in his place. Or her place,</q> he chortled suggestively. <.reveal
      handcuffs>  <.convstayt>',
      
      '<q>Special price, today only, for
      you, my homey, just $100. What\'dya say? Gimme some plastic, I\'ll 
      wrap \'em right up. Make it cash, and the price is just a very
      Harry-only special $60.</q> 
      <.p>'
    

    ]
    name = ‘specials on sale’
    convKeys = ‘specialsOnSale’
    curiosityAroused = !handCuffs.isIn(harry)
    curiositySatisfied = gRevealed(‘handcuffs’)
    timesToSuggest = nil
    ;
    ++ DefaultTellTopic
    “Harry, you’re a hard man to please Harv grumped.”
    ;
    ++ DefaultAnyTopic
    "You have an interesting mix of goods, Harv. "
    ;
    // ********** Extras *****************************************************

// list of responses while accepting cash
acceptCash: ShuffledEventList
[
‘Excellent, Harv murmurred, plucking the bill off of the counter. \b’,
‘Ah, hmmm, the clerk whispered appreciatively, grabbing the bill out of
the air as it floated down from Harry’s hand. \b’,
‘That’s the ticket. \b’,
‘Very good. \b’
];

// repository for cash received
harvsCashRegister: Container, Fixture
;
handCuffs: Thing ‘handcuffs’
“A pair of handcuffs.”
;

roomA: Room ‘Room A’
“Room A.”

north = roomB

;
roomB: Room ‘Room B’
“Room B.”

south = roomA

;

pantsPocketRight: Thing, Container ‘pants pocket right’
“Right pants pocket.”
;

pantsPocketLeft: Thing, Container ‘pants pocket left’
“Left pants pocket.”
;

wallet: Thing, Container ‘wallet’
“Wallet.”
;

class Dollar: Thing
vocabWords = ‘dollar bill;dollar dollars;bill bills’

dobjFor(Take)
{
    action()
    {
        switch(location)
        {
            case wallet:
                "Harry took a bill from his wallet. \b";
            break;
            case pantsPocketLeft:
            case pantsPocketRight:
                "Harry took a bill from his pocket. \b";
        }
        inherited;
    }
}
dobjFor(Give) asDobjFor(GiveTo)
dobjFor(GiveTo)
{
    preCond = [objHeld]
    action()
    {

    }
}

;

class TwentyDollarBill: Dollar ‘20; twenty twenties dollar dollars bill bills’
isEquivalent = true
dollarValue = 20
dollarGroupBaseName = ‘twenty’
;

class TenDollarBill: Dollar ‘10; ten dollar dollars bill bills tens’
isEquivalent = true
dollarValue = 10
dollarGroupBaseName = ‘ten’
;

class FiveDollarBill: Dollar ‘5; five dollar dollars bill bills fives’
isEquivalent = true
dollarValue = 5
dollarGroupBaseName = ‘five’
;

class OneDollarBill: Dollar ‘1; one dollar dollars bill bills ones’
isEquivalent = true
dollarValue = 5
dollarGroupBaseName = ‘one’
;

t49ers: Topic ‘49ers’;
tGiants: Topic ‘giants’;
tSpecialsOnSale: Topic ‘specials on sale’;
tWeather: Topic ‘weather’;[/code]

And here’s a transcript in which Harry leaves the room and returns…

[code]Room A

Room A.

north

Room B

Room B.

Harv, the shop clerk, sat on a stool behind the counter, eyes flitting back and forth as he closely watched for action within the floor displays.

“Harry, my man, good to see you again, and so soon. Why, it’s almost like you live here, heh, heh, heh,” bellowed the hefty, bearded man behind the counter.

Harry glowered in his direction.

“Looking for something special today? or just browsing as usual?” Harv asked, waiting expectantly.

(Harry could ask him about specials on sale)

ask about specials on sale

“Hey Harv, what’s new in toys?”

“Say, I got just the thing for someone in the law enforcement business such as yerself,” Harv replied.

(Harry could ask him about specials on sale)

south

Harry stepped away from the counter and turned towards the front door.

“See ya around, Harv.”

“See ya around, Harry.”

Room A

Room A.

north

Room B

Room B.

Harv, the shop clerk, sat on a stool behind the counter, eyes flitting back and forth as he closely watched for action within the floor displays.

talk to harv

“Hey, Harv.”

“Hey, Harry.”

(Harry could ask him about the weather, the Giants or the 49ers)

[/code]

That’s right. If you allow your player character to break off a conversation in the middle of a conversation node, then that node will be gone. A Conversation Node represents a particular point in the conversation; if the conversation is interrupted the moment is gone.

None of these would be directly relevant to the problem you describe.

It wouldn’t; curiosityAroused is a property of ActorTopicEntry, not of Topic, and tSpecialsOnSale is a Topic, not an ActorTopicEntry. In any case the value of curiosityAroused isn’t the issue here; the point is that a ConvNode doesn’t persist when you break off a conversation.

One way to tackle this is to give the shopkeeper a second ConvAgendaItem that reinvokes the ConvNode when Harry comes back into the store. Maybe this could be done in the beforeTravel() method of the shopkeeper or of his current ActorState. An alternative would be to define a TopicEntry on Harv that would take the conversation back to the ConvNode, something like:

harv: Actor 'Harv;heavy heavyset hefty bearded shop;man clerk;him' @roomB
  ...
;

+ AskTellTopic @tSpecialsOnSale
    "<q>Tell me more about your specials,</q> said Harry.\b
     <q>As I was saying...</q> said Harv. <.convnodet specialsOnSale> "

     name = 'specials on sale'

     isActive = !gRevealed('handcuffs')
;

This would allow Harry (or the player) to resume the conversation about the specials on re-entering the shop, provided ‘handcuffs’ hadn’t yet been revealed.

The more complicated alternative, which forces resuming the conversation on specials via an additional ConvAgendaItem might, in outline, look something like this:

harv: Actor 'Harv;heavy heavyset hefty bearded shop;man clerk;him' @roomB
  ...

  actorBeforeTravel(traveler, connector)
  {
      if(traveler == harry && !gRevealed(handcuffs))
        addToAgenda(harryBackAgenda);
  }
;

+ harryBackAgenda: ConvAgendaItem
    invokeItem()
   {
        isDone = true;
        "<q>Back again so soon?</q> Harv remarked. <q>We were just talking about the
        specials I have on sale today, I recall.</q> <.convodet specialsOnSale> ";
   }
;

Either approach should do what you want (depending which way you want it done). You may have to fine-tune it a bit, of course, not least since I’m not typing this at a machine on which I’m able to test these suggestions.