Unlocking it with

Standard actions which change the state of things



locking it withunlocking it withswitching onswitching offopeningclosingwearingtaking off


Unlocking something with something (past tense unlocked it with): applying to one thing and one carried thing

Unlocking undoes the effect of locking, and renders the noun openable again provided that the actor is carrying the right key (which must be the second noun).

Unlocking can be performed on any kind of thing which provides the either/or properties lockable, locked, openable and open. The 'can't unlock without a lock rule' tests to see if the noun both provides the lockable property, and if it is in fact lockable: it is then assumed that the other properties can safely be checked. In the Standard Rules, the container and door kinds both satisfy these requirements.

We can create a new kind on which opening, closing, locking and unlocking will work thus: 'A briefcase is a kind of thing. A briefcase can be openable. A briefcase can be open. A briefcase can be lockable. A briefcase can be locked. A briefcase is usually openable, lockable, open and unlocked.'

Inform checks whether the key fits using the 'can't unlock without the correct key rule'. To satisfy this, the actor must be directly holding the second noun, and it must be the current value of the 'matching key' property for the noun. (This property is seldom referred to directly because it is automatically set by assertions like 'The silver key unlocks the wicket gate.')

The Standard Rules provide locking and unlocking actions at a fairly basic level: they can be much enhanced using the extension Locksmith by Emily Short, which is included with all distributions of Inform.


Typed commands leading to this action

"open [something] with [something preferably held]" - unlocking it with
"unlock [something] with [something preferably held]" - unlocking it with

Rules controlling this action

check    an actor unlocking something with  can't unlock without a lock rule   name  unlist
check    an actor unlocking something with  can't unlock what's already unlocked rule   name  unlist
check    an actor unlocking something with  can't unlock without the correct key rule   name  unlist

carry out    an actor unlocking something with  standard unlocking rule   name  unlist

report    an actor unlocking something with  standard report unlocking rule   name  unlist