I’m trying to implement the style of interior door you see in most houses: basically, lockable (without a key) from one side, and not lockable from the other.
Ideally, I want these doors to be as close to invisible as possible, particularly when unlocked - no extraneous messages about opening and closing doors. Really, I want them to have two states - locked-and-closed, or unlocked-and-open.
It’s fairly easy to implement them with Locksmith - almost:
[code]A house door is a kind of door. A house door is usually lockable and locked. A house door is usually scenery. A house door has a room called the latchable side.
Before unlocking keylessly a house door:
if the noun is unlocked, say “[The noun] is already unlocked.” instead;
if the location is not the latchable side of the noun, say “You can’t unlock [the noun] from this side.” instead;
now the noun is unlocked; now the noun is open instead;
Before locking keylessly a house door:
if the noun is locked, say “[The noun] is already locked.” instead;
if the location is not the latchable side of the noun, say “You can’t lock [the noun] from this side.” instead;
now the noun is closed; now the noun is locked instead.
[/code]
However, when traveling from the latchable side, the door is automatically unlocked, and then we get an error message complaining that the door is already open. Also, if trying to lock the door from the wrong side, it’s automatically closed first, and then locking fails, leaving the door in a closed-and-unlocked state.
Is there something like this already implemented somewhere (really just a two-state-only door that otherwise acts as standard Inform doors would help a lot), or do I have to go to the trouble of tracking down every rule that invokes an implicit action?
Additionally, I’d like to implement a “go to [room]” action, similar to the Misadventure example (allowing the player to go to adjacent rooms by name). I’d like the player to be able to travel without being aware of the map directions at all (in a very small map - three bedrooms, two bathrooms, living room, kitchen, and a one-room hallway/common area connecting most of the rooms). It’s very easy to implement up until you add doors. Doors interfere with the adjacency relationship - two rooms connected by a door are not adjacent.