Handling automatic selection of goodies in inform7

Building up my game using a ‘test room’ approach to test out game mechanics and the like (much faster than running through the game to get to the interesting bits). Consider the following scenario:

Test Room
There is a white guinea pig here, looking slightly distressed.
Alice > i
You are carrying:
  a utility belt (being worn)
    a white cartridge
    a yellow cartridge
    a red cartridge
  a spray gun (being worn)
Alice > put white in gun
(the distressed white guinea pig in the spray gun)
(first taking the distressed white guinea pig)
I don't suppose the distressed white guinea pig would care for that.
Alice > put yellow in gun
(first taking the yellow cartridge)
You put the yellow cartridge into the spray gun.
Alice > drop red
You haven't got that.
Alice > drop cartridge
Which do you mean, the white cartridge, the red cartridge or the yellow cartridge?

First, using ‘white’ apparently does not raise the disambiguation question. I would want it to refer to the white cartridge since it makes sense to try to put that into the gun instead of the pig.

Putting something in a container seems to have no problem to automatically get that something from another container worn by the player, but dropping something is unable to find it if there is a single match, but does raise the disambiguation question when it is ambiguous? What am I missing here?

I also tried to use “Implicit Actions” by Eric Eve but that did not seem to help here.

Suggestions are welcome!

What triggers disambiguation and how Inform rates the various choices is a deep topic - there was a recent thread on it that I’m not immediately finding - but happily, all you need here is a Does The Player Mean rule. Something like this should work:

Does the player mean inserting a cartridge into the spray gun: it is very likely.

(Assuming you’ve defined cartridges as a kind of thing).

EDIT: found the thread!

1 Like