Defining regions with tables?

Hi folks, weird question for the knowledgable amongst you - is there a way one can define regions using tables instead of writing the list of rooms inside one in sentence form? I realize the answer might be a flat no, but I may as well ask.

You can define regions with a table, in fact. But you can’t do what you want, which is to define the rooms in each region from the table.

This works, for what it’s worth:

Regions are defined by the Table of Geography.

Table of Geography
region
Indoors
Outdoors
The Watershed
The Dales

Sigh! I suspected it would not be possible, from what little I know of the inner workings of Inform. Thanks for confirming!

So, you can do it, at the expense of runtime startup code. “map region” is an alterable property, you know…

Indoors is a region.
Bedroom is a room.  Bathroom is a room.  Living Room is a room.  Kitchen is a room.

Table of Indoor Locations
room
Bedroom
Bathroom
Living Room
Kitchen

When play begins:
	repeat through Table of Indoor Locations:
		now the map region of room entry is Indoors.

This will break if you have nested regions (this only sets the lowest level region). It’s probably not a great idea unless you have oodles of rooms and are having trouble organizing them.

Since you can define the list of regions with a table, you could actually do something where the name of the table for each region is looked up from the list of regions… and this would probably only make sense if you have lots and lots of regions and each one has lots and lots of rooms

Very interesting. No, I did not realize that map region was an alterable property.

I was only mainly to do this because it’s easier for me to read tables than long lists of rooms - my game has only a few regions, but they are very large. It is not necessary for me to perform this operation at start simply so I can read it a little better.

Still learned something, though. Thanks mate!