having problem with adv3lite FollowAgendaItem

Harry, Harv and Lolita are in the hallway. Harry goes north, which causes Harv and Lolita to start following. In the waiting room (through the north passage), Aaron is waiting. There is a FollowAgendaItem in aaron.t.

When all of the rooms are connected directly, by a simple dir = dest, things work as expected. Harry goes north to the waiting room and Harv and Lolita follow him. In the waiting room, Aaron takes the lead and all three characters follow him through to the end of the chain of rooms defined by the FollowAgendaItem.

But when I change the north = secondRoom directive, which is the first passage after Aaron takes the lead, to a north: TravelConnector, things fall apart.

Harry goes north, Harv and Lolita follow, they meet up with Aaron, who says “follow me” but when Harry goes north through the travel connector, we lose Aaron. Harv and Lolita follow as expected, but Aaron has dropped out.

Actually, this is how it’s working in my test bed.

In the game, which is a bit too complex to post here, nobody gets through the travel connector. In the game window, there’s just a blank line. But tracing through the debugger, I see an exception getting thrown in execCycle(cmd) in action.t

/* If an exit signal is issued we skip to here. */ catch(ExitSignal ex) { /* * If the exit macro is used in the course of the command, * consider the command a failure. */ actionFailed = true; }

I have not been able to track down what is causing this exception, but it halts travel for all of the characters.

Here’s the transcript of play in my much smaller test bed, without a travel connector, with Aaron leading the way through all of the rooms…

…and here it is with the travel connector, in which Aaron drops out after the group passes through the travel connector between the waiting room and the second room…

…and here’s the code, with the travel connector temporarily commented out and north = secondRoom directive live…

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

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

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

hallway: Room ‘hallway’ ‘hall’
“The hallway.”
north = waitingRoom
;

waitingRoom: Room ‘waiting room’
“The waiting room. <.reveal greenLight> <.p>”

/*
north: TravelConnector
{
    destination = secondRoom
    canTravelerPass(traveler)
    {
        local ret = nil;
        if(gRevealed('greenLight'))
            ret = true;
        return ret;
    }
    explainTravelBarrier(traveler)
    {
        "The light on the door was red. <.p>";
    }
    travelDesc = "The light on the door was green"
}
*/
north = secondRoom
south = hallway

;
secondRoom: Room ‘second room’
“The second room.”
north = thirdRoom
south =waitingRoom
;

thirdRoom: Room ‘third room’
“The third room.”
south =secondRoom
;

// lolita character
lolita: Actor ‘Lolita’ @hallway
“Lolita. <.p>”
contType = Carrier
globalParamName = ‘lolita’
isFixed = true
isHer = true
isInitState = true
ownsContents = true
person = 3
proper = true
bulkCapacity = 5000
beforeTravel(traveler, connector)
{
if(traveler == harry && connector == hallway.north)
{
getActor.startFollowing();
}
}
;

// harv
harv: Actor ‘Harv;him’ @hallway
“Harv. <.p>”
contType = Carrier
globalParamName = ‘harv’
isFixed = true
isInitState = true
ownsContents = true
person = 3
proper = true
bulkCapacity = 5000

beforeTravel(traveler, connector)
{
    if(traveler == harry && connector == hallway.north)
    {
        getActor.startFollowing();
    }
}

;

// aaron
aaron: Actor ‘Aaron’ @waitingRoom
“Aaron. <.p>”
isHim = true
globalParamName = ‘aaron’
person = 3
bulkCapacity = 5000
;

// *********** FollowAgenda Items *****************************************

  • FollowAgendaItem
    initiallyActive = true
    connectorList = [secondRoom, thirdRoom]

    specialDesc()
    {
    "Aaron waited for Harry to follow him ";
    switch(getActor.getOutermostRoom)
    {
    case waitingRoom:
    "north into the second room. ";
    break;
    case secondRoom:
    "north into the third room. ";
    break;
    }
    }
    arrivingDesc()
    {
    if(nextDirection != nil)
    {
    "Arron waited for Harry to follow him
    <<nextDirection.departureName>>. ";
    }
    else
    “The journey has ended. <.p>”;
    }
    ;
    [/code]

I’m about to turn in for the night, so I can’t look at this in detail right now, but there’s one thing I noticed in your code that may be relevant. You have a FollowAgendaItem whose definition begins:

+ FollowAgendaItem
    initiallyActive = true
    connectorList = [secondRoom, thirdRoom]

The connectorList property is meant to be just what it says: a list of the TravelConnectors the NPC wants to lead the PC through, not the room the NPC wants to visit, so that when you change north = secondRoom to define a travelConnector on the north property, you need to make the corresponding change on the connectorList:

+ FollowAgendaItem
    initiallyActive = true
    connectorList = [waitingRoom.north, thirdRoom]

Without this change, I’d expect Aaron to drop out, since Aaron will lead when Harry takes the connector Aaron wants him to take; if Harry leaves via waitingRoom.north and Aaron is waiting for him to leave via secondRoom then, if these are two different objects, as they become when you define waitingRoom.north to be a TravelConnector object, then Aaron will be left waiting!

The exception you’re seeing in your actual game is what you get from an exit statement (which is actually a macro that expands to throw new ExitSignal); this is not an error as such, but a way of stopping an action. I don’t know enough about your game to be more specific, but you need to look for an exit statement that’s executed when these actors try to go through the connector in question; this may be in a beforeTravel() method, for example.

Or, more likely, it’s coming from Actor.beforeTravel() which issues an exit statement to stop the normal travel command when there’s an active FollowAgendaItem to let the followFuse handle it instead. If you set a breakpoint in Actor.beforeTravel you may catch it there - but this is something that’s meant to happen, so if that’s the source of the problem in your game there may be an issue with the way you’ve defined the FollowAgendaItem in question - perhaps the same kind of issue with its connectorList as in your testbed game? That’s where I suggest you start looking, in any case.

You were right on both counts.

I was defining a room name instead of the travel connector and that caused Aaron to drop out.

The exit macro was triggered because the same <.reveal> that allowed Aaron to take the lead also triggered a change to a new Scene, in which Aaron’s state was also changed. So, I tripped over my own code.

Both have been fixed, and Harry and crew are now following Aaron.

Thanks.

Jerry