I stumbled across a somewhat puzzling behaviour in Inform 7 (6E72). The following code doesn’t compile:
[code]Chapter 1 - Kitchen
The Kitchen is a room.
Chapter 2 - Cellar
The Cellar is south and down from the Kitchen.[/code]
The problem message is
However, to make it compile, it’s sufficient to either take out just the heading “Chapter 2 - Cellar” or, while keeping the heading there, to take out either direction (south or down). The latter option, of course, results in not having both connections.
To be sure, it’s not a big deal, since I can easily say:
The Cellar is south from the Kitchen. The Cellar is down from the Kitchen.
Nevertheless, should I report this as a bug? (Also, I’m not exactly sure what the desired and canonical behaviour is.)
It’s some kind of bug, because removing a section header should not change the compilation. (Unless there’s some kind of ambiguous phrase in your code. But “Kitchen” is not ambiguous.)
I didn’t think this kind of phrasing was supported, but it clearly works (without the section header). So it’s worth reporting as sometimes not working.
Okay, I see what’s going on. I tried this:
The Kitchen is a room.
The Pantry is a room.
The Cellar is south and down from the Kitchen.
The Cellar winds up south of the Pantry. So it’s obviously parsing it as something like “The Cellar is south. The Cellar is down from the Kitchen.” The first half relies on a recently-mentioned room, and recently-mentioned stops being true across section headers.
So it’s definitely a phrasing to avoid – it will generally not do what you expect. You should still report it, but in the category “this did something confusing”. It may not be fixable.
That makes sense, thank you for investigating and explaining! I reported it just now (http://inform7.com/mantis/view.php?id=268).
It’s definitely this. Except in instances where it’s being used to end a series of commas, ‘and’ should only be used to combine complete ideas:
The Cellar is south of the Kitchen and down from the Kitchen.
… is about the shortest way you can make the statement work. Everything after ‘is’ and ‘and’ should roughly echo each other in most assertions.
I actually don’t believe this is entirely a bug for reasons of making map connections like the following:
The Kitchen is a room. The Cellar is down. The Pantry is north and south from the Kitchen.
… Not to say that my example really makes sense, but it demonstrates that the option makes ‘redirected’ pathways a bit simpler to design.
Edited to correct an error in the second code example. Twice.