Have uploaded to the Inform extensions page updates of Locksmith and Facing, and a new extension called Approaches. Approaches implements a GO TO… command as found in the manual, but produces somewhat more elegant output, coping with cases where the player’s movement is blocked by a door or some other kind of movement requirement. For instance:
You go north to the aforementioned unwelcoming hut, north again to the unattended pathway, north again to Paris and west to Bois du Boulogne.
You go north to the dusty street, then head west to the church. Entry into the church is barred without a hymnal, though.
You go north to the open field, then head north again to Seamus’ Hut. Unfortunately, you find you lack a key that fits the hut door.
You go to Crimson Chamber by way of Grooved Channel, Shallow Jade Amphitheater, Silver Filigree Prison and Mandarin Casket Room.
or… well, many other variations of your own devising, really. If you try it, though, remember to make sure you have the new Locksmith, too.
2 thoughts on “Another day, another extension”
Nice extension. But I have a problem:
Key 1 unlocks the golden door.
Key 2 unlocks the silver door.
Key 3 unlocks the wooden door.
Master key unlocks the golden door.
Master key unlocks the silver door.
But Inform 7 gives an error, because the golden door has key 1, and silver door has key 2.
Yes, I’m afraid so. That’s not a feature of the extension, though — you’d find the same thing if you left the extension out. In the standard rules, Inform defines the “lock-fitting” relation thus:
Lock-fitting relates one thing (called the matching key) to various things.
The verb to unlock (it unlocks, they unlock, it unlocked, it is unlocked)
implies the lock-fitting relation.
The “one thing… to various things” portion means that each key may open multiple doors, but a given door may be unlocked only by one key.
There are several conceivable ways to deal with that. One would be to use the section-replacing syntax (see the documentation on Extensions for how to replace parts of the library from within your own code). That way, you could replace the relevant portions of the standard rules to make lock-fitting a various-to-various relationship (though you then have the problem that you can’t refer to *the* matching key of a door, since a door might have several matching keys).
Another way — kludgier but faster — would be to write some instead rules that permitted the master key to override unlocking. But that would lose the benefits of Locksmith when it came to the master key.