Debugging NPC implicit actions

Is there a straightforward-ish way of debugging implicit action handling by NPCs?

Simple example to illustrate:

#charset "us-ascii"
#include <adv3.h>
#include <en_us.h>

startRoom:      Room 'Void'
        "This is a featureless void. "
;
+ BasicChair 'basic chair' 'chair'
        "It is a basic chair. "
;
alice: Person 'Alice' 'Alice'
        "She looks like the first person you'd turn to in a problem. "
        isProperName = true
        isHer = true
        location = startRoom
        obeyCommand(fromActor, action) {
                if(action.ofKind(SitAction) || action.ofKind(StandAction))
                        return(true);
                return(inherited(fromActor, action));
        }
;
me:     Person
        location = startRoom
;
versionInfo:    GameID
        name = 'sample'
        byline = 'nobody'
        authorEmail = 'nobody <foo@bar.com>'
        desc = '[This space intentionally left blank]'
        version = '1.0'
        IFID = '12345'
;
gameMain:       GameMainDef
        initialPlayerChar = me
;

Here we have a simple “game” with the player, the long-suffering Alice, one room, an Oxford comma, and a chair. The player, for some reason, has the power to compel Alice to sit and stand at will.

Or rather that’s the intent. Instead:

Void
This is a featureless void.

You see a chair here.

Alice is standing here.

>alice, sit
Alice refuses Alice's request.

In this particular case the solution is simple: add SitOnAction to the conditional in Alice’s obeyCommand(). But say that I don’t already know that, and perhaps I’m not even aware that what’s going on is that the NPC has to process an implicit action to do something. What’s the standard approach to debugging this kind of thing? The output produced by TADS3 by default is not particularly informative (except insofar as if we’ve been around this teacup looking for the handle before we might recognize that Alice refusing her own request is an indication that some implicit action is implicated).

1 Like