Listing things with non-printed identifiers in groups

I started trying to figure out whether it is possible to have objects understood by words that are not part of the printed name.

Then I thought of this trick which I thought was neat:

Every thing has a text called object identifier. 

Understand the object identifier property as describing a thing.

When play begins (this is the enumerate objects at the beginning rule):
	let N be 1;
	repeat with item running through things:
		now the object identifier of the item is "object #[N]";
		increment N;
		
the lab is a room.

A cat is a kind of animal.

There are 5 cats in the lab

test me with "showme object #3"

The “object #3” works well as such, but the problem it messes up the listing of groups. Instead of “You can see five cats here”, it spells out “You can see a cat, a cat, a cat, a cat and a cat here.”

I’d like to be able to add a “secret” vocabulary for things which does not mess up the listing in groups. Is that possible?

I’ve tried fiddling around with “group X together”, “printing the plural name” etc but I haven’t really found a way to do it.

While the reason for it is different, I ran into a similar result in one of my games. I ended up grouping objects together by hand. This sort of thing:

Rule for grouping together dopply multi things enclosed by a rug (called R) (This is the Group Together the Duplicate-type Dopples On a Rug rule): Let Multi List be a list of texts; If the number of marbles enclosed by R > 0: Let Marble Entry be "[number of marbles enclosed by R in words] marble[s]"; Add Marble Entry to Multi List; If the number of tiny bells enclosed by R > 0: Let Bell Entry be "[number of tiny bells enclosed by R in words] tiny bell[s]"; Add Bell Entry to Multi List; If the number of faintly glowing-stones enclosed by R > 0: Let Faint Entry be "[number of faintly glowing-stones enclosed by R in words] faintly glowing stone[s]"; Add Faint Entry to Multi List; If the number of softly glowing-stones enclosed by R > 0: Let Moderate Entry be "[number of softly glowing-stones enclosed by R in words] softly glowing stone[s]"; Add Moderate Entry to Multi List; If the number of brightly glowing-stones enclosed by R > 0: Let Bright Entry be "[number of brightly glowing-stones enclosed by R in words] brightly glowing stone[s]"; Add Bright Entry to Multi List; Say Multi List.

Later Eleas suggested simpler phrasing for the individual entries, so, this kind of phrasing seems to work too:

If there are rugly listable marbles, add "[number of rugly listable marbles in words] marble[s]" to the new rug list; If there are rugly listable tiny bells, add "[number of rugly listable tiny bells in words] tiny bell[s]" to the new rug list; If there are rugly listable glowing-stones, add "[number of rugly listable glowing-stones in words] glowing stone[s]" to the new rug list;

At that point I didn’t want to go back and mess with the parts I had already done, though, because it had been a challenge to get them to work correctly, so I just used the simpler phrasing in a few places.

Sounds like something might be done here with Brady Garvin’s Object Kinds extension, but then again it may be pointless complexity.

Yes, that’s easy:

The hellhound is an animal.
Understand "fluffy" as the hellhound.

Slightly harder, but described in chapter 18.14.

A cat is a kind of animal. The printed name of a cat is usually "cat".

The admetus cat is a cat in the Kitchen.
The quaxo cat is a cat in the Kitchen.
The alonzo cat is a cat in the Kitchen.
The mephistopheles cat is a cat in the Kitchen.

Before listing contents: group cats together.
Rule for grouping together cats: say "[listing group size in words] cats".

Right, that’s what I thought!

I know that that works, but this does not:


A dog is a kind of animal. 

A species is kind of value. The species are Schnauzer, Bloodhound and Scooby Doo.
A dog has a species. Understand the species property as describing a dog. 

5 dogs are in the kitchen.

when play begins:
	repeat with dog running through dogs:
		now the species of the dog is a random species. 
		
Before listing contents: group dogs together.
Rule for grouping together dogs: say "[listing group size in words] dogs".

It says “You can see four cats and three dogs here” - or however many dogs there were of the first species.
If you take out the rule for grouping together dogs, you get stuff like “You can see four cats and three dogs, dog and dog here.”

It looks like there is something about the “Understand the species property as describing a dog” bit that messes with the grouping somehow.

Inform’s normal behavior is that if the player can distinguish the objects by name (on the command line) the objects should not be grouped. It assumes that there are no “secret” distinguishing names – if you distinguish the dogs with your “as describing a dog” statement, you’ll also distinguish their printed names.

You’re violating that assumption, so you need to do additional work to override the normal behavior.

To be clear, I’m talking about an undistinguished group like “four dogs”.

You can also get a listing like “four dogs (a Schnauzer and three Bloodhounds)”. That’s also handled by the grouping-together and listing-contents activities.

Yeah, I guess. But I still think it’s frustrating that it almost works the way I want. Actually… Oh wait. I think I have it. Hmm. Maybe…