Capitalize door name at beginning of sentence in room description?

I’ve got some doors named door 101, door 102, door 103, etc. I think I’ve figured out how to make them always capitalized (Door 101) or always lower case (door 101). What I can’t figure out is how to make them capitalized when they appear at the beginning of a sentence.

The description of Room 103 is "Bla bla bla.[paragraph break][Door 103] leads northeast."

Leaves me with

`Bla bla bla.

door 103 leads northeast.`

I know there is something called “in sentence case” but I can’t figure out how to make it work. Putting those words in different places just seems to give me different errors.

This is unfortunately not something that Inform handles very well out of the box. It handles capitalization on articles, but assumes anything without an article is a proper noun that should be capitalized exactly as it appears in the source text.

But, it’s not too hard to add, for a situation like this.

To say (the item - a thing) capitalized:
    let T be "[item]";
    say T in sentence case.

This isn’t a perfect solution because it lowercases all the rest of the letters, which would not be ideal for, say, a person named “van Helsing”. But it should work for your case.

1 Like

Thanks! That seems to have worked!

If you were doing it another way than in the room’s description property itself, a lot of options open up. If it weren’t scenery, you could say:

For printing a locale paragraph about a door (called the portal):
  say the printed name of the portal in sentence case;
  if the portal is door 103, say " leads northeast."

but there would be a bunch of choices to make while considering how best to scale that up to the rest of the doors.

1 Like