Obscure TADS 3 conversation bug

(TADS 3.1.3)
I noticed that in any situation, if I tried something like hi, npc then I’d get a runtime error:

[Runtime error: nil object reference
–>adv3/parser.t, line 4002
   adv3/parser.t, line 3921
   adv3/parser.t, line 1297
   adv3/parser.t, line 1297
   adv3/parser.t, line 2000
   adv3/parser.t, line 1297
   adv3/parser.t, line 1297
   adv3/parser.t, line 1297
   adv3/parser.t, line 1316
   adv3/en_us/en_us.t, line 5186
   adv3/exec.t, line 141
   <System>
   adv3/exec.t, line 141
   adv3/actor.t, line 10512
   adv3/actor.t, line 9417
   adv3/actor.t, line 9287
   adv3/pov.t, line 156
   adv3/pov.t, line 58
   adv3/actor.t, line 9287
   adv3/report.t, line 1941
   adv3/exec.t, line 1281
   adv3/actor.t, line 9287
   adv3/events.t, line 125
   adv3/misc.t, line 589
   adv3/misc.t, line 118
   adv3/misc.t, line 659
   adv3/misc.t, line 603
   /usr/local/share/frobtads/tads3/lib/_main.t, line 217
   /usr/local/share/frobtads/tads3/lib/_main.t, line 122
   /usr/local/share/frobtads/tads3/lib/_main.t, line 31

Looks like TryAsActorResolveResults defines most of its member functions as empty. But some of these are required to return something, especially unknownNounPhrase.

A simple

modify TryAsActorResolveResults
    unknownNounPhrase(match, resolver) { return []; }
;

patches around the immediate problem. I don’t know if there are any more bug fixes, but I thought it might be worth mentioning if you come across this weird problem.

Ideally, it’d parse as a Hello action, but alas, I think it comes across as a command to “hi”.

4 Likes

looks like is cognate to the “take it when the default is not set” bug discussed some weeks ago…

Best regards from Italy,
dott. Piergiorgio.

2 Likes

Hmm, mine doesn’t do that, but it could have been a side effect of something I modified. Mine seems to think that “hi, lady” are two separated commands: an ambiguous “hi” followed by the unknown command “lady”. No error. When I turn on my noun-as-x-noun verb, it parses the two commands like “you need to specify who you’re greeting” followed by the desc of the lady a la “x lady”.

Lol, it just so happens I hit that yesterday after trying it for the first time! When I try your patch, I get

>hi, bobby
The story doesn't understand that command.

This is definitely better than the runtime error. Does it actually parse as Hello for you?

1 Like

No I get the same response, but yeah, it is preferable!

Yeah I thought for the longest time it was something I had done, but it’s clearly two parts of Adv3 not talking together correctly since it returns nil when a list is expected. Maybe somehow I’ve primed the error to happen, but it’s definitely an Adv3 bug.

I just realized the behavior I described was for my debug version. In my release version, “hi, guard” is interpreted as “guard, hi”…

Without patching, but using a3Lite, I get this interesting output:

Atuzejiki is here.


>hi, Azuj

I don’t understand that command.


>hi

You now have Azuj’s attention.

(You could ask her about the weather or a foo)

(notice that there’s an interesting, and very simple, trick whose allows NPC debugging without reaching the point in the game where they enter the stage…) whose point to a glitch (not a bug) of A3Lite library, whose correctly get the implicit Actor but don’t understand the an explicit actor. Hmmm… We have indeed the two most powerful and complex NPC conversation system, so first thing first, I think that we should shed light in how initiating convos is handled in detail, in both adv3 and a3Lite.

Best regards from Italy,
dott. Piergiorgio.