SOLVED: body parts recognised in showme, but actions only work on people with long names

Hi there, I’m trying to provide special responses for when you interact with someone’s hand. My code looks something like:

The lounge is a room.
The sofa is in the lounge. Elizabeth and James are on the sofa.
Elizabeth is a woman. James is a man.
Greg is a person in the lounge.
A hand is a kind of thing. A hand is a part of every person.
Instead of touching a hand, say "You reach toward [noun], but at the last moment, your fingers shy away."
Instead of eating a hand, say "Yuck."

This should consistently work for everyone; the player, James, Elizabeth and Greg. However, when I say “touch james’s hand / touch greg’s hand / eat james’s hand / eat greg’s hand” I get a ‘You can’t see any such thing’ error.

But when I say “touch elizabeth’s hand / touch my hand / eat elizabeth’s hand / eat my hand” I get the predicted responses.

When I use SHOWME, it shows that all four people have hands as predicted.

What’s happening? Why is this inconsistency occurring?

SOLVED: I use a Mac and I had the “Smart Quotes” feature turned on, which turned all my single apostrophes into a ’ curly apostrophe! This was preventing Inform from reading any of them. Thanks very much, eagle-eyed forum users!

1 Like

Ahhh! I’ve tried it on another person with a name 9+ characters and it works for them too! But why? It seems like it should be the reverse that’s true… I really don’t understand what the parser is doing here.

Huh. If I just paste that into Inform it works for me on all the people. (edit: it works for me both on 6M62 and 10.1.2)

Does rules on / touch james's hand show anything useful, maybe?

This seems to give me a different error … but I’m wondering if part of the problem is that while

test eating with "x james's hand/x greg's hand/x elizabeth's hand".

Works okay with >test eating, doing this on the command line, you need “x james’s hand.x greg’s hand”, etc.

Another issue may be that elizabeth’s is too many letters, so you may want to go with


(If this is off-base, hope the general stuff is helpful in some way.

Do you happen to remove apostrophes in the player’s command, such as with the Punctuation Removal extension?

By default, the parser’s truncates each words to 9 letters, so “elizabeth’s” is equivalent to “elizabeth”. But if you remove the apostrophe, then “greg’s” becomes “greg s”, wich won’t be recognised as referencing a hand.

1 Like

I’ve also tried out the code provided by @lulamorashi
It works when I type “touch james’s hand” myself. When I copy the text provided by @lulamorashi, also "touch james’s hand’ I get the same output as @lulamorashi : “You can’t see any such thing”. Checking via, I see the apostrophe I’ve used in the command I’ve typed is officially an apostrophe unicode character, while the apostrophe I’ve copied from the original post is a “right single quotation mark” character. When I use that character on Elizabeth, it does recognize Elizabeth’s hand.

Note, I am not sure what the official difference is between these two characters. From my keyboard I only get the ‘apostrophe’ one, and I am only able to test the ‘right single quotation mark’ one by copying and pasting.

I have the 10.1.1 version installed btw.

So, to recap: when using the apostrophe character everything works as intended, when using the right single quotation mark character, I get the “You can’t see any such thing” error with James and Greg, but not with Elizabeth.

I hope this helps!

1 Like

Keyboards are usually oly able to type the straight ' apostrophe.

However, the forum converts them automatically into curly ones, so it’s possible the original poster did type a straight one at the prompt but it got converted after pasting the command is the forum, so it might not be the origin of the issue.

The apostrophe in “elizabeth’s” doesn’t matter because of the truncation to 9 characters. In fact, one could even type “elizabethblablabla” and it would work.

1 Like

Likewise. @lulamorashi , what version of Inform are you using? Are you Including any extensions?

Hi everyone, thanks for your help while I was asleep in my timezone haha.

IT’S THE CURLY APOSTROPHE! I’m using Inform 10.1.2. I watched closely and saw that as I typed, my ’ converted into a ’ . I’m using a Mac – maybe it’s a Mac thing?

Here’s a direct copy-paste from the Story window:

rules on

Rules tracing now switched on. Type “rules off” to switch it off again, or “rules all” to include even rules which do not apply.

[Rule “parse command rule” applies.]

touch james’s hand

You can’t see any such thing

Unfortunately, the parser still lives in a world where characters never take more than one byte. @Zarf wrote a Unicode Parser which I had thought hadn’t worked in a while, but I now see that it’s just the case that the latest version never made it to the Friends of I7 Extensions: the version on Andrew’s website was updated for 9.2/6L38 and I just tried it and it looks good in 9.3/6M62. It won’t work as is in v10, but it might be the case that it’s an easy update; I’ll give it a try later.