Partial sentences ending with periods don't expand the second noun

A person playing my ifcomp game uncovered some odd behavior and I was wondering if it was a bug. I have the following “understand” clauses.

Hooking it with is an action applying to two things.
Understand "hook [something] with [hook]" as hooking it with.

If you type your command without a period, you get this:

>Hook object
(with the hook)
You hook the object.

But with a period you get this:

>Hook object.
I didn't understand that sentence.

So the 2nd noun expansion didn’t happen with the period. Is this expected behavior? Does the period imply that the sentence is final and shouldn’t be mucked with by the parser?

1 Like

I think this may be a long-running bug:

2 Likes

Huh, interesting – I also ran into that when a player (I think the same one as yours, actually!) found that dialogue wasn’t working when there was a period at the end of the sentence (like, ASK ARTHUR ABOUT EXCALIBUR was working, ASK ARTHUR ABOUT EXCALIBUR. wasn’t). I can post my (awful, just awful) code too if that would help suss things out…

EDIT: just saw Brian’s post – wow, weird stuff! I include Emily Short’s Punctuation Removal to remove stray punctuation, but don’t remove periods because I know some people like to put multiple commands on one line. But wondering whether the number of people who do that is greater than the number of people who put sentences at the end of their commands, and which set of folks to prioritize…

If it’s a persistent problem that’s not fixable, one way to deal with it would be to check to see if the player has used a period in a command, and if so, have a message about it the first time it happens, suggesting that players not use a period at the end of a command, or explaining what might happen if they do. I suspect using a period at the end of a command isn’t that common.

You could remove a period only if it’s the last character in the player’s input. That would allow “N. E. UP” to work while fixing a good chunk of the buggy cases.

2 Likes