Error on Take command

I have suddenly started getting an error when play testing my game and using the take command. Whenever I try to take something, anything take-able, I get the error shown below. I had made a backup of the folder a few weeks ago, and going back to that folder, the take command works as expected. I ran a diff function on the two folders and it seems to be everything in the obj folder is different, along with the updates I have made since the backup.

I don’t want to change the backup folder at this point, since it is working. But copying the updated files from the new folder to the backup folder doesn’t seem to work, either.

>take pot
Runtime error: object value required

Any thoughts?
P.S. I am on a Mac using VS Code and Parchment.

One tiny typo sent my whole weekend into the dumpster.

Please disregard!


I need to bump this. I am getting the error again. I’ve removed all other source files except for the start room and am still getting the error. It happens on any takeable object. Even object that I have not overidden the dobjFor(Take).

+broth: Food 'broth' 
isListed = nil
        "The thin broth had chunks of fish in it earlier in the week. ";
    dobjFor(Take) {
        check() {
        "As you reach for the ladle, Mama raises her hand in a halting gesture. you'll have to wait. ";

take broth
Runtime error: object value required
–>/Users/user/Documents/TADS/extensions/adv3Lite/doer.t, line 627
/Users/user/Documents/TADS/extensions/adv3Lite/doer.t, line 539

1 Like

I should wait for Eric, because where the error appears is amidst the doer-handling routine, specifically when the object names are matched with the objects. matching done thru a quadruple AND:

627             if (tobj != nil && cobj != tobj && !cobj.ofKind(tobj) 
628                 && cobj.lexicalParent != tobj)

tobj and cobj are defined immediately above as:

620             local cobj = cmdLst[i];
621             local tobj = cmd[i];

your source is barebones, so I suspect that the calling doer is one defined in the library; and indeed there’s a doer involving TAKE:

   5992 takePathDoer: Doer 'take PathPassage'

whose handles commands of the type TAKE PATH, meaning going thru a passage.

and if your bug happens also with objects without overriden TAKE handling, I suspect that the bug stems from this built-in doer… whose indeed should be trapped the quad-AND above, namely the class test part (the third one), so tentatively I place the runtime error firing in one of the first two tests.

sadly I can’t hope to help, because is jedi-level use of the Source, so at least we can call this a lead ?

Best regards from Italy,
dott. Piergiorgio.

I’m afraid I’m not seeing this error. I copied disherwood’s code into my own testbed game and it worked just fine. What else is in your start room source file?

My version of doer.t is different from Piergiorgio’s; I suspect I must have changed it for the next update. But Piergiorgio’s analysis suggests that cobj is nil at line 627, which as Piergiorgio says occurs when the library is trying to match the Doer to its objects (the test !cobj.ofKind(tobj) will throw an error if cobj is nil, as will the following line). Piergiorgio is also right that the only Doer defined in the library specific to Take is the takePathDoer which functions as he says. But it worked as expected when I tested it.

But this doesn’t get me much closer to what’s happening in disherwood’s case.

If this is a library bug, it must be a very obscure one, since I’m unable to trigger it and no one else has reported it. Which suggests to me that there are three possibilities here:

  1. There’s an error somewhere else in disherwood’s code;
  2. Something in disherwood’s code is triggering an unusual egde case that’s throwing up an obscure library bug.
  3. Disherwood’s copy of the library has somehow become corrupted.

But without further information I’m unable to go any further than that.

All, Thank you for your help and suggestions.
I have found the error. It had nothing to do with taking anything at all.
I took everything out then starting adding objects back in, one at a time. This code was the culprit.

<<if gRevealed('Inga')>>
            'your oldest sister moans.'
        <<else>>'Inga, your oldest sister, moans.'

It should have been like below without the single quotes around the output.

<<if gRevealed('Inga')>>
            your oldest sister moans.
        <<else>>Inga, your oldest sister, moans.

This was really difficult to debug!
Thanks again,