Terror of the Sierra Madre
Suppose we have a game where we want the player to control two different characters, swapping bodies from one turn to the next. First, the setting, and the two people who will alternately play:
If we tried the text above in Inform, we would find ourselves in the Hay-Strewn Corridor and confronted by both Teresa and Maleska. If "player" is not set to any named person, Inform creates a bland person called "yourself" to represent the player. To avoid this, we set "player" to the person we want to begin as. The player character is normally privately-named, so we'll need to make sure "Maleska" still means what it should.
Now the Corridor contains just two people, and we arrive on the scene as Maleska, with only Teresa facing us.
At the end of every turn we will use the 'now the player is…' phrase. (This looks as if it simply changes the value of "player": which it does, but it also carries out a complicated operation behind the scenes to effect the switch.)
Our two characters already see the Corridor differently, but let's differentiate them further:
In this small example, strength is not used for anything, except that we will display it on the status line:
That last rule doesn't quite do what we might have expected. When we print "[player]", we find that Inform usually prints "yourself". This is because Inform says "you" to mean Teresa when talking to the player-being-Teresa, and likewise for Maleska. We want to override that in this particular story, because the rapid switches of personality are otherwise hard to follow. So:
Test me with "look / look".
The horse stalls are empty: you have already drained the animals, and carried off their corpses. The house will not long sustain you now.
The window throws on the floor a bright square of malevolent sunlight.
Teresa stands opposite you, her fingers wrapped tightly around a bulb of garlic and a cross.
Maleska > (Testing.)
Maleska > [1] look
Hay-Strewn Corridor
The horse stalls are empty: you have already drained the animals, and carried off their corpses. The house will not long sustain you now.
The window throws on the floor a bright square of malevolent sunlight.
Teresa stands opposite you, her fingers wrapped tightly around a bulb of garlic and a cross.
Teresa > [2] look
Hay-Strewn Corridor
The stalls for horses run down one side of the room, but the house has long stood empty. A square window without shutters looks out over the ranch, away toward the Sierras.
Maleska watches you from eyes entirely black.