PROBLEM. Each region can only be declared to be inside a single other region

I’m getting this error when trying to compile, although I’ve only put each room in one region. I broke down my list of rooms included in each region into individual statements to see where the problem is. Apparently some rooms which share a word in the name are causing confusion, as the problem is only reported in instances where there are rooms with names like “Bar” and “Street by Bar.” Is there a way to fix this without renaming a lot of rooms?

1 Like

If you could boil it down to a minimal code example demonstrating the problem it’d be a lot easier to attempt a meaningful answer.

Streets is a region.
Street by Bar is in Streets.

Indoors is a region.
Bar is in Indoors.

Inform is fairly smart about understanding ambiguities like this, but in practice “fairly smart” means it still makes really frustrating mistakes sometimes.

The best solution is to not have the internal name of any object in your game be a subset of the internal name of any other object. In other words, have a Bar Room (or just “Bar-place” with printed name “Bar”) instead of a Bar. That will let you manually disambiguate by using the whole name when needed.

But, in your specific case, I believe you should be able to fix it by explicitly saying “Bar is a room in Indoors”, which clarifies that you’re talking about a new object and not an existing one.

4 Likes

Oddly, that seemed to take care of some of the errors but not all. I may have to rename some rooms.

Either of these work:

Use unabbreviated object names.

Streets is a region.
Street by Bar is in Streets.

Indoors is a region.
Bar is in indoors.

or (just changing the order)

Indoors is a region.
Bar is in indoors.

Streets is a region.
Street by Bar is in Streets.

But Daniel’s right, of course, that you’re best off not having objects whose names are substrings of other objects’ names.

3 Likes

I couldn’t get it to work without changing names, so I gave my streets names and now everything seems to be working. Thanks!

1 Like