Inform 7 Home Page / Documentation
§8.10. Removing things from play
Some things will occasionally be in a limbo state called being "off-stage": like actors or props not needed in Act II, but perhaps to be brought back on-stage later, they wait on the sidelines. Anything created with no apparent location will start the story off-stage, as in the case of the lamp here:
Aladdin's Cave is a room. The genie's lamp is a container.
(Such things are easy to see in the World index because they are listed after all of the rooms and their contents, not belonging inside any room.) If we wanted to make this clearer to a human reader, we could add:
The lamp is nowhere.
to emphasise the point. In this context, "nowhere" means "in no room". Moving the lamp onto the stage-set, so to speak, is easy:
now the lamp is in the Cave;
now the player is carrying the lamp;
and we can whisk it away again like so:
now the lamp is nowhere;
(We can't say "now the lamp is somewhere" because that's too vague about exactly where it is.) In older builds of Inform, the usual thing was to write "remove the lamp from play", but that's now a deprecated phrase: better to use "nowhere" instead.
remove (object) from play
Removes the given object from play, so that it is not present in any room. We are not permitted to remove rooms, or doors, or the player, from play; but we are permitted to remove backdrops, making them disappear from all ro ms in which they are present. Example:
We can test whether something is on-stage or off-stage with:
if the gold coin is somewhere, ...
if the gold coin is nowhere, ...
Inform also understands two adjectives for this:
if the gold coin is on-stage, ...
if the gold coin is off-stage, ...
Because these are adjectives, they can be used in a few ways which "nowhere" and "somewhere" can't, such as:
say "Ah, so many absent friends. Who now remembers [list of off-stage people]?"
Note that "on-stage" and "off-stage" apply only to things. Rooms, directions and regions are the stage itself: so it makes no sense to ask the question of whether they are "on-" or "off-". Doors are always on-stage; a backdrop, say "the sky", is always on-stage unless it has been taken off by writing something like "now the sky is nowhere".
Some kinds of game objects -- food, for instance -- can only sensibly be used once, and should then be destroyed. The EAT command already implements this, but suppose we also had a category of drinkable potions:
Here we have a destruction action that allows the player to break any fragile items. Once destroyed, these things are removed from play, but we can still refer to them: they are now off-stage. This makes it easy for our sulking character to list the ones that have been destroyed:
Suppose we have a supply closet in our game from which the player is allowed to take red pens. To keep modeling simple, we only allow him to have one in play at a time, and we test this by seeing whether the red pen is "off-stage" before moving it to his possession.
This approach might seem no different from having a single red pen sitting in the closet, but it may be preferable, for two reasons. First, it's not very plausible for a supply closet to contain nothing but a single red pen (well, assuming a well-regulated supplier, anyway); and second, it gives the player a way to get a new red pen should the original be destroyed in a tragic handwriting accident.
Instead of taking the supply of red pens:
if the red pen is off-stage:
move the red pen to the player;
say "You help yourself to a fresh red pen.";
say "You're only allowed one pen at a time. The department secretary is very strict."