Parent region of region

This may be obvious but how do you find the parent of a region? The main reason for this is I’m trying to write an extension that will change the status line to show the parent region and then the location. This is why I can’t just hard code the region since the extension could be used in different games.

Example source:

Alpha Base is a region.

The Decon Zone is a region.
The Landing Zone is a region.

The Decon Zone is in Alpha Base.
The Landing Zone is in Alpha Base.

The goal here is that even if the player is in a room in the Decon Zone, the status line will report Alpha Base. (Actually, I would do “Alpha Base (Decon Zone)”.)

Might have stumbled upon an answer:

To decide which region is the outer region of (R - a region): (- parent({R}) -).

When play begins:
	let R be the map region of the location;
	let RR be the outer region of R;
	say "[RR]".

That works in that RR is the parent region. I just need to make that a bit more usable.

An alternative way to do this is to assign each region some text called the regional description, and print that on the room description header every time you look in one of those regions.

In theory the I7 “regional containment” relation should handle this, but it doesn’t support the case of region-in-region testing. So the only way to get this is the I6 parent() function, as you have found.

Is this actually intended? I always thought regional containment did allow region-in-region testing, and even had old code that assumed that, but checking now I see that it doesn’t work (at least in 6M62). The documentation seems to suggest otherwise, however - on the “regional in”, WI 6.11 says:

Should this be a bug / feature request?

Is this what you are trying to accomplish?

[code]“Location, Location, Location”

When play begins:
now the left hand status line is “[shortlocate]”.

Alpha Base is a region.
The Decon Zone is a region.
The Landing Zone is a region.
The Decon Zone and The Landing Zone are in Alpha Base.

Room A is in Decon Zone.
Room B is north of Room A. Room B is in Landing Zone.

To say locate:
say “You are in [the player’s surroundings] within [if the location is in Alpha Base]Alpha Base - [end if][if the location is in The Decon Zone]The Decon Zone[end if ][if the location is in The Landing Zone]The Landing Zone[end if].”

To say shortlocate:
say “[if the location is in Alpha Base]Alpha Base - [end if][if the location is in The Decon Zone]The Decon Zone[end if ][if the location is in The Landing Zone]The Landing Zone[end if]”

Carry out looking:
say “[locate]”[/code]

I didn’t see that the docs say that regional containment works on regions… yes, that makes it a bug.

Bug reported: http://inform7.com/mantis/view.php?id=1982