Two things with the same name

I read somewhere in the manual, I think, that two things can have the same name because what is being referred to will be determined by its scope. I can’t find the section now.

However, I had some problem with it anyway, and I don’t know if I can describe exactly what the problem was now because I moved on to something else (not that that totally matters for what I’m about to ask). I know that I wanted there to be a Shaman’s hut, a Your Hut (perhaps the pronoun was a problem), and the ability to see “huts” as some kind of backdrop when you are in a commons area surrounded by huts. I couldn’t make it happen.

In a yet to be developed section, I’d like for there to be two planes. They’ll be in different rooms, but I worry about unforseen problems.

Here’s my question - would “kinds” be a good way to handle this? For example

[code]A hut is a kind of thing.
The Shaman’s hut is a kind of hut.
Your hut is a kind of hut.

A plane is a kind of thing.
A biplane is a kind of plane.
A jet is a kind of plane.[/code]

Since I’m not prepared with the exact details of what went wrong, some general guidance would be appreciated. Try this with “kinds”? And if not, where’s that section of the manual that deals with this?

Thanks!

You don’t need kinds for this. I’m not sure if you mean same name in the game or in the code, but if you mean in the game:

The biplane is in the hangar. The printed name of the biplane is "plane". Understand "plane" as the biplane. The jet is in the runway. The printed name of the jet is "plane". Understand "plane" as the jet.
You can’t have the same name for two different things in the code (as in The plane is in the hangar. The plane is in the runway.), because the compiler can’t then tell them apart. You can have some slack with different sections in the code, like so:

[code]Chapter 1 - Shaman’s hut

Village is a room.

Shaman’s hut is in the village. The hut is scenery.

Chapter 2 - Your hut

Your hut is in the village. The hut is scenery.[/code]
Here “The hut is scenery” refers to the hut described in the same chapter. If you remove the chapter headings “the hut” refers to the Shaman’s hut which is defined first. Note that this not good coding practice, as it leads to hard to see mistakes if you reorganize the code.

The biplane is in the hangar. The printed name of the biplane is "plane". Understand "plane" as the biplane. The jet is in the runway. The printed name of the jet is "plane". Understand "plane" as the jet.
This won’t cause any problems with your code, but it can be potentially confusing to the player. You’ll end up with a game that looks like this:

[code]Hangar
You can see a plane and a plane here.

GET IN PLANE
Which do you mean, the plane or the plane?[/code]
What you want, I think, is for the planes to be called “biplane” and “jet”, respectively, but for the player to be able to refer to either one of them as “plane”. You can do this with just the understand-statements, like so:

[code]The biplane is in the hangar. Understand “plane” as the biplane.
The jet is in the runway. Understand “plane” as the jet.


Hangar
You can see a biplane and a jet here.

GET IN PLANE
Which do you mean, the biplane or the jet?
[/code]

Michael, that looks good. I will try it. I didn’t realize that the “Which do you mean” functionality was built-in. That’s great.