Let's Play/Read: Inform 7 manuals (Done for now)

Chapter 18, Part 1

I just spent 4 hours processing and uploading all the Spring Thing games so I don’t have the bandwidth to do this whole chapter. Good thing I planned on splitting it up!

This chapter is about Activities. What are those? I don’t know! To me they are mysterious things only referenced by Emily Short code and only to be called on in the most dire of circumstances.

An activity is a thing the computer does, as opposed to an action the NPC does. Even though we can write ‘before’ rules for activities, they are not like actions.

Example 334:

This has a lot of stuff that I don’t really understand enough to comment on, so I’m pasting some pertinent parts but hiding them:

Summary
Printing the room-description of something is an activity.

Rule for printing the description of something (called item):
    if the description of the item is not "":
        say "[description of item][paragraph break]";
    otherwise:
        say "You see nothing special about [the item].".

The activity-based examining rule is listed instead of the standard examining rule in the carry out examining rules.

This is the activity-based examining rule:
    carry out the printing the description activity with the noun;
    rule succeeds.

Printing the room-description of something is an activity.

Rule for printing the room-description of a room (called item):
    if the description of the item is not "":
        say "[description of item][paragraph break]";
    otherwise:
        do nothing instead.

The activity-based room description body text rule is listed instead of the room description body text rule in the carry out looking rules.

This is the activity-based room description body text rule:
    if the visibility level count is 0:
        if set to abbreviated room descriptions, continue the action;
        if set to sometimes abbreviated room descriptions and
            abbreviated form allowed is true and
            darkness witnessed is true,
            continue the action;
        begin the printing the description of a dark room activity;
        if handling the printing the description of a dark room activity,
            say "It is pitch dark, and you can't see a thing.";
        end the printing the description of a dark room activity;
    otherwise if the visibility ceiling is the location:
        if set to abbreviated room descriptions, continue the action;
        if set to sometimes abbreviated room descriptions and abbreviated form
            allowed is true and the location is visited, continue the action;
        carry out the printing the room-description activity with the location.

Rule for printing the room-description of a room when the player wears the sunglasses:
    say "The walls look like they're covered with ants. Just a coincidence, I'm sure[antsy]."

Rule for printing the room-description of the Kitchen when the player wears the sunglasses:
    say "Are ants coming out of the sink? No, probably not[antsy]."

Rule for printing the description of something (called the item) when the player wears the sunglasses:
    say "[The item] [are] [one of]ant-colored[or]ant-legged[or]covered in ants[at random][antsy]."

Rule for showing action of the microwave:
    say "The microwave hums meaningfully to itself."

Rule for showing action of the microwave when the player wears the sunglasses:
    say "The microwave hums as though inhabited by a billion ants[antsy]."

18.2 is How activities work

It says that activities start, do stuff, and finish, and always last one turn at most. Multiple activities can happen at once.

Example:
suppose the following is printed as part of the description of a grocery:

You can see a banana, an apple and a star-fruit here.

At the moment when Inform prints “apple”, two activities are under way: “listing contents of the Grocery”, and “printing the name of the apple”. The sequence of events was in fact:

say "You can see "
start listing contents of the Grocery
    say "a "
    start printing the name of the banana
        say "banana"
    finish printing the name of the banana
    say ", an "
    start printing the name of the apple
        say "apple"
    finish printing the name of the apple
    say " and a "
    start printing the name of the star-fruit
        say "star-fruit"
    finish printing the name of the star-fruit
finish listing contents of the Grocery
say " here."

You can check to see if an activity is running:

if the printing the name activity is going on, ...
if the printing the name activity is not going on, ...

(Honestly, I’m just dying here. Activities are so scary that I don’t want to even look at them).

18.3 is Rules applied to activities.

Activities can have rules, and activities always have three phases: ‘before…’, ‘for…’, and ‘after…’, with the after phase usually occurring, unlike actions which often stop before reaching that stage.

1. All "before printing the name of" rules are considered;
2. The most specific, applicable "rule for printing the name of" is considered;
3. All "after printing the name of" rules are considered.

Apparently using ‘instead’ with an activity only terminates ‘before’ rules, not ‘for’ and ‘after’.

Inform’s standard activities are all of this pattern: they start out with no “before” or “after” rules, and just one “for” rule.

18.4 is While clauses.

You can only clarify activities with ‘while’ clauses:

The sack is a player's holdall. The sack is carried. Rule for printing the name of the sack while the sack is not carried: say "your abandoned sack".

This specific example could easily be done with a normal text variation, so I’m not really seeing the power yet.

This next example seems to show what’s good though, since you can make ‘while’ check for other activities:

Rule for printing the name of the lemon sherbet while listing contents: say "curious sort of lemon sherbet sweet".

It produces this result:

You can see a teaspoon and a curious sort of lemon sherbet sweet here.
> TAKE ALL
teaspoon: Taken.
lemon sherbet: Taken.

Okay, I’m going to stop there for now, and will pick up more tomorrow!

1 Like