I have been reading Jim Aiken’s wonderful book “The Inform 7 Handbook.” In it, he gives an example of how one might go about setting a little red barn as an room in a Farmyard. We want the player to be able to not just go north to enter the barn, but to be able to type “enter the barn” and “go inside” and so forth.
So we have this:
The Farmyard is a room. “A muddy farmyard. A little red barn stands to the north.”
The barn-exterior is scenery in the Farmyard. The description is “The barn is freshly painted a
cheerful bright red.” Understand “little”, “red”, and “barn” as the barn-exterior. The printed name of the barn-exterior is “little red barn”.
Little Red Barn is north of the Farmyard. “In the barn you can see some stalls and some hay.”
Instead of entering the barn-exterior:
try going north.
Instead of going inside in the Farmyard:
try going north.
Instead of going outside in the Little Red Barn:
try going south.
Instead of exiting in the Little Red Barn:
try going south.
I understand this example code, and it all works as expected. However, I noticed that if the player enters the barn, they will exit if they just type “exit.” If they type “exit barn” then they get the message, “I only understood you as far as wanting to exit.”
So I figured I would add this:
The barn-interior is scenery in the Little Red Barn. Understand “little”, “red”, and “barn” as the barn-interior. The printed name of the barn-interior is “little red barn”.
Instead of exiting the barn-interior:
try going south.
However, this did not work. The source failed to compile, giving this error:
Problem. You wrote ‘Instead of exiting the barn-interior’ , which seems to introduce a rule taking effect only if the action is ‘exiting the barn-interior’. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.
I don’t understand why “Instead of entering the barn-exterior” works fine, but “Instead of exiting the barn-interior” fails. Isn’t exiting a defined action already, just like entering?