Inform 7 Home Page / Documentation
§8.8. Moving backdrops
A backdrop can be in several rooms at once. When created, its position can be given as any specific collection of rooms, or as a region, or even as "everywhere". For instance:
The Upper Cave is above the Rock Pool. The Ledge is east of the Pool.
The stream is a backdrop. It is in the Upper Cave and the Ledge.
Moving backdrops is not like moving other things, because there's no single destination. There are several possibilities:
(a) A backdrop can be moved to a region. If we define:
Lower Level is a region. The Rock Pool and the Ledge are in the Lower Level.
then we can write either of
move the stream to the Lower Level;
now the stream is in the Lower Level;
and either way, the stream is now found in the Rock Pool and the Ledge but nowhere else.
(b) A backdrop can be moved to a category of rooms:
move (object) backdrop to all (description of objects)
This phrase moves the backdrop so that it is now present in every room matching the given description. Example: If we define
then we can write
This phrasing, "move the ... backdrop to all ..." is deliberately meant to look unlike the simpler "move ... to ...", to emphasise that this kind of movement is possible only for backdrops.
What then happens is that the stream is present in whichever rooms are currently wet. But the stream's position is ordinarily checked only after movements, for efficiency's sake. So if the player is in a room which suddenly changes from being dry to being wet, the stream will not magically appear (though it will be there if the player goes out and comes in again). If this is not good enough, the phrase "update backdrop positions" can be used to ensure the accuracy of all backdrop locations after a dramatic change:
update backdrop positions
This phrase runs through all backdrops in the model world and makes sure they are correctly in, or not in, the current location, so that everything appears right from the player's point of view. Example:
Instead of pulling the lever when the Cave is dry:
now the Cave is wet;
now the lever is in the Rock Pool;
now the lever is portable;
update backdrop positions;
say "The old rusty lever pulls away, and the thin cave wall goes with it, so that a stream bursts into the cave, falling to the pool below."
(c) A backdrop can be moved to be either everywhere or nowhere:
say "It's a bright new day!";
now the stars are nowhere.
say "Darkness falls rapidly here.";
now the stars are everywhere.
Because we can invent our own adjectives (see the chapter on Phrases), we can make the conditions for a backdrop as simple or as complicated as we like.
In this scenario, we want the player to be able to take, move, and drop orange traffic cones to seal off one street or another. So we create our own "accessible" adjective as follows:
will tell the traffic backdrop where to appear.
The traffic is a backdrop. It is not scenery. The initial appearance is "Dense traffic snarls the streets, making it difficult to cross even with the lights. Men on motorbikes edge between the cars, and sometimes pull up onto the sidewalks to go around." The description is "It is more or less as usual for this time of day. It's a wonder it ever dissipates, really."
After dropping the orange cones in a road:
say "With steely determination you begin to lay out the orange cones, blocking access to this segment of street. This produces honking and swearing -- but you persevere.";
update backdrop positions.
That accomplishes everything we set out to do, but let's add a very simple puzzle to test it out with:
The manhole cover is a door. "[if location is accessible]Under the cars in the middle of the street, you can just make out the cover of the manhole you need to get into.[otherwise]There's a promising manhole in the middle of the street.[end if]". It is closed and openable. It is below the Town Square and above the Access Tunnel.
Instead of taking the orange cones in Town Square:
if the manhole cover is closed or Town Square is accessible, continue the action;
otherwise say "You'd better not let the traffic back in until you've closed the manhole. There'll be accidents otherwise."
After going to the Access Tunnel:
say "With a stealthy glance left and right, you lower yourself into the access tunnel, thus accomplishing your mission for Chapter 2. To continue your adventure, see Chapter 3: The Vault of Peaquod.";
end the story finally.
And finally, a couple of features from the Activities chapter to make the output more elegant: