Modified Lock-Unlock

version 2 by Al Golden

  • Home page
  • Beginning
  • Next

  • Documentation

    Allows locking and unlocking of doors, non-doors, containers, and non-containers with or without a key.

    Also this version will not allow something which is unlockable to be unlocked or locked, nor will it allow
    something which is unopenable to be closed or opened.

    Doors and containers need to have the attribute openable and lockable if you want them as such otherwise
    you will never be able to lock/unlock/close/open them.

    Version 2 now REQUIRES the player to be carrying the key or whatever you designate as the matched unlocking
    device with in your hands before you can unlock or lock something with it.

    New properties added for this version:

    key-required,nonkey-required. matched and unmatched.

    NOTE: the verbs "UNCOVER" and "UNWRAP" are now separate from "OPEN".


    The properties unlockable and unopenable have been added to this extension.
    Make an object unlockable if you don't ever want it to be unlocked or locked.

    Objects are now unopenable by default. You need to say that the object is openable
    if you want it to be so. Objects are unlockable by default. They need to be made
    lockable if you want them to be able to be locked. This goes for doors and
    containers as well for both locking/unlocking and opening/closing.

    If an object requires a key then make it key-required. You will not be able
    to unlock it without a "matched" key or whatever you want to call it.

    The key needs to be given the "matched" property.


    WARNING 1: This extension is NOT recommended for brand new I7 Authors.

    WARNING 2 : IT CAN NOT BE USED WITH the LOCKSMITH extension by Emily Short.

    WARNING 3: If there is more than 1 matched key in the game, then each key must
    be matched to whatever it unlocks. Example:if you have a chest key and a box key,
    you must code the fact that the chest key can only open the chest and the box key
    can only open the box. Otherwise you will be able to open the box with the chest key and vice versa.

    This seems somewhat complicated but a work-around is very easy to code for those
    who are experienced with the Inform 7 language.


    It is HIGHLY suggested that you print out this entire extension and study it.

    Report any problems to: