Part of every man

Test is a room. Jim is a man in Test. Barbara is a woman in Test. The player is Jim.

A nose is a part of every person. A mustache is a part of every man. A bosom is a part of every woman.


It doesn’t seem to matter which order I arrange these lines, but the compiler finds a way to get it wrong. If I compile the lines as given, it never attempts to instantiate “mustache” at all. Under the Index, under “Kinds,” it says mustache: 0 instances. It does successfully instantiate “your nose” and “Barbara’s bosom,” however.

If I declare the body parts first, and the room and people second, it still gets it wrong: it instantiates “your nose” and “Barbara’s bosom” but it creates “Jim’s mustache” and doesn’t recognize that it’s your mustache.

What do I have to do differently? Is this a bug?

[sub]P.S. I posted this last night on rec.arts.int-fiction, but I figure I’d get more eyeballs here.[/sub]

The problem is with assigning parts to the player, whoever they are. The error arose for Barbara-as-player with bosom as well. Here’s the way I fixed it, kind of a cheesy workaround, but:

[code]Bodypart is a kind of thing. A nose, mustache, and bosom are kinds of bodyparts.

A nose, mustache, and bosom are a part of every person.

Test is a room. Jim is a man in Test. Barbara is a woman in Test.

When play begins:
repeat with x running through every person:
if x is female:
now every mustache that is part of x is off-stage;
if x is male:
now every bosom that is part of x is off-stage.

When play begins:
now every bodypart that is part of Jim is off-stage;
now every bodypart that is part of the player is part of Jim;
now the player is Jim.[/code]

Basically, this will give you a bit more latitude when assigning body parts ( you could now do a slight rewrite to make the bearded lady archetype ( woman with mustache, or whatnot :stuck_out_tongue: ).

The second ‘when play begins’ is pretty self-explanatory, but it also gives you a bit of room to repeat the option later in other ways, if you need.

( I’m sorry about the ‘indent’ phrases, I just didn’t know how to make it appear, and I wasn’t sure if it would be obvious as-is )

Edit: You will also most likely need to put the old ‘yourself’ character off-stage with the second ‘when play begins’ event as well.

Edit the 2nd: Having just noticed the code tag ( :unamused: ), I made the example more presentable.

Thanks! It’s hard to believe this is intended behavior, but if one must work around it, then one must.

Does it help to say “A nose is a kind of thing,” “A mustache is a kind of thing,” etc.? In 5Z71 that generated appropriate noses, mustaches, and bosoms on Barbara and Jim, though the behavior of “yourself” was still somewhat messy. (And without that, the code doesn’t even compile in 5Z71.)

It seems the behaviour has changed quite a lot. Given this code:

A body part is a kind of thing.

A head is a kind of body part. A torso is a kind of body part. A bosom is a kind of body part. A stylish beard is a kind of body part.

A head and a torso are part of every person. A bosom is part of every woman. A stylish beard is part of every man.

The hall is a room. John is a man in the hall. The player is John. Sally is a woman in the hall.

Test me with "x head/x beard/x my beard/x your beard/x my head/x my bosom"

we get the following output:

Looks like when parsing “my” in this example, what the parser understands is actually “any one instance of the kind when only one instance of the kind is in view.” Otherwise it fails to match entirely.

Adding another woman and another man substantiates this. Now, “my” anything no longer counts as valid either.

I’ve been using i7 for about a year and a half, and I honestly can say I’ve never gotten ‘my’ to work with anything ( sensibly ) without some form of sneaky workaround ( not much unlike the example I gave above ). :slight_smile:

Hmmm… now that you mention it, “my” has always been more than a little odd. I’ve been using I7 for upwards of 8 months now, off and on, and I just finished an absurdist little test game that I had to subject to mercy killing before it managed to escape. But if there’s anything I learned to do in short order, it’s playing with regex.

I did faff about a fair bit with body parts to begin with, and wrote some longish code in 5Z71 loosely based on the cave troll example. It was supposed to handle all contained items (worn, held, or incorporated), redirecting “my” to yourself, “his” to the same for all men in the room, and “her” was intended to do the same thing. Only, of course, with the slight problem of “her” being both possessive and personal pronoun, so it had to change that pronoun only if the form “her [something]” was valid, where [something] would be a legal object.

And then disambiguation issues gave me a thorough beatdown, after which I discovered how to work the understanding by relations bit as demonstrated in the Inform manual. I settled for that then, but now, it might just be necessary to dust off some old concepts…

(God, I hope not. That thing was a nightmare.)

Pretty much the same thing happens in 5Z71. But if you delete “the player is John” you get reasonable responses, except that “x my beard” gets you something about John’s stylish beard and “x my bosom” about Sally’s bosom – it’s as though it ignores “my” if it can find a match without it.

My conjecture is that a lot of the issues here have to do with the mysterious “yourself” object – it’s a person rather than a man or woman, which is why it doesn’t get a mustache or bosom or whatever, and it seems to be catching some of the “my” references. (Try “showme yourself” and “showme me.”) It’s supposed to represent “yourself,” and it’s off-stage, but even when I put it in scope “x my head” doesn’t work, so I’m not sure what’s going on there. But the parsing for “my” seems to be kind of goofed up, and this seems to be exacerbated when you’re using “the player is whosit.”

Oh, I looked at an old RAIF thread on this and vaporware suggested (basically)

Understand "my" as a thing when the item described is part of the player.

That helps fix “x my head,” I think.

I’m very new to inform, but, could it perhaps help to indicate that the player is male if the player is Jim/John?

This variation of “Night Before Christmas” is the best I can come up with after fiddling a few hours. It’s hardly perfect, but so far, we can avoid doing unnecessary regexing (which I understand is detrimental to performance). Parsing by hand can be fun to do, true, but it’s often overkill, so I like to keep it in store for those occasion where nothing less would do.

Definition: a person is other if it is not the player.
Definition: a thing is selfish if it is part of the player and the player can see an other person.

A body part is a kind of thing. 

A head is a kind of body part. A torso is a kind of body part. Arms are a kind of body part. Legs are a kind of body part. A tail is a kind of body part.

A mystique is a kind of body part.
A beer gut is a kind of body part.
A club foot is a kind of body part.


A head, a torso, and some legs are part of every person.

Some arms are part of every man. Some arms are part of every woman.
A tail is part of every animal. A mystique is part of every woman. A beer gut is part of every man.


Understand "my" as a thing when the item described is selfish.
Understand "her" as a thing when the item described is part of an other woman.
Understand "his" as a thing when the item described is part of an other man.
Understand "its" as a thing when the item described is part of a neuter thing.

Lisa is a woman. Anna is a woman. 
Brian is a man. 

Toby is a man. One club foot is part of Toby.

Fido is an animal. Fido is neuter.


[Just some stuff for easier testing]

Becoming is an action applying to one visible thing. Understand "become [a person]" as becoming.

Check becoming:
	if the noun is not a person, say "That's not a valid person." instead.

Carry out becoming:
	say "You are enveloped by a sparkling light, and when it clears, you are in the body of [noun]!";
	now the player is the noun.


The Arena is a room. Anna, Lisa, Brian, Toby, and Fido are in the Arena. The player is Anna.
The commode is a container. A stain is part of the commode. The commode is in the Arena.

Test me with "x head/x torso/x his torso/x her torso/x gut/x her gut/x her mystique/x my gut/x foot/x my foot/x my head"

Running the “test me” gives the following output:

(choice of body part is thoughtfully kept in strict adherence to stereotypes)

This works as a starting point, I’d say. We still have the old “I don’t see ‘her’ (name) at the moment” malarkey, to which Endosphere found a solution workable under 5Z71 (I have yet to check if it works under 6E72). Then there is the problematic matter of the parser ignoring the difference between pronouns in certain cases, so that “x its club foot” will happily point you toward both men and women without any mention of that fact. And finally, there is the disambiguation between parts to address.

At any rate, IMO this is not noticeably different in behaviour from 5Z71.

And, presumably,

Understand "your" as a thing when the item described is part of the person asked.

for commands such as
Toby, examine your bellybutton

Indeed.

Also I looked up Endosphere’s hack for 5Z71 and it no longer works in 6E72. Basically, Endosphere discovered that simply restating the parser error rule for can’t find any such thing would produce the correct error message for failing to find something incorporated into a woman (“x Lisa’s beer gut”, in this example). (EDIT: I screwed up the transcription, is all. It still works well. Here’s the code).

Definition: a person is other if it is not the player.
Definition: a thing is selfish if it is enclosed by the player and the player can see an other person.

A body part is a kind of thing. 

A head is a kind of body part. A torso is a kind of body part. Arms are a kind of body part. Legs are a kind of body part. A tail is a kind of body part. A mystique is a kind of body part. A beer gut is a kind of body part. A club foot is a kind of body part.

A head, a torso, and some legs are part of every person.
Some arms are part of every man. Some arms are part of every woman.
A tail is part of every animal. A mystique is part of every woman. A beer gut is part of every man.


Understand "my" as a thing when the item described is selfish.
Understand "her" as a thing when the item described is enclosed by an other woman.
Understand "his" as a thing when the item described is enclosed by an other man.
Understand "its" as a thing when the item described is enclosed by a neuter thing.

Rule for printing a parser error when the latest parser error is can't see it at the moment error:	say "You can't see any such thing.".


Lisa is a woman. Anna is a woman.  Brian is a man. Toby is a man. One club foot is part of Toby. Fido is an animal. Fido is neuter.


The Arena is a room. Anna, Lisa, Brian, Toby, and Fido are in the Arena. The player is Anna.
The commode is a container. A stain is part of the commode. The commode is in the Arena.

Test me with "x head/x torso/x his torso/x her torso/x gut/x her gut/x her mystique/x my gut/x foot/x my foot/x my head"

With this change, Lisa is no longer considered to be absent. Strange, but there it is.

I would submit this to the bug tracker, but I am leery of doing so, as I’ve never done it before, and I fear that somehow I’ll just introduce confusion instead of helping matters. Maybe it’s silly of me, but still…

…ho-kay, I’m being silly, and probably misinterpreting Endosphere’s fix. The changed error rules threw me, I suppose. Anyway, I just bit the bullet and reported the strange behaviour of “her” to the bug tracker.

I’m confused, but since my name came up I thought I’d chime in. Are the questions of this thread answered, or does anyone still need help on something?

I think I ought to explain: few months back when I was just starting out, I made a certain thread on the same subject, in which you posted a solution. Your solution, I now understand, was to overwrite the “You can’t see “her” ([person]) at the moment” rule. Back then, I got it a bit wrong, and assumed you had simply restated the “you can’t see any such thing” rule, and that somehow, that made things work due to buggy behaviour. Stranger things have happened, and I assumed this was one of those things.

Anyway, I’ve reported the error on the bug tracker, and it stands to reason that the feminine pronoun would be a special case (since “her” can refer directly to a person, unlike “his” and “its”). I still don’t understand why Inform accepts “x her scrotum” without complaint, as long as there is a man in the room with the requisite incorporated object. I find it annoying on a personal level, and in this instance it does seem misleading, but is it a bonafide bug?

Definitely a bug!

So I should report that one as well, then? Sorry it I’m being slow on the uptake. For some reason I feel compelled to be as careful as possible before issuing a bug report, as I don’t want to spam the maintainers with unnecessary and/or annoying requests.

See my note on Mantis inform7.com/mantis/view.php?id=162#c522 for some success in this area with output such as:

Welcome
An Interactive Fiction
Release 1 / Serial number 100907 / Inform 7 build 6E72 (I6/v6.31 lib 6/12N) SD

Lab
You can see a straw hat, a machine, Bob and Caitlin here.

test me
(Testing.)

[1] x bob’s hat
Which do you mean, the small red hat or the large red hat?

[2] small
You see nothing special about the small red hat.

[3] x bob’s machine
The machine is currently switched off.

[4] x it’s dial
Which do you mean, the speed dial or the frequency dial?

[5] speed
You see nothing special about the speed dial.

[6] bob, give me your hat
Which do you mean, the small red hat or the large red hat?

[7] small
Bob gives the small red hat to you.

[8] x nose
Which do you mean, Alice’s nose, Bob’s nose or Caitlin’s nose?

[9] my
You see nothing special about Alice’s nose.

[10] x nose
Which do you mean, Alice’s nose, Bob’s nose or Caitlin’s nose?

[11] his
You see nothing special about Bob’s nose.

[12] x nose
Which do you mean, Alice’s nose, Bob’s nose or Caitlin’s nose?

[13] caitlin’s
You see nothing special about Caitlin’s nose.

[14] take caitlin’s hat
(the straw hat)
Taken.

[15] give it to caitlin
You give the straw hat to Caitlin.

[16] x hat
Which do you mean, the large red hat, the straw hat, the small yellow hat, the large yellow hat, the small red hat or the blue hat?

[17] caitlin’s
Which do you mean, the straw hat, the small yellow hat or the large yellow hat?

[18] yellow
Which do you mean, the small yellow hat or the large yellow hat?

[19] large
You see nothing special about the large yellow hat.