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

Chapter 17, Cont.

Section 17.12 is This/that.

This just refers to a shortcut way of using slashes to indicate multiple meanings:

Understand "reach underneath/under/beneath [something]" as looking under.

This is shorthand for:

Understand "reach underneath [something]" or "reach under [something]" or "reach beneath [something]" as looking under.

I tend to use the second format more than the first, except specifically if there is a new action with several possible propositions.

You might also want ‘nothing’ to be an option. That’s done with two hyphens: --

Understand "reach underneath/under/beneath/-- [something]" as looking under.

Unfortunately, you can’t use a slash for the first word in a command. (At least, I always get errors when doing so).

I should say I haven’t actually updated to Inform 10, since I’m in the middle of a big project. Do you think I should? I have time to fix things…

Section 17.13 is New tokens

I’ve never used this section before, but it looks really powerful.

It seems like it’s mainly just a macro/function/shorthand for stuff that you repeat often in understand statements.

Understand "beneath/under/by/near/beside/alongside/against" or "next to" or "in front of" as "[beside]".

Understand "on/in/inside" or "on top of" as "[within]".

Example 3.10 is Lies:

Understand "beneath/under/by/near/beside/alongside/against" or "next to" or "in front of" as "[beside]".

Understand "on/in/inside" or "on top of" as "[within]".

Understand "lie down" as lying down.

Understand "lie down [within] [something]" as entering.

Understand "lie [beside] [something]" or "lie down [beside] [something]" as lying near.

Section 17.14 is Tokens can produce values

This section is worded in a way that I get confused, but it says you can do this:

Colour is a kind of value. The colours are red, green and blue. Understand "colour [a colour]" or "[a colour] shade" as "[tint]"

But not that:
Understand "colour [a colour]" or "[something]" as "[tint]".

So when defining new tokens (again, something I have never done), you can make it match any given value in a kind of value, but have to be consistent in the kind used.

Anyone used these new tokens before? They seem useful, I just never knew about them or felt intimidated when I did.

Section 17.15 is Understanding things by their properties.

I’ve used this one a ton! This is like when you want ‘open’ to refer to an open door and ‘closed’ to a closed door.

In fact, for many years I didn’t know how to make ‘understand’ conditional at all, so my games are built to work around that.

Anyway, here’s how it works:

The china pot can be unbroken or broken. The china pot is unbroken.

Understand the unbroken property as describing the pot.

After dropping the china pot:
    say "Crack!";
    now the china pot is broken;
    now the printed name of the pot is "broken pot".

This lets the player use the terms ‘unbroken’ or ‘broken’ to refer to the pot, as needed. You can add synonyms for properties:

Understand "shattered" or "cracked" or "smashed" as broken. Understand "pristine" as unbroken.

I’m not sure if you can do the opposite, like if you have a weird property name, if there’s a way to exclude its use (but if it’s weird enough, no one would ever guess it anyway).

What I didn’t know are that there are two ways of doing this:

Understand the broken property as describing a flowerpot.
Understand the broken property as referring to a flowerpot.

In ‘referring to’, you can only use the adjective when its in front of part of the name of the flowerpot itself.

Example 311 is Aspect:

An aspect ratio is a kind of value. 16:9 specifies an aspect ratio.

A television is a kind of device. A television has an aspect ratio. Understand the aspect ratio property as referring to a television. Understand "European standard" as 16:9.

In my own game, I use this ‘understand as describing’ stuff twice:

The frozen-target can be broken or unbroken. Understand the broken property as describing the frozen-target. Understand "broken" as broken .

and later on for a two markers that are identical outside of their colors.

Whew, there are a lot more examples in this section!

Example 313 is Channel 1:
A television is a kind of device. A television has a number called the channel. Understand the channel property as referring to a television. Understand "channel" as a television.

Understand "tune [something] to [number]" or "change channel of [something] to [number]" as changing the channel of it to.

Check changing the channel of something to:
if the noun is not a television, say "[The noun] cannot be tuned to a channel." instead.

Carry out changing the channel of something to:
now the channel of the noun is the number understood.

Report changing the channel of something to:
say "You tune [the noun] to channel [number understood]."

Example 314 (pi!) is Terracottissima:

A flowerpot can be unbroken or broken. After dropping an unbroken flowerpot: say "Crack!"; now the noun is broken. Understand the broken property as describing a flowerpot.

Before printing the name of a broken flowerpot, say "broken ". Before printing the name of an unbroken flowerpot: if a flowerpot is broken, say "unbroken ".

Before printing the plural name of a broken flowerpot, say "broken ". Before printing the plural name of an unbroken flowerpot: if a flowerpot is broken, say "unbroken ".

Example 315 is Peers:

A title is a kind of value. The titles are Baron, Viscount, Earl, Marquess, Duke and Prince.

A peer is a kind of man. A peer has a title. A peer is usually a Baron. Before printing the name of a peer, say "[title] ". Understand the title property as describing a peer.

The House of Lords is a room. Maltravers, Pollifax, Omnium and St Vincent are peers in the House of Lords. Omnium is a Duke. St Vincent is an Earl.

Ennobling is an action applying to one thing and one title.

Check ennobling:
if the noun is the player, say "The Sovereign is the fountain of honour, and may not be ennobled." instead;
if the noun is not a peer, say "Commoners should remain so." instead;
if the title of the noun is the title understood, say "But that is his title already." instead;
if the title of the noun is greater than the title understood, say "As he is already of the rank of [title of the noun], any such letters patent are liable to be deemed invalid, following the precedent of the Buckhurst Peerage Case (1876). Best not." instead.

Carry out ennobling:
now the title of the noun is the title understood.

Report ennobling:
say "'Whereas Our Parliament for arduous and urgent affairs concerning Us the state and defence of Our United Kingdom and the Church is now met at Our City of Westminster We strictly enjoining Command you upon the faith and allegiance by which you are bound to Us that the weightness of the said affairs and imminent perils considered (waiving all excuses) you be at the said day and place personally present with Us and with the said Prelates Great Men and Peers to treat and give your counsel upon the affairs aforesaid And this as you regard Us and Our honour and the safety and defence of the said Kingdom and Church and dispatch of the said affairs in nowise do you omit Witness Ourself at Westminster the Fifth day of November in the 43rd year of Our Reign,' you say, with unpunctuated serenity. The new [noun] bows stiffly."

Example 316 is Channel 2
This example is like the other channel example but has features like using tokens:

Understand "[number]" or "channel [number]" as "[channel]".

Example 317 is Terracottissima Maxima:

A flowerpot is a kind of thing. A flowerpot has a text called pattern. Understand the pattern property as describing a flowerpot. The printed name of a flowerpot is usually "[pattern] flowerpot". The printed plural name of a flowerpot is usually "[pattern] flowerpots".

The Herb Garden is a room. In the Herb Garden is a flowerpot with pattern "blue willow". In the Herb Garden is a flowerpot with pattern "striped". In the Herb Garden is a flowerpot with pattern "striped".

It mentions that using text properties in this way (which I have done) is essentially the same as using values, except that texts can be more complex (to be explored in the future, it says).

Example 318 is Tilt 1:

This has stuff like cutting out part of the player’s command (something I don’t think we’ve seen so far):

After reading a command:

    if the player's command includes "of [suit]":
        while the player's command includes "of":
            cut the matched text;
    repeat through the Table of Value Names:
        while the player's command includes topic entry:
            replace the matched text with value entry.
    [This allows Inform to understand "ace", "deuce", "king", etc., as numerical ranks.]

and has some fancy action redefinitions:

Understand the commands "take" and "carry" and "hold" and "get" and "drop" and "throw" and "discard" as something new.

Understand "take [text]" or "get [text]" or "drop [text]" as a mistake ("Here, you only draw and discard. Nothing else matters at the moment.").

Understand "draw" or "draw card" or "draw a card" as drawing. Drawing is an action applying to nothing. The drawing action has an object called the card drawn.

Finally, onto 17.16! ‘Understand things by their relations’.

I don’t think I’ve used this before. This lets you refer to things by things they contain, or are part of, or any other relationship.

Hmmm, pretty neat! Could be useful if an item can get passed from person to person, like a coin, so you can refer to ‘so and so’s coin’.

A box is a kind of container. Understand "box of [something related by containment]" as a box.

The Toyshop is a room. The red box is a box in the Toyshop. Some crayons are in the red box.

and now TAKE BOX OF CRAYONS will work, because CRAYONS matches against “[something related by containment]” for the red box - or it does for as long as the crayons are there.

To reverse a relation:

A box is a kind of container. Understand "box in [something related by reversed containment]" as a box.

The Toyshop is a room. The crate and the hammock are in the Toyshop. In the crate is a box. In the hammock is a box.

Example 319 is Cinco:

The taco shell is an edible thing in the Fundraiser. It is a portable container. It has carrying capacity 1.

Understand "[something related by containment] taco" as the taco.

Rule for printing the name of the taco shell while not inserting or removing:
if the taco contains something (called filling), say "[filling] taco";
otherwise say "taco shell";
omit contents in listing.

The player carries shredded beef. It is edible.

The taking action has an object called source (matched as "from").

Setting action variables for taking:
now source is the holder of the noun.

Report taking something from the taco shell:
say "You gingerly pick [the noun] out of the taco shell." instead.

Example 320 is Puncak Jaya:
A ghost is a kind of person. A man-ghost is a kind of ghost. A man-ghost is always male. A woman-ghost is a kind of ghost. A woman-ghost is always female.

Representation relates one ghost to one person. The verb to represent means the representation relation.

One man-ghost represents every man. One woman-ghost represents every woman.

Indication relates a ghost (called X) to a person (called Y) when X represents Y and Y is not visible.

Understand “[something related by indication]” as a ghost.

When play begins:
now every ghost is in the concept-repository.

Instead of doing something to a ghost:
say “You seem to have left [a random person which is represented by the noun] behind.”

Example 321 is Whither?
This lets you refer to a door as ‘east door’ or ‘west door’ or whatever, depending on which side of it we are on.

The initial appearance of a door is usually "Nearby [an item described] leads [if the other side of the item described is visited][direction of the item described from the location] to [other side of the item described][otherwise][direction of the item described from the location][end if]."

Direction-relevance relates a door (called X) to a direction (called Y) when the direction of X from the location is Y. The verb to be directionally-relevant to means the direction-relevance relation.

Understand "[something related by direction-relevance] door" as a door.

Section 322 is Claims Adjustment

A photograph is a kind of thing. 36 photographs are in the film roll.

Appearance relates one thing to various photographs. The verb to be shown by means the appearance relation.

The description of a photograph is usually "It shows [a random thing which is shown by the item described]."

Understand "of [something related by reversed appearance]" as a photograph.

This uses the ‘random thing’ trick, where you describe something uniquely and then say ‘a random thing’ and it always picks that thing.

Section 17.17 is Context: understanding when

This is conditional understanding! I’m using it for the first time with my current game.

Understand "mix [colour] paint" as mixing paint when the location is the Workshop.
Understand "rouge" as red when the make-up set is visible.

We can’t use ‘the noun’ or ‘the second noun’ or ‘the number understood’, because those are defined in a different stage of action processing.

A convenient option:

Understand "your" as a thing when the item described is held by the person asked.

We are now introduced to the ‘privately-named’ concept:

The secret document is a privately-named thing in the drawer.
The printed name of the secret document is "[if the secret document is handled]secret document[otherwise]dusty paper".
Understand "dusty" and "paper" as the secret document.
Understand "secret" and "document" as the secret document when the secret document is handled.
After taking the secret document for the first time: say "Heavens! It is the secret document!"

I can never remember which has a hyphen out of ambiguously plural, plural named and privately named.

Privately-named just gets rid of the ‘main’ inform name you gave an object so that players can’t type it in. It becomes more useful the larger your game (invaluable in Cragne Manor).

Only rooms, things, directions, and regions can be privately or publicly-named. If you want an object you created to have it that’s not one of those for, you have to say something like this:

A concept is a kind of object. A concept can be privately-named or publicly-named. A concept is usually publicly-named.

(Privately-named is a property which only affects how Inform creates the object, and it can’t usefully be given or taken away during play. “Understand … when …” is the way to change names during play.)

Example 323 is Quiz Show, which adds a special mode when guessing stuff:

Answer mode is a truth state that varies.
Current state is a text that varies.

Guessing is an action applying to one topic.
Understand "[text]" as guessing when answer mode is true.

Every turn when the player is in the lab:
    if a random chance of 3 in 5 succeeds:
        choose a random row in the Table of Dates of Statehood;
        say "Sam asks you, 'In what year was [state entry] admitted into the Union?'";
        now current state is state entry;
        now answer mode is true.

Table of Dates of Statehood

State Topic Comment
“Florida” “1845” “March 3rd”
“Delaware” “1787” “December 7th”
“Hawaii” “1960” “July 4th”

Example 324 is Bibliophilia:

Understand "examine [text]" as examining as a book when the player is in the Reading Room. Understand "look up [text]" as examining as a book when the player is in the Reading Room.

Examining as a book is an action applying to one topic.

Carry out examining as a book:
say "You can't find any such text."

Instead of examining as a book a topic listed in the Table of Book Titles:
say "[description entry][paragraph break]"

Table of Book Titles

topic title description
“Reading Greek Death” or “reading/greek/death” or “greek death” “Reading Greek Death” “A dense orange paperback treatise on the development of Greek eschatology.”
“TAPA/Transactions/134-2” “TAPA 134-2” “Transactions of the American Philological Association from 2004.”
“Oxford Classical Dictionary” or “OCD/dictionary/classical/oxford” “Oxford Classical Dictionary” “A hefty reference with short articles on everything from Greek meter to ancient cosmetics.”
“Collected Dialogues of Plato” or “Plato/dialogues/hamilton/cairns” “Collected Dialogues of Plato” “All the Platonic dialogues – some, admittedly, in rather tired translations – but still a useful single volume, ed. Edith Hamilton and Huntington Cairns.”
“Adobe Illustrator CS User Guide” or “user guide” or “adobe illustrator” or “adobe/illustrator/cs/user/guide” “Adobe Illustrator CS User Guide” “Hello, how did this get here? A suspiciously familiar name is scribbled inside the front cover…”

Example 17.18 is Changing the meaning of pronouns

Inform automatically keeps track of IT, HIM, HER, and THEM. Occasionally, you want to change these pronouns manually, usually when the text prominently mentions an object the player hasn’t interacted with or if the game swaps in one object for another that the player will think is the old object. You just type this:

set pronouns from the key;
set pronouns from Bunny;

and that sets the appropriate pronoun.

(I remember having to do this in Dialog, too, which has its own built-in function for it).

Example 325 is Pot of Peturnias:

At 9:01 am:
    move the broken flower pot to the location;
    say "Quite unexpectedly, a flower pot falls from the sky and breaks open on the ground. Good thing you weren't standing six inches to the left.";
    set pronouns from the broken flower pot.

Example 17.19 is Does the player mean…

This is a useful thing that just ranks stuff in disambiguation checks.

The Champs du Mars is a room. The great Eiffel Tower is here. "The great Tower stands high over you." The souvenir model Eiffel Tower is here. "Comparatively tiny is the souvenir version."

Does the player mean taking the great Eiffel Tower: it is very unlikely.

This makes it so if the player types GET TOWER, instead of getting this message:

Which do you mean, the great Eiffel Tower or the souvenir model Eiffel Tower?

You get this one:

(the souvenir model Eiffel Tower)
Taken.

The rankings are as follows:

it is very likely
it is likely
it is possible
it is unlikely
it is very unlikely
You can be as specific as you like:
Does the player mean doing something with the cursed dagger of Thog: it is very unlikely.
Does the player mean doing something with the cursed dagger of Thog when the player is hypnotized: it is likely.
Does the player mean throwing the can of shoe polish at the shoe polish vending machine: it is likely.
Does the player mean tying the noun to the noun: it is very unlikely.

This isn’t a miracle worker though. For instance:

Does the player mean throwing the can of shoe polish at the tree: it is likely.
may not work if the player types THROW POLISH AT TREE and POLISH is ambiguous, because when the parser is trying to understand POLISH, it hasn’t yet seen to the end of the command and realised that the second noun will be the tree; so the second noun is unset and the rule won’t match.

Apparently ‘inserting it into’, ‘removing it from’, and ‘putting it on’, checks things in the opposite order.

Example 326 is Masochism Deli:

The plural of potato is potatoes. A potato is a kind of thing. A potato is edible.

Temperature is a kind of value. The temperatures are hot and cold. A potato has a temperature. A potato is usually cold.

Understand the temperature property as describing a potato. Before printing the name of a potato (called subject): say "[temperature of subject] ". Before printing the plural name of a potato (called subject): say "[temperature of subject] ".

Does the player mean dropping a hot potato which is carried by the player: it is very likely.

Does the player mean taking a cold potato which is not carried by the player: it is very likely.

The player carries three potatoes.

When play begins: now a random potato is hot.

Section 17.20 is Multiple Action Processing

This is how to handle commands involving ‘ALL’. There are two phrases involved:

First is multiple object list, which just gives a list of objects (but somehow isn’t a regular list?). For a single object, this list is empty; it’s either 0 or plural with nothing in between.

You can change the list as so:

alter the multiple object list to

I’ve never been brave enough to try this.

This is one of those sections which is pretty incomprehensible and has no real examples, so let’s see if the examples come to the rescue!

Example 327 is The Best Till Last:

A multiple action processing rule when the action name part of the current action is the burning it with action (this is the orderly burn rule):
    let L be the multiple object list;
    let dull list be a list of objects;
    let fun list be a list of objects;
    repeat with item running through L:
        if the burn description of the item is "":
            add item to dull list;
        else:
            add item to fun list;
    let F be the dull list;
    add fun list to F;
    alter the multiple object list to F.

Okay, so this seems to confirm that you can do regular list processing with this list.

Example 328 is Western Art HIstory 305

Understand "examine [things]" as examining.

A painting is a kind of thing. A painting is usually fixed in place. Understand “painting” as a painting. Understand “paintings” as the plural of painting.

The painting-collective is a thing. The printed name of the painting-collective is "paintings". The description of the painting-collective is "There's [a list of visible paintings]."

A multiple action processing rule when the current action is examining (this is the examine kinds rule):
    let L be the multiple object list;
    let F be L;
    let the painting count be 0;
    repeat with item running through L:
        if the item is a painting:
            increment the painting count;
            remove the item from F;
    if the painting count is greater than one:
        add the painting-collective to F;
        alter the multiple object list to F.

Section 17.21 is Understanding Mistakes, something I think I may have used once but only rarely.

This is where you want to recognize a command but show that it’s not a real action. They don’t process the ‘every turn’ rules, I think.

You make a mistake as so:

Understand "act" as a mistake.

But this doesn’t print anything, so add a message with this:

Understand "act" as a mistake ("To join the actors, you have to adopt a role in the play! Try PLAY HAMLET or similar.").

or restrict to a special location:

Understand "act" as a mistake ("To join the actors, you have to adopt a role in the play! Try PLAY HAMLET or similar.") when the location is the Garden Theatre.

or catch a wider variety of words:

Understand "act [text]" as a mistake ("To join the actors, you have to adopt a role in the play! Try PLAY HAMLET or similar.") when the location is the Garden Theatre.

It suggests using mistakes for beta testing:

Understand "* [text]" as a mistake ("Noted.").

It mentions that mistakes don’t handle things like ‘topic understood’ or ‘noun’ or ‘the noun’ very well.

Example 329 is Query:

Understand "who" or "what" or "when" or "where" or "why" or "how" or "who's" or "what's" or "when's" or "where's" or "why's" or "how's" as "[query]".

Understand "[query] [text]" as a mistake ("[story title] understands commands, such as '[command prompt]examine [a random thing that can be seen by the player]', but not questions. For more instructions, type HELP.").

Example 330 is The Gorge at George:

Understand "talk to [someone]" as a mistake ("To start a conversation, try to ASK [the noun] ABOUT something or TELL [the noun] ABOUT something.").

Example 331 is Hot Glass looks like Cold Glass:

This provides an alternative way to write helpful error messages:

After reading a command:
    if the player wears the goggles, make no decision;
    if the player's command includes "[heat]":
        say "Without the IR goggles on, you cannot tell hot things from cold at sight.";
        rule succeeds.

Finally, 17.22 is Precedence:

In inform processing, the more specific lines are checked before more general ones.

Understand "employ [a door]" as opening.

Understand "employ [an open door]" as entering.

So for an open door, the second line fires; for other doors, the first line fires.

Why is it like this? Here’s an example:

Understand "on/in/inside" or "on top of" as "[within]".

Here Inform puts “on top of” before “on/in/inside”, since otherwise only the “on” of “on top of” will be recognised.

Inform tries commands with a single noun before nouns with multiple nouns. So in the following, the first command is given precedence:

Understand "put [something preferably held] on" as wearing.
Understand "put [other things] on/onto [something]" as putting it on.

Example 332 is Some Assembly Required:

Before cutting something which is worn by the player:
    try taking off the noun.

Instead of cutting something when something is part of the noun:
    say "You cut up [the noun], snipping off [a list of things which are part of the noun].";
    now every thing which is part of the noun is in the holder of the noun.

Instead of cutting something which is part of something:
    say "You carefully snip [the noun] free.";
    now the player carries the noun.

Definition: a thing is removable if it is part of something. Understand "cut [removable thing]" as cutting.

The idea here is that there are multiple identical things in the room, and if one is ‘removable’, it is selected before others that have the same name.

Example 333 (nice number and about 100 away from the final example) is Lakeside Living.

Definition: a fluid container is empty if the current volume of it is 0.0 fl oz. Definition: a fluid container is full if the current volume of it is the fluid capacity of it.

Understand the command "fill" as something new.

Understand "fill [fluid container] with/from [full liquid source]" as filling it with. Understand "fill [fluid container] with/from [fluid container]" as filling it with.

This gives preference to full containers.

Great chapter! About half of it is things that are absolutely vital to Inform and the other half are arcane things that terrify me.

The next chapter is the largest, and one that I have never even begun to attempt: activities. I’ve never known what I was doing when messing with activities, I just copied examples word for word with eyes closed.

Since it’s so long and since Spring Thing processing will be happening, I’ll be splitting it up into several smaller chapters. Thanks!

2 Likes

Remember also that you can define a relation any way you like (“numerical descriptivity relates one thing (called X) to one number (called Y) when the number of things held by X is Y”), so this is actually a very general way to understand things!

Technically speaking, “multiple object list” is actually a function producing a list: if you mess around with the list it returns, it doesn’t actually affect the internal data structures. That’s why the “alter the multiple object list to X” phrase exists: this sets those internal data structures to match whatever you’ve done with the list in I7.

Yep! Mistakes are always out-of-world. They’re also good for adding snarky responses to things: is your clever response to XYZZY really clever enough to motivate you to write a whole action for it? In I6, it would have to be!

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

Basically, activities are anything you might want to attach “before” and “after” rules to, but are not actions performed by a character in the world. They also let you test whether they’re currently happening.

Apart from that, they’re really just rulebooks. Which means at their core they’re a way to have Inform apply the most specific rule for any situation.

For a specific example, “reading a command” is an activity. This means you can do:

  • “Before reading a command”, which does something first. This would be a good point to print a tutorial message, for example—you know it’ll happen right before the game prints “>”.
  • “Rule for reading a command”, which replaces the normal functioning of the activity. Maybe you want the game to read commands from a walkthrough, for example; a “rule for reading a command while the walkthrough is happening” could grab the next line from the walkthrough and shove it into “the player’s command”. (The default “rule for reading a command” prints a prompt, then waits for the player to type something; if your rule is more specific, it’ll take precedence over this.)
  • “After reading a command”, which does something afterward. This is the point to mess with “the player’s command” before any of the other machinery gets to it—the “reading a command” activity is still happening now, but once it’s done, the command is considered read and the parser kicks in.

The activity framework gives you access to these three stages, as well as letting you check whether they’re currently happening (perhaps you want to update your graphics windows?).

5 Likes

I mostly never had to create activities outside of extensions. I think the best way to view activities are as hooks for authors to customise some behaviour: when writing this feature of an extension, I use an activity to provide the default behaviour, which will allow authors to replace that behaviour (with a for rule) or add things in before or after rules.

That’s why 80% of the “Activities” chapter is just describing the activities defined by the Standard Rules: the Standard Rules are full of these hooks so that authors can change or add some specific behaviour.

4 Likes

Same here. I often create rulebooks, but I don’t typically need a rulebook with before/after functionality. (If I did, I might just create two rulebooks rather than an activity!)

Chapter 18, continued

18.5 is New Activities.

Activities can just be themselves or the can affect other things. Here are some ways of defining an activity:

Assaying is an activity.
Analysing something is an activity.
Announcing something is an activity on numbers.

If we use the word ‘something’ or ‘of something’ but don’t specify the kind, ‘objects’ becomes the kind.

"assaying activity" has kind activity on nothing
"analysing activity" has kind activity on objects
"announcing activity" has kind activity on numbers

Just like actions, making an activity creates multiple rulebooks (before, for, and after), which are all empty. You can test if it all three are simultaneously empty as so:

if the analysing activity is empty, ...

(It compares this to rulebooks, but I’ve never learned this about rulebooks before).

Just like we write ‘try’ for actions, we write ‘carry out’ for activities.

carry out the assaying activity;

For an activity with values:

carry out the analysing activity with the pitchblende;
carry out the announcing activity with the score;

So far, these seem to have a lot of the functionality of phrases, but with the benefit of having multiple stages and being able to be scheduled.

None of these definition do anything unless we also have a rule to go in the rulebooks, especially in the ‘for’ section:

Rule for announcing a number (called N): say “Ladies and gentlemen, [N].”

The last for assaying rule:
say "Professionally, you cast an eye around mineral deposits nearby, noticing [list of rocks in the location]."

‘The Last’ is something from next chapter that says this is the last one read. Apparently its best to make the ‘main’ rule the last one so that there are more chances for other people’s rules to interfere.

The first ‘for’ rule that runs is the last, because it stops after that. Unless you don’t want it to! Then you type ‘continue the activity’.

Once you’ve defined one activity, you can reference it inside others (the ‘hook’ thing people mentioned above):

Rule for printing the name of a rock while assaying: ...

Example 335 is AARP-Gnosis

This gives a collective item representing many volumes of an encyclopedia, which we can take one at a time or all at once:

Collecting something is an activity.

Every turn:
    repeat with item running through collectives:
        carry out the collecting activity with the item.

To remove (item - a thing) when empty:
    let space be the holder of the item;
    if the number of things which are part of the item is 0:
        now the item is nowhere;
    if the number of things which are part of the item is 1:
        let the last thing be a random thing which is part of the item;
        move the last thing to the space;
        now the item is nowhere.

Before collecting a thing (called the item):
    remove item when empty;
    let space be the holder of the item;
    if space is not a thing and space is not a room:
        if something (called the other space) contains at least two things which fit the item, move item to the other space;
        if a room (called the other space) contains at least two things which fit the item, move item to the other space;
        if someone (called the owner) carries at least two things which fit the item, move item to the owner.

Rule for collecting a thing (called the item):
    let space be the holder of the item;
    if space is a thing or space is a room:
        repeat with component running through things held by the space:
            if the component fits the item, now the component is part of the item;
        remove item when empty.

There’s some other code involving actually doing stuff to the encyclopedia.

Example 336 is Aftershock

This example points at that the line about a device being switched on or off is often inappropriate, and has a new way of dealing with that:

Showing action of something is an activity.

Rule for showing action of something (called item):
    if the item is switched on, say "[The item] is switched on.";
    otherwise say "[The item] is switched off."

The new described devices rule is listed instead of the examine devices rule in the carry out examining rules.

This is the new described devices rule:
    if the noun is a device:
        carry out the showing action activity with the noun;
        now examine text printed is true.

This is the same as baseline functionality, but you can replace the behavior more easily for specific things now:

Rule for showing action of an electric lamp (called item):
    if the item is switched on, say "[The item] is lit[if the number of visible lit things is greater than 1], competing with [the list of visible lit things which are not the item][end if].";
    otherwise say "[The item] is dark."

Example 337 is Crusoe:

The fancy examining rule is listed instead of the standard examining rule in the carry out examining rules.

Printing the description of something is an activity.

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

All we have done here is enclose what is usually just a rule inside an activity. This means that we can now write before and after rules for the activity, and also add special instructions like “Rule for printing the name of something while printing the description of something” – this may not be likely to arise often, but Inform now has the concept of “printing the description of something” as a separate context of action.

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

After printing the description of something charred:
    say "It is charred." instead.

Last after printing the description of something:
    say paragraph break.

Hmm, that last rule (about ‘last after …say paragraph break’) seems like it could be useful!

Section 18.6 is Activity Variables, something I never wanted to see with my own two eyes (what’s next? Seeing the code for the Inform parser itself in C++?)

You just make a property of the activity like this:

Analysing something is an activity. The analysing activity has a text called first impression. Instead of examining something (called the sample), carry out the analysing activity with the sample.

Before analysing: now the first impression is "unremarkable".

Rule for analysing someone: now the first impression is "living tissue".

After analysing something (called the sample):
    say "Your professional opinion of [the sample] is that it is
        [first impression]."

(The idea is you make a default in ‘before’, specify it in ‘for’, and do something in ‘after’).

Section 18.7 is Beginning and ending activities manually.

We usually do this as so:

carry out the analysing activity with the pitchblende;

Next is more fine-tune handling:
begin the assaying activity;
will start the activity and run the ‘before’ rulebook. You must later print an ‘end the activity’ statement (has anyone ever seen this in action??? in a real games source code???).

If you have an activity on an object, you have to specify what to start it on:
begin the analysing activity with the pitchblende;

And you end it like so:
end the assaying activity;

The main benefit that I can see of this more fine-tuned method is that you can run other activities in the center and they can have special code that only runs when the larger activity is running, and so on.

The ‘after’ rulebook runs when we end things.

The for rules don’t run at all, so you can put your own behavior here:
if handling the analysing activity with the pitchblende:

in between the Begin and End statements.

You can replace this activity that happens within the if statement with something like this elsewhere:

Rule for handling the analysing activity with the pitchblende when the player is not sober:
    say "You can't seem to focus."

More specifically:

if handling (activity) activity:

This should be used only where the given activity has been started with “begin …” and will be finished with “end …”. It runs the “for” rules for the activity, and then comes out true if none of those for rules intervened in the handling of that activity. (The activity must be one which doesn’t apply to any value.)

(or if there’s an object, we say if handling ... activity with ...).

Man I reallllly hope there’s an example at the end that shows why this is useful and how for rules and if handling interact. If there’s not I’m just going to erase all of this from my brain.

You can also abandon activities and skip the ‘after’ rulebook, and is used only in dramatic circumstances (it’s only used between begin and for or between for and end):

abandon the assaying activity;

or

abandon the analysing activity with the pitchblende;

We need to follow three golden rules: all activities must end, they must never last longer than a turn, and if activity B starts during activity A then it must also finish during activity A. We must also be careful to make sure that if an activity applies to something, then it begins and ends with the same something (the pitchblende, in the above example).

Okay, I’m begging for examples, let’s see…

No examples! :scream:

Yeah, I’m going to pretend I didn’t read any of this section (I honestly didn’t know if there would be examples or not, I hadn’t scrolled down yet).

Section 18.8 is Introduction to the list of built-in activities.

This just says that activities make IF graceful and beautiful and that we’re about to go through every activity possible.

(Also if Graham Nelson or Emily Short ever is reading this: I actually really like the Inform documentation; all the problems I have with it are problems I have just as much or more with other programming languages. It’s like when I’m trying to write in Python and the only examples use very complex inheritance or constructors or error catching that is not at all relevant to me. At least Inform has tons of examples and is thoroughly documented; this chapter may not be very relevant to my experience but I’d hate for it not to exist.)

Section 18.9 is Deciding the Concealed possessions of something. This section sets the tone and pattern for all the others: a section on ‘when it happens’, one for ‘default behavior’, and examples.

So this activity runs silently all the time when checking visibility, so this should be optimized as much as possible. By default nothing is concealed (by this rule). An example:

Rule for deciding the concealed possessions of the Cloaked Villain: if the particular possession is the sable cloak, no; otherwise yes.

The coin is in the Roman Villa. The face and inscription are parts of the coin. Rule for deciding the concealed possessions of the coin: if the coin is carried, no; otherwise yes.

Hmm, so ‘the particular possession’ must be an action variable. I guess it’s not as scary as I thought!

Example 338 is Hays Code, which promises Clark Gable in a pink thong. Let’s see…

The Movie Set is a room. Clark Gable is a man in the Movie Set. "Clark leans on a polystyrene pillar, wearing [a list of unconcealed things worn by Clark] with his usual aplomb." Persuasion rule for asking Clark to try doing something: persuasion succeeds.

Clark is wearing a pin-striped suit and a pink thong. Rule for deciding the concealed possessions of Clark: if the particular possession is the thong and Clark is wearing the suit, yes; otherwise no.

:thinking:

Section 18.10 is Printing th name of something. This one is really useful and comes up a lot! I’ve messed around with this before by using sample code.

It happens whenever something is printed. By default, the printed name is printed, except for th current player, who is called ‘you’ or ‘yourself’. I had to hack this when I had a clone messing with the player, I didn’t know what activities were so I was very confused. Although I think I must have taken it out since I can’t find it now.

Here are some examples:

Rule for printing the name of the pen while taking inventory: say "useful pen".

A novel is a kind of thing. Dr Zhivago and Persuasion are novels. Before printing the name of a novel, say "[italic type]". After printing the name of a novel, say "[roman type]".

Hey, I have a novel in my game! I could add this!

After printing the name of the wrist watch while taking inventory: say " (time: [the time of day])".

 Rule for printing the name of the bottle while not inserting or removing:
    if the bottle contains sand, say "bottle of sand";
    otherwise say "empty bottle";
    omit contents in listing.

Hmm, neat.

Next is a very useful phrase:

omit contents in listing

This is how you keep a container from saying something like ‘a box (in which is a pizza)’. It isn’t permanent (there are rules for that).

Example 339 is Shipping Trunk:

Before printing the name of the baking powder when the powder is in a container which contains a smelly thing: say "completely ineffective ".

Notice that we run a ‘before’ rule to literally print things before a name, and we can use after for after.

Before printing the name of a bottle (called target) while not inserting, taking, searching, or removing:
    if the target is closed, say "sealed ";
    otherwise say "now open ".

After printing the name of a bottle (called target) while not inserting, searching, examining, or removing:
    if the target contains a noncork thing, say " containing [a list of noncork things in the target]";
    omit contents in listing.

These examples are really selling activities on me, seems like a lot of the things I mess around with the most deal with activities.

Example 341 is a rare 4-star example (the first in quite a while!)

This is a way to set a flag/property for every object based on whether we’ve printed the name before.

Definition: a subject is pending if the player is aware of it and it is not known by the player.

Instead of thinking:
    if the number of pending subjects is 0, say "You have no fresh leads at the moment.";
    otherwise say "You recall that thus far you have not followed up with questions about [the list of pending subjects]."

After printing the name of a subject (called idea):
    now the player is aware of the idea.

Highlighting is a setting that varies. Highlighting is dull.

Understand "highlighting [setting]" as setting highlighting. Setting highlighting is an action out of world, applying to one setting.

Carry out setting highlighting:
    now highlighting is the setting understood.

Report setting highlighting:
    say "Highlighting is now [if highlighting is dull]off[otherwise]on[end if]."

Before printing the name of a subject (called idea) when highlighting is bright:
    unless the player knows the idea:
        say "[bold type]".

After printing the name of a subject when highlighting is bright:
    say "[roman type]".

Section 18.11 is Printing the plural name of something.

This is only used for groups of identical items. It’s used in the middle of, like You can see five gold rings here., it’s only the ‘gold rings’ here.

The default behavior is just printing the gold rings.

To change the number, change the ‘printing a number of something’ activity.

Example 342 is Hudsucker Industries

Tone is a kind of value. The tones are effusive, affectionate, polite, curt, and flamingly rude.

A letter is a kind of thing. The description of a letter is usually "On inspection, it turns out to be quite [tone]." A letter has a tone. The tone of a letter is usually polite.

A letter can be read or unread. A letter is usually unread. Carry out examining a letter: now the noun is read.

Before printing the name of a read letter: say "[tone] ".

Before printing the name of an ungrouped letter: say "random ".

Before printing the plural name of a letter (called the subject):
    if the subject is grouped:
        say "[tone] ";
    otherwise if the number of unread letters which are next to the subject is 0:
        say "unsorted ".

After printing the plural name of a letter (called the subject):
    if the number of read letters which are next to the subject is 0, say " (all unread, at the moment)" instead;
    if the number of unread letters which are next to the subject is greater than 0, say " (some as yet unread)" instead.

Proximity relates a thing (called X) to a thing (called Y) when the holder of X is the holder of Y. The verb to be next to means the proximity relation.
Definition: a letter is grouped:
    if it is unread, no;
    if the number of unread letters next to it is greater than 0, no;
    repeat with item running through letters which are next to it:
        if the tone of item is not the tone of it, no;
    yes.

Hmm, this is a pretty neat trick!

Section 18.12 is Printing a number of something, again used only for identical objects.

It has a variable called ‘listing group size’. It usually just prints a number and then prints the plural name of something (so it contains the previous activity).

You could do something weird like:
Rule for printing a number of ants: say "altogether [listing group size in words] ants".

Rule for printing a number of blocks when the listing group size is 3: say "all three blocks".

Example 343 is Prolegomena (for a player who can’t count high at a glance):

A red pencil is a kind of thing. 12 red pencils are on the desk.

A letter is a kind of thing. 12 letters are on the desk. Understand "correspondence" as a letter.

Rule for printing the plural name of a letter:
    if the listing group size is greater than 7, say "correspondence";
    otherwise say "letters".

Rule for printing a number of something (called the target) when the listing group size is greater than 7:
    say "[one of]some [or]various [or]an assortment of [at random]";
    carry out the printing the plural name activity with the target.

and we can override this with even more specific rules:

Rule for printing a number of red pencils (called the target) when the listing group size is greater than 10:
    carry out the printing the plural name activity with the target;
    say " in nearly-sufficient quantity".

Section 18.13 is Listing contents of something

This is done when taking inventory, and when listing nondescript items in the location.

This rule does not fire for containers!

So this works:

Rule for printing the name of the brogues while listing contents of a room: ...

But this won’t affect room descriptions:

Rule for printing the name of the brogues while listing contents of the shoe box: ...

This rule also isn’t used when printing player-made lists.

By default, it just prints out the list.

You can use this to make some descriptions fancier (this is different from initial appearance because this fires even after you pick up the object and drop it!):
Rule for printing the name of the wrapper while listing contents of a room: say "discarded sweet wrapper".

You know, stuff like this makes me realize why Curses! and Emily Short games are so special; they really know the inner workings and can make really special touches.

You can group items together in the following way with the special syntax ‘group…together’, which I’m absolutely going to use for tokens in my game! (I have 7 colored tokens).

You can use ‘group … together’, ‘group…together giving articles’, or ‘group…’ together as (text)'.

The first two just make the objects listed as a single line in the inventory, while the third prints the text and then the objects in parentheses.

Example 344 is Unpeeled:

Scullery is a room. A sack is carried by the player. The sack contains a yellow onion. The player carries a cork.

Before printing the name of the onion while listing contents:
if the holder of the onion contains exactly 1 thing, say "single ".

Section 18.14 is Grouping together something

This is only used when doing the ‘group together’ activity mentioned in the last section.

There is a variable called ‘listing group size’, but if there are multiple groups, the listing group size will be the number of groups.

If the list contains five men and six women, for example, “listing group size” might be 2 rather than 11.

Example:

Before listing contents: group Scrabble pieces together.

Before printing the name of a Scrabble piece while not grouping together, say "tile ". After printing the name of a Scrabble piece while not grouping together, say " from a Scrabble set".

Before grouping together Scrabble pieces, say "the tiles ". After grouping together Scrabble pieces, say " from a Scrabble set".

Nice to see we can say ‘while not…’ for an activity.

You don't even have to print them individually:
Before listing contents while taking inventory: group utensils together. Rule for grouping together utensils: say "the usual utensils".

Section 18.15 is Issuing the response text of something.

This is for responses that are marked with a letter like (A) in rules that use them (you will usually only write such rules when making an extension).

So this activity runs during this rule:

Carry out taking inventory (this is the print empty inventory rule):
    if the first thing held by the player is nothing,
        say "[We] [are] carrying nothing." (A) instead.

The default behavior is just to print the line.

We are advised not to mess with this rule (instead, just changing the responses manually). But it can be useful if you want to mess with the behavior of all responses, like this:

This is a way to see which responses are being printed, for example:

Before issuing the response text of a response (called R): say "[R]: ".

whence:

>WAIT
standard report waiting rule response (A): Time passes.

Or we can print out the same response in all viewpoints (using a trick to avoid repeating too many times):

The response inhibition is initially false.

Rule for issuing the response text of a response (called R) when the response inhibition is false:
    now the response inhibition is true;
    let the current viewpoint be the story viewpoint;
    repeat with P running through narrative viewpoints:
        now the story viewpoint is P;
        say "[P]: [text of R][command clarification break]";
    now the story viewpoint is the current viewpoint;
    now the response inhibition is false.

With that in place,

>EAST
first person singular: I can't go that way.
second person singular: You can't go that way.
third person singular: He can't go that way.
first person plural: We can't go that way.
second person plural: You can't go that way.
third person plural: They can't go that way.

Example 345 is Wesponses:

The response inhibition is initially false.

Rule for issuing the response text of a response (called R) when response inhibition is false:
    now response inhibition is true;
    let output be "[text of R]";
    now response inhibition is false;
    replace the text "r" in output with "w";
    replace the text "R" in output with "W";
    say "[output]".

Section 18.16 is Printing room description details of something.

This is for the nondescript items in a room. This rule is specifically for the parentheses after an item like:

You can also see Po and a cage (empty) here.

It doesn’t print the contents of something (that’s the ‘omit contents in listing’ thing).

We can get rid of these things altogether!
Rule for printing room description details: stop.

Hmm…I don’t think we’ve seen ‘stop’ before. Isn’t that for actions? I though stopping an activity was like ‘abort the activity’ or something mentioned earlier.

You can also add a new detail:

Rule for printing room description details of a person:
    say " (at last, someone to talk to)" instead.

This is really nice, as often it’s hard to make these nondescript items seem nice.

Example 346 is Rules of Attraction:

Definition: a thing is nonmagnetic if it is not a magnet.

Rule for printing room description details of a magnet (called attractor): if something is part of the attractor, say " (stuck to which [is-are the list of things which are part of the attractor])".

After printing the name of a magnet (called attractor) while taking inventory:
if something is part of the attractor, say " (stuck to which [is-are the list of things which are part of the attractor])".

Before taking a touchable thing which is part of a magnet (called attractor):
move the noun to the holder of the attractor.

Hmm, that last bit is a neat way to let the player take parts of things!

Section 18.17 is Printing Inventory details of something, which is just like the last section but for inventory. Standard behavior looks like this:
a flaming branch (providing light)

We can get rid of it like this:
Rule for printing inventory details: stop.

and we can add new ones like this:

Rule for printing inventory details of something edible:
    say " (yummy!)[run paragraph on]".

Hmmm, I feel like this is opening new horizons for me. I doubt I’ll be able to make effective use of it, but it’s nice!

Section 18.18 is Printing a refusal to act in the dark.

This runs when visibility is bad, and says: “It is pitch dark, and you can’t see a thing.”

We can alter this slightly:
Rule for printing a refusal to act in the dark: if we are examining something, say "It's not totally dark here, perhaps, but certainly too dim for close-up examination of anything." instead.

Example 347 is Zorn of Zorna:

Rule for printing a refusal to act in the dark:
    if we are examining something, say "The details of [the noun] are too fine to make out in the light of only [the number of visible lit candles in words] candle[s]." instead.

Section 18.19 is Printing the announcement of Darkness. This happens when the room becomes dark after being lit, and prints “It is now pitch dark in here!”.

We can change the text:
Rule for printing the announcement of darkness: say "Ooh-er! It's now very nearly pitch dark in here." instead.

Why does that rule say instead??? Since when is instead part of activities? Man, I thought I was understanding this. Did I write about that earlier? I really have to read this chapter again.

We can also move stuff around

Before printing the announcement of darkness: now all of the gremlins are in the kitchen.

or do a special rule when its dark because you closed a container:

Rule for printing the announcement of darkness when closing a container which contains the player:
    say "Congratulations: now you can't see a thing." instead.

Section 18.20 is Printing the announcement of light.

This is the opposite of last section, and just has the player try looking.

We can vary it like this:
Rule for printing the announcement of light in the Dazzling Temple: say "You are almost blinded by the suffusion of white light, and have spots before your eyes." instead.

1 Like

I’m far from an expert, but I think this is just to stop it continuing on and printing the normal “announcement of darkness” as well. Ending with “instead” is the same as saying “stop the action”, I think?

1 Like

This is not something I’ve ever seen used in a game, or ever expect to see used in a game. It exists for when you’re writing an extension with a bunch of I6 code, and you want to let people using the extension hook their own I7 code into it.

Even if you’re writing an extension, if it’s a normal one without big blocks of I6, you still shouldn’t need this—it’s mostly for the Standard Rules.

1 Like

“Stop” (as its own statement) and “instead” (attached to another statement) mean “return from the current rule or phrase, whatever it is”. Inform decided not to call it “return” for the same reason it chose not to use “continue” for skipping to the next iteration of a loop (namely, the authors thought it flowed better in the prose-like syntax).

1 Like

Chapter 18, Continued

Section 18.21 is Printing the name of a dark room. This is the same for all dark rooms and can’t really be specified. Usually it just prints the word ‘Darkness’, but you can modify it like this:

Before printing the name of a dark room, say "Near ".
to say ‘Near Darkness’.

18.22 is Printing the description of a dark room. This one also cannot be specified for specific dark rooms.

The default behavior is to print, ‘It is pitch dark, and you can’t see a thing’.

You can modify it like this:

Rule for printing the description of a dark room: say "Your eyes can barely make anything out." instead.

or this:

Rule for printing the description of a dark room: try listening instead.

Example 348 is Hohmann transfer.

Rule for printing the description of a dark room:
    say "It's night on this side of the planet, so you can make out only the glow of urbanized areas along the seacoasts." instead.

Rule for printing the name of a dark room:
    say "Dark Side" instead.

One reason I avoid doing things like that is because I don’t think you can put scenery items like ‘the glow of urbanized areas’ into a dark room, so why mention it in the description? Unless I’m wrong.

Example 349 is Four Stars (not a four star example though).

In this example, you can ‘listen’ or ‘smell’ to get a list of all scented or audible things:

The report listening rule is not listed in the report listening to rules.

Carry out listening to something:
say "From [the noun] you hear [the sound of the noun]."

Instead of listening to a room:
if an audible thing can be touched by the player, say "You hear [the list of audible things which can be touched by the player].";
otherwise say "A merciful peace prevails."

Definition: a thing is audible if the sound of it is not "silence".

Before printing the name of something audible while listening to a room:
say "[sound] from the "

A thing has some text called scent. The scent of a thing is usually "nothing".

The report smelling rule is not listed in the report smelling rulebook.

Carry out smelling something:
say "From [the noun] you smell [scent of the noun]."

Instead of smelling a room:
if a scented thing can be touched by the player, say "You smell [the list of scented things which can be touched by the player].";
otherwise say "The place is blissfully odorless."

Definition: a thing is scented if the scent of it is not "nothing".

Before printing the name of something scented while smelling a room: say "[scent] from the "

Rule for printing the description of a dark room: try listening; try smelling; rule succeeds.

Instead of examining an audible thing while in darkness: try listening to the noun. Instead of examining something while in darkness: try touching the noun.

Before touching something when in darkness:
    say "You grope about..."

etc.

18.23 is Constructing the status line. It makes a left hand status line and right hand status line.

We can alter this construction to, for instance, provide shortened names in the status line:

The Temple Of A Thousand Mightily Peeved Deities is a room. Rule for printing the name of the Temple while constructing the status line: say "Temple".

And you can hide it:

The blindfold is wearable and carried. Rule for constructing the status line while the blindfold is worn: do nothing.

Example 350 is Ways out. I’ve copied this one many times before.

When play begins:
    now left hand status line is "Exits: [exit list]";
    now right hand status line is "[location]".

To say exit list:
    let place be location;
    repeat with way running through directions:
        let place be the room way from the location;
        if place is a room, say " [way]".

Rule for printing the name of a direction (called the way) while constructing the status line:
    choose row with a heading of the way in the Table of Abbreviation;
    say "[shortcut entry]".

Table of Abbreviation
heading

shortcut

north

"N"

northeast

"NE"

northwest

"NW"

east

"E"

southeast

"SE"

south

"S"

southwest

"SW"

west

"W"

up

"U"

down

"D"

inside

"IN"

outside

"OUT"

Example 351 is Guided Tour:

When play begins:
    now left hand status line is "Nearby: [if a room is adjacent][the list of adjacent rooms][end if][if a room is adjacent and a door is visible] and [end if][if a door is visible][the list of visible doors][end if]";
    now right hand status line is "".

Rule for printing the name of an unvisited room (called the target) while constructing the status line:
    let aim be the best route from the location to the target;
    say "something [aim]".

After printing the name of a visited room (called the target) while constructing the status line:
    let aim be the best route from the location to the target;
    say " ([aim])".

> Rule for printing the name of a direction (called the aim) while constructing the status line:
> choose row with a heading of the aim in the Table of Abbreviation;
> say "[shortcut entry]".

> Table of Abbreviation

|heading|shortcut|
| --- | --- |
|north|"N"|
|northeast|"NE"|
|northwest|"NW"|
|east|"E"|
|southeast|"SE"|
|south|"S"|
|southwest|"SW"|
|west|"W"|
|up|"U"|
|down|"D"|
|inside|"in"|
|outside|"out"|

Section 18.24 is Writing a paragraph about. It happens before writing a paragraph about something, and usually does nothing! But if you make a rule for writing a paragraph, it rplaces what would have been printed, and anything whose name is printed in this rule (using a name printing phrase or substitution or activity, etc.) is excluded from the ‘nondescript’ portion of the room description.

Warning: because we often want a “for” rule for this activity to make some calculation and then possibly choose to do nothing (see the example “Otranto”), Inform suppresses the usual paragraph not when a “for” rule took effect but when it detected a paragraph having been printed. This can get confused if a text substitution affecting paragraph breaks, say “[line break]”, is within the final “say” of a “for writing a paragraph about” rule.

You can use this thing to combine several ‘nondescript items’ into one:

Rule for writing a paragraph about Mr Wickham:
    say "Mr Wickham looks speculatively at [list of women in the location]."

Printing the name of something in an activity like this makes it ‘mentioned’; if we want Inform to describe it again later, we can set it to ‘unmentioned’ (all of this happening in one turn).

Example 352 is Reflections:

Rule for writing a paragraph about a shiny thing:
    say "The [brightness of the torch] light of [the torch] reflects in the surface[if the number of shiny things in the location > 1]s[end if] of [the list of shiny things in the location]."

Before printing the name of the torch while writing a paragraph about something:
    if the torch is in the location, say "fallen ".

Example 353 is Emma:

This game replaces the concept of ‘room’ with ‘social clumps’ in a party.

by the banquet table is a room. at the corner is a room. next to the doorway is a room. by the window is a room.

Social clump is a kind of value. The social clumps are vacancy, lone person, couple, cluster, group.

A room has a social clump. Understand the social clump property as describing a room.

Before printing the name of a room:
    say "a [social clump] ".

After looking:
    assign clumping;
    say "Elsewhere in the room, you can see [the list of rooms which are not the location]."

Understand "go to [any room]" as joining. Joining is an action applying to one visible thing. Carry out joining: move player to the noun. Report joining: do nothing.

Understand "examine [any room]" as looking toward. Looking toward is an action applying to one visible thing. Carry out looking toward a room: say "In that direction you see [a list of other people in the noun]."

When play begins: assign clumping. Every turn: assign clumping.

To assign clumping:
    repeat with space running through rooms:
        now the social clump of the space is vacancy;
        if the space contains exactly 1 person, now the social clump of the space is Lone person;
        if the space contains exactly 2 people, now the social clump of the space is Couple;
        if the space contains more than 2 people and the space contains fewer than 5 people, now the social clump of the space is cluster;
        if the space contains more than 4 people, now the social clump of the space is group.

The room description heading rule is not listed in the carry out looking rules.

A person has a number called longevity. The longevity of a person is usually 0. A person can be active or passive.

Definition: a person is other if it is not the player.

Every turn:
    repeat with mover running through other people:
        now the mover is active;
        increment the longevity of mover;
        if longevity of mover is greater than 3 or the mover is bored:
            assign value of spaces for the mover;
            let destination be the nicest room;
            if the destination is not the location of the mover:
                if the player can see the mover, say "[The mover] makes excuses and drifts off to join [the destination].[paragraph break]";
                move the mover to the destination;
                now the mover is complacent;
                now the longevity of the mover is 0;
                if the player can see the mover, say "[The mover] wanders over.[paragraph break]";
                assign clumping;
                now mover is passive.

A room has a number called attractiveness.

Definition: a room is nice if its attractiveness is 1 or more.

To assign value of spaces for (mover - a person):
    repeat with space running through rooms:
        now attractiveness of the space is 0;
        repeat with figure running through people in the space:
            if the mover is bored, decrease attractiveness of the space by 2;
            if the mover likes the figure, increment attractiveness of the space;
            if the mover dislikes the figure, decrement attractiveness of the space;
            if the mover desires the figure, increase attractiveness of the space by 2.

Rule for writing a paragraph about Frank Churchill:
    if the location contains a woman (called flirt) who is desired by Frank:
        say "[Frank Churchill] is talking with great animation and slightly more than becoming warmth to [the flirt][if an unmentioned other person is in the location], while [the list of unmentioned other people in the location] look on with varying degrees of amusement or irritation[end if].";
        repeat with character running through people in the location:
           if the character is not Churchill and the character is not the flirt, now the character is bored.

Example 354 is a rare 4 star example

A person has some text called current occupation. The current occupation of a person is usually "None".

Mood is a kind of value. The moods are bemused, bored, attentive, rapt, and blushing. A person has a mood. A person is usually attentive.

Instead of examining a person:
    now every thing is unmentioned;
    carry out the writing a paragraph about activity with the noun.

Rule for writing a paragraph about a person (called X):
    let the subsequent mention be "Name";
    if the current occupation of X is not "None":
        say "[current occupation of X]. ";
        let the subsequent mention be "He";
        if X is female, let the subsequent mention be "She";
    if X wears something unmentioned:
        if the subsequent mention is "Name", say "[The X] ";
        otherwise say "[subsequent mention] ";
        say "is wearing [a list of unmentioned things worn by X]";
        if X carries something unmentioned, say " and carrying [a list of unmentioned things carried by X]";
        say ".";
    otherwise:
        if X carries something unmentioned:
            if the subsequent mention is "Name", say "[The X] ";
            otherwise say "[subsequent mention] ";
            say " is carrying [a list of unmentioned things carried by X]."

Rule for writing a paragraph about a device (called X):
    let the subsequent mention be "Name";
    if the X is unmentioned:
        say "[The X] is here. ";
        let the subsequent mention be "It";
    if something is part of X:
        if the subsequent mention is "Name", say "[The X] ";
        otherwise say "[subsequent mention] ";
        say "[if a mentioned thing is part of X]also [end if]features[if a mentioned thing is part of X], in addition to [the list of mentioned things which are part of X],[end if] [a list of unmentioned things which are part of X]";
        say ".".

Rule for printing the name of the steering wheel while writing a paragraph about a person:
    say "steering wheel".

Rule for writing a paragraph about a supporter (called X):
    let the subsequent mention be "Name";
    if the position of X is not "None":
        say "[position of X]. ";
        let the subsequent mention be "It";
    if a mentioned thing is on X:
        say "Besides [the list of mentioned things which are on X], ";
        let the subsequent mention be "it";
    if the subsequent mention is "Name", say "[The X] ";
    otherwise say "[subsequent mention] ";
    say "holds [a list of unmentioned things which are on X]."

That seems interesting, not sure how this would pan out.

Hmm…I just compiled this and it’s actually pretty neat. It prints a paragraph about the machinist, the lady, and the car, but not really all at once. When they’re all in the room, it’s wrapped up into one paragraph, but it has parts where the machinist and car have separate paragraphs and part where the car and the lady are wrapped into one. Really it’s stuff like this I think that makes Short’s games magical, real masterclass stuff.

Section 18.25 is Listing Nondescript items of something. This is the final list paragraph at th end of a room description. It usually prints “You can also see such and such”. It has an associated property which it assigns to objects caled ‘marked for listing’.

You can omit something by saying something more important about it:

Before listing nondescript items:
    if the watch is marked for listing:
        say "The watch catches your eye.";
        now the watch is not marked for listing.

You can also change the listing style. Below is the default:

Rule for listing nondescript items of the Distressingly Messy Room:
    say "Strewn carelessly on the floor";
    list the contents of the Distressingly Messy Room, as a sentence,
        tersely, listing marked items only, prefacing with is/are,
        including contents and giving brief inventory information;
    say "."

Example 355 is Rip Van Winkle.

This example shows how if you put someone’s name into the room description then you don’t want to list them independently later:

A person can be asleep.

The Catskills is a room. "Here is a lovely, secluded fold in the mountains, far from civilization[if Rip Van Winkle is asleep]: as though to prove it, Rip Van Winkle is sleeping under a tree[end if]."

A tree is scenery in the Catskills.

Rip Van Winkle is a man in the Catskills. Rip Van Winkle is asleep.

Before listing nondescript items of the Catskills:
    if Rip Van Winkle is marked for listing:
        now Rip Van Winkle is not marked for listing;
        if Rip Van Winkle is not asleep,
            say "Rip Van Winkle stands here, looking mightily confused."

Instead of waiting:
    say "Rip Van Winkle wakes up with a snort.";
    now Rip Van Winkle is not asleep.

Example 356 is “Happy Hour”

This example groups some nondescript items together and has some complex code about commas and periods:

Before listing nondescript items:
    say "You can see [a list of people who are marked for listing] here. ";
    repeat with named party running through people:
        now the named party is not marked for listing;
    let count be the number of visible other people who are carrying something;
    if count is 0:
        say paragraph break;
        continue the action;
    let index be count;
    repeat with holder running through visible other people who are carrying something:
        if index is count, say "[The holder]";
        otherwise say "[the holder]";
        say " has [a list of things carried by the holder]";
        decrement index;
        make delimiter index of count.

To make delimiter (index - a number) of (count - a number), continuing or halting:
    if index is 0:
        if continuing, say ". [run paragraph on]";
        otherwise say ".";
    otherwise if index is 1:
        if count is 2, say " and ";
        otherwise say "[optional comma] and ";
    otherwise:
        say ", ".

To say optional comma:
    if the serial comma option is active:
        say ",".

Example 257 is Eye of the idol:

Positioning relates various things to various things. The verb to be placed in means the positioning relation. The verb to be placed on implies the positioning relation.

Room-positioning relates various things to various rooms. The verb to be room-placed in means the room-positioning relation.

Definition: a thing (called prop) is in-place:
    if the prop is in the location and the prop is room-placed in the location, yes;
    if the holder of the prop is a thing and the prop is placed in the holder of the prop, yes;
    no.

Definition: a thing is out-of-place if it is not in-place.

Before listing nondescript items:
    now every marked for listing in-place thing is not marked for listing.

Rule for writing a paragraph about a quiet supporter (called chosen table):
    if an out-of-place thing is on the chosen table:
        if an in-place thing is on the chosen table,
            say "On [the chosen table], in addition to [the list of in-place things on the chosen table], [is-are a list of out-of-place things which are on the chosen table].";
        otherwise say "On [a chosen table] [is-are a list of out-of-place things which are on the chosen table].";
    now the chosen table is mentioned.

Section 18.26 is Printing th locale decription of something

This is the part of the room description that describes visible items in the location, which can be a container like a cage. It is usually very complex, and is the activity that prints stuff like ‘writing a paragraph about’ and then ‘listing nondescript activities’.

It suggests that this should be meddled with only after trying the other two, more specifci activities first.

For instance, in a room where nothing can be seen on the ground:

Rule for printing the locale description of the Very Misty Moorlands:
    say "Mist coils around your feet, thick as a blanket. You cannot even see the ground you walk upon." instead.

Report taking something in the Very Misty Moorlands:
    say "You grope blindly in the mist and pick up [the noun]." instead.

You can also throw stuff in the middle of the activity like this:

The parcel is a closed opaque container on the marble table. The alarm clock is a device in the parcel. The alarm clock is switched on.

Before printing the locale description of a room (called the locale):
if the locale encloses the alarm clock and the alarm clock is switched on, say "A faint ticking noise can be heard."

Example 358 is Priority Lab

This is a debugging rule, that uses something apparently called the ‘table of locale priorities’:

Before printing the locale description (this is the dump locale table rule):
    say "Locale Priority list:";
    repeat through Table of Locale Priorities:
        let the flag be whether or not the notable-object entry is mentioned;
        say "[line break] [notable-object entry]: [locale description priority entry]";
        if the flag is false, now the notable-object entry is not mentioned;
    say line break.

We then manipulate it in various ways:

A thing can be early-described, late-described, latest-described, never-described, sightline-described, or ordinarily-described. A thing is usually ordinarily-described.

After choosing notable locale objects (this is the apply early and late description rule):
    repeat with item running through early-described things:
        if there is a notable-object of item in the Table of Locale Priorities:
            set the locale priority of the item to 1; [list before everything else -- this would work with any number lower than 5 and higher than 0]
    repeat with item running through late-described things:
        if there is a notable-object of item in the Table of Locale Priorities:
            set the locale priority of the item to 10; [list after everything else -- this would work with any number larger than 5]
    repeat with item running through never-described things:
        set the locale priority of the item to 0; [don't list at all]
    continue the activity.

After choosing notable locale objects (this is the latest-described items priority rule):
    repeat with item running through latest-described things:
        if the item is a notable-object listed in the Table of Locale Priorities:
            now the item is mentioned;
            now the item is marked for late listing.

The late listing rule is listed after the you-can-also-see rule in the for printing the locale description rules.

A thing can be marked for late listing. A thing is usually not marked for late listing.

This is the late listing rule:
    if something is marked for late listing:
        say "Oh! And also [a list of things which are marked for late listing].";
        now everything is not marked for late listing;
    continue the activity.

Hmm, I think this is the only place we have learned about this table (so far).

Section 18.27 is Choosing Notable Locale Objects for something

This is part of the printing the locale description, it picks what gets mentioned and gives them a priority number (with 1 being the highest priority). It doesn’t print anything, it just gives a priority of 5 to everything directly contained by the locale.

You can manipulate it like this:

Rule for choosing notable locale objects for the Misty Moorlands:
    repeat with item running through large things in the Misty Moorlands:
        set the locale priority of the item to 5.

Report taking a small thing in the Misty Moorlands:
    say "You grope blindly in the mist and pick up [the noun]." instead.

Which is weird because I thought it already had priority 5?

It recommends not making a supporter have a lower priority than things on it.

Example 359 is Low Light.

It is a different way of handling darkness.


To decide whether the light level is high:
    if the brilliant lamp is switched off, no;
    if the player cannot see the brilliant lamp, no;
    yes.

To decide whether the light level is low:
    if the light level is high, no;
    yes.

The shadow is a privately-named thing on the desk.

Understand "barely-visible" or "barely visible" or "shadow" as the shadow when the light level is high. Understand "invisible" or "shadow" as the shadow when the player encloses the shadow.

Before printing the name of the shadow:
    if the light level is high:
        say "barely-visible ";
    otherwise if the player encloses the shadow:
        say "invisible (but tangible) "

After dropping the shadow when the light level is low:
    say "You let it go and it fades into the ambient gloom."

After choosing notable locale objects:
    unless the light level is high:
        set locale priority of the shadow to 0.

So setting the locale priority to 0 is a way of hiding the object.

Example 360 is Casino Banale.

A fact is a kind of thing. A fact can be known or unknown. A fact can be ready to learn or hidden. A fact has some text called the narration.

Definition: a thing is narratively significant if it conveys an interesting fact.

Definition: a thing is narratively dull if it is not narratively significant.

Conveyance relates various things to various facts. The verb to convey means the conveyance relation.

Definition: a fact is interesting if it is unknown and it is ready to learn.

After examining something which conveys an interesting fact (called discovery):
    say "[discovery][paragraph break]".

After choosing notable locale objects:
    repeat through the Table of Locale Priorities:
        if the notable-object entry is narratively significant:
            set the locale priority of the notable-object entry to 1.

For writing a paragraph about a narratively significant thing (called item):
    now the item is mentioned;
    let chosen fact be a random interesting fact which is conveyed by the item;
    say "[chosen fact][paragraph break]".

I tried compiling this and see what it does but I don’t really understand how changing the locale priority does anything here.

Okay, I tried deleting that line, and a paragraph changed from this (with the line):

Penny catches your eye again. The bright coral lipstick was really not a wise choice.

Frince and Tim are chattering.

To this without the line:


Frince and Tim are chattering impatiently.

Penny catches your eye again. The bright coral lipstick was really not a wise choice.

Section 18.28 is Printing a locale paragraph about.

This is part of printing the locale description, working its way through high priority items and working down.

The default behavior is these seven rules:

(1) The "don't mention player's supporter in room descriptions rule" excludes anything the player is directly or indirectly standing on or, less frequently, in. The header of the room description has probably already said something like "Boudoir (on the four-poster bed)", so the player can't be unaware of this item.

(2) The "don't mention scenery in room descriptions rule" excludes scenery.

(3) The "don't mention undescribed items in room descriptions rule" excludes the player object. (It's redundant to say "You can also see yourself here.") At present nothing else in I7 is "undescribed" in this sense.

(4) The "set pronouns from items in room descriptions rule" adjusts the meaning of pronouns like IT and HER to pick up items mentioned. Thus if a room description ends "Mme Tourmalet glares at you.", then HER would be adjusted to mean Mme Tourmalet.

(5) The "offer items to writing a paragraph about rule" gives the "writing a paragraph about" activity a chance to intervene. We detect whether it does intervene or not by looking to see if it has printed any text.

(6) The "use initial appearance in room descriptions rule" prints the "initial appearance" property of an item which has never been handled as a paragraph, if it has one.

(7) The "describe what's on scenery supporters in room descriptions rule" is somewhat controversial. It prints text such as "On the mantelpiece is a piece of chalk." for items which, like the mantelpiece, are scenery mentioned - we assume - in the main room description. (It is assumed that scenery supporters make their contents more prominently visible than scenery containers, which we do not announce the contents of.)

Weird that the ‘don’t mention undescribed items’ rule only includes the player.

In my current game I have a couple of areas where I wanted to move from supporter to supporter in a single room without reprinting everything al the time. So I was trying to turn a lot of these rules of manually. I ended up (from stuff I learned in an earlier chapter) putting in ‘Move the player to …without printing a room description’, but I wonder if I could have just messed with this activity.

You can remove doors from the room description:

For printing a locale paragraph about a door (called the item)
    (this is the don't mention doors in room descriptions rule):
    set the locale priority of the item to 0;
    continue the activity.

And you can get rid of the rule the manual says may be the most contentious of all:

The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook.

Example 361 is Kiwi:

A raised supporter is a kind of supporter.

For printing a locale paragraph about a raised supporter (called the high place):
    if the player is on a supporter (called the riser):
        say "Up on [the high place] (and only visible because you're on [the riser]) [is-are a list of things on the high place].";
    otherwise:
        say "The [high place] is above you."

Example 362 is Copper River:

For printing a locale paragraph about a dull thing (called item):
    now the item is mentioned.

Before printing a locale paragraph about a supporter (called item):
    now every dull thing on the item is mentioned.

Before printing a locale paragraph about a container (called item):
    now every dull thing on the item is mentioned.

I’ll leave off there since 18.29 is scope which I want to learn more about.

1 Like

Strictly speaking it bypasses all things with the “undescribed” property. It’s just that the player is the only thing which has this property by default.

1 Like

Yeah, the example reads a bit strangely at first glance. I think the idea is just that we don’t set the locale priorities for the other items (the small ones).
As I understand it, what’s going on is that the custom “Rule for choosing notable locale objects for the Misty Moorlands” is the most specific rule “for choosing notable locale objects”, which means it’s the only rule (from the “for” rulebook of the corresponding activity) which is run. So, it sets the locale priority for the large items to 5 (which, as you say, the standard rule would otherwise have done, too). But since the standard rule is overridden by the custom rule, the locale priority of the small items is not set to 5, so – as desired – they don’t show up in the Misty Moorlands locale description.

2 Likes

This makes way more sense, thank you!

1 Like

I have to say, this chapter has really helped my game so much more than I thought it would. I’m enjoying messing with listing descriptions.

Something from earlier chapters that I’ve started doing is when I want scenery to be hidden until the player finds it, I put it in like usual but then say something like this:

`The desk-drawer is part of the oak-desk.

Understand “drawer” as the desk-drawer when the oak-desk is examined.`

This basically makes the drawer very hard to find until the player has looked at the desk. It’s much easier to code and less liable to failure than moving stuff from off-stage. On the other hand, it does run the risk of somehow getting caught in disambiguations in weird situations (as people have discussed in other threads about privately-named things).

I’ve also been using this method for details of paintings and things, since it’s weird to walk in a room and say ‘x man’ and say ‘do you mean Fred or the painting of the Champs-Elysee?’ when there’s a man in the painting.

Anyway, on to:

Chapter 18, cont.

18.29 is Deciding the scope of something.

You can only refer to an object if it is ‘in scope’. In the standard rules, something is in scope if it is in the location of the player and it is not dark.

You can mess with scope like this:

After deciding the scope of the player while the location is the Shrine:
    place the holy grail in scope.

The reason I always feared this is because whenever I tried to put something in scope, I always got the error that said ‘You can’t reach into ___room name’.

But that’s because I hadn’t read section 12.18! In that section we learned rules like:

A rule for reaching inside the flask: say "Your hand passes through the glass as if it were not there, chilling you to the bone."; allow access.

and

A rule for reaching inside open containers:

if the person reaching is the player:
  say "Your hands seem enigmatically too large for [the container in question].";
  deny access.

So if you add an item in another room in scope, you just need to write a rule for reaching inside its location! Pretty neat. That solves my main problem I had with scope, so maybe I’ll use it more.

To put something in scope:

place the distant volcano in scope;
place the lacquered box in scope, but not its contents;

(usually contents are automatically placed in scope if it is transparent or open or not a container).

To place just the contents of something in scope (including a room):

place the contents of the lacquered box in scope;
place the contents of the Marbled Steps in scope;

To be able to look into another room:

The Cloakroom is a room. "This is just a cloakroom, but through a vague, misty mirror-window you can make out the Beyond." After looking in the Cloakroom, say "In the mirror you can see [list of things in the Beyond]."

After deciding the scope of the player while the location is the Cloakroom: place the Beyond in scope.

The Beyond is a room. Johnny Depp is a man in the Beyond.

To allow someone to refer to things in a dark room by name:
After deciding the scope of the player while in darkness: place the location in scope.

Hmm, maybe I can use darkness now more often!

This activity happens before a command is fully processed, so you can’t say ‘while taking a ___’, since Inform doesn’t know what the noun or second noun is yet. But it does know the action, so ‘while taking’ would be okay.

This is really exciting!

Example 363 is Peeled.

A thing can be large or small.

Before touching a large thing when in darkness: say "You grope for [the noun]..."

After deciding the scope of the player:
    repeat with item running through large things in the location:
        place item in scope.

If instead you want to put a whole kind of thing in scope for an action, say ‘any’, like this:

Understand "ask about [any subject]" as inquiring about. A subject is a kind of thing. The skintight catsuit is a subject. Inquiring about is an action applying to one visible thing.

Carry out inquiring about something:
say "'What can you tell me about [the noun]?' you demand. Mr Steed raises his eyebrows, but does not reply."

We say ‘visible thing’ because otherwise we get a ‘can’t reach into’ error.

(note that ‘subject’ is a kind here, sneakily defined in the middle of the paragraph, which really confused me for a while).

Example 364 is Four Stars 2:

After deciding the scope of the player while listening or sleeping or looking:
    if in darkness:
        repeat with locale running through adjacent rooms:
            place locale in scope.

A reaching inside rule while listening or sleeping or looking:
    rule succeeds.

The report listening rule is not listed in the report listening to rules.

Carry out listening to something:
    say "From [the noun] you hear [the sound of the noun]."

Instead of listening to a room:
    if an audible thing can be touched by the player, say "You hear [the list of audible things which can be touched by the player].";
    otherwise say "A merciful peace prevails."

Definition: a thing is audible if the sound of it is not "silence".

Before printing the name of something audible while listening to a room:
    say "[sound] from the "

A thing has some text called scent. The scent of a thing is usually "nothing".

The report smelling rule is not listed in the report smelling rulebook.

Carry out smelling something:
    say "From [the noun] you smell [scent of the noun]."

Instead of smelling a room:
    if a scented thing can be touched by the player, say "You smell [the list of scented things which can be touched by the player].";
    otherwise say "The place is blissfully odorless."

Instead of sleeping when the player can touch an audible thing (called the irritant):
    say "The steady [sound of the irritant] from [the irritant] prevents your slumber."

Section 18.30 is Clarifying the parser’s choice of something.

This only runs where the player types a verb and a noun (the first noun specifically) and the noun is the name of an object (not a kind), and there are multiple options and Inform picks one.

If that happens, then this activity runs, which prints which one you picked in parentheses, like:

 > Take box
(the laminated mahogany box)

Taken.

An example on how to change it:

The Champs du Mars is a room. The great Eiffel Tower is here. "The great Tower stands high over you." The souvenir model Eiffel Tower is here. "Comparatively tiny is the souvenir version." The great Eiffel Tower is fixed in place. Does the player mean taking the great Eiffel Tower: it is very unlikely.

Rule for clarifying the parser's choice of the model tower: say "(The little one, obviously.)"

Section 18.31 is Asking which do you mean. This is like the previous section, but when Inform isn’t confident which of the objects to choose. It is a complicated rule since it also has to deal with multiple indistinguishable objects.

You can put an explanation before hand if doing a tutorial:

Before asking which do you mean: say "Okay, so I'm going to have to ask a question now: you've typed something ambiguous, and I don't know which noun you're referring to."

After asking which do you mean: say "(Just type a word or two to give me more information.)"

or just use this activity in a ‘while’ clause:

The Champs du Mars is a room. The great Eiffel Tower is here. "The great Tower stands high over you." The souvenir model Eiffel Tower is here. "Comparatively tiny is the souvenir version." The great Eiffel Tower is fixed in place. Understand "actual" as the great Tower.

Rule for printing the name of the great Tower while asking which do you mean: say "actual Tower". Rule for printing the name of the souvenir tower while asking which do you mean: say "souvenir".

Example 368 is Apples:

An apple is a kind of thing. Consumption is a kind of value. The consumptions are pristine and bitten. An apple has a consumption. The description of an apple is "It is [consumption]."

Understand the consumption property as describing an apple.

Before printing the name of an apple while asking which do you mean: say "[consumption] ". Before printing the plural name of an apple while asking which do you mean: say "[consumption] ".

Example 369 is Originals:

This has an elaborate scheme for having a thing and a model of a thing. We want to print the word ‘actual’ before the original thing, but not when printing the name of the model.

The virtual-context is a truth state that varies. The virtual-context is false.

Before printing the name of a model:
    now virtual-context is true.

After printing the name of a model:
    now virtual-context is false.

Before printing the name of something (called target) while asking which do you mean:
    if the target is not a model and virtual-context is false:
        say "actual ".

Example 370 is Walls and Noses:

In this example we use Inform 6 code (which I think is our first time?) to tell if something is in the parse list (which we also haven’t learned of previously):

Definition: a direction is matched if it fits the parse list.
Definition: a room is matched if it fits the parse list.
Definition: a thing is matched if it fits the parse list.

To decide whether (N - an object) fits the parse list:
    (- (FindInParseList({N})) -)

Include (-
[ FindInParseList obj i k marker;
    marker = 0;
    for (i=1 : i<=number_of_classes : i++) {
    while (((match_classes-->marker) ~= i) && ((match_classes-->marker) ~= -i)) marker++;
    k = match_list-->marker;
    if (k==obj) rtrue;
    }
    rfalse;
];
-)

My motivation to learn Inform 6 has gone down a lot since I learned it was just like modded C++ (maybe that’s not true?), since many of my education and career choices were centered around avoiding jobs that use C++ heavily.

Include Complex Listing by Emily Short.

Rule for asking which do you mean when everything matched is a nose:
    prepare a list of matched things;
    if your nose is an output listed in the Table of Scored Listing:
        choose row with an output of your nose in the Table of Scored Listing;
        now the assigned score entry is -1;
    say "Whose nose do you mean, [the prepared list delimited in disjunctive style]?"

So this example also has an undocumented extension used in it (I mean undocumented in the manual). Basically, this example is like ‘Why not rewrite the whole parsing system from scratch?’

I wonder if this would be of use to @Lancelot, who was recently asking about how to make Inform disambiguate when writing only half of an action applying to one thing and one specific kind of value.

Section 18.32 is Supplying a missing noun/second noun

These two activities are for when you type a command that takes a certain number of object parameters, but forget to type that parameter. (Edit: that’s what I thought at first, but after experimentation and rereading, I realized it’s not that at all! This action is only for when you write an ‘Understand’ rule for an action that has one or more missing parameters.)

This rule can’t be used to give hints to inform on which object to guess it should select; that’s what ‘does the player mean’ is for.

But it can be used to pick a specific noun, or to make no choice and have the command rejected. If the activity prints nothing, Inform says, ‘You must supply a noun’.

(Hmm, I was summarizing text, but it seems confusing, so I don’t think I fully grasped it). (edit: I think I get it after my notes above)

Inform automatically does this rule for ‘going’ with no direction (which prints a refusal), and listening and smelling ‘which supplies the noun of the location itself’.

So if you type ‘smell’, the actual action that is performed is ‘smelling the location’.

The rule for listening is explicitly:

Rule for supplying a missing noun while listening (this is the ambient sound rule):
    now the noun is the location.

You can use this rule to allow people to use the best item as the second noun seamlessly:

Understand "unlock [something]" as unlocking it with.

Rule for supplying a missing second noun while unlocking:
    if the skeleton key is carried, now the second noun is the skeleton key;
    otherwise say "You will have to specify what to unlock [the noun] with."

In an effort to help out a friend, I tried doing this to a verb applying to a noun and a kind of value, but I got the bizarre error ‘you may not supply a second subject’, which doesn’t even show up on google searches. I think though that it only shows up when trying to put two ‘things’ into an action that only accepts one ‘thing’.

Example 371 is Latin Lessons:

A dance-name is a kind of thing. Argentine tango, samba, merengue, cha-cha, street salsa are dance-names.

Dancing is an action applying to one visible thing. Understand "dance [any dance-name]" as dancing. Understand "dance" as dancing.

Rule for supplying a missing noun while an actor dancing:
now the noun is street salsa.

Man, this means I should update my extension, which currently has an action called ‘singleuttering’ for using ‘say’ with only one topic and no people to say it to.

Example 235 is “The Problem of Edith”:

Suggestion relates things to each other. The verb to suggest means the suggestion relation.

A subject is a kind of thing. The current subject is a thing that varies. greeting is a subject.

Understand "ask [someone] about [any subject]" as asking it about the subject. Understand "tell [someone] about [any subject]" as asking it about the subject.

Asking it about the subject is an action applying to one thing and one visible thing.

Carry out asking it about the subject:
say "'Hmm, [the second noun],' says [the noun]. ";
relate the current subject with the second noun;
now the current subject is the second noun.

This example doesn’t really use the activity in this section.

Section 18.33 is Reading a command. This one sure gets used a lot, though not by me! It prints the prompt text, waits for the player to type and press return, rejects blank lines and treats commands starting with ‘oops’ as correcting the last one.

They suggest not changing ‘for’ rules for this one.

But the other rules are okay:

Before reading a command while the turn count is 1, say "(This is your chance to say what the protagonist should do next. After the '>', try typing 'take inventory'.)"

(This changes the prompt, like Austin Auclair did in his recent Seedcomp game, which replaced it with an anchor).

More powerful is ‘after reading a command’, which lets you access the variable called ‘the player’s command’, giving you ultimate power:

After reading a command:
    if the player's command includes "please":
        say "Please do not say please.";
        reject the player's command.

If you ever want to hijack the parser entirely at the source, this is really the place to hit it up.

if the player's command matches "room [number]", ...

will be true if the command is ROOM 101, but not if it’s EXPLORE ROOM 7.

We can also say ‘if ____ does not match ____’.

The player’s command has the type ‘snippet’, which is what all these statements accept.

if the player's command includes "room [number]", ...

will be true if the command is ROOM 101, EXPLORE ROOM 7, or ROOM 22 AHOY, but not if it’s VISIT ROOM GAMMA 7.

We can also check if a snippet does not include a topic.

Finally, you can just say
reject the player's command, which ignores the text entirely and goes back to the keyboard with no ‘every turn’ machinery running.

So you can use this to force a limited parser. Which, I had a limited parser area of my mega-game coming up to work on, so maybe I’ll try this out!

We can manipulate text all we want:

 if the player's command includes "please":
        say "(Quelle politesse! But no need to say please.)";
        cut the matched text.

if the player's command includes "room [number]":
    replace the matched text with "office".

if the player's command includes "or else":
    cut the matched text.

Some sample uses:

 After reading a command:
    if the player's command matches "grab", replace the player's command with "take all".

The only three snippets we will really use are the player’s command, the matched text, and the topic understood (which is only used in processing actions containing the ‘[text]’ token).

After reading a command:
    let T be "[the player's command]";
    replace the regular expression "\p" in T with "";
    change the text of the player's command to T.

Example 373 is cloves:

Manner is a kind of value. The manners are insouciantly, sheepishly, and defiantly.

After reading a command:
    if the player's command includes "[manner]":
        cut the matched text;
    otherwise:
        say "But how, my dear boy, how? You simply can't do something without a pose. Thus far you have mastered doing things [list of manners].";
        reject the player's command.

When play begins:
    now the left hand status line is "Behaving [manner understood]";
    now the right hand status line is "[location]";
    now the manner understood is insouciantly.

Interestingly, the variable ‘the manner understood’ is set even though we removed it from the player’s command, I think because in the parsing stage (after reading a command) we had it check for the token ‘manner’.

Example 374 is Fragment of a Greek Tragedy:

Understand “restart/restore/save/quit” as “[meta-command]”.

After reading a command:
if the player’s command matches “[meta-command]”, make no decision;
say line break;
repeat through Table of Current Topics:
if the player’s command includes topic entry:
say “CHORUS: [reply entry][paragraph break]”;
follow the advance time rule;
rule succeeds;
say “[italic type] Pause.[roman type][line break]”;
follow the advance time rule;
rule succeeds.

Table of Current Topics
topic

reply

“journey/trip/travel/came/arrived”

“Sailing on horseback, or with feet for oars?”

“horseback/legs/feet/oars”

“Beneath a shining or a rainy Zeus?”

“shining/rainy/weather/zeus”

“Mud’s sister, not herself, adorns thy boots.”

I think the ‘make no decision’ just exits out of our current after rule and lets it go on to processing. I think ‘rule succeeds’ does the opposite. I haven’t reached the rules chapter yet though.

Example 375 (wow, we’ve gotten far!) is North by Northwest:

This is a way to truncate very long commands like north-northeast:

After reading a command:
    let N be "[the player's command]";
    replace the text "north" in N with "n";
    replace the text "east" in N with "e";
    replace the text "south" in N with "s";
    replace the text "west" in N with "w";
    change the text of the player's command to N.

I should have done this in my game Ether but that was my first game and I wrote it 8 years ago and I literally just learned this concept today.

Example 376 is Complimentary Peanuts:

Instead of asking Aunt Martha to try doing something:
    repeat through Table of Aunt Martha's Commentary:
        if player's command includes topic entry:
            say "[commentary entry][paragraph break]";
            rule succeeds;
    say "'Hmmf,' says Aunt Martha."

Asking someone about something is speech.
Telling someone about something is speech.
Answering someone that something is speech.
Asking someone for something is speech.

Instead of speech when the noun is Aunt Martha:
    repeat through Table of Aunt Martha's commentary:
        if the topic understood includes topic entry:
            say "[commentary entry][paragraph break]";
            rule succeeds;
    say "'Hmmf,' says Aunt Martha."

Section 18.34 is Implicitly taking something.

This happens when you try to do an action with an item that is present but not carried. By default, inform prints (first taking the ___) and then silently tries taking it.

No matter what rules are written for this activity, it is impossible to use it to allow the action to go ahead even without the item. The activity allows us to change how, or if, an implicit take will happen, but not to change the consequences of failure.

(you can change this behavior by unlisting rules, though).

Here’s what we can do with this activity:

Rule for implicitly taking the curare:
    say "Ordinarily you'd pick up the curare in order to be able to do that, but this seems like a good moment for caution." instead.

Rule for implicitly taking something (called target):
    try silently taking the target;
    if the player carries the target, say "You appropriate [the target] first, of course. [run paragraph on]"

Rule for implicitly taking the noun when the second noun is a thing and the second noun is not carried by the player:
    try silently taking the noun;
    try silently taking the second noun;
    say "(first taking both [the noun] and [the second noun])[line break]"

Rule for implicitly taking something which is carried by the player when the person asked is Clark:
    say "'I don't see how I'm supposed to do that when you're holding [the noun],' remarks Clark sulkily." instead.

Check an actor photographing a flower:
    if the actor is not carrying the noun:
        carry out the implicitly taking activity with the noun;
        if the actor is not carrying the noun, stop the action.

Example 377 is The Big Sainsbury’s

This is a way to make implicit actions take up time:

Rule for implicitly taking something:
    follow the advance time rule;
    continue the activity.

Example 378 is Pizza Prince:

A pizza slice is a kind of thing. 10 pizza slices are in Pizza Limbo. A pizza slice is always edible.

Rule for implicitly taking the pizza selection:
    let chosen slice be a random pizza slice in Pizza Limbo;
    if chosen slice is nothing: [That is, there were no slices remaining]
        say "[manager refusal]";
    otherwise:
        move the chosen slice to the player;
        say "(helping yourself from the selection)";
        now the noun is the chosen slice.

Rule for clarifying the parser's choice of the pizza selection while taking:
    say "(from the magnificent selection before you)[line break]"

That example had more nuance to it, so if you plan on copying it, I’d read the whole thing.

Example 379 is Lollipop guild:

This example skips some implicit takes altogether.

The carrying requirements rule does nothing when showing something to the guardian.
The can't show what you haven't got rule does nothing when showing something to the guardian.
The block showing rule does nothing.

This lets you show whatever you want to the guard without taking it.

Section 18.35 is Printing a parser error.

This happens when the parser tries to match a command but can’t.

These are the possible parser errors:

didn't understand error
only understood as far as error
didn't understand that number error
can't see any such thing error
said too little error
aren't holding that error
can't use multiple objects error
can only use multiple objects error
not sure what it refers to error
excepted something not included error
can only do that to something animate error
not a verb I recognise error
not something you need to refer to error
can't see it at the moment error
didn't understand the way that finished error
not enough of those available error
nothing to do error
referred to a determination of scope error
I beg your pardon error
noun did not make sense in that context error
can't again the addressee error
comma can't begin error
can't see whom to talk to error
can't talk to inanimate things error
didn't understand addressee's last name error

You can add little notes to this or alter them or print the name of the report:

After printing a parser error:
    say "If you are new to interactive fiction, you may like to try typing HELP."

Rule for printing a parser error when the latest parser error is the I beg your pardon error:
    say "What's that? Speak up, speak up." instead.

Rule for printing a parser error:
    say "That's a rum thing to say, and no mistake." instead.

Rule for printing a parser error:
    say "The [latest parser error] happened.";
    continue the activity.

(I often change these errors with the format of The error name rule response (whatever) is “”).

Example 380 is WXPQ:

Rule for printing a parser error when the latest parser error is the noun did not make sense in that context error:
    say "For once, you're at a loss for anything to say."

The parser error “That noun did not make sense in this context” arises instead of “You can’t see any such thing” when the player uses a command that could apply to any item in the game.

It goes on to explain how to handle two separate error messages for two different functions with that token.

Example 381 is Xot:

The last error is a text that varies. The last error is "xot".

Before printing a parser error:
now the last error is the player's command.

Every turn when a random chance of 1 in 2 succeeds:
say "Over the loudspeaker comes some distorted nonsense. If you listen carefully, it sounds as though some fool is saying '[last error], [last error], [last error]!'"

Section 18.36 is Deciding whether all includes.

This runs when the player types a command using ‘all’. We generally exclude things like the player’s body, scenery, and fixed things.

Some examples:
Rule for deciding whether all includes scenery: it does not.

The above rule is already in the standard rules.

Rule for deciding whether all includes the oval roof: it does.

Section 18.37 is Printing the Banner text.

When a game starts, it prints some generic banner text:

Relations
An Interactive Fiction by Emily Short
Release 1 / Serial number 050630 / Inform 7 build 2U98 (I6/v6.30 lib 6/10N) SD

To say this at any time, type
say "[the banner text]"

You can alter it like:

After printing the banner text, say "DRM authentication code: 13S-451-2034u75y65u%%a1248."

or:

Rule for printing the banner text: say "Welcome." instead

Example 382 is Bikini Atoll, an example I’ve copied in quite a few of my games:

The Hut and the Tropical Beach are rooms.

The conch shell is in the Hut. After taking the shell for the first time: say "As you gather the oddly-warm conch shell into your arms, you experience a sudden flash of deja-vu...[banner text]"; move the player to the Tropical Beach.

Rule for printing the banner text when the player is not carrying the shell: do nothing.

I like to have ‘cold opens’ in my games, with the banner text only showing up at some dramatic moment like a film title. I did that in Color the Truth, and in the seed I entered into seedcomp that Charm Cochran used for Red Door Yellow Door.

I do follow this note in the text, though:

(By tradition, and as a courtesy to all the people who have worked on Inform, authors ensure that the banner is printed some time near the beginning of each game played. So please only defer it, rather than suppress it altogether.)

Section 18.38 is Printing the player’s obituary

This prints the asterisk and ‘you have died’ message, along with printing the final score and blanking the status line.

After printing the player's obituary: say "And you visited [number of visited rooms] place[s]."

Example 383 is Battle of Ridgefield:

This removes the option to do anything but quite the game after dying (and dying is triggered by ‘end the story’).

Rule for printing the player's obituary:
    say paragraph break;
    center "In defense of American Independence";
    center "at the Battle of Ridgefield, April 27, 1777,";
    center "died Eight Patriots who were laid in this ground,";
    center "Companioned by Sixteen British Soldiers,";
    center "Living, their enemies,";
    center "Dying, their guests";
    say paragraph break;
    wait for any key;
    stop game abruptly;
    rule succeeds.

Example 384 is Finality, which removes Undo from the final options table:

When play begins:
    choose row with a final response rule of immediately undo rule in the Table of Final Question Options;
    blank out the final question wording entry.

Instead of jumping:
    say "If you insist.";
    end the story.

This just doesn’t remind them about undo, but you can fully remove it (unless they have one of the cool interpreters that has built-in UNDO):

Use undo prevention.

Example 385 is Jamaica 1688:

Table of Final Question Options (continued)

final question wording only if victorious topic final response rule final response activity
“REVEAL the inspiration for something or somewhere” true “reveal [any thing]” investigate something rule
true “reveal [any room]” investigate something rule
This is the investigate something rule:
    repeat through the Table of Footnotey Stuff:
        if the player's command matches the topic entry:
            say "[revelation entry][paragraph break]";
            rule succeeds;
    say "I'm afraid I have no revelation to vouchsafe there."

I’ve copied this one before, but I notice this example and the last one aren’t directly related to the section text itself.

Section 18.39 is Amusing a victorious player.

If there are no player-made rules for this, it does nothing. If the player adds a ‘Rule for amusing a victorious player’, then AMUSING becomes an option at the end of the game.

Rule for amusing a victorious player: say "Hmm. You're easily amused."

Example 386 is Xerxes:

Table of Amusing Matter

title subtable description toggle
“Cult Revisions” “Did you try… [paragraph break] banning the worship of Seth? [line break] of Dionysus? [line break] assigning all your priests to Re? [line break] assigning male priests to Cybele? [line break] assigning married priestesses to Hestia? [line break] identifying one god as another (e.g., Isis and Hecate)? [line break] identifying a mortal as a god (e.g., Alexander as Helios-Apollo)?”
“Military Revisions” “Did you try… [paragraph break] allying a Greek city-state with the Persians? (try >MEDIZE) [line break] playing Athens as a land-based power?”
Rule for amusing a victorious player:
    now the current menu is the Table of Amusing Matter;
    now the current menu title is "Things to Try";
    carry out the displaying activity;
    clear the screen.

And finally…
Section 18.40 is Starting the Virtual machine.

This is just a ‘hook’ for running a command at the very beginning, way before ‘when play begins’. It may even run before any windows are created, so don’t use it to print text!

Examples 387 is Blankness:

Include Basic Screen Effects by Emily Short.

When play begins:
    say "take me home";
    wait for any key;
    say " yeah";
    wait for any key;
    say " yeah";
    pause the game;
    now the left hand status line is "[location]";
    now the right hand status line is "[turn count]".

Before starting the virtual machine:
    now the left hand status line is "";
    now the right hand status line is "".

Paradise City is a room. The description of Paradise City is "The grass is green and the girls are pretty."

Whew! What a chapter! Four days worth of material, and I went from utter fear and terror to joy. I still don’t understand making new activities at all, but the sections on old activities have been so fruitful that I’ve restructured many parts of my games based on the inspiration I’ve gathered from this chapter. What fun!

Next chapter is Rulebooks, another thing I’ve been afraid of for a long time but much less frightening than ‘activities’.

2 Likes

Unless you want to make commands come from somewhere other than the keyboard! Which can be very useful.

This is my least favorite part of Inform 7 because newcomers love to try to reimplement the parser in “after reading a command” rules. I think the manual should discourage this more than “for reading a command” rules.

Yep, any time you match a token like “[manner]” against a snippet, it sets the “manner understood” variable. (Though there’s only one “___ understood” variable shared by every type, so the parser might obliterate it when parsing a line like “set [something] to [number]”. You should stash the value in your own variable before letting any other parsing happen.)

Yeah, this activity is mostly a remnant of the time before responses. It used to be that the best way to change the text printed by a specific rule was to replace the rule outright. But these parser errors were printed deep in I6 code! So this activity was created to give authors a way to hook their I7 code into the process.

Unfortunately, the things the library uses rulebooks for are often much more opaque than the things the library uses activities for. (But on the other hand, I write my own rulebooks much more than I write my own activities.)

1 Like

Inform 6 has very little in common with C++ actually. It’s much more like a reduced version of C. Most notably, it’s basically typeless, and it doesn’t have structs.

It may not have said this anywhere, but I think activities are probably most useful in extensions, particularly ones where you might want to give space for hooks both before and after something happens. For example, opening in a window in Flexible Windows is an activity so that you can set up stylehints before, and then clear stylehints afterwards. If you don’t need hooks then you don’t need an activity.

One last tip for activities: the for rulebook of an activity has a default outcome of success, which means only one rule will run under normal circumstances. But you can change it to make all rules run with:

The for ACTIVITY NAME rules have default no outcome.
1 Like

(On the “supplying a missing noun / second noun” activity:)

I feel like this whole activity was a mistake on Graham’s part. It’s a more confusing way to do something that you already figured out how to do on your own.

1 Like

Well, one advantage I’ve come to see in the activity recently is that it keeps the number of actions in your game down.

The reason this is an advantage is that when you have situations or rules that poll lots of actions, there are fewer actions you have to remember to include.

Using Brian’s example; let’s say you have uttering and singleuttering. And you have the player in a situation where they have to speak and nothing else. You have to do this:

Instead of doing anything other than uttering or singleuttering when standoff is happening:

Whereas if it’s all uttering with the activity filling in, you can just do:

Instead of doing anything other than uttering when standoff is happening:

That’s not much on its own, but by the time you’ve created many alt versions of actions to account for the player not typing a noun, it’s a little fraught that you won’t remember to round them all up every time. As a game gets bigger and more complex with more and more actions, this becomes truer.

-Wade

2 Likes

Are these the only rules for supplying missing parameters we can use? I tried to create a rule for supplying a missing topic but I get an error like:

Problem.  You wrote 'Rule for supplying a missing topic while transforming it'  (line 29): but the punctuation here ':' makes me think this should be a definition of a phrase and it doesn't begin as it should, with either 'To' (e.g. 'To flood the riverplain:'), 'Definition:', a name for a rule (e.g. 'This is the devilishly cunning rule:'), 'At' plus a time (e.g. 'At 11:12 PM:' or 'At the time when the clock chimes') or the name of a rulebook, possibly followed by some description of the action or value to apply to (e.g. 'Instead of taking something:' or 'Every turn:').

I also tried as Rule for supplying a missing text (just in case) but get the same error.

1 Like