I’ve been perusing the forums pretty much all day today, trying to resolve one niggling little problem that seems to have been bouncing around the community for years.
Now, I’m by no means a master of Inform 7, and I’ve needed to come to the community for help in the past, but I think that today I might be onto something.
I’m not going to link to other topics just at the moment, because as I said, I’ve been bouncing around between posts for hours and I’m not really sure where all of the code I’m using to get this far has come from.
The issue at hand is one where, when giving actors body parts, and then setting the player to be a certain actor, referring to
"my peg-leg" when the player character doesn’t have a peg-leg causes the parser to refer instead to a different character’s peg-leg. This is obviously less than desirable.
I managed to prevent this from happening by doing the following:
[ Allow the player to refer to their own body parts using "my". ] Understand "myy" as a body part when the item described is part of the player. After reading a command: if the player’s command includes " my " begin; replace the matched text with “myy”; [say “The player’s command is [the player’s command].”;] end if.
This works to prevent automatically referring to a different character’s peg-leg, but results in a different undesirable response. For example, inputting
examine my peg-leg might result in
I only understood you as far as wanting to examine your hook-hand
It occurred to me that this is the same error as you would get in the following scenerio:
The playground is a room. There is a red ball in the playground. There is a jungle gym in the playground. Test me with "examine red jungle gym".
The problem now has nothing to do with the word “my” and how it’s being handled as a pronoun, but instead arises because the parser recognizes “my” as the first word in the name of an object, only be be thrown a second object immediately after. It’s effectively reading the commands as
examine my hook-hand peg-leg and
examine my red ball jungle gym.
Alas, this is as far as I managed to get. I understand the problem, but I’m not sure how to come up with a solution. Perhaps somebody out there can help me out.