Inform 7 Home Page / Documentation


§8.5. Change of properties with values

Changing properties with values is very similar:

now the printed name of the Closet is "Suddenly Spooky Closet"

Inform checks three different things to ensure that this change is safe to perform. Firstly, the value must be the right kind for the property in question, so this for instance would be rejected:

now the printed name of the Closet is 7

Secondly, the object in question has to be allowed to have the given property. This, for instance, would be disallowed:

now the initial appearance of the Closet is "Dusty"

(since "initial appearance" is a property which only things can have, not rooms). Finally, the object has to actually have the property, not just have the right to have that property. Thus:

now the printed name of the Closet is "Suddenly Spooky Closet"

...is only permitted if the Closet is designed with a "printed name". In fact this is certain to be true: all rooms and things automatically have a printed name, which is the short boldface description in the case of rooms, and the usual text briefly describing something in the case of things.

"Now" is a simple way to change many things in Inform, but it's cumbersome to change the map of the model world using "now", because the map is such a complicated arrangement. (It's not a property: it's a sort of mesh of relations.) So a special phrase exists to change map connections:

change (direction) exit of (room) to (room)

This phrase alters the map so that the given map connection is made. Note that connections can be made to rooms, but not doors: the positions of doors are fixed. Example:

change the east exit of the Closet to the Tsar's Imperial Dining Salon

Since "nothing" is not a room, this doesn't allow us to change the exit to nothing, so there is a separate definition of:

change the west exit of the Closet to nothing

change (direction) exit of (room) to nothing/nowhere

This phrase alters the map so that the given map connection is unmade. Example:

change the west exit of the Closet to nowhere

Altering the map itself is not a very subtle way to adjust when and where the player can move - writing suitable rules is usually a cleaner solution - so this phrase is best avoided unless really needed.


arrow-up.png Start of Chapter 8: Change
arrow-left.png Back to §8.4. Change of either/or properties
arrow-right.png Onward to §8.6. Whose property?

*ExampleThirst
A waterskin that is depleted as the player drinks from it.

*ExampleThirst 2
A campfire added to the camp site, which can be lit using tinder.