In retesting the code in my Handbook, I’ve hit an example in Chapter 5 that may have worked formerly but doesn’t quite work now. Or maybe it never did, but I didn’t test thoroughly enough. Here’s the code:
The Test Lab is a room. "Many devious tests are conducted here."
[When play begins: Now the player is Bob.]
Bingo is an animal in the Lab. The description is "[if the player is Bingo]You are[otherwise]Bingo is[end if] a peppy-looking cocker spaniel."
Bob is a man in the Lab. The description is "[if the player is Bob]You are[otherwise]Bob is[end if] a heavyset, muscular man."
The player is Bob.
Linda is a woman in the Lab. The description is "[if the player is Linda]You are[otherwise]Linda is[end if] a sultry and curvaceous beauty."
The red button is in the Lab.
Instead of pushing the red button:
if the player is Bob:
now the player is Linda;
say "A strange tingly feeling overtakes you. You feel much more feminine than before.";
otherwise if the player is Linda:
now the player is Bingo;
say "Your head spins. When you recover, things seem to have changed. The world is larger, and you're covered with fur.";
otherwise:
now the player is Bob;
say "You feel odd for a moment Yes, you're human again, and muscular, and male."
You’ll note that I’ve commented out the “When play begins” rule. Instead, I’m declaring by fiat that “The player is Bob.” With the code in this form, here’s the output after the player presses the button and becomes Linda:
Test Lab
Many devious tests are conducted here.
You can see Bingo, Bob and a red button here.
>x bob
You can't see any such thing.
>showme bob
There seems to be no such object anywhere in the model world.
Yes, Bob is shown in the room description, and yet Inform claims he doesn’t exist. If I comment out “The player is Bob” and uncomment my “When play begins rule,” I get a different problem:
Test Lab
Many devious tests are conducted here.
You can see your former self, Bingo, Linda and a red button here.
This is not an improvement. And just for the record, the search engine in the IDE can’t find “your former self” anywhere in the Documentation. So I clearly need to put a full explanation of it in the Handbook.
More urgently, however, I need to make this example work as it’s supposed to work, with Bob but with no former self. How would I do that?