Understanding Player Name as Yourself

The topic is one example, but in general, is there a way to make inform understand the player’s text input as the name of a thing? Thanks in advance.

“Identity Theft” in the Inform7 recipe book oughta be a good start.

Understand the [X] property as describing [Y].

Well, yes, I know how to collect a name and I know how to make alternate names for the same thing understood. I may have been unclear; where I’m stuck is

[code]Needing Input is a number that varies.
The player’s name is a text that varies.

After printing the banner text:
now needing input is 1;
now the command prompt is "Your name is ".

After reading a command when needing input is 1:
if the number of characters in the player’s command is greater than 10:
say “[line break][italic type]Perhaps something shorter.[roman type][line break]”;
reject the player’s command;
otherwise:
now the player’s name is the player’s command in title case;
now the command prompt is “>”;
now needing input is 0;
now the player is in the Player’s Room;
reject the player’s command.

The printed name of Player’s Room is “[player’s name]'s Room”.[/code]

I can name myself Sam, but if I try something like EXAMINE SAM or GO TO SAM’S ROOM, it doesn’t parse because Sam’s Room is only a printed name and not the actual name of your room, and Sam is just some bit of text.

So I looked up “Gopher-Wood” because I remembered that being helpful with something else I’d done, but that solution doesn’t work with user given input. If I type something like

Understand the player's name as yourself.

Or variations of that, I get various problems, the particular one from above being

It doesn’t look to me like you can understand a text variable as anything (other folks can correct me if I’m wrong), but you can give things text properties and use understanding by properties, like this:

Yourself has some text called the player's name. Understand the player's name property as describing yourself.

And for the room, since you’ve already got the printed name property set, you can use that:

Understand the printed name property as describing a room.

So here’s what you might have:

[code]The Kitchen is a room. The Player’s Room is a room.

Needing Input is a number that varies.
Yourself has some text called the player’s name.

After printing the banner text:
now needing input is 1;
now the command prompt is "Your name is ".

After reading a command when needing input is 1:
if the number of characters in the player’s command is greater than 10:
say “[line break][italic type]Perhaps something shorter.[roman type][line break]”;
reject the player’s command;
otherwise:
now the player’s name of yourself is the player’s command in title case;
now the command prompt is “>”;
now needing input is 0;
now the player is in the Player’s Room;
reject the player’s command.

The printed name of Player’s Room is “[player’s name of yourself]'s Room”.

Understand the player’s name property as describing yourself.
Understand the printed name property as describing a room.

Going to is an action applying to one visible thing. Understand “go to [any room]” as going to.
Check going to when the location is the noun: say “You’re already here.”
Carry out going to: move the player to the noun.[/code]

Note that you have to say “the player’s name of yourself” (at least sometimes) because “the player’s name” is now a property of the yourself object.

Thanks all, much appreciated!