Naming a Backdrop conflicting with Room Name

So I am trying to set a backdrop named The Pyramid to be present in two rooms, Pyramid Top and Pyramid Base. However because the names are so similar inform keeps thinking they are the same and thus are conflicting.

I’ve tried the ‘called’ function to specify the name of the backdrop or the room and it just says I am referring to the same thing though I’m sure I’m not.

You wrote ‘The Pyramid Top is a room’, but that seems to contradict ‘The The Pyramid is a backdrop’, as a room and a backdrop are incompatible.

The The Pyramid is a backdrop. The The Pyramid is in the Pyramid Top and the Pyramid Base.

The description of the The Pyramid is "The Pyramid towers above everything."

What am I doing wrong? How do I use the ‘called’ bit properly here?

Inform is confusing “Pyramid” for “Pyramid Top”, since it allows the source to use abbreviated forms of names.

Try:

The pyramid backdrop is a backdrop. It is privately-named. The printed name is "pyramid". Understand "pyramid" as the pyramid backdrop.
8 Likes

Phil’s solution seems fine – and is the usual way to deal with this – but to answer your original question:

I’m not sure why the “called” syntax isn’t working for you (although you didn’t use it in the posted code). It works fine here:

Note that "showme pyramid" will not refer to the backdrop, but to either the Top or the Base (depending upon where you are when you type it). This might be annoying for debugging, but won't affect the gameplay. Also, if you have actions in the game which recognize room names, this kind of clash could get you into trouble.

In some cases, if you need to avoid the confusion by the compiler that Phil described, you can also:

Use unabbreviated object names.

as described in WI §3.2 Rooms and the map. However, this is described by the docs as being “drastic” since you will then have to write out the full names of every object in your source code.

2 Likes

I thoroughly disagree with Graham Nelson here. In general, to avoid unnoticed and unintentional name collisions (which can be hard to debug), I feel one should always use the full names of every object, with the correct capitalization. But that’s getting beyond the scope of the original question.

5 Likes