Gopher-wood
Example 32
★★Suppose that we want a character who starts out with a general epithet ("the bearded man") but is later introduced to the player properly ("Japheth"). In that case, we want to be able to tell Inform to stop using an article once the character has been given a proper name. We can do this like so:
"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".
Test me with "x japheth / x man / look / x japheth".
Ark
You can see a bearded man here.
>(Testing.)
>[1] x japheth
You can't see any such thing.
>[2] x man
You peer at him a bit more closely and realize that it's Japheth.
>[3] look
Ark
You can see Japheth here.
>[4] x japheth
You see nothing special about Japheth.
You can see a bearded man here.
>(Testing.)
>[1] x japheth
You can't see any such thing.
>[2] x man
You peer at him a bit more closely and realize that it's Japheth.
>[3] look
Ark
You can see Japheth here.
>[4] x japheth
You see nothing special about Japheth.