adv3Lite: Probable Library Bug

If you’re using adv3Lite, I’d appreciate it if you’d try the command ‘clean X with Y’ where X and Y are any two objects in scope. Whether you’ve defined dobjFor(CleanWith) and iobjFor(CleanWith) on them doesn’t seem to make any difference. This command produces a runtime error on line 446 of action.t.

I’ve emailed Eric Eve about this. I’m confident he’ll be able to sort it out, but I don’t know what his life is like at present, so I don’t know how soon he may be able to look into it. If you get different results, please let us know!

The weird thing is, I can see no differences at all between CleanWith and DigWith, which is right next to it in the library files. Yet DigWith works, and CleanWith doesn’t. Possibly your eagle eye will be able to detect a difference.

The problem seems to have something to do with trying to find a remap for the command. The line in action.t is:

remapResult = obj.(remapProp);

Apparently, obj. is nil, or possibly remapProp is nil. Something like that. I don’t have a clue.

Jim, can you paste in the test code you’re looking at? I can run it here but I’d like to use the same code.

Here’s one version of it. Try cleaning the hamster with the duck:

lab: Room 'The Lab'
    "A not entirely sterile room filled with bubbling retorts, oscilloscopes, and discarded candy wrappers. "
;

+ me: Thing 'you'
    isFixed = true
    person = 2
    contType = Carrier
;

+ hamster: Thing 'hamster; cute little; rodent critter'
    "It's cuddly. "
;

+ duck: Thing 'duck; noisy smelly aquatic; bird'
    "It's just an ordinary duck. "
;

Yep, same error. I don’t have much to offer, except this comment in thing.t

The handling of the Clean action is possibly more elaborate than it needs to be by default

I noticed that too. As far as I can see, though, that just refers to the number of tests being made in the verify() routine for dobjFor(CleanWith).

As a test case, I constructed a new action called FrotzWith. I copied everything I could find from the library’s CleanWith code into my FrotzWith … and FrotzWith works just fine. It doesn’t do anything except print a message when it reaches the action() code, but I doubt that makes a difference. I could maybe check that a little further.

Stepping through the debugger, it seems the basic issue is that when this code block evaluates in action.t (https://github.com/EricEve/adv3lite/blob/df5e7ff78f6d3e3deb6a6e521b1f4991c2e6d278/action.t#L427)

        case IndirectObject:            
            verifyProp = verIobjProp;
            preCondProp = preCondIobjProp;
            remapProp = remapIobjProp;
            break;

Those locals all remain nil, unlike for example when the game resolves the direct object. I don’t know why that would be. If you set a breakpoint there and then try the command “dig duck with hamster” (by the way, the absurdity of that redeems the inscrutability of this bug) only the remapResult remains nil.

localsCapture

I think I found it; it’s a typo in the adv3lite file english/grammar.t.

Compare

with

If you edit the CleanWith VerbRule to action = CleanWith, the game output will be

The Lab

A not entirely sterile room filled with bubbling retorts, oscilloscopes, and discarded candy wrappers.

You can see a duck and a hamster here.

clean duck with hamster

The duck doesn’t need cleaning.

And the locals in that code block from my previous post get non-nil values like they should.

That’s it. Eric replied to my email this morning. He already knew about it. I don’t know if I would ever have found it!

Your mention of DigWith was why I found it – comparing search results of DigWith and CleanWith. The adv3lite docs really could use a good search feature, or I need to set something up locally with another tool. I had to use Github’s.

The Learning book is easy to search, and there would be no point in searching the Library Reference Manual. The Library Manual and the System Manual could use a search utility, that’s true, but they have tables of contents.