DefaultAnyTopic not working as expected (adv3Lite)

I have defined a HelloTopic and a ByeTopic, both of which are active when the gPlayerChar is in the room, and a DefaultAnyTopic that is active all the time.

When the gPlayerChar and the NPC are in the room, topics work as expected…

There is no AskTopic for ask about the time, so the DefaultAnyTopic text (…that’ll be the day…) is displayed.

But when the gPlayerChar and NPC go into the next room, where the HelloTopic and ByeTopic are not active, the DefaultAnyTopic text is displayed for the missing HelloTopic and a non-existent AskTopic, but not for the missing Bye topic.

The adv3Lite Manual says (adv3Lite/docs/manual/actortopicentry.htm#default_idx)…

…which leads me to expect it to be used for the missing ByeTopic.

Here’s the test bed code…

[code]#charset “us-ascii”

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

versionInfo: GameID
IFID = ‘445C38A3-AD1B-4729-957A-F584600DE5C1’
name = ‘test’
byline = ‘by Jerry Ford’
htmlByline = ‘by
Jerry Ford

version = ‘1’
authorEmail = ‘Jerry Ford jerry.o.ford@gmail.com
desc = ‘Testing DefaultAnyTopic.’
htmlDesc = ‘Testing DefaultAnyTopic.’

;

gameMain: GameMainDef
initialPlayerChar = me
paraBrksBtwnSubcontents = nil

;

me: Actor ‘me’ @room
“The main man.<.p>”
isHim = true

person = 2

actorAfterTravel(traveler, connector)
{
    if(connector == nextRoom)
        otherGuy.moveInto(nextRoom);
    else if(connector == room)
        otherGuy.moveInto(room);
}

;
room: Room ‘room’
“The room. <.p>”
east = nextRoom
;
nextRoom: Room ‘next room’
“The next room.<.p>”
west = room
;
otherGuy: Actor ‘other guy;;man person;him’ @room
desc = “<<otherGuy.theName>> stands in the middle of the room. <.p>”

;

  • HelloTopic
    “Howdy, doody, pardner, <<otherGuy.theName>> drawls. <.p>”
    isActive = gLocation == room
    ;
  • ByeTopic
    “Well, now, got to be gittin’, <<otherGuy.theName>> says laconically.<.p>”
    isActive = gLocation == room
    ;
  • DefaultAnyTopic
    “Yep, that’ll be the day, <<otherGuy.theName>> says. <.p>”
    ;
    [/code]

Jerry

You’re right that the library is inconsistent here, in that DefaultAnyTopic was trapping explicit hellos but not explicit goodbyes, but I’m not sure in my own mind what the correct behaviour should be. Saying HELLO and GOODBYE (i.e. starting and ending a conversation) is a bit different from carrying on the middle of a conversation, so I’m not sure that displaying a DefaultAnyTopic is the right response to Hello or Goodbye.

The change I’ll make to the library is to add a matchGreetings property to DefaultAnyTopic; if it’s true the DefaultAnyTopic will match both HELLO and GOODBYE; if it’s nil it won’t match either. My instinct is that the default should be nil (I suspect many DefaultAnyTopics will read oddly as responses to HELLO and GOODBYE, even though some may read fine, so that nil is the better default).