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

Chapter 12, part 2:

Section 12.10 is about the mythical ‘Action variables’. I would never read this section unless forced to by publicly promising to cover the entire rulebook.

It says that even in the standard rules only 2 or 3 of the 90 actions use this level of complexity.

You use action variables like this:

Setting action variables for photographing:
    now the camera photographed with is the sharpest camera which is carried by the actor.

where ‘sharpest camera’ is defined earlier (recall that if you define a comparison with an inequality inform makes a superlative out of it):
A camera is a kind of thing. A camera has a number called picture quality. The digital SLR camera is a camera in the tote bag. The player carries a camera called the instant one-shot camera. The picture quality of the SLR camera is 10. The picture quality of the one-shot is 2. Definition: a camera is sharp if its picture quality is 5 or more.

and ‘the camera photographed with’ is defined as:
The photographing action has an object called the camera photographed with.

So this last thing is literally a variable of the action. These names need to be distinct for each action:

The best way to do this is to include the past participle of the action name - just as “camera photographed with” contains the past participle “photographed” of the action “photographing”.

This is a temporary variable that starts out with the default and then is set by the ‘set action variables’, which runs even before the before rules and shouldn’t do anything but set the rulebook variables. Since the rule should work for everyone, use ‘the actor’ instead of ‘the player’.

So now you can say stuff like this:

A check photographing rule:
    if the camera photographed with is nothing:
        say "You can hardly photograph without a camera, now can you?" instead.

The phrase ‘the camera photographed’ basically belongs to the ‘name space’ of this action, and cannot be used by anything not part of the action.

You can also write a special gerund or something that is faster than the above:
The photographing action has an object called the camera photographed with (matched as "using").

Instead of photographing something using the one-shot camera:
    say "But you promised to give this to Sally's nephew."

Check photographing something using the noun:
    say "That would require some sort of contraption with mirrors." instead.

Report photographing something using a sharp camera:
    say "You feel cool and important as the shutter clicks."

Honestly, I’m struggling to find a purpose for this. I often want to bring in local variables during action processing, but how is this different from something like `

Check photographing:
  let current be the sharpest camera which is carried by the actor;
...

Is the idea that it’s convenient to use the same variable name throughout all six stages of action processing? (although I’ll admit I throw a lot of things into INSTEAD and BEFORE and ignore the rest usually).

There are five examples here.

Example 198 is Removal:
Ohhh, this is a great example for why to use action rules! It helps ‘remember’ where things were at the start (this is nice!):


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

Report taking something from the location:
    say "You pick up [the noun] from the ground." instead.

Report taking something:
    say "You take [the noun] from [the previous locale]." instead.

Very neat! I find this very useful. I don’t have anywhere this could fit in my code right now because I didn’t know it existed but I think this is absolutely great.

Example 199 is Further Reasons Why All Poets Are Liars, which has the best description:

The young William Wordsworth, pushing a box about in his room, must struggle to achieve a Romantic point of view.

(I feel like @Lancelot would like this example):

Understand "push [box]" as a mistake ("You can push the box to the window, the bed or the shelf.").

Understand "push [something] to [something]" as pushing it over to. Pushing it over to is an action applying to two things.

The pushing it over to action has an internal position called the old position.
The pushing it over to action has an internal position called the new position.
Setting action variables for pushing something over to something:
    now the old position is the current box position;
    now the new position is nowhere at all;
    if the second noun is the window, now the new position is over by the window;
    if the second noun is the bed, now the new position is near the bed;
    if the second noun is the shelf, now the new position is under the shelf.

Check pushing it over to:
    if the noun is not the box, say "That's not something you can push." instead;
    if the player is on the bed, say "You can't reach from here." instead;
    if the player is on the noun, say "Not while you are standing on [the noun]." instead;
    if the new position is nowhere at all, say "You can only push [the noun] to the window, the bed or the shelf." instead;
    if the new position is the old position, say "The [noun] is already [new position]." instead.
Carry out pushing it over to:
    now the current box position is the new position.
Report pushing it over to:
    say "With some effort, you shove [the noun] from [old position] to [new position]."

We’ve finally made it to Example 200! We’re almost halfway through with examples. This is The Second Oldest Problem. It’s based on original FORTRAN code of Adventure, which is pretty neat:

The going action has a number called the dark terminus count.
Setting action variables for going:
    now the dark terminus count is 0;
    if in darkness, increment the dark terminus count.
The last carry out going rule:
    if in darkness, increment the dark terminus count;
    if the dark terminus count is 2, end the story saying "YOU FELL INTO A PIT AND BROKE EVERY BONE IN YOUR BODY!" instead.

This is only the second oldest problem in the IF literature: the earliest puzzle is unlocking the steel grate which bars entrance to the cave.

Example 201 is Puff of Orange Smoke:

A body is a kind of thing. A body is a part of every person. Instead of touching a body: say "[The noun] is grotesquely inert."

The description of Lydia's body is "Long, long legs and no attitude at all." The initial appearance of Lydia's body is "Lydia's corpse is sprawled at your feet."

Spirit-possession relates one person to one body. The verb to be owner of means the spirit-possession relation.

When play begins:
    repeat with victim running through people:
        let the corpse be a random body which is part of the victim;
        now the victim is owner of the corpse.

Setting action variables when the noun is a body which is part of a person (called owner):
    now the noun is the owner.

Setting action variables when the second noun is a body which is part of a person (called owner):
    now the second noun is the owner.

Setting action variables when the noun is a dead person and the noun is owner of a visible body (called the mortal remains):
    now the noun is the mortal remains.

This shows how setting action variables can be used to redirect actions with one part of a thing to another (I’ve just since reading this manual started doing this with text on a thing).

Example 202 is Croft: (as in Lara Croft)
This has tons of rules, mostly around messing with platforms. Here is an example:

The dropping action has an object called the container dropped into (matched as "into").

The dropping action has an object called the supporter dropped onto (matched as "onto").

Rule for setting action variables for dropping:
if the actor is in a container (called C), now the container dropped into is C;
if the actor is on a supporter (called C), now the supporter dropped onto is C.

Report dropping a heavy thing onto a metallic thing:
say "You drop [the noun], and [the supporter dropped onto] clangs protestingly." instead.

Report someone dropping a heavy thing onto a metallic thing:
say "[The actor] drops [the noun] onto [the supporter dropped onto], which clangs protestingly." instead.

Section 12. 11 is Making Actions Work for other people:

If you make action rules that mention ‘the player’, then they won’t say anything when other people do them (which was my problem with the clone).

photograph clark
You can hardly photograph without a camera, now can you?

clark, photograph me

This section just says we’ll fix that later.

Example 203 is The Man of Steel, which gives an example of an action which has no ‘understand’ rule since players will never type it:

Escaping is an action applying to nothing.

Carry out someone escaping:
    let space be the holder of the person asked;
    let place be a random room which is adjacent to the space;
    let way be the best route from the space to the place;
    try the person asked going way.

Every turn:
    if Clark Kent can see kryptonite, try Clark Kent escaping.

Example 204 is Trying Taking Manhattan:

The loud inventory rule is listed instead of the report other people taking inventory rule in the report taking inventory rules.

This is the loud inventory rule:
unless the player is the person asked:
say "[The person asked] says, 'I seem to be carrying [a list of things carried by the person asked][if the person asked is wearing something] and wearing [a list of things worn by the person asked][end if].'"

Persuasion rule for asking someone to try doing something: persuasion succeeds.

Grand Central Station is a room. "Here you are in New York, New York. Any minute now someone is going to burst into song."

Kermit the Frog is a man in Grand Central Station. "Kermit the Frog stands nearby, enjoying being green." Kermit is wearing a hat and a trenchcoat. He is carrying a microphone.

(There have been a ton of pop culture references in the last few sections; seems like the authors are having fun and figuring that no government censor would ever bother reading this deep into the Advanced Actions chapter).

Example 205 is Under Contact, a rare 4-star example. It basically lets Clark Gable do a lot of things and comment on them. The most interesting part to me is this code and the following table:

Unsuccessful attempt by Clark doing something:
repeat through table of Clark Retorts:
if the reason the action failed is the cause entry:
say “[response entry][paragraph break]”;
rule succeeds;
say “‘I don’t think that’s in the script,’ says Clark dubiously.”

Table of Clark Retorts

cause response
can’t take yourself rule “‘I’m always self-possessed,’ Clark remarks. You’ve heard that line before, but it sounds so much more convincing from him.”
can’t take other people rule “‘I don’t think it would be appreciated if I tried to do that to [the noun],’ he rumbles.”
can’t take component parts rule “‘I don’t want to rip [the noun] out,’ Clark remarks.”
can’t take people’s possessions rule “‘I don’t cotton to acting like a thief,’ Clark replies. ‘It ain’t proper.’”
can’t take what you’re inside rule “‘Do you see where I am, babe?’ Clark demands.”
can’t take what’s already taken rule “[already done]”
can’t take scenery rule “‘I’m not the stunt man, darling,’ he says with a wry twinkle.”
can’t take what’s fixed in place rule “‘I’m not the stunt man, darling,’ he says with a wry twinkle.”
can’t exceed carrying capacity rule “Clark grins. ‘I’ve only got so many hands, darling,’ he says.”
can’t insert into closed containers rule “[physical impossibility]”
can’t go that way rule “[physical impossibility]”
can’t go through closed doors rule “[physical impossibility]”
can’t enter closed containers rule “[physical impossibility]”
can’t exit closed containers rule “[physical impossibility]”
can’t drop yourself rule “‘We’re inseparable, me and me,’ Clark replies, with a smile.”
can’t drop what’s already dropped rule “[already done]”
can’t drop what’s not held rule “‘Not under my control, [the noun],’ replies Clark.”
can’t drop clothes being worn rule “[salacious retort]”
can’t put something on itself rule “‘I lack the dexterity,’ says Clark. Oh, he’s so modest.”
can’t put onto what’s not a supporter rule “‘[The second noun] won’t support a thing,’ says Clark reprovingly.”
can’t put clothes being worn rule “[salacious retort]”
can’t insert clothes being worn rule “[salacious retort]”
can’t give worn items rule “[salacious retort]”
can’t wear what’s not clothing rule “‘Costuming just gets stranger every year,’ says Clark. ‘In short: no.’”
can’t wear what’s already worn rule “[already done]”
can’t eat unless edible rule “‘What’re you trying to do, poison me?’”
can’t eat clothing without removing it first rule “[salacious retort]”
can’t take off what’s not worn rule “[already done]”
can’t close what’s already closed rule “[already done]”
can’t open what’s already open rule “[already done]”
can’t switch off what’s already off rule “[already done]”
can’t switch on what’s already on rule “[already done]”
can’t unlock what’s already unlocked rule “[already done]”
can’t lock what’s already locked rule “[already done]”

And I think I’ll stop there for the day! This is a big section and less people read on weekends anyway. I’ll pick up the other half tomorrow. I’ll probably split Activities the same way, that one’s monstrously large.

5 Likes