Thanks, that's a useful tip!
But I still can't customize the messages successfully. Here's my UnlockWith function:
Code:
dobjFor(UnlockWith) {
action() {
"The lock mechanism is stiff and unlocks with a loud CLACK, echoing around the cells. ";
inherited;
}
check()
{
// this condition is clearly not right.
if (self.getKnownKeyOwner()!=me)
{
reportFailure('You try to fit the key into the lock, but to no avail. ');
exit;
}
inherited();
}
}
If I drop the
check function, then if I have the wrong key I get:
Quote:
>unlock door
(with the bent key)
The lock mechanism is stiff and unlocks with a loud CLACK, echoing around the cells. The bent key doesn’t fit the lock.
This is why I figure that echoing a message on a bad check is the right way to prevent this. Ideally I'd want to have the key name available so I can customize the failure message too, but one step at a time...