adv3Lite fatal error with CUT verb

A warning to all those using adv3Lite: One of my beta testers (the fantastic @ChristopherMerriner) discovered a fatal bug that will cause the parser to crash. If the player enters CUT without an object, the game halts with this response:

Runtime error: nil object reference
-->/usr/local/share/frobtads/tads3/lib/adv3Lite/english/english.t, line 3797
   /usr/local/share/frobtads/tads3/lib/adv3Lite/english/english.t, line 3753
   /usr/local/share/frobtads/tads3/lib/adv3Lite/parser.t, line 5181
...

The problem is that the Cut verb does not define a missingQ (“missing question”) property. The parser crashes because it manipulates missingQ as a string to present a message to the user (“What do you want to cut?”).

Because VerbRule is a grammar predicate, I don’t know a better way to patch those objects without replacing them. I wound up doing this in my game code to correct the bug:

replace VerbRule(Cut)
    [badness 500] 'cut' singleDobj
    : VerbProduction
    action = Cut
    verbPhrase = 'cut/cutting (what) (with what)'
    // no missingQ leads to CUT command (with no noun) to crash interpreter
    missingQ = 'what do you want to cut;'
;

There might be a way to modify rather than replace, but the above does work.

Alternately, you could simply add the missingQ line to your copy of adv3Lite, but I avoid doing that for reasons of sanity.

5 Likes

Is cut a default verb in Adv3Lite…? I haven’t memorized the action list yet lol.

CUT <dobj> and CUT <dobj> WITH <iobj> are standard verbs with adv3Lite.

2 Likes

Oof. Thanks for posting this!

I think I also found a weird crash where if you’re in a room (let’s say it’s called “The Barn”), and you type in > FEEL THE BARN, it crashes.

That might have been from something that I added under the hood, but I’m fairly sure it’s from standard, if anyone wants to test it lol.

1 Like