Pronoun problems [solved]

I’m running into a problem with pronouns, and my searchings through the forums and included documentation have given me nothing to go on.

In my WIP I have a player character who will eventually be encountering and conversing with various NPCs. I’d like to be able to use the “his/her” pronoun when in the presence of an NPC to examine various features of the NPCs, but I seem to be at a loss for how to do this. Take a look at this excerpt:[code]“Pronoun test” by Joel Webster

Blank room is a room.

A body-part is a kind of thing.
A belly button is a kind of body-part.
Every person incorporates one belly button.

Graham is a man in blank room.
Emily is a woman in blank room.

The player is Graham.

Test me with “pronouns / x belly button / x my belly button / x her belly button / x emily’s belly button / x graham’s belly button”.[/code]This results in:[code]Blank room
You can see Emily here.

pronouns
At the moment, “it” is unset, “him” is unset, “her” means Emily, “them” is unset and “me” means Graham.

x belly button
Which do you mean, Graham’s belly button or Emily’s belly button?

x my belly button
You can’t see any such thing.

x her belly button
I only understood you as far as wanting to examine Emily.

x emily’s belly button
You see nothing special about Emily’s belly button.

x graham’s belly button
You see nothing special about Graham’s belly button.[/code]What I want to happen is to have the disambiguation read “Which do you mean, your belly button or Emily’s belly button?”, and I’d like the two following lines to work properly. I’m currently running on a lack of sleep, so that might have something to do with my frustration, but I don’t even know how to begin to attack this.
Thanks in advance for your help!

When you make every object of a certain kind incorporate an object of a certain other kind Inform 7 is hard coded to give the parts names like this. It doesn’t check at run time whom the belly buttons belong to; the body-parts are given their names when the game compiles, and there is very little to do about that.

You could try things like “Understand “her” as a body-part that is part of a woman” or something to that effect, but I’m not sure if that compiles.

If I remember correctly you can fix the “Graham’s belly button” issue by reordering your source code a little – I think by putting “Graham is a man in the living room. The player is Graham.” before “Every person incorporates a belly button.” Then that belly button will get the name “your belly button” instead of “Graham’s belly button.” (There may be a bug relating to that, though I forget what it is.)

Unfortunately, IIRC handling “her” is difficult, because it can be a straight-up pronoun or a possessive (dative/accusative as well as genitive, or something like that). Someone else may know what to do; otherwise, you could just make Emily the PC…

OK, I found the passage in the documentation that discusses the “Graham’s belly button” problem. It’s section 4.14, “Assemblies and Body Parts”:

In earlier versions of I7, “A nose is part of every person” and “Every person incorporates a nose” didn’t always work the same way, but now they do, I think.

The bug I was thinking of was this one, which has to do with genders – if you want to say “An Adam’s apple is part of every man” then the Adam’s apple won’t always be generated when you make the player a named man. But that isn’t what you’re trying to do here, so you may not run up against it.

Thanks, I’ll have to try those suggestions in the morning.

Another issue (probably related) occurred in an earlier iteration. I’m away from my inform computer right now, but what happened was the disambiguation read something like: Which do you mean, yourself's belly button or Emily's belly button? Which is equally frustrating.

I’ll apply your suggestions tomorrow and let you know what I find. Thanks again!

You know, when pronoun trouble comes up someone really should link this.

ACTUALLY USEFUL UPDATE: I think the way to implement Felix’s suggestion about “her” is this:

Understand "her" as a thing when a woman incorporates the item described. 

or “when the item described is part of a woman,” I guess.

Yes, that’s it!

That will give you the response

but you can prevent that disambiguation easily by phrasing the understand statement thus:

Understand "her [body-part]" as a thing when a woman incorporates the item described.

I’ve tried your suggestions, and they mostly work.
Thanks to your advice, the pronoun problem with the PC using third person instead of second is solved.

However, the whole business with “her” is not going to be solved so easily. Understand "her [body-part]" as a thing when a woman incorporates the item described. Gives me this result:> x her belly button Which do you mean, your belly button or Emily's belly button?Which is a sideways step from the original “I only understood you as far as wanting to examine Emily.”

I’ve tried various permutations of Understand "her [body-part]" as a thing incorporated by a woman when a woman incorporates the item described. but the parser rejected this.
So my next plan of attack was: Does the player mean doing something to a thing incorporated by the player: it is unlikely. And this gives me:> x her belly button (Emily's belly button) You see nothing special about Emily's belly button.Which is what I was hoping for, except for the disambiguation message. I’m sure I can just fudge my way around this somehow.

I think I might need to do something with a “To decide who is the most likely woman” statement, though I’m unfamiliar with the proper use of those as well. I’ll keep plugging away on this, please let me know if you have more insight on the matter.
Thank you for your help!

Will Understand "her [body-part]" as a thing when a woman incorporates the item described and the player does not incorporate the item described. work?

That doesn’t work.
I think that would work if it were something that only Emily incorporated. The problem is that there are many pieces of a person that are common to both men and women (such as belly buttons), so it still asks me which do I mean.
If it were something that only Emily were incorporating, then I think your statement would work.

I greatly appreciate all of the help you’ve given me. Here is what I have now:[code]“Test” by Joel Webster

Blank room is a room.
Empty room is south of blank room.

Graham is a man in empty room.
Emily is a woman in blank room.

The player is Graham.

A body-part is a kind of thing.
A belly button is a kind of body-part.
Every person incorporates one belly button.

Understand “her [body-part]” as a thing when a woman incorporates the item described.

Does the player mean doing something to a thing incorporated by the player: it is unlikely.

Test me with “x belly button/ n / x belly button / x my belly button / x her belly button / x emily’s belly button”.[/code]Which results in:[code]Empty room

x belly button
You see nothing special about your belly button.

n

Blank room
You can see Emily here.

x belly button
(Emily’s belly button)
You see nothing special about Emily’s belly button.

x my belly button
You see nothing special about your belly button.

x her belly button
(Emily’s belly button)
You see nothing special about Emily’s belly button.

x emily’s belly button
You see nothing special about Emily’s belly button.[/code]I like the way this works now. My only nitpick is the disambiguation statement under “x her belly button” but I can live with that for now.

I’m going to mark the thread solved, but if anyone has any insight on how I might eliminate that one last thing, I’d appreciate it.
Thanks again for all of your help :slight_smile:

You could try this, though it might be a bluntish instrument:

Rule for clarifying the parser's choice of Emily's belly button when the player's command includes "her": do nothing.

EDIT: And you can use a similar trick to make sure that 5 doesn’t ask for a disambiguation:

Does the player mean doing something to a thing incorporated by a man [or "the player", if you like]: if the player's command includes "her": it is unlikely.