Items vanishing on their own from model world

Hello again folks. Latest travail pertains to items vanishing completely from the model world.

I have a large game (~280,000 words of source code) that is ready for debugging. It is an update and minor expansion of a game I wrote a few years ago that had a few remaining bugs in it, so I went to update it (and in the process upgraded from Inform 7 to 10.1.2).

The issue is that items random appear not to show up. For example, the opening scene of the game takes place in an office. There’s an item on the desk, and the description is printed when one “looks” in the room. But when I try to take the item, it says I can’t see it here. And when I use the SHOWME command (I know it is outmoded, but it seems to work for other objects) it tells me the object is nowhere in the model world. I have tried both the private name and all of the usable names for the objects.

Any idea what might be going on here?

Wood Paneled Office
You find yourself in a large, tastefully appointed office that is both solemn and somnolent.  The rat-faced attorney's desk remains despite the absence of the rat-faced attorney himself.

On the desk is an actual physical copy of the 1983 Valley of the Minotaur game in its original packaging.

On the desk is a group of three framed photographs.

A large grandfather clock ticks away.

Behind the attorney's desk is a marble-framed fireplace, bereft of fire but dusted with the ashes of client's dreams.

You can also see some wood panels here.

>take game
You can't see any such thing.

>SHOWME GAME
There seems to be no such object anywhere in the model world.

>

I have commented out any modifications to the take action just to make sure that’s not having an impact. But the fact that the item is not in the world seems like some sort of bug?

Can you post your code pertaining to the object? :grinning:

Without looking, the only thing I can think of is that perhaps the word ‘game’ is not in your object’s actual name, and does not appear as a single word in an Understand phrase… (such as Understand …“game”,… as Valley of the Minotaur copy). Or, perhaps the game is inside a package (a closed opaque container)…??

I hope that this helps.

1 Like

What happens when you TAKE ALL FROM DESK?

Interestingly, when I “take all” it shows it to be taken.

You are carrying:
  a group of photographs
  a Valley of the Minotaur game package (closed)
  a letter from the law firm

The pertinent portion of the code defining the “game” is

The votmg is privately-named.  It is a measured container.  The votmg is openable.  "On the desk is an actual physical copy of the 1983 Valley of the Minotaur game in its original packaging."  The votmg has printed name "Valley of the Minotaur game package".  The votmg is closed.  A description of the votmg is "An aged, pathetically-cartooned and anemically slim but firm-looking cardboard envelope, advertising itself as 'your passport to adventure.'  A passport to a war-torn region of sub-Saharan Africa would likely be as appealing.[if votmg is open]  The package is open.[otherwise]  The package is closed.[end if]".  Understand "package" and "game" and "envelope" and "game package" and "Valley of the Minotaur" and "Valley of the Minotaur game" and "cardboard envelope" and "envelope" as "[votmg]".  

Interestingly, this used to work – but when I removed the brackets from the definition (at the end), it worked again. To be honest I’m not entirely sure what brackets are used for in that particular implementation.

Thanks very much for nudging me in the right direction!

1 Like

The brackets (within quotes) indicate a token. The phrase compiles, but, probably because the object is privately-named, it may be treating the alternate names as if the player had typed the private name (ie as ‘You can’t see…’). The way I read your code, you don’t need the brackets or quotes around the private name in the Understand phrase, votmg

The votmg is privately-named.  It is a measured container.  The votmg is openable.  "On the desk is an actual physical copy of the 1983 Valley of the Minotaur game in its original packaging."  The votmg has printed name "Valley of the Minotaur game package".  The votmg is closed.  A description of the votmg is "An aged, pathetically-cartooned and anemically slim but firm-looking cardboard envelope, advertising itself as 'your passport to adventure.'  A passport to a war-torn region of sub-Saharan Africa would likely be as appealing.[if votmg is open]  The package is open.[otherwise]  The package is closed.[end if]".  Understand "package" and "game" and "envelope" and "game package" and "Valley of the Minotaur" and "Valley of the Minotaur game" and "cardboard envelope" and "envelope" as the votmg.  

.

In that context, the square brackets mean something different than they would in a say statement. As EpicIFer says, in the context of an Understand... statement, they mean (and in this case create) a grammar token.

Without getting into too many technical details, a grammar token is something that the parser will use to understand player input – it allows multiple text patterns to mean the same thing to the parser. In your original code, you create a [votmg] token, but you do not give the compiler the information needed to connect it to the object, which you have designated as privately-named. You could add the line:

Understand "[votmg]" as Valley of the Minotaur game.

which tells the compiler: “Anything matching that token (defined elsewhere) should be interpreter by the parser as meaning that game object.”

See WWI 17.13 New tokens for more details.

This may seem like just a longer way to go about the same thing, but it’s not. Multiple tokens can be combined into a single Understand... line, allowing more sophisticated pattern matching.

Understand "red" or "vermillion" or "ruby" or "corundum" as "[crystal-color]".
Understand "crystals/grit/powder/sand/dust" as "[crystal-noun]".
Understand "[crystal-color] [crystal-noun]" or "aluminum/aluminium/-- dioxide" as the corundum dust.
4 Likes