Messing around this morning in Inform, I thought I’d try creating the Inform equivalent for the adv3Lite line out asExit (north). Seems simple enough: If the player is in a closet, the command ‘out’ should be possible, even though the player is not “in” anything at the moment. What’s the Inform equivalent?
I tried this:
Exitwise is a direction. The opposite of exitwise is entrywise. Understand “out” as going exitwise. Understand “in” as going entrywise.
Followed this with the line:
Instead of going exitwise in the Test Lab, try going north.
This caused the compiler to spit out the following:
Problem. An internal error has occurred: unowned. The current sentence is ‘Understand “out” as going exitwise’ ; the error was detected at line 886 of “inform7/if-module/Chapter 5/Understand Sentences.w”. This should never happen, and I am now halting in abject failure.
What has happened here is that one of the checks Inform carries out internally, to see if it is working properly, has failed. There must be a bug in this copy of Inform.
Oops. Should I report this as a bug, or is it a user error of some sort? (In any case, as Inform hasn’t been updated in more than 3 years, I can’t quite see the point in reporting a bug. But that’s a separate issue.)
Ah, I see, it seems like out is defined as a synonym for exit, so it doesn’t even try the going action. But you could easily catch the that action too…
I should go look at how I did this before. I’m pretty sure I had it working.
Yeah, Inform’s handling of IN and OUT is a bit convoluted. If there’s an “out” exit, or you’re inside a container, it should generally do the expected thing; but if there’s neither, it will default to “exiting” as usually having the better error message.
If you want a more general rule with standardized behaviour, and one that can adjust for enterable containers within the location, this might help you out:
Considered-exiting relates various rooms to one direction (called the room-exiting direction). The verb to room-exit means the considered-exiting relation. The verb to be room-exited means the reversed considered-exiting relation.
The Gazebo is a room. The armoire is an enterable container in the gazebo.
The Rose Maze is a room outside of the gazebo. The rose maze room-exits north.
The Garden is a room north of the rose maze.
Check an actor exiting (this is the convert to going for outside-or-room-exited rooms rule):
let the local room be the location of the actor;
if the container exited from is the local room:
if the local room room-exits a direction (called item):
convert to the going action on the item;
if the room-or-door outside from the local room is not nothing:
convert to the going action on outside;
The convert to going for outside-or-room-exited rooms rule is listed instead of the convert exit into go out rule in the check exiting rules.
First check an actor going outside (this is the convert direction when there is a considered-exiting relation rule):
if the room-or-door outside from the location of the actor is not nothing:
continue the action;
if the location of the actor room-exits a direction (called item):
now the noun is item;
When play begins:
move the player to the armoire, without printing a room description;
There! A single word can be used to exit a container, go “outside”, or move in a non-outside direction of your choosing. Honestly, I might… end up throwing this into my own code now that I’ve put it together.
EDIT 2+: Deleted my old example because it was entirely redundant with an existing rule, and fixed my more formal example for a few more redundancies and oversights while I was at it (both for anyone else digging through here and for my own potential future purposes). Apologies!