There are three kinds of food pouches available in the galley—steak, potatoes, and vegetables. In order to eat them, the PC must properly prepare them, a process which begins with adding water to rehydrate.
To implement this scenario, I have defined a FoodPouch class with three subclasses, one for each of the different food types. The primary noun for each of the classes is ‘pouch’ and each class is further disambiguated by a disambigName = ’ pouch’…
class FoodPouch: Thing
vocabWords = 'pouch;food;package'
disambigName = 'food pouch'
class VegPouch: FoodPouch 'pouch;medley vegetable veg veggie;packet
disambigName = 'vegetable pouch'
class SteakPouch: FoodPouch 'pouch;filet mignon steak;packet'
disambigName = 'steak pouch'
class PotatoPouch: FoodPouch 'pouch;scalloped potato potatoe;packet
disambigName = 'potato pouch'
I have defined an AddTo verb and a ‘water’ object, so the first step in preparing the food for eating is the command add water to pouch.
'add' singleDobj 'to' singleIobj
action = AddTo
verbPhrase = 'add/adding (what) (to what)'
missingQ = 'What do you want to add;what do you want to add it to'
resolveIobjFirst = true
There can be more than one pouch in scope at a time.
If there are multiple pouches in scope, the command add water to pouches produces, as it should, a request to disambiguate.
But the parser does not recognize the dismabigName property of the object I’m carrying until I force some kind of update action by issuing an intermediate command.
This produces the following confusion (I’m carrying a steak pouch and a potato pouch; a vegetable pouch is also in scope)…
I need to find some way to force the disambiguation update in the code, not on the command line, so that the pouch I am carrying is identified by its disambigName property the first time I enter the add water command.
I can’t find a hook that will let me force the update. A breakpoint in check() for iobjFor(AddTo) doesn’t stop the action until after the disambiguated name is entered on the command line.