Inform 6: Apostrophe In Object Name

I’m trying to root out a nasty bug and I’m wondering if Object names can have Apostrophe.

Like:

Object → cBadge “Captain’s Badge”

I’ve also tried:

Object → cBadge “Captain@@39s Badge”

I did this in an older game and it worked fine. But now it’s part of the bug. Taking the apostrophe out fixes it. But there could be something else deeper going on.

Thanks for the input - D

Apostrophes are legal inside strings. Maybe there’s an unclosed word (as opposed to string) in an earlier object declaration?

Thanks, that’s what I thought but I wanted to check.

I’m wondering what you mean by this. All my object names are inside of quotes.

An object’s short_name is a string or function that prints out its display name, like “Captain’s badge” in your example. An object’s name variable is the array of words that the parser matches with the object, like ‘captain’ ‘captain^s’ ‘badge’ in your example. (Carets replace apostrophes in words.) Your example might look something like:

Object  captain_badge "captain's badge" RoomName
 with 	name 'captain' 'captain^s' 'badge',
 has    wearable;

Leaving out one of the apostrophes in the name array would cause a lot of problems.

Yeah, including one too many apostrophes would kill the code. But my bug’s not a compile time. It’s part of a LOOK bug for a room description. It’s printing crazy stuff before the room and after. I’ve even got :
*** LOOK ERROR 2 99,46 *** or something like that one time when probing the code.

  • Thanks for the clarification

Huh, if it’s a runtime bug, then I have no idea. The only thing I can come up with is that PrintOrRun() is a total hack, and it may break in weird circumstances I’ve never personally run into; that’s pretty unlikely, though.

Not sure if it’s intentional but here, you’re using a “U+2019 RIGHT SINGLE QUOTATION MARK” (’) character instead of a “U+27 APOSTROPHE” character ('). If it’s the same as in your source code it could explain the issue.

(Discourse converts those automatically when posted: it’s done the same to your example character!)

1 Like

Well I found the error. It had nothing to do with an apostrophe in the object name. Removing that just fixed the game in that certain state.

It had to do with two other objects in the same room. Both had .&name–> being changed to a place holder that wasn’t there. How very pedestrian.

  • Sorry for the trouble
2 Likes