[I6] Changing pronoun from 'it' to 'them', depending on how object is referred to

I have a bag of marbles. I have a parse_name routine so that I can only refer to it as ‘bag’, ‘bag of marbles’ or ‘marbles’. So far, so good. However, ‘bag’ and ‘bag of marbles’ are singular, whereas ‘marbles’ is plural. Consider the following:

>GET MARBLES
Taken.

>X THEM
I'm not sure what "them" refers to.

I’m sure that I’ve seen something somewhere that allows me to forcibly change the pronoun in situations like this, but I can’t find it. Am I right, or am I imagining things? Can anyone tell me how to do this?

Incidentally, I have used parser_action = ##PluralFound; but this doesn’t change the pronoun for subsequent references.

Forget it. I worked it out. I can clear pluralname if it’s singular and set pluralname if it’s plural and ‘it’ or ‘them’ then works properly.

A reasonable strategy, but note that both “TAKE BAG OF MARBLES. X IT” and “TAKE BAG OF MARBLES. X THEM” sound reasonable to me. It might be worth just setting both the it and them pronouns to allow this.

(I don’t think I6’s library has a built-in way to do this, like I7’s “ambiguously plural” property. But it’s probably fine to just shove an object reference into the appropriate slot in the LanguagePronouns table.)

2 Likes

I definitely recommend this path. If you flip the flag back and forth depending on circumstances, you’ll have an endless trail of bugs where it winds up in the wrong state at some particular time.

I’m not convinced. If I change the LanguagePronouns table, then I have to either change the library or replace the LanguagePronouns table programmatically (assuming it’s possible to replace an array, as DM4 only mentions the ability to replace a routine). In either case, the change is applied globally. I don’t think that’s the right thing to do, as it means every object can be referred to as ‘it’ or ‘them’ regardless of whether it’s singular or plural.

By setting pluralname in the parse_name routine, the change only applies to that object and only when you explicitly refer to that object. I can’t see how that would result in “an endless trail of bugs where it winds up in the wrong state at some particular time”.

Am I missing something here?

Oh no, not changing the way the pronouns work; the same table is used at runtime to store which object each pronoun refers to.

Flipping through the library code, it looks like there’s a convenience method for this: SetPronoun(pronoun, object). Neat; I hadn’t known about that one.

1 Like

I think SetPronoun might have been what I was looking for in the first place. So now we have two potential solutions.

If you use the pluralname method, then it only applies ‘it’ or ‘them’ to the object, not both.

If you use the SetPronoun method, then it applies both ‘it’ and ‘them’ to the object.

Both methods have their advantages and disadvantages. The disadvantage that’s common to both is that each pronoun remembers the last object that it was applied to. If you use that pronoun further down the track, then you might get an unexpected surprise. You are less likely to get unexpected surprises if you use the first method rather than the second, just as you can reduce the unexpected surprises by setting:
Constant MANUAL_PRONOUNS;

Unfortunately, there doesn’t seem to be any way to clear all the old pronouns when you refer to a new object. If the library could do that, then we could eliminate all unexpected surprises.

I believe the library uses SetPronoun every time it manipulates the pronoun table, so you could modify that routine to clear all existing references every time it sets a new pronoun.

But I wouldn’t recommend this either. Something like X BOB. I. X MARBLE. SHOW IT TO HIM is a nice feature; would you really prefer the game say it doesn’t understand “him”?

Inform’s general philosophy on parsing (as opposed to, say, ZIL’s) is that you should try to be as lenient as possible, even if that means accepting invalid sentences—the idea is, the player is much more likely to try “X GREEN” than “X LAMP LAMP LAMP LAMP SHINY”, so accepting the first is more important than rejecting the second. (ZIL’s default library, if I remember right, would reject both for having adjectives not followed by nouns—it cares more about proper English syntax than Inform’s does.)

And part of this philosophy is remembering pronouns until they’re explicitly overwritten. The idea this time is, if the player uses a pronoun, they probably know exactly what they mean by it—they’re unlikely to use “him” if the last male NPC showed up 50 turns ago, so it does no harm to keep that pronoun assigned, even if it’s no longer relevant.

1 Like

You’re right, of course. The Inform approach is very lenient and can make artificial intelligence look really, really dumb when the player enters crazy commands that are somehow understood, yet sensible commands aren’t.

I really need to give this some more thought. I certainly won’t change any of the default behaviour unless I have a good reason for doing so.

This isn’t entirely true. ZIL, as in ZILF standard library and Infocom ZIL (Zork I), accepts adjectives without a noun. In fact only the first adjective is significant in that case. The second example with VERB NOUN ADJ isn’t understood.

Example from Zork I:

>l
Living Room
You are in the living room. There is a doorway to the east, a wooden door with strange gothic lettering to the west, which appears to be nailed shut, a trophy case, and a large oriental rug in the center of the room.
There is a brass lantern (battery-powered) here.
There is a sword here.

>get brass brass brass elvish
Taken.

>i
You are carrying:
  A brass lantern

>examine lamp brass
That sentence isn't one I recognize.

>
1 Like

I stand corrected!

1 Like