I’m using PunyInform, but I think this probably applies to the standard library too.
I’m having problems with pronouns for objects which may be considered either singular or plural.
For example: a pile of leaves is a single pile, but multiple leaves. So I’d like it and them to both work.
Another example: I have some gates (a pair of gates which open/close together is the idea), and I allow it be called gate as well, but only one of the pronouns (it or them) works. For example UNLOCK GATE THEN OPEN IT fails.
I don’t suppose there is a nice easy fix for cases like these?
You can write a parse_name routine which decides at parse-time whether the player refered to the object as singular or plural, and sets or unsets the pluralname attribute accordingly.
In the standard library, this comes with an extra challenge, in that them_obj etc can be assigned automatically when the player enters the room (and by default, it is), but PunyInform doesn’t do that.
Cheap scenery uses this mechanism, e.g. you use this code in a room object:
cheap_scenery 'book' 'books//p' "You're not into reading.";
So “them” starts refering to that object whenever it’s in a location and you LOOK? That doesn’t sound great to me. If there are two objects like that, they may compete for setting it last. If you perform an action on one of them, the variable setting doesn’t happen.
You could set it in a before routine, but then you still have the problem that the library will also set these variables.
I think setting them in a routine is useful when swapping out an object for another in code. E.g. if the player opens a box, and for some reason you need to replace the box with another version of the box, you may also change it_word to point to the new box, if it was pointing to the old one