Possession in i7?

Sorry to make a new topic, because I’m sure this has come up before at some point. I can’t seem to find it though.

Anyway, I’ve noticed this behavior while writing my game:

You are carrying:
a ham

drop my ham

x ham
You see nothing special about the ham.

x my ham
You see nothing special about the ham.

x your ham
You can’t see any such thing.

I’m wondering why inform 7 so readily accepts “x my ham” when it’s now just a ham on the floor? It’s just an ordinary object, so the player doesn’t have any inherent possession over it, whether held or not. But, I’d really like the game to be able to distinguish these things.

I should say I’m only up to halfway through chapter 4 of the manual. This is just irking me though. So… I thought I’d ask.

BTW, I already know why “x your ham” doesn’t work. I just left it in there for completeness.

Any help would be great. Back to reading the manual, I guess… :frowning:

I7 has come under fire before for its handling of pronouns. I’ve heard that TADS 3 handles them better, although I don’t know what it does with possessive pronouns. There are a couple extensions on the inform7 site that might help, but I have no idea what they do. Have a look at Plurality by Emily Short (built-in) and Pronouns by Ron Newcomb.

It may be necessary to extend their behavior to do what you want though, and I would be cautious about doing it. The parser is designed to accept as many commands as possible, so if a command is worded in a funny way, but it could possibly match something it will probably be accepted. “My” does have meaning in some cases:

[code]Test is a room.

A widget is a kind of thing. There are two widgets in Test.

test me with “take widget/take my widget/take widget”[/code]

Haha, thanks for going to that much trouble. :wink:

My game is very bare-bones right now, so I’m not that surprised it doesn’t do everything that I’d expect.

And by the sounds of it, maybe things like this will be handled in extensions at some point. I won’t look into those until I’ve finished the manual though.

From my limited play, I have noticed some other things I’d like to (eventually) customize, and I’m writing them down, just in case I see something to fix it. :stuck_out_tongue:

I’m coming back to this thread with some working code because I’ve discovered another thing I’d like to find a solution for.

Here’s the current code for my test project:


When play begins:
now the player is Robert;
now yourself is off-stage.

The Cell is a room.

Robert is a man in the Cell. Michael is a man in the Cell.

A tattoo is a kind of thing. A tattoo is part of every man.

Rule for printing the name of the tattoo which is part of the player: say “your tattoo”.

Understand “mine” and “my” and “your” as a thing when the item described is part of the player.

Understand “yourself” as a thing when the item described is the player.[/code]

And I’m pretty happy with how things behave, but I’ve identified something I’d like address.

This is a transcript:

[code]>x my tattoo
You see nothing special about your tattoo.

x your tattoo
You see nothing special about your tattoo.

x his tattoo
You can’t see any such thing.

x michael’s tattoo
You see nothing special about Michael’s tattoo.

x robert’s tattoo
You see nothing special about your tattoo.[/code]

“x his tattoo” doesn’t work. Anyone know why not?

If I change Robert’s sex to female, thereby having only one male in the room, i7 has no trouble understanding “x his tattoo” is asking about Michael’s tattoo. Like so:

[code]>x my tattoo
You see nothing special about Michael’s tattoo.

x your tattoo
You can’t see any such thing.

x his tattoo
You see nothing special about Michael’s tattoo.

x michael’s tattoo
You see nothing special about Michael’s tattoo.

x robert’s tattoo
You can’t see any such thing.

But, as you might notice, this configuration brings up the thread’s original issue, namely “x my tattoo” being treated as “x tattoo”. There’s probably no need to dwell on that…

So, can anyone offer a suggestion how I might catch the “x his tattoo” (in the first configuration) problem? Is it just because the interpretor isn’t bothering to ask for clarification when it can’t work out which tattoo the user means?

I have downloaded/tried Plurality by Emily Short, Disambiguation Control by Jon Ingold and Pronouns by Ron Newcomb, but I haven’t written any custom code from them into my game. I just wanted to see if they would pick this situation up natively, but they didn’t.

Umm, so I guess I’ll go back to reading the manual.

Any help would be great, because it’s these little things that really irritate me while I’m playing a game like this.

Try adding this:

Definition: A person (called subject) is NPC if the subject is not the player. Understand "his" as a thing when the item described is enclosed by an NPC man.

I’m not sure that I7 automatically understands “his,” so this makes “his” refer to things that are carried, worn, or part of some man who isn’t the player. (And I remember from somewhere that things get messy when you try to deal with “her,” because there the possessive is the same as the pronoun referring to the woman herself, but in prison you may not need to worry about that.)

Unfortunately this doesn’t tell I7 to use “his” to whatever the pronoun “him” refers to – try putting two men in the cell, examine one of them, then examine “his tattoo.” If there’s a way of exposing the referent of “his” to the source code, you could maybe use that to line “his” up with “him,” so that this would work, but I’m not sure how to do it; I suspect it involves a bit of I6 code.

Also, there may be an extension floating around to do this.

I7 does understand “his”. On the I6 level it’s considered a “descriptor” like “that” etc. And it is connected somehow to the pronoun “him”. However, it seems that “his” only captures possessions in the sense of things worn or carrried, not parts. (Which is a little confusing, since genitives—like “Michael’s”—captures parts but not things worn or carried.)

Oops. Shouldn’t post on things I don’t know about first thing in the morning. Or perhaps at all. Can you say more about how descriptors work, and if there’s any way to hack this?

Well (breaking my own rule), I think the thing with genitives is that when you create a tattoo as a part of every person, the actual name it gets is “Michael’s tattoo” etc. So “Michael’s” works in this case because it’s part of the name.

You can maybe get genitives to work more generally with a little bit of hacking – use an “after reading a command” rule to turn apostrophe-s into a separate word, and use a [something related by reversed enclosure] token with it so that “Michael 's” gets understood as things Michael encloses. There’s some code here under the spoiler tags (if you copy-paste it you need to fix the tabs and line breaks). It should mostly work, except that “random person enclosing the noun” should be “random person enclosing the item described” or perhaps something slightly more complicated involving conditions to deal with loose noses and noses that are carried by but not part of anyone. The other bugs mentioned in the thread are either fixed or never existed, I think.

I’m pretty sure that’s right. If you have a person named Michael William Fitzpatrick, you’ll be able to refer to “Fitzpatrick’s tattoo” but not “Michael’s tattoo” or “Michael William’s tattoo” - because the full name that Inform gives it is “Michael William Fitzpatrick’s tattoo.”

Unless you use indexed text, I think the only way around that is:

Understand "Michael's" and "William's" as a thing when the item described is part of Michael.

…separately for each person.

Thanks for looking into this. :slight_smile:

I really appreciate it, to all. I think it’s a bit over my head at this stage, but I’ll be sure to refer back to this when I’ve gotten a bit further along in the manual. For now, I’ll just write a note to revisit these things later.

Oh, I did come up with another line that solved one problem. I’m not sure if it’ll work under all situations, but it seems to work under the testing I’ve done. It might be of interest.

[code]Understand “his/hers/her” as a thing when the item described is not held by the player.

Understand “mine/my/your” as a thing when the item described is held by the player.

Understand “yourself” as a person when the item described is the player.

I don’t need the hers/her part really, but I put it in anyway just to see. It works as well.

I won’t know if all this really works until I start putting more into the world and play test things. But I’m putting that off for a little bit.

Thanks again for the great resources.

Be careful: “held by the player” means “carried or worn,” not “enclosed by the player.” So if there’s a widget in the rucksack you’re wearing, you’ll be able to refer it to “his” but not as “mine.” Enclosed also covers component parts, while held does not.

An addendum to my previous post about genitives: If I’m not mistaken, you don’t have to worry about words that are longer than the character limit, because past that point the apostrophe-s will be ignored.

Thanks for the pointer, capmikee.

I think I’ll be using matt_w’s suggestion though, because it does exactly what I was aiming at, and I think my try might pick up a little extra. So, for now I’ll integrate that and then do some writing.