Capitalizing room titles

I’m trying to always capitalize room titles in my Inform 7 game.

I would expect that it would be something like this:

Rule for printing the name of a room: say "[the player's capitalised surroundings]".

But I have two issues. First, I can’t get “[the player’s capitalised surroundings]” to work in any situation even though it is in the Inform 7 manual.

Second, this just freezes the game when I try it without ‘capitalised’:

Rule for printing the name of a room: say "[the player's surroundings]".

This works though

Rule for printing the name of a room: say "this placeholder text".

I recently had similar questions. Here’s that thread:

Hope this helps. And you’re totally in my club now!

1 Like

Haha, thank you. I googled but did not find that thread.

Edit: I don’t think that actually solves my problem. I think you are trying to print the room name in the description, which I was able to do. I am trying to modify the bold header itself.

However the extension there by Nathan Nerode does what I need I think. I am not sure how to install it in Borogove (the web interface) though and I expect there is a more straightforward way.

Normally you’d just define the room names capitalized to begin with. What’s the situation in which you want to print them in lower case?

Yes, that works, but sometimes I move things around in the story and then the uncapitalised variation is the first time that room appears in the source code.

I have found a solution though in another thread and adapted it for my purposes:

Rule for printing the name of a room (called the chosen room):
say the printed name of the chosen room in title case.

If you say

The printed name of the Blue Grotto is "Blue Grotto".

…then it doesn’t matter what order the source is in.

Hmm, I guess that is better if I decide to go back and change room titles.

Yes, I’ve done that before - if you write a reference to a room in lower-case before you define it, Inform will take the first mention in source-code order as the printed name. Such as:

Living room is a room. "It's a living (room)." South of Living Room is kitchen.

Kitchen is a room. The description is "It's a kitchen."

In this case, the printed names as first mentioned will be “Living room” and “kitchen” even though I’ve capitalized Kitchen when I define it and Living Room later.