Here, Brian <
bcl...@es.co.nz> wrote:
> Lets take an example where you were writing an adventure where the player
> had to collect three gold coins to complete the adventure.
>
> If the player typed Get coin then would inform know which coin the player
> is referring to?
Inform (probably TADS too, but I haven't checked) has a notion of
"indistinguishable objects". Ideally, a set of objects are
indistinugishable if they have exactly the same set of noun synonyms.
(Inform's approximation of this ideal is rough, but can be made to
work.)
If you say "get coin" and there are more than one available, the
parser divides them into equivalence classes based on
indistinguishability. If there's only one class available, it
autoselects an item from that class. If there's more than one class
available, it asks a disambiguation question listing the *classes*
(not the objects).
So you might get a question like "which do you mean, a gold coin, a
copper coin, or the silver coin?" (If there were three gold coins, two
copper coins, and one silver coin available.)
In the same situation, typing "take gold coin" would take one of the
gold coins with no question.
> If the player is carrying the first coin and wants to pick up another coin
> with the command 'get coin' then would Inform do an inventory and tell the
> player that he already has a coin making it impossible to pickup another
> coin?
The "take" grammar uses a token which is biased towards not-held
objects. Similarly, the "drop" grammar uses a token which is biased
towards held objects. These mechanisms are somewhat crude, but work
for the simple case of N indistinguishable objects in a room. You can
take and drop them one at a time.
> When doing an inventory is each coin listed or are the coins listed as a
> collection? eg 'you have gold coins'
They are listed as a group. This is a separate mechanism, though. The
list-writing function has a notion of groupable objects, and puts
groups together as it writes the list out.
(Objects don't have to be indistinguishable to be groupable. The
list-writer can produce output like "You have six coins (one silver,
two copper, and three gold).")
You should download Inform 7 and try a few of these cases yourself.
--Z
--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*