How can you change a locked door description?

Is there a way to change the description of a locked door in Inform 7? I have the player in a room with an exit but I don’t want them to be able to leave until they complete some action, so I wanted the door to tell them “You can’t leave until you’ve completed your business.” The locked door description “The door is locked” seems pretty set in stone, but there’s got to be a way to change that, right?

1 Like

If you turn actions listing on in the IDE, you’ll be able to see what rule is firing to print that response and therefore which one you need to either change or circumvent with a more specific rule. In other words, if you have this:

The Lab is a room. North of the lab is a door called the back door.
The back door is closed and locked.

You’ll get this output:(I added the bold)

n

(first opening the back door)

It seems to be locked.

actions

Actions listing on.

n

[going north]

(first opening the back door)

[(1) opening the back door - silently]

It seems to be locked.

[(1) opening the back door - silently - failed the can’t open what’s locked rule]

[going north - failed the can’t go through closed doors rule]

Now you can add this:

Check opening the locked back door:
	say “You can’t leave until you’ve completed your business.” instead.

There are other ways of doing this, but the point is, the “actions” testing command and the actions index is very helpful for finding the rule you’re looking for.

5 Likes

Thanks! Much obliged :slight_smile: