"nil object reference in actor.t" when trying to use ConvNode

I’ve got an Actor with a talking state, and on the talking state I have several top level topics, one of which has a ConvNode, which in turn has a TellTopic. Like this:

john: Actor 'man';

+ johnTalking: ActorState;

... other topics...

++ AskForTopic @overalls
    "blah blah <.convnode overalls>"
;

+++ ConvNode 'overalls';

++++ TellTopic 'foo'
    "bar"
;

I’ve tried commenting various things out, and the error seems to show up if and only if the line introducing the ConvNode is present. As long as it’s commented, it runs fine (at least at first), and as soon as I introduce it, the game crashes on startup. What can I do about this? Thank you!

1 Like

Paging @johnnywz00

He uses these systems wayyyyyyyy more than I do.

2 Likes

I suspect the problem may be due to your locating the ConvNode in the AskForTopic instead of directly in the Actor (in other words, I suspect there should only be one + sign before the ConvNode).

4 Likes

Oh! I tried to move the ConvNode out one (so it was just part of the ActorState), but I didn’t think of moving it all the way out! I’ll try that.

Edit: Yup, it worked.

2 Likes

@Eric_Eve follow up question: how do I specifically initiate a ByeTopic from inside a topic response?

1 Like

You can name the ByeTopic, and call the BT’s topicResponse from within another topic response, is one way…

2 Likes

actor.endConversation(endConvActor) seems to work as well. The issue is, it doesn’t seem to actually end the conversation at all? Like, the player is still somehow in conversation with the actor.

1 Like

Can you check whether it’s a convnode that’s still active? I didn’t actually use convnode all that often…

1 Like

Well, convnodes end after one turn, and it stays on after that turn, so it can’t be being kept alive by a convnode I don’t think

1 Like

Without digging into some reading, I can’t be sure where Lite and adv3 differ on the handling of conversation stuff. In adv3 you usually have to use a |.convnode nil| tag to end the node… I’m not sure what you mean about them ending after one turn, unless you have set yours to act that way (or that is a default of Lite that I’m not aware of)

2 Likes

What is the evidence that the conversation doesn’t seem to be ended?

1 Like

if you trigger him to close the door and become hidden again and stuff, you can still talk to him as if he’s still there by saying stuff like tell about foobar. Additionally, when you knock on his door again and he appears again, when you say talk to man, it says you’re already in conversation with him

1 Like

yeah I just checked Learning TADS 3 and ConvNodes in adv3Lite work in the reverse way to adv3 it seems, you have to explicitly write DefaultAnyTopic responses and stuff that explicitly call <.convstay> if you want them to stick around for longer than one turn.

2 Likes

So he’s out of scope with door closed, but still responds to TELL ABOUT?

1 Like

I’m just hiding and unhiding him. He’s technically in the room same room as you no matter what, since you’re talking to him through his half-open door, while standing in the hallway, so it seemed unnecessarily complicated to actually have a room for the interior of his apartment.

1 Like

Did you check to see if endConversation reaches sayGoodbye? Perhaps there’s some sneaky condition that makes canEndConversation fail

1 Like

At first glance I’m curious that sayGoodbye displays the ByeTopic, and sets gActor interlocutor to nil, but I don’t see anything about changing the otherActor’s state back to non-conv.

1 Like

Wait… Lite doesn’t use InConversationState… so what is the flag?

1 Like

The only place in the Lite library where I see currentInterlocutor = nil is in the takeTurn method of the Actor. If the game thinks your actor can still see your PC, it won’t end the conversation? Do you have to set currentInterlocutor = nil manually in special situations (like closing the door)?

1 Like

I’ll try that and report back!

2 Likes