Understanding the "Initial" property

Hello everyone :slightly_smiling_face:

I have already developed a little project in Inform 6, but I am actually just starting out with a “real” (parser-based) text adventure and I’d like to better understand the “Initial” property for objects.

I’m using it to override “you can see the object here”, but I understand that this is not the real purpose… why is it called “Initial”?

Sorry but I tend to get a bit lost in DM4…
Thank you

In DM4, Chapter 4

The initial message is used to tell the player about the mushroom when
the Forest is described. (Once the mushroom has been picked or moved,
the message is no longer used: hence the name ‘initial’.)

This is the printed initial description of an object when entering a room or looking in a room. As soon as you handled the object, for example taking it, this text is no longer printed.

Thank you very much for your kind feedback.

According to my tests, it seems that Initial remains valid if the object is a container even after it is opened or closed.

So is there a more appropriate way to override the message “you can see this object” in the room (without resorting to “concealed”)?

Thank you.

I think initial is printed as long as not the attribute moved is set on the object. You may have to give moved to the object when opening or closing it.

2 Likes

(It may be time for the real experts to chime in here…)

DM4 advises using one of the when_ properties rather than initial if the object’s a door, container or switchable.

However, it’s generally more straightforward to use the describe property to prevent the “You can see” message showing for the object - it’s very similar to the initial property, but works consistently even if the object’s a door, container or switchable.

Unlike initial, describe will still show the same message for the object regardless of whether it’s been picked up or not.

2 Likes

Right. describe also continues to work after an object is picked up and dropped.

describe is allowed to print nothing, in which case the object won’t show in the room at all. (But for objects which should never move at all, scenery is better.)

The only thing to be careful of is that if describe prints anything at all, it should end with a newline. Whereas initial should not end with a newline.

4 Likes

Thank you so much for the tip, I’ll check describe then!

1 Like