changing name after looking at a person

is it possible to change the name of a Person after looking at someone like:

John is a Person. John is in testroom.
Before looking at John:
his name is anonymouse;

you are in the testroom.
you can see anonymouse.

=> look at anonymouse
you can see a sign with his name on his Shirt, his name is John.
(now the printed name of John is John not anonymouse)
you can see John.

I would simply create another person with the same characteristics but different name and say something like–

Mike is a person. Understand "John" as Mike. After examining John: now John is nowhere; now Mike is in the location; say "As you peer at John, the name on his shirt changes....to Mike."

Is this what you mean?

Look at example 32 in the Inform documentation, Gopher-Wood:

[code]“Gopher-wood”

The Ark is a room. A bearded man is in the Ark.

Instead of examining the bearded man for the first time:
now the printed name of the bearded man is “Japheth”;
now the bearded man is proper-named;
say “You peer at him a bit more closely and realize that it’s Japheth.”

[Finally, we need to tell Inform to understand the man’s name, but only when he’s been introduced. For this purpose, we borrow from the chapter on Understanding:]

Understand “Japheth” as the bearded man when the bearded man is proper-named.

Test me with “x japheth / x man / look / x japheth”.[/code]

In your case, if he’s proper-named to begin with, you don’t need to change that; but you would need to change the Understand line to catch the correct condition. Also, note that the name of the action is “examining,” not “looking at”; there can be many different commands that lead to an action, but there’s only one name for the action that you can use in source code. So the action that LOOK AT MAN and EXAMINE MAN trigger must be described in the source code as “examining John.”

…oh, and you’re using “Before looking at John” to do something that kind of thing doesn’t do. A “Before” rule will say something that happens before you perform a certain action–so if you write a “Before examining John:” rule it will take effect when the player types “x John,” just before the examining happens. If you want John’s printed name to be “anonymouse” until John is examined, just set it that way at the beginning:

The printed name of John is "anonymouse".

And then make sure it can be understood properly:

Understand "anonymouse" as John.

In this case you don’t need any extra code to get the game to understand “John,” because it will automatically understand his name as referring to him unless you make him privately-named.

(Also, “anonymous” is spelled with no e, though I’m not sure if you’re making a pun.)

thank you both :slight_smile: i will take the seccond idea.