Limitations of GONEAR or code problem?

Okay, so I define a room. I define a person in that room. If I GONEAR that room, the person never exists. I can leave the room and come back and still no person. If I GONEAR that person, the person suddenly exists in that room. If I GONEAR and adjoining room and THEN go to that room without ever having visited that room first, the person exists.

I’m concerned that, though I know GONEAR is intended only as a debugging tool, I may not be defining my persons or rooms correctly. Right now, it’s very basic and standard stuff. There’s a room. There is a person in that room.

Is there something I’m missing?

It only does this with NPCs, by the way. Objects appear to show up fine.

This doesn’t directly address the “invisible NPC” problem, but it might provide a diagnostic clue: When you’re in the room where the NPC is supposed to be but isn’t, try using “showme” to take a look at the NPC in question; it should tell you, among other things, where he is. That should tell you whether (i) the game thinks he’s in the room but you can’t interact with him, or (ii) he’s really not in the room. At least that might be useful information to know even though it does not, in itself provide an explanation for the odd behavior.

Robert Rothman

I am unable to reproduce this problem, so I’m guessing it’s something in your code. Robert’s suggestion to use “showme” is a good one. Also, you might want to check the world index of your game to make sure things are really where you think they are. As a very minimal test, this:

Lab is a room. North of Lab is Back. Sam is a man in Back.
… results in this:

All great suggestions. And all told me that everything was fine.

So I figured out the problem, but not WHY the problem is happening. Stupid on my part because I should have seen the “placeholder” objects that I have in the room that told me immediately I was in the wrong place. Again… Probably something stupid or it could be some code that I’ve never used before. I’m probably not defining the rooms properly…

I’m using private names for the rooms because many of the rooms are the same thing. In this example, we’ll say bedroom.

[code]Bedroom2 is a room. The printed name of bedroom2 is “The Bedroom”.
A chair is bedroom2.

Bedroom3 is a room. The printed name of bedroom3 is “The Bedroom”.
Sam is a man in bedroom3.[/code]

If I put that in its own game, it does exactly what it’s supposed to. But in my main game file, it always takes me to bedroom2 instead. So there has to be some code in there somewhere that is forcing me to bedroom2 instead.

I’m not particularly keen on posting large chunks of the game file in here, because I don’t know what exactly is causing the issue. I don’t know if it’s a loaded extension or if it’s some arbitrary piece of code I’ve added somewhere.

I’m going to start stripping things and testing. If anyone has any immediate ideas as to where I can begin looking, please share!

Come to think of it, it was doing this with placeholder items as well. If I had placeholder2 and placeholder3 and tried to go near 3, it would always take me to 2. So I changed the item names. One is a rubber ducky, one is a desk lamp, et cetera.

If the names are long the problem might be that the parser reads only the first 9 characters of each word, so if you have “placeholder1” and “placeholder2” and you type GONEAR PLACEHOLDER2 the parser reads up until GONEAR PLACEHOLD and picks the first it can find. (“Bedroom” has only 7 letters but I assumed that was only an example.)

The length does APPEAR to be the issue. Moving the NPC into rooms with shorter names SEEMS to have solved it. I’m not going to lose a lot of sleep over it right now. Hopefully it doesn’t cause issues later in the game.