Stopping open and closed being printed for containers

Is it possible to prevent the open and closed messages for containers being printed? I have a radio in my game which I want to be described simply as “a portable radio” and not have “(which is closed)” after it. The same goes for various objects in the game. If you have several containers in a room the text can be quite long as it lists all the open and closed states!

I found a similar request on here, but it is for Inform 7: https://intfiction.org/t/suppressing-open-and-closed-in-container-names/969

I am using PunyInform.

Give the object the invent property. Perhaps something like:

invent [;
  if(inventory_stage == 2) rtrue;
],

or, for a radio, you could have it say only if the radio is on:

invent [;
  if(inventory_stage == 2) {
    if(self has on) print " (playing some ghastly music)";
    rtrue;
  }
],

That works beautifully! Thank you.

If you don’t fancy reading the DM4, I think glancing over the PunyInform quick reference (in the documentation folder) would be benficial to you, to get some idea of what’s available.

1 Like

I find the Inform Beginner’s Guide a superb read. I get many ideas from there. The DM4 is great but a minefield of information. I’ll check out the PunyInform guide you mentioned too.

1 Like