more character weirdness (adv3lite)

Sal is a bartender at the Lush Lounge (don’t laugh–actual name, actual bar in San Francisco).

Harry goes into the bar, Sal is at the counter. Sal’s initState is salAtCounter…

// at counter
+ salAtCounter: ActorState
    specialDesc = "A tall thin man in dark slacks and a white, long sleeve
        dress shirt, open at the chest and cuffs rolled up, tended the bar."
    
    isInitState = true
;

But when Harry goes into the bar, the specialDesc is not displayed…

The specialDesc text used to be displayed, not long ago before some code cleanup I’ve been doing for the past week or so. I just have no idea what I did that made it go away.

And, specialDesc text is still being displayed for other characters, just not Sal (or at least Sal’s the one where I’m seeing it at the moment).

The most obvious thing I can think of off the top of my head is that in the course of your code clean-up you’ve some how managed to insert another object between the salAtCounter ActorState and the sal NPC so that the former is no longer located in the latter. Another possibility might be that you’ve overridden specialDesc on the sal NPC, which could break the mechanism for showing the specialDesc from the ActorState. One more possibility is that there’s already a single + in front of the definition of the sal NPC so that the salAtCounter NPC now needs two ++. But without seeing more of your code I can only guess.

I’ve checked the code many times for proper + nesting. I can see no errors.

Sal actually has two states—salAtcounter when Harry enters the bar, then as soon as he greets Harry he switches to salTalking. Both of these states have specialDesc text, neither of which is displayed in the game window (and both of which worked previously).

Here’s the contents of the sal.t source file in which the sal character is defined…

#charset "us-ascii"

#include <tads.h>
#include "advlite.h"

// sal character (bartender at the Lush Lounge)
sal: Actor 'Sal;tall thin;man bartender;him' @lushLounge
    "Sal was tall, thin, clean shaven---including his head, which was shaved
    bare all around. He was dressed in dark slacks, white long sleeved shirt
    open in the front to the fourth button down from the collar.  The cuffs of
    his shirt were rolled up twice to show clean, unadorned and virtually
    hairless skin.
    <.p> "
        
    globalParamName = 'sal'
    person = 3   
    bulkCapacity = 5000
    attentionSpan = 3
    
;

//***************** default conversation topics *******************
+ HelloTopic
    "\"Hey, Sal, got a minute?\" Harry asked the bartender. \b
    \"<<one of>>Harry, hello, what can I get for you?\" <<or>>Sure, Harry, for
    you, anytime...still looking for information about last night? Or
    something else on your mind?\"<<stopping>> "
    
    changeToState = salTalking
;
+ DefaultAskTellTopic
    "\"I couldn\'t say,\" Sal said. \"I don't bother with that sort of thing.\""
;
+ AskTopic @tWeather
    "\"Foggy again, huh?\" \b
    \"Ain\'t it always?\" Sal replied. "

    name ='the weather'
;
+ AskTopic @tGiants
    "\"How \'bout them Giants?\" Harry groused. \b
    \"Giants and A's, World Series, just you watch,\" Sal grinned. "
    
    name='the Giants'
;
+ AskTopic @t49ers
    "\"How \'bout them Niners?\"\b
    \"Ahh, they\'re moving. Santa Clara Niners doesn\'t have quite the same
    ring to it, know what I mean?\" Sal said. "
    
    name = 'the 49ers'
;

// *********** ActorStates *********************************************

// at counter
+ salAtCounter: ActorState
    name = 'salAtCounter'
    specialDesc = "A tall thin man in dark slacks and a white, long sleeve
        dress shirt, open at the chest and cuffs rolled up, tended the bar."
    
    isInitState = true
;

// talking
+ salTalking: ActorState
    name = 'salTalking'
    specialDesc = "Sal continually polished the top of the counter with a clean white
        cloth. "
;
++ ByeTopic
    "\"Okay, Sal, thanks,\" Harry said. \b
    \"Anytime.\" Sal folded up his counter cloth and laid it down on the
    counter. "
    changeToState = salAtCounter
;
++ AskTopic, StopEventList @tLastNight
    eventList =
    [
        '\"Say, Sal, last night...\" Harry said. \"You remember me being
        here?\" \b
        \"Sure, Harry, you were here. Most of the night, if I recall,\" Sal
        replied. ',
        
        '\"Yeah, uh, huh. You see who I was with?\"\b
        \"Harry, you know me, I see nothing, know nothing, tell nothing,\" Sal
        shrugged, and extended a hand palm up. \"Unless...\" ',
        
        {:"<<first time>>\"Sal, buddy, it\'s me, Harry,\" Harry pleaded. \b
        \"And Harry, my buddy, I can count out, say, 20 reasons to button my
        lips, or open them up, as the case may be...\" <<only>>Sal <<first
        time>>smiled and <<only>>wiggled his fingers suggestively. "}
        
    ]
    name = 'last night'
    curiositySatisfied = gRevealed('darkAngel')
;
++ GiveTopic @TwentyDollarBill
    topicResponse()
    {
        gDobj.moveInto(sal);
        "\"Okay, Sal, okay, we can do that dance,\" Harry grinned back. \b
        <q>Harry, you da man,</q> Sal said as he neatly folded the 20 and
        stuffed it into his shirt pocket. <q>So, what can I tell you?</q> 
        <.activate darkAngel> <.convnodet womanLastNight>\b";
    }
;

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

// woman last night
+ ConvNode 'womanLastNight'
;
++ AskTopic, StopEventList @tWomanLastNight
    eventList =
    [
        '\"So who was it, Sal? Who was I with?\" \b
        \"Her name is Grace,\" Sal replied.  \"Grace Oscuro. The Dark Angel.\"
        <.convstayt>',
        
        {: "\"Dark angel? What\'s that, a stage name? She a singer? Dancer?
        Exotic...\" Harry pressed<<if gRevealed('darkAngel')>>, already
        knowing the answer but curious to see if Sal\'s story held up<<end>>
        . \b
        \"No, nothing like that,\" Sal said. \"She\'s known in the Tenderloin.
        She\'s got street cred, Harry. You best be careful.\" <.convstayt>"},
        
        '\"Street cred? What street cred? What\'s that supposed to mean?\"
        Harry continued to press for information. \b
        \"Her old man...\" Sal\'s voice dirfted off, then came back as he
        continued. \"Long time ago, Harry. Her old man was...connected.\"
        <.convstayt>',
        
        '\"Connected how? And what\'s this all got to do with me?\" \b
        \"I don\'t know the whole story, Harry, I just run a bar, you know? I
        hear what I hear, that\'s all. And
        it was a long time ago. I hear her old man died when she was just a kid,
        but she\'s still in the...the family. You know? That\'s all I can tell
        you, Harry, that\'s all I know. You want more, you need to see a guy
        named Mike, runs a tattoo shop on O\'Farrell.\" <.convstayt>',
        
        '\"Mike? The tattoo guy? Yeah, I know of him,\" Harry replied. \"Yeah, I
        know him.\" \b
        \"You better be careful, Harry, you\'re poking around some serious shit,\" Sal
        said.\" <.reveal darkAngel> <.convstayt>',
        
        {:"<<first time>>\"Yeah, thanks, Sal,\" Harry answered. \b
            <<only>>\"Serious shit<<first time>>, Harry<<only>>.\" "}
    ]
    activated = nil
    convKeys = ['darkAngel']
    name = 'the woman last night'
    curiositySatisfied = gRevealed('darkAngel')
;
++ NodeEndCheck
    canEndConversation(reason)
    {
        switch(reason)
        {
            case endConvBye:
                "<q>Sal, gotta run...but, hey, it's my 20 bucks, right? What the
                hell, keep going,</q> Harry said. <.convstayt>";
                return blockEndConv;
            case endConvLeave:
                "Harry turned towards the door as if to leave, then turned back to
                Sal. <q>Hey, Sal, sorry, time's short. But I paid my dues, let's
                hear the gory details.</q> <.convstayt>";
                return blockEndConv;
            default:
                return nil;
        }
    }
;
++ NodeContinuationTopic
    "<q>Okay, Sal, keep going...</q> Harry urged. <.convstayt> "
;
++ DefaultAnyTopic
    "<q>I need to know more,</q> Harry said hurriedly. <.convstayt>"
;
++ DefaultAskTellTopic
    "<q>I couldn\'t say,</q> Sal said. <q>You know me, Harry, mum\'s the
    word.</q>"
;

BTW, I’ve added a name property to each state; this property is used by a custom debug command, locate, which displays information about the character and actor state. I’ve tried removing the name property with no affect on the game behavior—other than causing the locate command to fail :slight_smile:

Well, I can’t see anything wrong with your code, so this is very mysterious (and very difficult for me to track down while I’m still away fro home).

The next suggestion I’d make by way of detective work would be to set a breakpoint in Actor.specialDesc() just before Harry enters the bar. The value of followAgendaItem at the start of the method should be nil (if not, that might be the problem, but it would be very odd). The value of curState should be salAtCounter (again, if it isn’t, we need to try to track down why), and, as you step through the code you should see salAtCounter’s specialDesc invoked. Since it isn’t being invoked, then it may be you’ll be able to see what’s going.

The other possibility, which seems at least equally likely at this point, is that you’ll find that Actor.specialDesc() isn’t being invoked on Sal at all, in which case the problem is to try to figure out why. If that does turn out to be the case, then the problem may be with the lushbar location rather than the Sal NPC, so the next thing to try would be to move Sal temporarily to a different location and see if you still get the same problem. If that makes the problem go away then the problem must be with the lushBar location (or something else that’s in that location), and we’ll need to look at that.

Well, simpler than I thought it would be.

You were correct, it wasn’t in Sal, it was in the Lush Lounge.

During my code cleanup, I took the opportunity to embellish the lounge a bit, adding a bowl to the bar and a peanuts object to the bowl, then a dobjFor(Eat) to let Harry eat an unlimited supply of peanuts.

Unfortunately, this resulted in this in the game window…

In order to remove the “On the bar Harry saw a peanuts” line , I added listContents = nil to the Room ojbect.

Unfortunately, that line not only removes the contents, it also removes the actor’s specialDesc. Or rather, I guess the library considers Sal to be room contents.

With the listContents = nil line removed, Sal’s description is back. I’ll have to figure something else out for the peanuts.

Thanks for the help, your intuition was exactly right and it quickly led me to the problem.

Jerry

Precisely so. As you’ve now discovered, overriding listContents to be nil on a room is a seriously bad idea unless you’re deliberately aiming for a weird effect! :slight_smile:

If you added ‘them’ to the end of the vocab of the peanuts, you’d at least make them plural:

+peanuts: Thing 'peanuts;;;them'
;

If you don’t want them listed at all, you could add isListed = nil to the definition of the peanuts, but then the player would never be aware of their existence. Or you could give the peanuts an appropriate initSpecialDesc.