[I7 6G60] Disambiguating "plain" instances of a kind?

I have a situation similar to the following:

[code]“Kind Instance Disambiguation” by Otis

Relative position is a kind of value. The relative positions are left, middle, and right.

A cup is a kind of container. A cup has a relative position. Understand the relative position property as describing a cup.

Before printing the name of a cup, say "[relative position of the item described] ".

An egg is a kind of thing. An egg is usually edible.

Place is a room.

There is a supporter called a table in Place.

There is a cup on the table. It has relative position left.

There is a cup on the table. It has relative position middle. There is an egg in it.

There is a cup on the table. It has relative position right. There is an egg in it.[/code]

This allows commands like “>take egg from right cup” or “>take egg from middle cup”, but I would like the basic command “>take egg” to generate a disambiguation prompt asking “Do you mean the egg in the middle cup or the egg in the right cup?” As it is, the default response in 6G60 seems to be to execute a take on the “leftmost” egg in the underlying I6 object tree.

I thought I would be able to do this via the “asking which do you mean” activity, but it does not appear that this activity is triggered in this case. The parser does not seem to treat multiple “plain” instances of a kind in the same way that it treats two objects that share a name (which, on reflection, makes quite a bit of sense).

Can anyone offer a pointer on how to force this?

I think that (in 6G60 at least) Inform won’t disambiguate between things unless they have some dictionary entries that differ – and understand by relation statements don’t count as different dictionary entries. So adding

Understand "in [something related by reversed enclosure]" as an egg.

won’t work; Inform still won’t disambiguate.

So what I would try is giving the eggs themselves relative position properties and including an Understand line for them. You have to include a new value to account for eggs that are in no cup, and keep updating the positions of the eggs:

[code]
A cup is a kind of container. A cup has a relative position. Understand the relative position property as describing a cup.

Before printing the name of a cup, say "[relative position of the item described] ".

An egg is a kind of thing. An egg is usually edible.

Place is a room.

There is a supporter called a table in Place.

There is a cup on the table. It has relative position left.

There is a cup on the table. It has relative position middle. There is an egg in it.

There is a cup on the table. It has relative position right. There is an egg in it.

An egg has a relative position. Understand the relative position property as describing an egg.

When play begins:
update egg positions.
Every turn:
update egg positions.

To update egg positions:
repeat with Humpty running through eggs:
if Humpty is in a cup (called the goblet):
now the relative position of Humpty is the relative position of the goblet;
otherwise:
now the relative position of Humpty is loose.

Before printing the name of an egg while asking which do you mean: say "[relative position of the item described] ".[/code]

Once this disambiguation-forcing bit is in place I guess you could make it say “in the right cup”:

[code]“Kind Instance Disambiguation” by Otis

Relative position is a kind of value. The relative positions are left, middle, right, and loose.

A cup is a kind of container. A cup has a relative position. Understand the relative position property as describing a cup.

Before printing the name of a cup, say "[relative position of the item described] ".

An egg is a kind of thing. An egg is usually edible.

Place is a room.

There is a supporter called a table in Place.

There is a cup on the table. It has relative position left.

There is a cup on the table. It has relative position middle. There is an egg in it.

There is a cup on the table. It has relative position right. There is an egg in it.

An egg has a relative position. Understand the relative position property as describing an egg.

When play begins:
update egg positions.
Every turn:
update egg positions.

To update egg positions:
repeat with Humpty running through eggs:
if Humpty is in a cup (called the goblet):
now the relative position of Humpty is the relative position of the goblet;
otherwise:
now the relative position of Humpty is loose.

Before printing the name of a loose egg while asking which do you mean: say "loose ".

After printing the name of an egg (called Humpty) while asking which do you mean:
if Humpty is in a cup (called goblet):
say " in [the goblet]".

Understand “in [something related by reversed enclosure]” as an egg.[/code]

The disambiguation here is a bit finicky, though; when it asks “Which do you mean, the egg in the middle cup or the egg in the right cup?” it accepts “right” (because relative position is understood) or “in right cup” but not “right cup,” since that gets processed as the command “take right cup egg.” And I don’t think having “right cup” understood as the egg is desirable, because it’ll lead to disambiguation when the player takes the right cup. Maybe it’d be possible to have “right cup” understood as the egg during disambiguation only? You could set a flag after asking which do you mean but I’m not sure if it’s possible to take the flag off at the right time; perhaps you could do it when executing a command or printing a parser error, but then I suspect that “take egg/x right cup” would lead to disambiguation. Still, that might be an acceptable price to pay.

BTW in this example it’d be good to make the cups fixed in place, or they’ll retain relative position in the player’s inventory.

…now that ShuffleComp’s over, I can say that I had similar problems with indistinguishable slices of bread and teacups in Tea and Toast, though instead of trying to make the player disambiguate I tried to handle it by redirecting the command to the most appropriate object – so if you’re trying to fill a teacup with something, if there’s an empty teacup that isn’t in the cabinet the action gets redirected to that.