There might be a way to piggyback on the existing adjacency relation somehow, though it wouldn’t be straightforward (relations can’t take properties).
On the other hand, it seems to me that when it actually comes time to fill in this information for all of your locations, you won’t want to have to type a sentence-length declaration for each distance. A table would be more succinct, and combined with a phrase, you could use it to find the distance whenever you needed it (whether that’s to set the travel time during the going action, or to describe the distance when an NPC is giving directions).
Of course, creating such a table and keeping it up to date is a nuisance. Here is a way to autogenerate the table with a default value for distance. The table is output to a separate file so that it can use tabs appropriately. You would then cut and paste the table into your story file and customize it with values that differ from the default.
[code]Owl Hill is a room. The Gully is east of Owl Hill. The Town is south of the Gully. The Foothills are west of Owl Hill. The Cliff is west of the Foothills.
Section - Distance Table (not for release)
The file of Distance Table is called “DistTable”.
To say tab:
(- glk_put_char_uni(9); -)
When play begins:
write “Table of Distances[line break]a-terminus[tab]b-terminus[tab]distance[line break]” to the file of distance table;
repeat with a-terminus running through rooms:
repeat with b-terminus running through rooms:
if a-terminus is adjacent to b-terminus:
append “[a-terminus][tab][b-terminus][tab]1[line break]” to the file of distance table.[/code]
In the generated table there are two entries for each map connection, one entry for each direction. With a little more work, you could make the table more compact (one entry per connection), which would be a better choice as long as you don’t need the distances between rooms to be nonreciprocal. This is the resulting table, copied direct from the file:
Table of Distances
a-terminus b-terminus distance
Owl Hill Gully 1
Owl Hill Foothills 1
Gully Owl Hill 1
Gully Town 1
Town Gully 1
Foothills Owl Hill 1
Foothills Cliff 1
Cliff Foothills 1
(Note that you could also have the game build the table in the same way, supplying your exceptions through a custom phrase, but that would take up valuable start-up time.)
Anyway, even if you don’t use a table to solve this problem, hopefully you’ll find the autogenerate-code-to-a-file technique useful…
–Erik