Daily Nugget # 7: Fun with containers, supporters, windows, and staircases

Hi All,

In my WIP I make use of all those things mentioned in the title. And when I play around with navigation I find some commands are MIA. Most of these are blatantly borrowed from examples spread throughout the Inform documentation, but I prefer to keep this little set together where I can easily find it.

Apparently I can use more specific tokens instead of something, if anyone knows of any drawbacks in doing it this way, I’d love to know about it.

update: @rileypb pointed out the pitfalls of using more specific tokens. I have updated the tokens below.

Containers

Understand "climb in/into/inside [something]" as entering.

Supporters

Understand "climb on/onto [something]" as entering.

Staircases

A staircase is a kind of door.
A staircase is usually open. A staircase is seldom openable.

Instead of climbing something: try entering the noun.

The Understand statement does not work with the generic [something] token so I have reverted to the Instead statement used in Inform7 examples.

Windows

A window is a kind of door.
A window is usually closed. A window is usually openable.

Understand "climb through [something]" as entering.
Understand "jump through [something]" as entering.

Instead of searching a window: [ LOOK THROUGH ]
	say "Through [the noun], you make out [the other side of the noun]."

As for exiting, I use the following:

Include Modified Exit by Emily Short.

Much easier than trying to create my own exiting code.

5 Likes

There was some discussion of this in another thread just recently. Using specific grammar tokens can have unintended consquences. For example:

Lab is a room.

The box is an open enterable container in lab.
The ball is in the lab.

Understand "climb in/into/inside [container]" as entering.

yields

Lab

You can see a box (empty) and a ball here.

>enter ball

That’s not something you can enter.

>climb into ball

You can’t see any such thing.

So the same intended action has different error messages. That’s because when it can’t match “ball” against [container] it tries the grammar line “climb [something]”, and tries to match “into ball” against [something], which fails, and causes the “You can’t see any such thing” error.

Since the entering action already has check rules against entering non-enterable things, there’s no reason to use the specific grammar tag.

2 Likes

yeah, I even rewrite at least some of the existing grammar lines using [someone] to use [thing] so I can use Check rules to provide better error messages.

3 Likes