Treating an object as both singular and plural in Inform 7

I have a stack of paperwork as an object in my game. Some testers refer to the object as “it” while others refer to the object as “them.” Is there a way to make the parser recognize the object as either singular or plural?

This doesn’t seem to cut it:

Understand "it" or "them" as the stack of paperwork.

Yielding:

>take them
I'm not sure what 'them' refers to.
1 Like

The Standard Rules have a property for this, although I’m not sure it’s documented.

The stack of paperwork is ambiguously plural.

…which gives us:

>x stack
You see nothing special about the stack of paperwork.

>get them
Taken.

>drop it
Dropped.
3 Likes

Thanks! It appears to be mentioned only in Example 249: Olfactory Settings

1 Like

Re-reading my answer, I wish I had said “The Standard Rules has a property for this”!

5 Likes

Just as an extra observation, I find I often want the other way as well, which would potentially be called ambiguously singular.

Example: I might have a trees plural object, for which I also want to accept ‘tree’. If the player types X TREE, CLIMB IT, the ‘it’ won’t match because the object’s plural.

So I have a flag called ‘p-switchy’ I can set on objects to make them take both ‘it’ and ‘them’ regardless of whether they are singular or plural or whatever:

lab is a room.

A thing can be p-switchy.

Before doing anything to a p-switchy thing:
	pluralswitch the noun;

some trees are in lab. trees are p-switchy.

Understand "tree" as trees.

To pluralswitch (TARGET - a thing): [sets both pronouns 'it' and 'them' to point to the mcguffin]
	set pronouns from TARGET; [get current cases]
	set pronoun it to TARGET;
	set pronoun them to TARGET;

To set pronoun her to (mcguffin - an object): (- (SetPronoun('her',{mcguffin})); -).

To set pronoun him to (mcguffin - an object): (- (SetPronoun('him',{mcguffin})); -).

To set pronoun it to (mcguffin - an object): (- (SetPronoun('it',{mcguffin})); -).

To set pronoun them to (mcguffin - an object): (- (SetPronoun('them',{mcguffin})); -).

Test me with "x tree/climb it/pronouns".

-Wade

5 Likes

That looks quite useful, thanks!

I’ve got an extension for you to try!

This should allow you to list more than one set of pronouns, in whatever order you want.

It’s still got some room for improvement, and I’ve not gotten much chance to debug it, so please send me any error reports you can.

4 Likes

Do you know if this extension works with build 6M62? I may give it a shot soon.

I was not able to get this extension to compile with 6M62.

I did succeed in getting part of the way by:

  • changing the version number to one compatible with that release

  • adding a temporary variable to to the phrase “To demonstrate pronouns about (T - some text) calling them (P - some text):” (line 893) to take care of the comma-separated phrase option inside of a text substitution (line 894)

Details
To demonstrate pronouns about (T - some text) calling them (P - some text):
	let Special Value be the prior pronouns needed, with player viewpoint; [<- this is only needed for 6M62]
	say "Considering [T], as for [those], [they] [have] as [their] pronouns [Special Value]. [Those] [are] able to use such pronouns as [theirs] for [themselves]. [P] [adapt the verb are from third person plural] also for others to use on [them]".

However, there are quite a few i6 inclusions that the 6M62 compiler balked on.
(Note that this extension seems to work just fine in v10.1.2. Thanks @sadiedemight!)

2 Likes