Beginner question about writing in Inform ["writing a paragraph about"]

Hi all

I’ve only started playing around with I7 over the past few days, having rediscovered playing IF during quarantine, so please forgive the obviousness of this question! I’ve decided for my first project I’m going to create a simple game for my partner for her upcoming birthday - a simple treasure hunt around our house. [Don’t worry, I won’t inflict this game on anyone else]

My first issue is about describing items in rooms. I wanted to get around Inform saying “You see x, y and z” after the room description, but can’t quite work out the difference between things being scenery, using “undescribed”, etc. I thought using “X is undescribed” was a good workaround, but from what I’ve read here that doesn’t seem to be a popular choice. I’ve tried reading through the Documentation, but my head is spinning a little bit.

Any help much appreciated!

1 Like

Welcome!

Inform 7 emerged from Inform 6, which is an entirely different language. That still means some conventions (like undescribed) carried over from I6 to I7. This can be a bit confusing.

You’re right that undescribed is used sparingly in Inform 7. The common methods for room description, at least to my knowledge, is this:

  • For things that are present in one room, but implicitly mentioned by the text (“sky”, etc – in other words, not mentioned by name), use scenery.
  • For things that span multiple rooms, use backdrops.
  • For giving a thing a unique appearance before you interact with it, set its initial appearance.
  • For giving an immovable thing a unique appearance, set it to fixed in place and set its initial appearance.
  • For things that are mentioned by name but otherwise fulfill the function of scenery, surround with brackets and that will mention it so that it won’t be listed.
  • For anything whose text depends heavily on context, use the writing a paragraph about activity (I actually use this a lot even for static things, there’s no real drawback that I can tell for doing so other than slightly more verbose code).

Putting it all together you get something like this:

Deep Forest is a room. "The trees grow thick here, and the air is gloomy. The path winds west."

The air is a backdrop. The air is everywhere.
Some trees are a backdrop. The trees are everywhere.

The Glade is west of the Deep Forest. "The canopy of trees open up here, affording you a glimpse of sunlight. A profusion of [wildflowers] grows among the grass."

Some wildflowers are scenery in the glade.

The standing stone is a thing. "On a patch of raised earth stands a weathered stone." It is fixed in place in the Glade. 

The fawn is an animal. It is in the Glade.
The fawn can be unconcerned or alarmed. The fawn is unconcerned.

For writing a paragraph about the fawn: say "A fawn grazes among the wildflowers."
For writing a paragraph about the alarmed fawn: say "A fawn stands among the wildflowers, its eyes on you."

Instead of doing something other than examining with the unconcerned fawn: 
	say "As you turn toward the fawn, it pauses and lifts its head in alarm.";
	now the fawn is alarmed.

Instead of doing something other than examining with the alarmed fawn: 
	say "The fawn sees your motion and bolts! It swiftly bounds away into the underbrush.";
	now the fawn is nowhere.
	
1 Like

Thank you! “Writing a paragraph about” is a totally new one for me, so I’ll do some reading on that activity.

The specific thing I’m having trouble with is items that are portable but not immediately visible when you enter a room. Is there some way to make scenery portable, or is this just a total oxymoron?

It’s not an unusual use case. There are various ways to do it, but not with portable scenery.

The first thing you have to decide is whether the player should be able to interact with them at all until they show up. If yes, then you can unmark it for listing straight away. If no, then you simply teleport it in when it “shows up” as it were.

Here’s a modified example demonstrating both.

Deep Forest is a room. "The trees grow thick here, and the air is gloomy. The path winds west."

The air is a backdrop. The air is everywhere.
Some trees are a backdrop. The trees are everywhere.

The Glade is west of the Deep Forest. "The canopy of trees open up here, affording you a glimpse of sunlight. A profusion of [wildflowers] grows among the grass."

Some wildflowers are scenery in the glade.

The standing stone is a thing. "On a patch of raised earth stands a weathered stone." It is fixed in place in the Glade. 

The fawn is an animal. It is in the Glade.
The fawn can be unconcerned or alarmed. The fawn is unconcerned.

For writing a paragraph about the fawn: say "A fawn grazes among the wildflowers."
For writing a paragraph about the alarmed fawn: say "A fawn stands among the wildflowers, its eyes on you."

Instead of doing something other than examining with the unconcerned fawn: 
	say "As you turn toward the fawn, it pauses and lifts its head in alarm.";
	now the fawn is alarmed.

Instead of doing something other than examining with the alarmed fawn: 
	say "The fawn sees your motion and bolts! It swiftly bounds away into the underbrush, dropping a single red flower as it does so.";
	now the fawn is nowhere;
	now the red flower is in the glade.
	
The red flower is a thing.

Before listing nondescript items:
	if the red flower is not handled, now the red flower is not marked for listing.

I don’t know if there’s a more natural built-in way of doing it.

To clarify a couple of shortcuts used above:

  • Scenery and backdrops are automatically fixed in place (rather than portable).
  • When you have quoted text immediately following the creation of an object, for rooms and scenery this sets its description, but for portable objects it sets the initial appearance instead. (Which makes a certain amount of sense as rooms and scenery can’t logically have an initial appearance anyway.)
  • It is possible to change objects from scenery to non-scenery (or from fixed in place to portable), although this is usually not preferred.
  • It’s not possible to change something from being a backdrop to not, or vice versa.
  • You can use the undescribed property if you want, and it does work, but it’s not preferred because it can sometimes have other surprising effects (such as excluding objects from “take all” or preventing use of doors, among others). And there are other ways to achieve the concealment effect that don’t have these extra side-effects.
  • Whatever method you use to hide a portable object, you probably should make it become un-hidden once the player has interacted with it (eg. by taking it). This occurs automatically for the “initial appearance” property (and also for the undescribed property), but for other methods you will need to pay attention to it yourself, as above where the flower is checked for “handled”.
2 Likes

Basically, yes to all this.

Thank you, this is all really helpful (I have to say, I’ve found the IF community in general very accessible and friendly for a newbie!).

2 Likes

I suspect we save our cruelty for the puzzles.

3 Likes

Well, I’ve just immediately run into another issue (that seems to somehow be toggling on and off…)

In this game, as it’s a treasure hunt I want some items to be hidden until eg a drawer is opened, a bag opened, etc.

After lots of fiddling, it seemed like the best way for me to do it was something like:

Golden Marble is a thing. Golden Marble is nowhere. Understand "marble", "gold" as golden marble. The description is "A beautiful golden marble, which shines like a cat's eye."

C's Bottom Drawer is a closed openable container in the Chest of Drawers. C's Bottom Drawer is scenery. Instead of examining C's bottom drawer for the first time: say "Apparently C has a system for this drawer, but you've never been able to work it out.Before you close the drawer, however, you notice something shiny nestled in among the t-shirts... It's a golden marble!"; now the Golden Marble is in C's bottom drawer.

I wrote that code, tested it and it seemed to work fine. I then wrote:

Carved Dog Figurine is a thing. Carved Dog Figurine is nowhere. The description is "A sweet carved figurine, reminding you of Poochy."

Bag of Embroidery is an open container in the Office. The description is "The totebag is slung over the back of the door, where you left it last night." Instead of examining Bag of Embroidery for the first time: say "You take a quick look through, rifling through the coloured strands of wool. Aha! A small carved dog figurine is hidden underneath the fabric."; now the Carved Dog Figurine is in Bag of Embroidery.

Now when testing again, when I examine the bottom drawer I get the text about seeing the marble but when I try to take it, it says “You see no such thing”. When I try to find the dog figurine in the bag, there’s no issues - I get the right text and I can take the figurine.

Not sure if it’s something to do with the order I’m writing the source code in?

The drawer is closed, so the player can’t see anything that’s inside. The latter code doesn’t affect it, I suspect you opened the drawer first when testing it the first time but not anymore when testing later. An “after opening the drawer for the first time” rule might work better here.

That worked! Thank you. So simple, so obvious, so easy for me to overlook.

If I’m understanding the situation properly, you don’t even have to put the marble nowhere to begin with. If the drawer starts out closed, then the player won’t be able to see the marble until she opens it, so there’s no harm in placing the marble in the drawer at the beginning. (Though you will still want to write a special message for opening the drawer the first time, so you don’t get the bland default message that happens when you open a container and find something in it.)

1 Like

You can use the “test” function to make sure you always do the same things.

e.g. :

Test marble with "look / open drawer / x marble". 

[each of the bits between slashes is a command that you'd type at the prompt]

If you write the above in your code, then typing in

> test marble

at the prompt will follow the steps you set up. Test scripts can even call other test scripts, so it’s a very handy way of checking to see if code you write later has any unexpected side-effects.