Treating an object as both singular and plural in Inform 7

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