How do I use Plurality by Emily Short?

Hi everyone,

I’m making a text adventure with Inform 7, and I’ve included Plurality, however, I don’t exactly know what it does :blush: . Could someone tell me what it does and how to use it?

Thanks,
Superjax

Plurality offers a lot of handy functionality having to do with inflection and pronouns of objects. For instance, say you want to write a rule which prints a response, but you want the same rule to work both with a singular-named thing (“the shoe”) and a plural-named thing (“the pants”).

After taking something: say "([the noun])[line break]"; say "You pick "; if the noun is singular-named, say "it"; otherwise say "them"; say " up with a smile."

With Plurality, you could simply say this:

After taking something: say "([the noun])[line break]"; say "You pick [it-them] up with a smile."

Plurality offers a bunch of useful phrases in that vein. It’s a really neat extension.

Normally I wouldn’t recommend referring to the Treasures source code for anything, because it’s a hackish mess … but it does make pretty extensive use of Plurality for generic responses (because it depends, more than many games, on generic rather than specific stuff). You can download it from the IFDB at:

ifdb.tads.org/viewgame?id=8upuvdnsk4sho6ac

If you do a search in the source for things like [it-they], you’ll see the juice. To skip to some of that right here, here’s the game’s code for generically describing something:

[code]Chapter of the Description Library

The description of a thing is usually “[one of][GDSC1][or][GDSC2][or][GDSC3][or][GDSC4][or][GDSC5][or][GDSC6][or][GDSC7][or][GDSC8][in random order][run paragraph on]”.
To say GDSC1: say “You [cotton] nothing [one of]unusual[or]remarkable[or]special[in random order] about the [noun].”;
To say GDSC2: say “It[’]s [one of]just[or]only[in random order] [a noun][one of], but [it-they] hath a certain charm[or], like any other[or], with all that entails[in random order].”;
To say GDSC3: say “It[’]s the finest example of [a noun] you[’]ve seen since you were enslaved.”;
To say GDSC4: say “[Cap it-they of the noun] remind[s] you of [a noun] from your childhood.”;
To say GDSC5: say “Now that you mention it, [it-they] really [is-are] a [italic type][one of]sinister[or]peculiar[or]perplexing[or]menacing[or]foreboding[or]mysterious[in random order][roman type] example of [a noun].”;
To say GDSC6: say “[Cap it-they of the noun] remind[s] you of the old [one of]folktale about[or]legend of[or]tavern tale about[or]fable of[in random order] the [one of]maiden[or]Warlock[or]clever farmer[or]crone[or]scholar[or]beggar[or]brave youth[or]pickpocket[or]ASTEROID WORM[in random order], the [noun], and the [one of]razing of GOD CITY[or]murder of the FIRST HOBLING EMPEROR[or]rise of DARTH VIRAXIS[or]the fall of the SKY-MONSTERS from the GALAXY[or]naughty vicar[or]tragic end of the AGE OF LEGENDS[in random order].”;
To say GDSC7: say “You can[’]t see any [noun] here![paragraph break]Oh, wait, there [it-they] [is-are].”;[ Perfectly ordinary [noun].";]
To say GDSC8: say “As you look upon [the noun], you can[’]t escape the feeling that [the noun] [is-are] [one of]examining [i]you[n] in return[or]concealing something[or]showing off a bit[or]familiar to you[or]gently infused with SORCERY beyond barbaric understanding[in random order].”;

The description of a person is usually “[one of]You [cotton] nothing exotic, enthralling, sexy or unusual about [the noun], at least by barbarian standards.[or]You [cotton] nothing about [the noun] that you would consider a threat.[or]If thou hast seen one [noun], thou hast seen them all.[cycling]”

To say cotton: say “[one of]see[or]espy[or]notice[or]sense[or]detect[in random order]”;
[/code]

Being able to do stuff like [Cap it-they of the noun] saves an enormous amount of hair-pulling.

Thanks!

How do you use [is-are] properly?

I’ve been trying to make it so that when you shoot something with a gun, it will be able to tell the difference between plural and singlular:

Carry out shooting something with something: say "[If the noun is a person]Krak! [the noun] falls to the ground dead. [Else]Krak! The [noun] [is-are] shot to pieces."; remove the noun from play.

I have been testing this out on some roses:

In the Garden are some objects called roses. Understand "rose" as roses.

However when i shoot the roses in game, it says this:

>shoot roses (with the ECS Rifle) Krak! The roses is shot to pieces.

Amazing grammar, eh?

How would I fix this?

The roses are plural-named. ought do it.

If you type “showme roses” or if you look into the World tab of the Index, you’ll see that the roses are singular-named. I don’t know how the compiler guesses whether an object should be singular or plural, but you can always tell it:

The roses are plural-named.

Apparently the word “some” tells the compiler that the thing is plural, so this works:

Some roses are in the garden.

…but apparently not with the “some things called” structure. My guess is that “called X” stops the compiler from guessing anything about the thing in question.