adv3Lite: Subtle Disambiguation and Plural Failure

Here’s the output:

TADS thinks ‘them’ is referring to the handles of the shopping bag (a component). Obviously it understands that the handles are plural – and yet it’s referring to them as “that” and “it’s”, which looks rather like a library bug. The handles are declared in the obvious way:

+bagHandles: Component '(bag) handles; them' "The handles are part of the shopping bag. " ;
The larger question is whether there’s a way to coax the library into understanding ‘them’ as referring to the objects just mentioned. It would have to be handled as a general case, by the library, and not by setting the parameters of these particular objects, because something similar might come up in almost any scenario – “On the table you can see a sharp knife and a bright red apple.” – that kind of thing.

To the bagHandles I add the obvious bit:

dobjFor(Take) {remap = shoppingBag}

This creates a new and misleading output:

Ah, but the player has just picked up the shopping bag, NOT the battered trumpet. I can add a dobjFor(Take) report() block, which will clarify that the bag is being picked up – but that doesn’t solve the problem either, because now ‘take all in trash can’ will ONLY print the report for picking up the shopping bag, even though the trumpet has ALSO been picked up. The report() code for one object is overriding the reporting of what happens with the other object.

This is what makes writing IF so much fun… :open_mouth:

You have defined the word “them” to be an adjective of the handle object, so the parser knows you mean the handles when you say “take them”. But it doesn’t know the object is a reference to a set of things and therfore should be referred to as “they”.

To tell the parser that, you need to add another “them”, after the third semicolon, to signal to the parser that the handles object is a plural…

+bagHandles: Component '(bag) handles; them;;them'

Then you’ll get…

See the Adv3Lite manual discussion of basic properties…

file:///D:/dev/tads/lib/adv3Lite/docs/manual/thing.htm#thingprops

(And in case you haven’t found it yet, the Adv3Lite manual has a nifty feature missing from previous docs—an index. Look under Part V—Final Moves in the Table of Contents page.)

Jerry

You’re right – I’m still getting used to the vocab property. Adding a couple of semicolons does indeed allow the parser to refer to the handles as “those.” But now “them” has no meaning, as shown in this output:

[code]>look in trash
In the trash can you see a battered trumpet and a shopping bag.

take them
I’m not sure what you mean by “them”.[/code]
Not sure this is a problem that needs to be fixed, as ‘take all in trash’ works. It’s just one of those parser things…

Don’t take the first “them” out when you add the semicolons.

If you define it as…

+bagHandles: Component '(bag) handles; them;;them'

…then it should work as you expect it to. The first “them” is part of the vocabulary. The second “them” is a flag to the parser.

Jerry

BTW, there are other ways to solve this problem…a Doer, for example, if you want more control over what gets taken and what gets displayed in the game window under specific conditions that you define. You could, for example, have “take them” mean take both the trumpet and the shopping bag, without reference to the handles, if that’s what you wanted when looking in the garbage can. Then, everywhere else, “take them” would still refer to the shopping bag handles if they’re in scope.

Here’s a Doer from my current WIP, for example, that overrides "take " if the object is “all” or if the PC is in the hibernation chamber. Otherwise, “take” works as defined by the library…

// take Doer 'take Thing' execAction(c) { if(c.dobjNPs[1].determiner == All) { "Taking inventory of everything in sight could take a bit of time; try focusing on just those items of interest. It should go faster. <.p>"; abort; } if(gPlayerChar.location == hibernationChamber) { if(c.dobj == satchel || c.dobj == straps) { "You reach down to the straps near your feet and unbuckle them. <.p>"; } } inherited(c); } ;

Probably not. I don’t want ‘them’ to refer to the handles in this situation. I want it to refer to the two objects (the shopping bag and the battered trumpet).

Then I would probably use a Doer.

You can restrict the locations where your override of the Take command is invoked with the “where” property (part of the Doer but external to the execAction) and restrict or identify the items to be taken with “if” statements within the Doer, as shown in the example.

Jerry