Grouping Together Identical Objects

In my game I have two identical objects. Let’s call them maracas. There are only ever two maracas in the game. What I wanted to do was group them together as a pair like so:

A maraca is a kind of thing. 2 maracas are in the music room.

Before listing contents:
	group maracas together.
Before grouping together maracas: say "a pair of ". 

The above gives:

You can also see two maracas here.

It seems that this won’t work doesn’t work unless the objects are named. “A left maraca and a right maraca are maracas in the music room” works, but then you’ve got all the hassle of disambiguation when the player types “take maraca” and I don’t want that. They’re meant to be interchangeable. I’ve found a few similar topics on the forum but they were all trying to solve much more complicated problems. Is there a simple solution I’m missing?

Does this work?

Rule for printing a number of maracas when the listing group size is 2: say "a pair of maracas”.


It does, by God! You have my unending gratitude.

…And it’s all there in §18.12. Printing a number of something. “Always read the manual” :roll_eyes:.


In fairness, I was also flailing around in the grouping sections of the manual and getting nowhere before deciding to see if the adjacent section on printing a number would do the business. And I’m not sure why a rule for printing the number would print the name of the objects too. But hey, it’s Inform, whatever works :slight_smile:

1 Like

It has, er, now been a while since I’ve done any Inform, but is there ever a point where the player needs to or should be able to pick up just one? Because my first instinct would be something like:

The maracas are an item in Room. The indefinite article of the maracas is “a pair of.” Understand “maraca” as the maracas.

I might be off on the exact syntax but basically am trying to convey that just because they are two discrete objects in the real world doesn’t mean that they can’t be one object in the game if you never need to interact with them separately.

1 Like

In this case, there is, otherwise I would have coded them as one object as you suggest. Nevertheless coding things like “a pair of socks” as a single item rankles with me a little, because anyone who’s tried to find a matching pair of socks in a hurry knows that they’re very much not.

(Lampshaded in my early game Goldilocks is a FOX! which includes a pair of gardening gloves that have a tendency to fall off, but because they’re coded as a single object, they both fall off at the same time: “Damn! The gloves just dropped off my hands! Yes, both of them, at the same time! What are the chances of that?”)