Adv3Lite TellTopic parser problem

In a previous post about no recovery from user input during a conversation with an NPC (which turns out to be not true, topics were missing a <.convstay> tag), I also grumbled about inconsistent parsing of user input.

tell about fails; the game requires tell about

…but…

ask about succeeds.

I didn’t see it at first, but now I believe the critical difference is AskTopic vs. TellTopic.

In the sample code posted with that previous post intended as a demonstration of the problem, there are two TellTopics. Run the game and see the problem. then change the TellTopics to AskTopics and the problem disappears.

Here’s the test code again, with the tCables topic changed to an AskTopic. Run the code, enter x self, then ask about cables (works) and tell about thumping (doesn’t work)…

#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 <a href="mailto:jerry.o.ford@gmail.com">
                  Jerry Ford</a>'
    version = '1'
    authorEmail = 'Jerry Ford <jerry.o.ford@gmail.com>'
    desc = 'Testing conversation.'
    htmlDesc = 'Testing conversation.'

;

gameMain: GameMainDef
    /* the initial player character is 'candidate' */
    initialPlayerChar = candidate
    paraBrksBtwnSubcontents = nil
   
;

// candidate, initial player char
candidate: Actor 'you;self body' @testChamber
    "You are a...well, that's what we're here to find out. <.p>"
    globalParamName = 'candidate'
    isHim = true
    person = 2
    contType = Carrier
   
    dobjFor(Examine)
    {
        action()
        {
            if(gDobj == self)
            {
                "In your currently fogged state of mind, you slowly take stock
                of yourself---face, hands, feet, arms, legs. \b
                Cables are attached to various parts of your body.\b
                <i>Thump thump. Thump thump.</i> You feel a rhythmic beating
                inside your chest.
                <.reveal selfExamined> <.p>";
            }
            else
                inherited;
        }
    }
;

// candidate, initial player char
innerSelf: Actor 'voice in your head'
    ""
    globalParamName = 'innerSelf'
    person = 3
    contType = Carrier
;

// ********* ConvAgendaItem *********************************************
+ ConvAgendaItem
    isReady = (gRevealed('selfExamined'))
    invokeItem()
    {
        "A voice inside your head speaks. \b
        <i>Assess the data,</i> it instructs. <i>What did your self examination
        discover?</i>
        <.convnodet dataPoints><.p>";
        isDone = true;
    }
    initiallyActive = true
;

// ********* ConvNodes **************************************************
+ selfDiscovery: ConvNode 'dataPoints'
;
++ cablesDiscovered: AskTopic @tCables
    "<i>There are cables...I'm attached to...</i> you begin. <i>What are they?
    What does it mean?</i>\b
    <i>That's curious,</i> replies the inner voice. <i>I don't know. We'll need
    more data. </i>
    <.p>
    <.convstayt>"
    name = 'the cables'
;
++ heartBeat: TellTopic @tHeartBeat
    "<i>I feel a rythmic thumping in my chest,</i> you silently tell your
    inner voice. \b
    <i>We have a heart beat, that's a data point,</i> the inner voice replies.
    <i>We are alive. That's useful to know.</i>
    <.p>
    <.convstayt>"
    name = 'the thumping sensation'
;
++ NodeContinuationTopic
    "<I>Con't let the mind wander,</i> the voice says. <i> We must finish
    this phase in order to move on.</i>
    <.p>"
;
++ NodeEndCheck
    canEndConversation(reason)
    {
        switch(reason)
        {
            case endConvBye:
                "<q>No, not good bye,</q> the inner voice tells you. <i>We are
                bound intricately and irrevocably.</i> <.p>";
                return blockEndConv;
            case endConvLeave:
                "<i>There is nowhere to hide from me,</q> says the voice in your
                head. <.p>";
                return blockEndConv;
            default:
                return nil;
        }
    }
;


tCables: Topic 'the cables';
tHeartBeat: Topic 'the thumping sensations';

// ********* Rooms ********************************************************

testChamber: Room 'Test Chamber' 'test chamber'
    "The test chamber.
    <.p>"
;

// self discovery
selfDiscoveryScene: Scene
    name = 'selfDiscovery'
    startsWhen = candidate.isIn(testChamber) && !gRevealed('candidateNameSet')
    endsWhen = gRevealed('candidateNameSet')
    recurring = true
    whenStarting()
    {
        if(!gRevealed('selfDiscoverySceneInitialized'))
        {
            commLink.connectTo(innerSelf);
            gReveal('selfDiscoverySceneInitialized');
        }
    }
    whenEnding()
    {
        commLink.disconnectFrom(innerSelf);
    }
;

Sorry to be a it unresponsive right now, but I’m away from home on holiday, and I don’t have access to a machine with TADS 3 on it.

I didn’t implement TELL ABOUT X as I didn’t regard it as standard grammar; following adv3 I implemented the abbreviation as T X.

The appropriate VerbRule is defined as:

VerbRule(TellAboutImplicit)
    ('t' | 'tell') topicIobj
    : VerbProduction
    action = TellAboutImplicit
    verbPhrase = 'tell/telling (whom) (about what)'
    missingQ = 'whom do you want to tell;what do you want to tell it about'
    iobjReply = topicPhrase
;

Contrast the corresponding VerbRule for AskAboutImplicit:

VerbRule(AskAboutImplicit)
    ('a' | ('ask' | 'tell' 'me') ('about')) topicIobj
    : VerbProduction
    action = AskAboutImplicit
    verbPhrase = 'ask/asking (whom) (about what)'
    missingQ = 'whom do you want to ask;what do you want to ask it about'
    iobjReply = topicPhrase
    priority = 45
;

Changing VerbRule(TellAboutImplicit) as follows should give you the response to TELL ABOUT X you want:

VerbRule(TellAboutImplicit)
    ('t' |( 'tell'|'t' 'about')) topicIobj
    : VerbProduction
    action = TellAboutImplicit
    verbPhrase = 'tell/telling (whom) (about what)'
    missingQ = 'whom do you want to tell;what do you want to tell it about'
    iobjReply = topicPhrase
;

But, as just explained, I’m not in a position to test this right now.

This issue is certainly not urgent, and I’d feel bad if I thought I were forcing an interruption to your holiday. :slight_smile:

That said, I tried adding this to my code, but it did not change the outcome…

replace VerbRule(TellAboutImplicit) ('t' |( 'tell'|'t' 'about')) topicIobj : VerbProduction action = TellAboutImplicit verbPhrase = 'tell/telling (whom) (about what)' missingQ = 'whom do you want to tell;what do you want to tell it about' iobjReply = topicPhrase ;

As for…

…I agree, but it does result in an inconsistency that is a bit jolting when both ask and tell topics are part of the same conversation, one right after the other. I fall into a pattern of…

It might bother me more than it would a casual player, since I’m exercising the same commands multiple times during development, but it’s still a notable event.

Jerry

My bad. This is what comes of posting untested code. I think I missed some parentheses:

replace VerbRule(TellAboutImplicit)
    ('t' |(( 'tell'|'t') 'about')) topicIobj
    : VerbProduction
    action = TellAboutImplicit
    verbPhrase = 'tell/telling (whom) (about what)'
    missingQ = 'whom do you want to tell;what do you want to tell it about'
    iobjReply = topicPhrase
;

Yes, that did it. Thanks.

Enjoy your vacation :slight_smile:

Jerry

I’m not a native English speaker so I wouldn’t comment on whether it’s standard grammar, but I think that’s not exactly the point. My problem with the current behavior of adv3Lite is that TELL ABOUT X while already in a conversation doesn’t trigger the response “whom do you want tell?” but instead “{NPC} does not respond.” (or whatever the DefaultTopic specifies), which is very misleading when X is a useful topic.

I’ll investigate if adv3 has exactly the same behavior, but I would consider it a bug if it is.

Now that I’m back at my own machine I’ve changed the TellAboutImplicit grammar for the next release so that it will accept any of the following:

T TOPIC
T ABOUT TOPIC
TELL ABOUT TOPIC

(This is the same change as shown in my corrected email to Jerry).