I am trying to more smoothly handle two of a kind in inform7. I also want to replace the standard reporting bits but not sure how to find out what to replace. I started out with the following:
The test room is a room.
A ball is a kind of thing.
2 balls are in the test room.
The lab room is south of the test room.
When I try drop ball or drop balls in the lab room I get the response You can't see any such thing.
When I try drop ball in the test room I get The ball is already here.
When I try drop balls in the test room I get There are none at all available!
It gets weirder when I add the following:
A cookie is in the test room.
Now when I try drop balls in the test room I get What do you want to drop those things in?
Rule for printing a number of something (called the target) when the listing group size is 2:
say "a pair of ";
carry out the printing the plural name activity with the target.
Now it says You can see a pair of balls and a cookie here., which is perfect. I can still use get ball / get balls / drop ball / drop balls. However I cannot get or drop a pair of balls. Should I do some swapping magic instead and replace two balls with a separate a pair of balls object? Or is there a way to make Inform handling such input as well?
Of course, this can lead to slightly unintuitive scenarios:
You can see a pair of balls here.
You can’t use multiple objects with that verb.
(Because it’s the same as if the player had typed “x balls”; and EXAMINE, by default, does not take multiple objects. You could amend that by adding Understand "examine [things]" as examining., for example.)
Argh of course I should have checked this forum more carefully… searching for the error message would have been a better way to approach this. I will see if the workarounds mentioned work out for me.
Edit: The solution reported does work for drop all. Well I guess I will leave it at that then, no use in trying to fight the parser intricacies, enough work to do already just to get a working game :p.
You don't have anything to drop.
What do you want to drop those things in?