Handling two of a kind in inform7

Hi all,

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?

Now I actually want to use a pair of balls instead of two balls (the game will have only two balls in total). What would be the best way of doing it? From 2.1. Varying What Is Written (ganelson.github.io) I learned I can do the following:

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?

Feedback is very much appreciated!

Yes, one way would be like this:

Understand "pair of/-- balls/--" as the plural of a ball.

… which will let the player use “pair” and “pair of balls” to refer to the balls. Cf. 17.8. Understanding names

Of course, this can lead to slightly unintuitive scenarios:

Lab
You can see a pair of balls here.

>x pair
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.)

2 Likes

Coming across “None at all available” weirdness is a rite of passage. It’s been working that way for so long that this behavior has tenure, so there aren’t plans to change it.

Bug !7-2122 (resolved)

There’s discussion here on fixing it in one’s own game:

4 Likes

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.

>drop all
You don't have anything to drop.
 
>drop balls
What do you want to drop those things in?
2 Likes