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

WI 11.16: New conditions, new adjectives

2 Likes

Oh, so it has the same format as ‘to decide whether’? I like that!

1 Like

“in” may not be exactly what you want, but at least it’s far from unambiguous!

The hardest thing about making a verb that means either one of enclosed by or regionally in is that Inform has hogged all the good words.

Withinhood relates an object (called o1) to an object (called o2)
  when o1 encloses o2 or o2 is regionally in o1.
The verb to surround means the withinhood relation.

An object variable can sometimes be a thing and sometimes a region. With this setup:

lab is a room.
cat is in lab.
manor is region.
the map region of lab is manor.
r1 is a region that varies.
obj1 is an object that varies.
obj1 is initially manor.

If you test if the Lab is in [...] with any of manor, r1, obj1, it’s true. If you test for the cat, you’ll find that the cat is in manor and r1 but not obj1. But both the cat and the lab are regionally in all of manor, r1, and obj1.

And to be in is the reversed containment relation, so to contain is as weird as in.

1 Like

You know, maybe you can explain a recent error I had.

I had a scene that had the following code:

Flying-scene ends abruptly when the player in end-room.

It compiled, but the scene always ended abruptly as soon as it began, even when it wasn’t in end-room. As soon as I changed it to ‘when the player is in end-room’, it worked perfectly.

How was Inform interpreting it before the word ‘is’ was there?

Good question. The compiled code just says “if (true)…” I don’t know what’s going on in Inform’s tiny mind, but it’s not very useful. Quite possibly that’s not meant to be valid Inform code, and the compiler has a bug about reporting the error.

2 Likes

Hunh. I was about to say something about the weird behavior of a lone “in” and how it differs from “is in” based on this thread…

but from your report of if (true) it looks like possibly there’s a different weirdness occurring if it’s in an action’s when clause.

1 Like

…oh my god, I have also always skipped this chapter because I never could think of anything I wasn’t sure how to do with object descriptions! And similarly, every time I’ve needed to figure out stuff of the form “list of things satisfying some condition” I’ve just done it via trench warfare with the compiler. Thanks once again for doing this thread, I’m learning a bunch!

This is funny, because I feel like for most rules, you can’t say “it” and need to do the “called the foo” thing…

Ah, I feel like I’m constantly trying to refer to this as “nothing” and then it doesn’t work – helpful!

Agreed – this is why learning about the enclosure relation was so revelatory!

That’s where it is? I thought this was just part of Inform oral tradition!

This is what I thought of too – Photopia is an I6 game, of course, but the code seems like it does what Cadre did.

2 Likes

Yes, the syntax for action definitions is a bit different. That’s where the confusion lies. But we’ll get to that later.

Strictly speaking, “visible” means “in scope”—Inform believes that the player can see it, and therefore should be able to refer to it in commands. This means that adding things to scope can make them “visible” when they wouldn’t otherwise be. For example, you can give things a “visible between rooms” property, and then make them be visible from adjacent rooms.

Similarly, you can modify what’s “touchable” with reaching inside and reaching outside rules, but we’ll get to those later.

This deserves a bit of emphasis because it always used to trip me up. Rooms separated by an open door are not adjacent. You need to define your own relation for that.

And I’m learning something new! I’ve never used this.

2 Likes

Chapter 7: Actions

Now we finally get to do stuff!

I usually associate ‘actions’ with commands the player types, but they don’t have to be synonymous.

We write actions using present participles. For instance, if the player types “take napkin” or “get the napkin” or something similar then the resulting action would be written as:

taking the napkin

Every action ends in success or failure. In this context, success means only that the player’s intention has been fulfilled. If the player sets out to take the napkin, but finds a million-pound banknote in its folds instead, the action will be deemed to be a failure.

There’s a testing command called ‘ACTIONS’ that prints out what actions are happening. I used this a lot in my game when debugging a clone that copies the players actions exactly two turns after you start them.

Here’s what the output looks like:

>s
[going south]
Security Vault
You can see a metal door here.
[going south - succeeded]
>close door
[closing metal door]
You close the metal door.
[closing metal door - succeeded]
>take door
[taking metal door]
That's fixed in place.
[taking metal door - failed the can't take what's fixed in place rule]

(This is from the text; I swear there should be an implicit looking action when they go south because when I was doing the clone thing there was an implicit look action).

Hmm, actually I just tried it in a sandbox and the Actions command doesn’t pick up on the implicit LOOK.

Section 7.1 is Instead rules. This is kind of the bread and butter of Inform programming; it’s what people usually start with, and many experienced programmers use it a lot, too.

An action is ordinarily handled by running it through Inform’s extensive rulebooks of what might be called normal behaviour. An action such as “taking the napkin”, for instance, will be run through numerous checks to see if it is physically reasonable, and then provided all is well, the napkin will be moved into the possession of the player.

Instead, though, we can bypass the rules to do with an action and do something else:

Instead of eating the napkin: say "Why not wait for the actual dinner to arrive?"

This is a rule (one of our first ones), called an ‘instead rule’.

You can also do it in one line:

Instead of eating the napkin, say “Why not wait for the actual dinner to arrive?”

Some examples:

Example 84, Grilling

Instead of taking something which is on the grill:
    say "'Hey, you'll burn yourself,' says Mom."

This example uses the ‘descriptions’ from last chapter, with the ‘which is on the grill’ part.

Example 85: Bad Hair Day replaces the player’s description:

Instead of examining the player:
    say "Oh, stop fussing. You look fine."

This is different from the description of the player, since, if unspecified, the player is an amorphous blob person called ‘yourself/your former self’ and the description of the player is attached to that being; changing to a different person (with the command ‘now the player is ____’) changes the description.

But this method gives the same description no matter who you are. This comes up a lot for me in my games because I often switch who the player is (in flashbacks in Color the Truth, for instance, or when controlling a giant death robot in Absence of Law).

Section 7.3 is Before Rules

These are like instead rules, but they happen before you do something. When I had my clone copying the player, I first was using Instead/carry out rules and the clone couldn’t copy unsuccessful attempts at things. Then I switched to ‘before’ rules and that let the clone attempt unsuccessful things/actions with inappropriate objects (like eating rocks).

Anyway, here’s what the section says:

“Before” rules genuinely precede checking of any kind. They also differ from instead rules in that they do not automatically stop the action in its tracks. Rather, they are provided as an opportunity to ensure that something else is done first. For example:

Before taking the napkin, say "(first unfolding its delicate origami swan)".

whence

>GET NAPKIN
(first unfolding its delicate origami swan)
Taken.

Often you still want to stop the normal actions, so you can just throw an ‘instead’ into the before rule. I always put it at the very end of a block like this:

Before going north:
  do thing1;
  do thing2;
  do thing3 instead;

But apparently it can go in front too:

Before taking the key, instead say "It seems to be soldered to the keyhole."

There is also a line called ‘stop the action’, which I’ve tried before and never does what I want. I tried to use it to stop the implicit LOOK action after going, but it doesn’t do that, it seems.

stop the action

This phrase stops the current rule, stops the rulebook being worked through, and finally stops the action being processed. Example:

Before taking the key:
say "It seems to be soldered to the keyhole.";
stop the action.

We can also stop it from stopping:

Instead of taking the napkin:
    say "(first unfolding its delicate origami swan)[command clarification break]";
    continue the action.

Hmm…I never got this before! ‘stop the action’ turns a before rule into an instead rule with slightly more power (due to firing before all other instead rules), while ‘continue the action’ turns an instead rule into a slightly weaker before rule.

Weird!

As a general principle, it is good style to use instead rules whenever blocking actions, and before rules only when it is genuinely necessary to do something first but then to continue: in fact, it is good style to use “stop the action” or “continue the action” as little as possible.

Example 86 is Democratic Process shows a useful before rule:

Before inserting something which is not carried by the player into something:
    if the noun is in the second noun, say "Already done." instead;
    say "(first taking [the noun])[line break]";
    silently try taking the noun;
    if the player is not holding the noun, stop the action.

In my mind, from now on I’ll think ‘stop the action is just like ‘instead’ except you put it in as its own command instead of at the end of another command’

Example 87 is Sand, a rare 4-star example. It allows you to put multiple things in other things. It includes the text of 86 as well as this line:

Understand "put [things] in [something]" as inserting it into. Understand "put [things] on [something]" as putting it on.

Section 7.4 is Try and Try silently.

[S]urveys of Inform source text showed that the three most popular phrases used by authors are “say”, “if” and “now”. The fourth most popular is “try”…

‘Try’ is what lets the computer do an action itself rather than waiting for the player to type it in.

Instead of entering the trapdoor, try going up.

This is one of the basic phrases players need to learn. In fact, so far I’d recommend new players start reading this chapter before any of the others!

You have to be specific in your action, and can’t type:

try eating something;

We use ‘try’ because it might fail:

Before locking the front door, try closing the front door.

could go wrong in any number of ways - perhaps the door is closed already, perhaps it is not openable, perhaps somebody has wedged it open. It would be safer to write:

Before locking the front door:
    try closing the front door;
    if the front door is open, stop the action.

You can also do ‘silently’ which means that routine messages aren’t printed (I assume this means the ‘carry out’ messages’):

`try silently taking the napkin;`

Silence is maintained only if this new action, the taking of the napkin, is successful (so if the napkin is successfully taken, the text “Taken.” will not appear): if the action should fail, a suitable objection will be voiced as usual.

Example 88, Fine Laid, is a way of redirecting one object to another in all situations except examining:

The sheet of paper is a thing in High Street Stationer. The writing is part of the sheet of paper.

The description of the sheet of paper is "A beautiful sheet of heavy cream paper." The description of the writing is "Delicate and spidery."

Instead of tasting the sheet of paper, say "You might need more fiber in your diet, but this isn't the way.".

Before doing something other than examining when the current action involves the writing:
    if the writing is the noun, now the noun is the sheet of paper;
    if the writing is the second noun, now the second noun is the sheet of paper;
    try the current action instead.

This is our introduction to ‘the current action’ as an object, as well.

My current game has tons of ‘labelled’ items or things with inscriptions. This might be a nice way of handling that…

Example 89 is ‘Hayseed’:

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

The ladder is a staircase. It is above the Barn and below the Hayloft.

Instead of climbing a staircase:
    try entering the noun.

I think I have this almost word for word in my current game.

Finally, we have 7.5, After rules, which completes the three main ways we mess around with rules: Before, Instead, and After. Later on, we’ll see Check, Carry Out, and Report, which are very similar but used more when defining new actions.

After rules replace Inform’s normal responses:

After taking the diamonds, say "Taken!"

just says ‘Taken!’ instead of
'Taken.

Taken!’

which is what you’d get if the normal response fired off.

You can also ‘continue the action’:
After taking the diamonds: say "(Mr Beebe looks up sharply.) "; continue the action.

If I understand this right (correct me if not) this is almost identical to using ‘instead’ with ‘continue the action’ here, except that with ‘instead’ the above line would be printed before the game actually took the object and with ‘after’ it’s printed after it took the object, which would matter if you change what’s printed based on the location of the object.

The only example is Example 90, Morning After:

A thing can be examined or unexamined.

After taking something unexamined:
    say "Taken. [run paragraph on]";
    try examining the noun.

Carry out examining something:
    now the noun is examined.

I have a flag in my game called ‘oncetaken’, which I think is identical to Inform’s ‘handled’, which I didn’t know existed at the time.

Section 7.6 is “Reading and Talking”. This feels more like a ‘Recipe Book’ section than a ‘Writing with Inform’ section.

For players to type ‘look up ___ in ___’ or "consult __ about ___’ we use the consulting it about action:

After consulting the book about "grove", say "The Grove is a sacred yadda, yadda. There's a tree, that sort of thing. Wisdom."

After consulting the book about "future events", say "It's a bit, what's the word? Delphic."

Here “grove” and “future events” are ‘texts’ (i.e. strings) and not objects.

Here’s the examples for asking about:

After asking the Sybil about "verses", say "She blushes."

After telling the Sybil about "persians", say "She nods gravely."

After answering the Sybil that "I am mad", say "She sighs."

Man, again I’d have to say that this is the first chapter I’d send a newbie to.

You can redirect ‘telling’ to ‘asking’ like so:
Instead of telling the Sybil about something, try asking the Sybil about it.

I have a custom conversation engine and I redirect ‘talking to’, ‘answering it that’, ‘asking it about’, ‘telling it about’, etc. to error messages detailing how to use my system.

There are lots of examples here; you can tell both authors are enthusiastic about this.

Example 91 is Sybil 1:

Instead of telling someone about something, try asking the noun about it. Instead of answering the noun that something, try asking the noun about it.

Instead of asking the Sybil about "persians", say "She nods gravely."

Instead of showing something to someone, try giving the noun to the second noun.

The player carries a coin. Instead of giving the coin to the Sybil: move the coin to the Sybil; say "She accepts with a smile."

I also redirect giving and showing since it’s rare you want different activity for these two in my games.

This example also includes some phrases using the slash format Mike Russo expressed fondness for:
Instead of asking the Sybil about "Darius/king", say "Her smile unnerves you."

Example 92 redirects one conversational topic to another:

Instead of asking Lucy about "checkers":
    try asking Lucy about "games".

Instead of asking Lucy about "games",
    say "'I don't like games,' she sniffs."

Example 93 is Sybil 2, who can also understand various forms of saying ‘yes’:Instead of asking the Sybil to try saying no: try saying no. Instead of asking the Sybil to try saying yes: try saying yes. Instead of asking the Sybil to try saying sorry: try saying sorry.

Instead of answering the Sybil that "yes", try saying yes. Instead of answering the Sybil that "no", try saying no. Instead of answering the Sybil that "sorry", try saying sorry.

Instead of saying yes in the presence of the Sybil:
    say "She looks interested."

Instead of saying no in the presence of the Sybil:
    say "She looks annoyed."

Instead of saying sorry in the presence of the Sybil:
    say "She looks bored."

The complexity arises from the fact that we want to handle both YES and SYBIL, YES. If we only had the latter, ‘yes’ would be treated as a text given to the Sybil, just as in the commands SAY YES TO SYBIL or ANSWER YES. But because we have defined it as a command (so that the player can use it independently), SYBIL, YES is understood as an order to the Sybil to do the YES action.

Example 94 is Costa Rican Ornithology:

A book is a kind of thing. Understand "book" as a book. A book has a table name called the contents.

Instead of consulting a book about a topic listed in the contents of the noun:
say "[reply entry][paragraph break]".

Report consulting a book about:
say "You flip through [the noun], but find no reference to [the topic understood]." instead.

The Guide to Central American Birds is a book carried by the player. The contents of the Guide is the Table of Listed Birds.

Table of Listed Birds

topic reply
“[red]” or “[red] bird/macaw” “You flip through the Guide for a while and eventually discover a reference to the [scarlet macaw], which appears to correspond with what you see before you.”
“quetzal/trogon” or “resplendent trogon” “The entry on the quetzal is quite lyrical, describing its brilliant plumage, flashing and igniting in the sunshine, which is supposedly sufficient to lure birdwatchers from all over the world. Unfortunately, the quetzal is described as being bright emerald in color, with a pink fuzz on its head and a long soft tail ‘like a feather boa’. None of these describes your visitor.”

(note that Discourse is weird copying and pasting tables so I did it this way).

Section 7.7 is The Other Four Senses (Again, very happy this section is so grounded in reality)

I’m just going to reproduce this section in full:

The five senses are all simulated with actions. Sight is so informative that it is handled by a whole range of actions: “looking”, which describes the general scene; “examining something”, which takes a closer look at a specific thing; “looking under something”, and so on.

The other senses have one action each: “listening to something”, “touching something”, “tasting something” and “smelling something”. It makes no sense to touch or taste the general scene, but listening and smelling are a different matter: we often just listen, without listening to anything specific. If the player types the command “listen”, Inform understands that as listening to the current location: similarly for the bare command “smell”. Thus:

Instead of listening to the Seashore, say "The song of gulls."

Instead of smelling the Cave, say "Salt and old seaweed."

This was useful for me in my current game where there is a dark room but you have to find two different objects, one by smelling and another by listening.

Example 95 is The Art of Noise, which is about listening and smelling:

A thing has some text called sound. The sound of a thing is usually "silence".

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 "Nothing of note."

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 "Preformatted text

This example shows unlisting a rule:
‘The report listening rule is not listed in the report listening rules’.

I usually just say ‘The report listening rule does nothing when …’. Not sure what the advantages are between doing nothing and unlisting.

Section 7.8 is Rules applying to more than one action.

You can say:
Instead of examining, looking under or searching the desk: say "There's no use poking around in that old desk."

I don’t know if this is still true, but at one point I had a rule like that with a ton of actions in it but it really slowed down compiling. Instead I used a different construction, like:

Examining is investigation.
Looking under is investigation.
Searching is investigation.

Instead of investigation when the noun is the desk:
  say "blah blah blah"

Section 7.9 is All actions and exceptional actions.

You can just type ‘doing something’ or ‘doing anything’ if you want to catch all possible interactions.

I do this with objects the player saw but aren’t there anymore. So if a monkey ran by and disappears, I make a scenery object called ‘missing-monkey’ or something and say

Instead of doing anything when the noun is the missing-monkey:
   say "The monkey is already gone!"

Although I notice that I said ‘when the noun is’ and they said ‘to the…’, which seems more general, since the monkey could be the second noun.

Oh, wait, maybe it’s not more general:

“Putting the handbag on the cucumber sandwich” would also not qualify as “doing something to the cucumber sandwich” - only to the handbag.

You can also add exceptions:

Instead of doing something other than examining, taking or dropping with the dagger: say "Don't fool around with that dagger. It's exceedingly sharp."

Note the “with”, which is crucial here. Without it, the rule is subtly different:

Instead of doing something other than examining, taking or dropping the dagger: say "Don't fool around with that dagger. It's exceedingly sharp."

This second version matches if the action is, say, taking a shield, or even just looking, because that would be an action other than examining the dagger, taking the dagger or dropping the dagger.

Example 96 is Zodiac:

Instead of doing something other than looking or examining in the presence of the Capricorn Killer:
    say "You dare not attempt it!"

This example also introduces ‘in the presence of’ (unless maybe that was covered in the ‘visible’ section before?)

Section 7.10 is The noun and the second noun (not, as I learned through cruel experience, The first noun and the second noun).

Basically, if you want to refer to the object of an action , call it ‘the noun’:

Instead of examining something, say "[The noun] is none of your concern!"

This is a pretty vital thing to know how to use!

‘The second noun’ is used for actions that apply to two things, and means the second thing you typed (unless you set up actions ‘with nouns reverse’, in which case its the first thing you typed).

Despite ‘the second noun’ being in the section name, there are no examples in the text or in th examples section that use it. So schade

Example 97 is Ming Vase:


A thing can be strong or fragile. A thing is usually strong.

Instead of attacking or dropping a fragile thing:
    now the noun is nowhere;
    say "[The noun] breaks into thousands of pieces!"
The pillow is a portable supporter. It is carried by the player.

Instead of dropping a fragile thing when the pillow is in the location: try putting the noun on the pillow instead.

After putting a fragile thing on the pillow:
say "You set [the noun] down gently on the pillow."

Example 7.11 is In rooms and regions.

You can just add conditions on actions only in certain areas:

Instead of taking something in the Supernatural Void, say "In this peculiar mist you feel unable to grasp anything."

You can also do this in regions:

The Public Area is a region. The Arboretum and Gardens are in the Public Area.

Instead of eating in the Public Area, say "The curators of the Gardens are ever among you, eagle-eyed and generally cussed."

This has been vital for my mega-game. One area is a wax museum under surveillance; one is a magical area with spells; and another has flashbacks where you a different person in the past. So there are a lot of rules I want to completely ban in one region (like in the spell region magic can teleport you, but I don’t want it to function elsewhere).

Section 7.12 is In the Presence of and when

Okay, so this is where in the presence of is defined! Haven’t used it before. Apparently it’s when two people or things are in the same location:

Instead of doing something other than looking, examining or waiting in the presence of the Queen: say "I'm afraid they take what you might call a zero tolerance approach to breaches of court etiquette here."; end the story saying "You have been summarily beheaded"

You can also use ‘when’ in an instead statement which just functions like an ‘if’ clause with any condition:

Instead of eating something when the radio set is switched on, say "Something about the howling short-wave static puts you right off luncheon."

Or if you only want that in the room that actually has the radio:

Instead of eating something in the presence of the radio set when the radio set is switched on, say "Something about the howling short-wave static puts you right off luncheon."

Example 98 is Beachfront. This is a crucial example that does something players often want to do: make an object that isn’t there until you search something else:

The heavy oak desk is a supporter in the stuffy office. It is scenery. Understand "paperwork" as the desk.

The creamy envelope is an openable container. The description is "There is no return address on the outside of the envelope, just the address of the Doctor's office -- but the legs of the capital A are rubbed down in a characteristic way, and the top of every R is open. There's no question that it comes from the same typewriter as the blackmail note." In the envelope is a letter. The envelope can be found or lost. The envelope is lost.

Instead of searching the desk when the envelope is lost:
    now the envelope is found;
    say "You rifle through the piles of bills and notices; invitations to conventions; advertisements for high-end prescription drugs; pink carbon sheets bearing patients['] names and medical identification numbers in spidery, elderly handwriting. Almost at the bottom of the heap, you find what you were looking for: a creamy envelope with the address typed.";
    move the envelope to the desk.

Instead of searching the desk:
    say "Further investigation of the desk reveals nothing else suspicious."

Notice that we have two rules that apply to “searching the desk”, but one of them has a more specific set of parameters (“when the envelope is lost”). This means that Inform will consult that rule first and use it if it applies; it will only carry out our plain vanilla “instead of searching the desk” rule when the more restricted rule is not relevant.

Example 99 is Today Tomorrow:

Instead of eating something in the presence of the chihuahua:
    say "[The chihuahua] yips at you! Maya looks despairingly at [the noun], which is obviously inciting it."

This example also introduces time of day:

Rule for deciding the concealed possessions of someone (called carrier):
    if the particular possession is the chihuahua and the carrier wears the trenchcoat, yes;
    otherwise no.

The time of day is 11:45 AM.

At 11:47 AM: say "Your boss pokes his head in, temporarily free of the round of conference calls that occupy all his days. 'Maya,' he says. 'Your coat?' He shakes his head, clucking sadly. 'It doesn't say professional!' But mercifully Maya manages to take it off so slowly that he doesn't glimpse her pet before her phone rings again.";
now Maya carries the trenchcoat.

Section 7.13 is Going from, going to.

Going has special text to distinguish when you care about the destination from when you care about the origin:

The Catalogue Room is east of the Front Stacks. South of the Catalogue Room is the Musicology Section.

Instead of going nowhere from the Front Stacks, say "Bookcases obstruct almost all passages out of here."

Instead of going nowhere, say "You really can't wander around at random in the Library."

Before going to the Catalogue Room, say "You emerge back into the Catalogue Room."

It includes this gem (another crucial thing for new players and cementing this chapter as ‘the best first chapter’ for me):

Note that “going nowhere” means trying a map connection which is blank, and if no rules intervene then “You can’t go that way” is normally printed. Unless “nowhere” is specified, descriptions of going apply only when there is a map connection. So “going from the Musicology Section” would not match if the player were trying to go east from there, since there is no map connection to the east. Similarly, “going somewhere” excludes blank connections.

You can use regions instead of rooms for ‘to’ and ‘from’.

If you type something like this in a region:
Instead of going north in the Wilderness, say "Oh, it's too cold."

Inform parses it as ‘Instead of going north when the player is in the Wilderness’ (here the Wilderness is a region).

You can’t use instead rules for variables in this way (this does not compile):

The Dome is a room. The Hutch is north of the Dome. The rabbit is in the Hutch. Before going to the location of the rabbit, say "You pick up a scent!"

But this does:
The Dome is a room. The Hutch is north of the Dome. The rabbit is in the Hutch. Definition: a room is rabbit-infested if it is the location of the rabbit. Before going to a rabbit-infested room, say "You pick up a scent!"

I’ve noticed that pretty much any complicated thing that won’t compile works well as an adjective. (well, at least a couple of times it has worked).

Lots of examples, including the glamorours example 100!

Veronica:

Neptune is a region.

Tijuana is a room.

High School is north of Tijuana. It is in Neptune.

Detective Offices is west of High School. It is in Neptune.

The player is in High School.

Instead of going from Neptune to a room which is not in Neptune:
say "It's a bad time to leave Neptune."

Is this a reference to something?

Example 101 is A&E:

Film Set is a region. Duck Pond, Stately Lawn, and Stately Home are in Film Set.

Instead of going to Film Set when the player does not carry the VIP Pass: say "A burly studio guard materializes in your path, convincing you that you would prefer to be elsewhere."

Example 102 is Bumping into Walls, a deeply useful example that tells the player available exits if they go the wrong way:
Definition: a direction (called thataway) is viable if the room thataway from the location is a room.

Instead of going nowhere:
    let count of exits be the number of viable directions;
    if the count of exits is 0, say "You appear to be trapped in here." instead;
    if the count of exits is 1, say "From here, the only way out is [list of viable directions].";
    otherwise say "From here, the viable exits are [list of viable directions]."

Example 103 is Polarity:
The former location is a room that varies.

First carry out going rule:
    now the former location is the location.

Understand "go back" as retreating. Understand "back" or "return" or "retreat" as retreating.

Retreating is an action applying to nothing.

Carry out retreating:
    let way be the best route from the location to the former location, using doors;
    if way is a direction, try going way;
    otherwise say "You can't see an open way back."

When play begins: now the former location is the Dome.

Instead of retreating when the former location is the location: say "You haven't gone anywhere yet."

This is the first example of the phrase ‘first carry out…’, which I never use but we’ll see more later.

1 Like

Chapter 7: Continued:

Section 7.14 is Going by, going through, going with. It refers to vehicles, doors, and pushing:

Instead of going to the Front Stacks by the trolley, say "The Front Stacks are far too confined for the trolley to manoeuvre into them."

(Reminds me of the hedge roller in Curses!, which is fun)

Before going through the green baize door, say "Through you go..." After going through the green baize door: try looking; say "...and here you are."

Instead of going from the Office with the trolley, say "But it looks perfectly placed here. Why push any further?"

(It seems in the first example the player is riding the trolley, while in the third they are pushing).

A final nugget of wisdom:

“Going” is not the only action which moves the player. Another is “exiting”, an action which moves the player out of whatever he/she is currently in or on. This action is often caused by the player typing just OUT or GET DOWN, and there’s no noun as such. But Inform allows the syntax “exiting from” to make it easier to write rules about the exiting of particular containers or supporters:

After exiting from the Mini Cooper:
    say "You painstakingly unpack your limbs from the tiny car."

Many examples!

First is 104, No Relation:

Instead of going by a vehicle (called the auto) to somewhere offroad:
    say "You can't drive [the auto] off-road."

The ignition is part of the car. Instead of going by the car when the ignition is switched off: say "The ignition is off at the moment." Instead of switching on the car, try switching on the ignition. Instead of switching off the car, try switching off the ignition.

We have to specify ‘going by a vehicle’ instead of ‘going by something’, since otherwise if a player is on a pedestal and tries going north this rule will trigger.

Example 105 is Mattress King:

After going a direction (called way-pushed) with something (called the thing-pushed):
    say "You push [the thing-pushed] [way-pushed] to [the location].";
    continue the action.

(Usually inform just prints the description of the new room)

Example 106 is One Short Plank, a bridge that collapses if the player is carrying something over it or pushing something onto it:

The East Jungle is a room. The plank bridge is west of the East Jungle and east of the West Jungle. The plank is an open unopenable door. "A precarious plank bridge extends [if the location is West Jungle]east[otherwise]west[end if] across the chasm." The description of the plank is "Extremely fragile and precarious."

Instead of going through the plank when the player is carrying something:
say "You step gingerly across the plank, which bows under your weight. But your meagre possessions are the straw which breaks the camel's back!";
end the story.

After going through the plank:
say "You step gingerly across the plank, grateful that you're not burdened.";
continue the action.

There is a feather in the East Jungle.

The gigantic stone ball is a thing in the West Jungle. It is pushable between rooms.

Before going through the plank with something:
say "Surely you jest." instead.

Example 107 is Provenance Unknown:

This example uses the rare and mysterious ‘setting action variables’ command, generally used for when the authors are pulling something monstrous and outrageous out of nowhere:

Setting action variables for pushing something to:
    if the noun is enclosed by a pushable between rooms thing (called the pushed item) which is in the location:
        now the noun is the pushed item instead.

Example 108, Zorb, lets players push things up or down.

The new can't push unpushable things rule is listed instead of the can't push unpushable things rule in the check pushing it to rules.

This is the new can't push unpushable things rule:
    if the noun is not pushable between rooms:
        say "[The noun] [are] not amenable to being pushed from place to place." instead.

The can't push vertically rule is not listed in any rulebook.

Section 7.15 is ‘Kinds of action’. I alluded to this earlier; it’s a way to group actions to make rules about them together.

I have a lot of testers who like to do weird things like lick the sun, so I take every action involving physically touching something and call it ‘physicality’, and have rules like ‘instead of physicality when the noun is distant…’

Here’s the books example:

Kissing Mr Carr is unmaidenly behaviour.
Doing something to the painting is unmaidenly behaviour.

Instead of unmaidenly behaviour in the Inn, say "How unmaidenly!"

Example 109 is Dearth and the Maiden, based on novelist Georgette Heyer. It essentially uses the above example.

Example 110 is Mimicry:

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

Before speech in the presence of an ungreeted person: try waving hands.

One complication is that “asking someone to try doing something”, which describes commands such as FRED, GO SOUTH, cannot be made into a kind of action. This requires its own rule:

Before asking someone to try doing something in the presence of an ungreeted person: try waving hands.

Check waving hands:
    unless the player can see someone who is not the player, say "You are alone." instead.

Carry out waving hands:
    say "You nod hello to [the list of ungreeted people who can be seen by the player].";
    now every ungreeted person who can be seen by the player is greeted.

The report waving hands rule is not listed in the report waving hands rulebook.

This example also includes some arcane rules:

A persuasion rule:
    describe poor reception;
    persuasion fails.

To describe poor reception:
    if the player is in the Invisible box,
        say "Everyone convulses with silent laughter as you try to shout from within the invisible box.";
    otherwise
        say "You attempt to convey your meaning with gesture and interpretive dance, but [the list of visible other people] scorn[if the number of visible other people is 1]s[end if] your performance, refusing to respond."

I’ve never used persuasion rules or persuasion fails, so I look forward to learning more about this.

7.16 is Repeated actions. I think someone was asking about this recently:

Instead of examining the tapestry for the third time, say "All right, so it's a masterpiece, but is this really the time to make a detailed study?"

Instead of examining the urn at least twice, say "It's an urn. What do you want from me?"

Instead of going nowhere for the 20th time, say "Do stop walking into walls, there's a good fellow."

Typing something like:
Instead of taking something for the fourth time, say "No. I'm capricious."

means that it is the fourth time a “taking…” action has been tried, and does not mean that the same item was taken each time. Also, note that we are counting the number of times the action has been tried, not the number of times it succeeded.

Example 111 is Y ask Y?

A thing can be examined or unexamined. A thing is usually unexamined. Carry out examining something: now the noun is examined.

Taking inventory is acting confused. Looking is acting confused. Examining an examined thing is acting confused.

After acting confused for the sixth turn:
say "(If you are feeling lost, try typing HELP for suggestions.)"

I remember reading about Lynnea Glasser designing Coloratura (one of the best parser games of the 2010s) and doing stuff like this but more subtly, so that if the player is stuck the game gently guides them forward.

Example 112 is a true 4-star example. It is the entire text of Emily Short’s A Day for Fresh Sushi, which is a real game in its own right that is fun to play. It has a fish that comments on everything you do. It says stuff like

After examining cloths for the first time:
    say "'Whatcha looking at? I can't see through the doors, you know.'"

Section 7.17 is Actions on Consecutive turns:

We can also reckon the number of consecutive turns on which an action has been repeated, by talking about “turns” instead of “times”, as demonstrated in the following example story. Note also that we are allowed to use the phrase “doing it” to mean “the same description as the previous one except for the part about turns or times”, like so:

Instead of examining the Daily for the first time, say "The best article seems to be about how your star sign affects your best swimsuit colour. Really: that's the best article."

Instead of doing it for the second time, say "You now know a generous amount about a typical week in the life of a weather forecaster."

Instead of doing it for the third time, say "You would now know how to cook herb bread, except that you have already forgotten the names of both of the herbs."

Instead of doing it more than three times, say "Nope, you've drained it of all conceivable sustenance, even the small ads about French farmhouses to let (sleeps 7) and breast reduction surgery (with alarming photographs in sallow light)."

After waiting for four to six turns, say "This is getting mighty dull." After waiting for seven to eight turns, say "Really, exceptionally dull." After waiting for nine turns, end the story saying "You have died of boredom, something previously thought medically impossible".

So I think only the bottom example uses the new ‘turns’ phraseology.

Finally, Section 7.18 is Postscript on actions, which just says that future sections will explain how to make NPCs do actions, create new actions, and completely redirect the effects of an action.

Great chapter! This is the real core stuff here.

1 Like

That’s the explanation given in the documentation, but I suspect it was also to avoid conjugating verbs. “Try”, “report”, “instead of”, etc are all words that can be followed by a gerund: “waiting” instead of “wait” or “waits” or such.

Actually it’s the report messages. Though those won’t be introduced for a few more chapters.

The flow of action processing goes…

  • Before: Should anything special be done before this action happens? I generally use these rules to redirect one action into another.
  • Feasibility checks: Can the player touch things that need to be touched? Is there sufficient light? If you asked someone else to do the action, are they willing to do it? This stage isn’t its own rulebook, by default, but some extension authors turn it into one: the “Precondition” rules.
  • Instead: The action is now known to be feasible. Are there special exceptions that should apply to this situation? I use these liberally, for any special situations pertaining to my game. By default, an Instead rule will stop the action, preventing any further processing.
  • Check: Are there standard reasons this action should fail, like taking something that’s fixed in place? This is the last chance to make the action fail.
  • If it reaches this point, the action is considered a success.
  • Carry out: The standard functionality of the action. Taking something moves it into the actor’s inventory. Most actions don’t print anything in this stage; the ones that do are things like examining, where the only effect is to print something.
  • If the action was tried “silently”, stop processing now.
  • After: Does the author want a special description for this situation? By default, an After rule will stop the action, preventing any further processing. (But this doesn’t make the action fail: it already succeeded.)
  • If the action was done by someone else, and the player can’t see that person, stop processing now.
  • Report: The standard description for the action. This is the stage that prints “Taken.” when you take something.
5 Likes

Yep, you can go TO (a room), FROM (a room), BY (a vehicle), WITH (a pushable thing), and/or THROUGH (a door).

And if you want, you can even create new prepositions like this: that’s what “setting action variables” rules are for! In Counterfeit Monkey, for example, an action variable lets you write rules about “waving the letter-remover at something creating an ant”.

2 Likes

I peeked ahead, and it looks like this is one of the largest chapters for a while, with the very biggest chapter being Advanced Phrases.

Chapter 8 - Change

Section 8.1 is Change of Values that Vary. The whole idea of this chapter is that we alter the basic worldstate or mechanics, as opposed to what we did in the last chapter which is just completely replace mechanics or use what is in place.

In this section we learn to use ‘now’ to set variables:

The prevailing wind is a direction that varies. The prevailing wind is northwest.

Instead of waiting when the prevailing wind is northwest:
    say "A fresh gust of wind bowls you over.";
    now the prevailing wind is east.

They point out that the type matters in Inform, so since we called the prevailing wind a direction, we can only use ‘now’ to set it to other directions, not numbers or rooms or texts.

Constants cannot be changed. This gives an error:

Colour is a kind of value. The colours are blue, red and mauve.

After pulling the psychedelic lever:
now blue is mauve.

Section 8.2 is Changing the Command prompt. I’ve seen a few people do this recently!

You change it pretty easily:

When play begins: now the command prompt is "What now? ".

and you can even put variable text in there:
When play begins: now the command prompt is "[time of day] >".

Section 113 is Don Pedro’s revenge, a complex example where you are given partially filled sentences as the command prompt, like so:

Table of Random Prompts

position prompt
boxed "So securely boxed-in that you can really only parry or thrust, you try to "
boxed "Trapped between your barrels, you decide to "
perched "Able to slice at your attackers but not to advance or retreat, you choose to "
perched "Perched up here with the advantage of height (but little mobility), you attempt to "
free "Out on the open deck with no impediments, free to advance or retreat, you decide to "
When play begins: reset the prompt.

Every turn: reset the prompt.

To reset the prompt:
    sort the Table of Random Prompts in random order;
    repeat through the Table of Random Prompts:
        if the position entry is the placement of the player:
            now the command prompt is prompt entry;
            stop.

Section 8.3 is Changing the Status Line. I’ve done this a lot in the past (I found a neat way to use Javascript to play music or display images in response to the status line, so it’s important in several of my games).

You just say Now the left hand status line is "" or Now the right hand status line is "".

The default value for the right hand status line is blank (or the score and turn count if scoring is on), while the default value for the left hand status line is “[player’s surroundings]”, which is either the location, or in darkness, or in an opaque container.

Example 114 is Politics as Usual:

When play begins:
now the right hand status line is "[map region of the location]".

Washington is west of Idaho.

Red is a region. Blue is a region. Idaho is in red. Washington is in blue.

I wondered when I saw this what would happen in my game where I have nested regions, but there’s a note that says it prints the smallest region available if there is ambiguity.

Example 115 uses the useful extension ‘Basic Screen Effects’ by Emily Short:

Rule for constructing the status line:
    center "[location]" at row 1;
    rule succeeds.

Section 9.4 is change of either/or properties. There’s not much special here, we just use ‘now’:

Instead of waiting when the oaken door is closed:
    say "There is a slow, creaky click! sort of noise as the door swings open, apparently all by itself.";
    now the oaken door is open.

It just mentions that you set a property that is already set (like making an open door open), just nothing happens, but if you try to give something a property is shouldn’t have (like making a number examined), it throws up an error.

Example 16 is “Vitrine”:

The smart window can be transparent. The smart window is transparent.

Carry out switching off the window: now the window is transparent.

Carry out switching on the window: now the window is opaque.

Section 8.5 is Change of properties with values. This is almost identical to the last one; we still use the same format:
now the printed name of the Closet is “Suddenly Spooky Closet”
The game just checks to make sure that you’re putting in a value of the appropriate type, and that the object has that kind of value associated with it.

The only thing in this section that doesn’t use the ‘now’ format is ‘change’ for changing exits of a room (due to like a landslide or a hidden door or something):

change the east exit of the Closet to the Tsar's Imperial Dining Salon

You can also change an exit to ‘nothing’ if it gets closed off:

change the west exit of the Closet to nowhere

Example 117 is Thirst:

The player carries a waterskin. The waterskin can be full, partly drained, or empty. The waterskin is full. Understand "water" as the waterskin.

Instead of drinking the waterskin when the waterskin is empty:
say "There is no water left."

Instead of drinking the waterskin: if the waterskin is partly drained, now the waterskin is empty; if the waterskin is full, now the waterskin is partly drained; say "You drink a long draught."

Example 118 is Thirst 2, which includes a campfire:

There’s a lot here, but there’s one part that’s especially useful for new people I think (having some stuff disappear while other stuff appears):

Instead of burning the whole kindling:
    if the tinder is not flaming:
        say "You need the tinder to be flaming, first.";
    otherwise:
        now the tinder is nowhere;
        now the kindling is nowhere;
        move the campfire to the location;
        say "You succeed in lighting yourself a proper campfire.";
        now the printed name of Campsite is "By The Campfire".

Section 8.6 is “Whose property”. This is something I didn’t realize for a while, that if some object is currently being referenced, you can omit its name:

The West Ballroom is a room. "A handsome sweep of chequered floor beckons the eye into the [printed name]."

So we don’t have to say ‘printed name of the west ballroom’ here, it just prints it itself.

This works but I’m not sure if it works in action definitions, which is where I’ve tried it the most and had it fail the most.

Section 8.7 is ‘moving things’. I always use ‘now the ___ is in ___’, but this is a different notation that I think affects rules differently. I often wish there was a nice way to move people from one room to another or from a container to its larger room without inform printing the new room’s description (if anyone has a nice answer let me know!)

Here we go:
move the genie's lamp to Aladdin's Cave;

or…
oh my gosh…

it’s…it’s right here…I…

move the player to Aladdin's Cave, without printing a room description

I could cry right now…this is everything to me…

We can also say ‘printing an abbreviated room description’ which only prints the description if the player has been their before, and is only when moving the player.

We can move things to people (which makes it carried):

move the genie's turban to Aladdin;

Or we can make it worn, but not with move:
now the genie's turban is worn by Aladdin;

Section 8.8 is Moving Backdrops.

Backdrops are secretly just scenery that is moved from room to room, following the player.

But nominally we have it ‘in’ a cluster of rooms at once, and can move it that way.

So we can move a backdrop called ‘stream’ to a region with either of these commands:

move the stream to the Lower Level;
now the stream is in the Lower Level;

Or we can move the backdrop with a command describing rooms:

A room can be wet or dry. A room is usually dry. The Rock Pool is wet.

move the stream backdrop to all wet rooms;

However, backdrops only update when you move, so this doesn’t work to make a backdrop appear in the player’s location. You can fix this with the following command:
update backdrop positions;

Finally, backdrops can go nowhere or everywhere:

After sleeping:
    say "It's a bright new day!";
    now the stars are nowhere.

After waiting:
    say "Darkness falls rapidly here.";
    now the stars are everywhere.

Example 120 is Orange Cones.

The traffic is a backdrop. It is not scenery. 

When play begins:
move the traffic backdrop to all accessible roads.

A line of orange cones are a thing.

Definition: a road is accessible if the orange cones are not in it.

After dropping the orange cones in a road:
say "With steely determination you begin to lay out the orange cones, blocking access to this segment of street. This produces honking and swearing -- but you persevere.";
update backdrop positions.

After taking the orange cones:
say "You go around taking up the orange cones, and within moments the traffic begins to flow into the street again.";
update backdrop positions.

I’ve never scene a backdrop that was declared not to be scenery; cool! It seems to allow it to be seen and have an initial appearance.

Section 8.9 is Moving the Player.

We’ve learned two ways to move the player:

move the player to the Bodleian Library;
now the player is in the Bodleian Library;

[T]acking on the option “without printing a room description”, remembering to add the comma, omits the description which would otherwise be produced. A compromise is to use the option “printing an abbreviated room description”: this gives a full description if the player has never been here before, but only a brief one if it is a familiar scene.

You can also move the player viewpoint, which I love to do!

now the player is Bob

This can cause some issues with reporting rules:

But that means that at the end of the action, the player is no longer the actor - that is, no longer the person who began the action; and consequently, Inform won’t use the report rulebook to say what has just happened. It’s a strange business, moving into another body.

Example 121 is Terror of the Sierra Madre.

Teresa is a woman in the Hay-Strewn Corridor. "Teresa stands opposite you[if Teresa carries something], her fingers wrapped tightly around [a list of things carried by Teresa][end if]." Teresa carries a bulb of garlic and a cross.

Maleska is a man in the Hay-Strewn Corridor. "Maleska watches you from eyes entirely black." Maleska carries a skull.

The player is Maleska. Understand "Maleska" as Maleska.

Now the Corridor contains just two people, and we arrive on the scene as Maleska, with only Teresa facing us.

Every turn:
    if the player is Maleska, now the player is Teresa;
    otherwise now the player is Maleska.

When you are someone, the printed name of that person is “yourself”. You can fix it with this:

Rule for printing the name of Teresa: say "Teresa".

Rule for printing the name of Maleska: say "Maleska".

Section 8.10 is Removing things from play

This is a useful section. It just says you can put stuff nowhere, either at the beginning:

The lamp is nowhere.

or in the middle of the game:

now the lamp is nowhere;

The old phrase was ‘remove ___ from play’, but that is now deprecated! You can’t remove rooms, doors, or the player, but can remove backdrops.

The opposite of nowhere is ‘somewhere’, and the two can be referred to as ‘on-stage’ or ‘off-stage’.

if the gold coin is somewhere, ...
if the gold coin is nowhere, ...
if the gold coin is on-stage, ...
if the gold coin is off-stage, ...

This is really core stuff, and I use this all the time. Before I understood it, I had a room called ‘Limbo’ and put everything in it, but not anymore (although I did do that in my Dialog game).

Example 122 is Beverage Service:

Instead of drinking a potion (called the drink):
    now the drink is nowhere;
    say "You quaff [the drink]. It goes down beautifully."

Example 123 is Spring Cleaning:

A thing can be tough or fragile. A thing is usually tough.

Instead of attacking something fragile:
    say "You smash [the noun] to smithereens!";
    now the noun is nowhere.

Example 124 is Extra Supplies:

This is a fantastic example where you want to model a supply of limitless items, but only allow the player to take one at a time. Whenever anyone wants to create 100s of indistinguishable objects, this is the better option much of the time. I’ll reproduce the whole thing:

The Supply Closet is a room. A supply of red pens is in the Supply Closet. Understand "pen" as the supply of red pens when the red pen is not visible.

There is a red pen.

Instead of taking the supply of red pens:
    if the red pen is off-stage:
        move the red pen to the player;
        say "You help yourself to a fresh red pen.";
    otherwise:
        say "You're only allowed one pen at a time. The department secretary is very strict."

South of the Supply Closet is the Furnace Room. The incinerator is a thing in the Furnace Room. It is a container. "The incinerator is here, working full blast."

After inserting something into the incinerator:
    now the noun is nowhere;
    say "A fiery blast consumes [the noun]!"

Section 8.11 is “Now”. We’ve used the ‘now’ command in every other section, so I’m not sure why this is here…it just gives a bunch of examples:

now the score is 100;
now the player is Kevin;
now the front door is open;
now Mr Darcy is wearing the top hat;
now all the doors are open;
now all of the things in the sack are in the box;

It says we can’t be impossible or vague, and says we have three ways of doing things with conditions:

S. - The relation holds at the start of play.
if S, ...; - Does the relation hold right now?
now S; - Make the relation hold from now on.

Example 125 is Bee Chambers, making a random maze (which is described as a bad idea):

A Bee Chamber is a kind of room.

Bee1, Bee2, Bee3, Bee4, Bee5, Bee6, Bee7, Bee8, Bee9, and Bee10 are Bee Chambers.

When play begins:
    now right hand status line is "[number of visited rooms]/[number of rooms]";
    repeat with place running through Bee Chambers:
        now a random Bee Chamber is mapped north of place;
        now a random Bee Chamber is mapped northwest of place;
        now a random Bee Chamber is mapped west of place;
        now a random Bee Chamber is mapped southwest of place;
        now a random Bee Chamber is mapped south of place;
        now a random Bee Chamber is mapped southeast of place;
        now a random Bee Chamber is mapped east of place;
        now a random Bee Chamber is mapped northeast of place;
        now a random Bee Chamber is mapped above place;
        now a random Bee Chamber is mapped below place;
        now a random Bee Chamber is mapped inside place;
        now a random Bee Chamber is mapped outside place.

The next, Example 126 Hatless, shows a pitfall of pre-game randomization:

A hat is a kind of thing. A hat is always wearable. Definition: a person is hatless if he is not the player and he does not wear a hat.

The indigo bowler, the polka-dotted fedora, the pink beret, and the scarlet cloche are hats.

When play begins:
now every hat is worn by a random hatless person.

This picks a random person and puts every hat on them!

So instead you should type:

When play begins:
    now every hatless person wears a random hat.

Except that that gives one hat to everyone (one at a time)

so finally:

When play begins:
    repeat with item running through hats:
        now the item is worn by a random hatless person.

This is our first example of ‘repeat with item running through…’ that shows up in the main part of a small example, that I can remember. It was probably part of a bigger example earlier.

Example 127 is Technological Terror:

Carry out shooting something with something:
    say "ZAP! [The noun] twinkles out of existence! [if something is part of the noun][The list of things which are part of the noun] clatter to the ground! [end if][paragraph break]";
    now every thing which is part of the noun is in the location;
    now the noun is nowhere.

Section 8.12 is increasing and decreasing. I struggled with this a lot before; this is just arithmetic. Inform’s format is a little clunky, but so is Dialog’s. How is TADS at math?

Here are some ways of increasing things:
now the score is the score plus six;

increase the score by 8;
increase the time of day by 5 minutes;

or decreasing things:

decrease the score by 6;
decrease the carrying capacity of the player by 10;

There is also an equivalent of the ‘++’ from C:
increment the score; just increases the score (or whatever variable you type) by 1.
decrement the score; does the same.

8.13 is Checking on whereabouts. This section is mainly a list of examples:

if the genie's lamp is in Aladdin's Cave ...
if Aladdin is not in Aladdin's Cave ...
if Aladdin's Cave contains the genie's lamp ...
if the genie's lamp is carried by Aladdin ...
if Aladdin is carrying the genie's lamp ...
if Aladdin does not have the genie's lamp ...
if the table supports the genie's lamp ...
if the table is supporting the genie's lamp ...
if the genie's lamp is supported by the table ...
if the genie's lamp is on the table ...
if the genie's lamp is on top of the table ...
if the genie's lamp is in the cupboard ...
if the genie's lamp is contained in the cupboard ...
if the genie's lamp is inside the cupboard ...
if the genie's lamp is within the cupboard ...
if the wick is part of the genie's lamp ...

The following are equivalent:

if the genie's lamp is carried by the player ...
if the genie's lamp is carried ...

So if we want to check it being carried by anybody, not just the player, we need something else (probably ‘carried by anybody’, is my guess).

Section 8.14 is More Flexible Descriptions of whereabouts. It’s the same thing but allows generic kinds, or nouns or kinds modified by adjectives, instead of specific things:

if the genie's lamp is carried by a woman ...
if the genie's lamp is inside the closed cupboard ...

Section 8.15 is ‘Calling names’

This is a:

majorly important section

This is when you want to vaguely describe an object and then use a name for it later:

if somebody is in an adjacent room (called the Hiding Place), say "You hear distant breathing from [the Hiding Place]."

Instead of waiting when a woman (called the kidnapper) is holding an animal (called the pet), say "How can you think of rest when, somewhere out there, [pet] has been cruelly kidnapped by [the kidnapper]?"

You have to place this parenthetical clause (phrase?) directly after its antecedent:

if something (called the penitential object) held by the player is hot

is allowed, but not

if something held by the player (called the penitential object) is hot

Example 128 is Higher Calling:

Before going through a closed door (called the blocking door):
    say "(first opening [the blocking door])[line break]";
    silently try opening the blocking door;
    if the blocking door is closed, stop the action.

Section 8.16 is Counting Things. I usually use this for lists and stuff. You just say ‘the number of [description of things]’ and it gives you a number. Like:

the number of edible things carried
the number of things on the table
the number of people in the Dining Room

I use ‘the number of’ 34 times in my game, for instance here:

To decide what lightcolor is currentcolor:
	if the number of switched on light-switches is 3, decide on white;
	if the number of switched on light-switches is 2:
		if green-switch is switched off, decide on magenta;
		if blue-switch is switched off, decide on yellow;
		if red-switch is switched off, decide on cyan;
	if red-switch is switched on, decide on red;
	if blue-switch is switched on, decide on blue;
	if green-switch is switched on, decide on green;
	decide on black;

You can also count weird things, like:
the number of non-recurring scenes
but not ‘the number of numbers’.

Section 8.17 is Looking at containment by hand

holder of (object) … object

This phrase produces the container, supporter, carrier, wearer or room in which the object resides.

This section delves into lists. There are a few phrases here I’ve never used (heck, I’ve never used ‘the holder of’ at all!):

first thing held by (object) … object

This phrase produces the first of the list of things held by the object. Example:

first thing held by Baroness Orczy

next thing held after (object) … object

This phrase produces the next item of the list of things held by something. Example: suppose Baroness Orczy is carrying a lapdog and a string of pearls.

next thing held after the lapdog

is then the string of pearls.

This seems kind of weird, honestly. How do you know when to stop? If you were in a repeat through loop, you wouldn’t be using this phraseology anyway. Just seems weird…

Section 8.18 is randomness!

a random (name of kind) between (arithmetic value) and (arithmetic value) … value

or:

a random (name of kind) from (arithmetic value) to (arithmetic value) … value

or:

a random (name of kind) between (enumerated value) and (enumerated value) … value

or:

a random (name of kind) from (enumerated value) to (enumerated value) … value

This phrase produces a uniformly random value in the range given. Examples:

a random number from 10 to 99
a random time from 2:31 PM to 2:57 PM

When you create values, it implicity orders them, so you can do this:
A cloud pattern is a kind of value. The cloud patterns are cumulus, altocumulus, cumulonimbus, stratus, cirrus, nimbus, nimbostratus.

Then a random cloud pattern between stratus and nimbus can only be stratus, cirrus, or nimbus.

I occasionally use the next one, although I deplore randomness in my games in general:
if a random chance of 2 in 3 succeeds, ...
Instead of waiting when a random chance of 15 in 100 succeeds: ...

To fix the random number generator to a specific random seed for testing:

When play begins, seed the random-number generator with 1234.

(or replace 1234 with some other positive number).

Lots of examples!

Example 129 is Do Pass Go:

Check rolling when the noun is not the pair of dice: say "Not something you can roll." instead.
Carry out rolling:
    now the pair of dice is in the holder of the actor;
    now the first die of the pair of dice is a random number from 1 to 6;
    now the second die of the pair of dice is a random number from 1 to 6.

This is just a segment, but notice how when you roll them they are in ‘the holder of the actor’. This is so if you roll dice while on a platform, it stays on the platform, or if in a cage, it stays in the cage.

Example 130 is Lanista part 1. This is basic combat!:

Instead of attacking someone:
    let the damage be a random number between 2 and 10;
    say "You attack [the noun], causing [damage] points of damage!";
    decrease the current hit points of the noun by the damage;
    if the current hit points of the noun is less than 0:
        say "[line break][The noun] expires, and is immediately carried away by the Arena slaves!";
        now the noun is nowhere;
        end the story finally;
        stop the action;
    let the enemy damage be a random number between 2 and 10;
    say "[line break][The noun] attacks you, causing [enemy damage] points of damage!";
    decrease the current hit points of the player by the enemy damage;
    if the current hit points of the player is less than 0:
        say "[line break]You expire!";
        end the story.

Example 131 is Weathering, which I print in its entirety:

A cloud pattern is a kind of value. The cloud patterns are cumulus, altocumulus, cumulonimbus, stratus, cirrus, nimbus, nimbostratus.

The Mount Pisgah Station is a room. "The rocky peak of Mt. Pisgah (altitude 872m) is graced only by an automatic weather station. The clouds, close enough almost to touch, are [a random cloud pattern]. Temperature: [a random number from 7 to 17] degrees, barometric pressure: [950 + a random number from 0 to 15] millibars."

Example 132 is Uptown Girls:

Every turn when a random chance of 1 in 3 succeeds:
reset passerby;
choose a random row in the Table of Atmospheric Events;
say "[event entry][paragraph break]"

Table of Atmospheric Events
event
"Slowly [a passerby] strolls by, turning to look at you as she passes."
"Some [passerby] nearly bumps into you."
"You dodge to avoid [a passerby]."
"You weave around [a passerby], who has stalled to look into a window."
"There's a ruckus as one of the ubiquitous taxis nearly collides with [a passerby] crossing the street."
"[The passerby] beside you waves to a friend across the street."
"To your left, [a passerby] drops her purse, and swears as she retrieves it."

Hair color is a kind of value. A person has hair color. the hair colors are red-headed, brunette, blonde.

Height is a kind of value. A person has height. The heights are tall, medium-height, short.

Grooming is a kind of value. A person has grooming. The groomings are messy and tidy.

To reset passerby:
now the hair color of the passerby is a random hair color;
now the height of the passerby is a random height;
now the grooming of the passerby is a random grooming.

There’s also a neat trick with tables at the end of this example, which I have not reproduced.

Finally, 8.19 is Random Choice of things:

a random visited room
a random scene

Often when there is one thing of a kind in a room and I want to great it, I say ‘let X be a random ____ in the location’. Sincere there is only one ____ in the location, this will always pick exactly that one.

For instance, I have this in my current game:

Instead of giving something to frankenstein:
	if the noun is oncefrankheld:
		let current be a random thing carried by Frankenstein;
		say "'Hmm, fine, I'll take it back,' says Frankenstein. 

	He grabs [the noun] from you and hands you [the current].";
		now current is carried by the player;
		now the noun is carried by Frankenstein;
	otherwise:
		let current be a random thing carried by Frankenstein;
		say "Frankenstein says, 'Ooh, what's this? Is it valuable?'

	He grabs [the noun] from you and hands you [the current].";
		now current is carried by the player;
		now the noun is carried by Frankenstein;

Back to the text:
say "You can see [number of adjacent rooms] way[s] from here; how about [random adjacent room]?"

If there are no adjacent ways, it prints You can see 0 ways from here; how about nothing?

Example 133 is Candy:

Toxicity is a kind of value. The toxicities are safe and poisonous. A piece of candy has a toxicity. A piece of candy is usually safe.

When play begins:
now a random piece of candy is poisonous.

Example 134 is Zork II (not the whole game! Just the Carousel Room):

Instead of going from the Carousel Room:
    move the player to a random adjacent room.
2 Likes

You can only omit the object name if you’re defining a text property of an object. That’s the only situation where the compiler really knows what object is “the item described”.

The West Ballroom is a room. "A handsome sweep of chequered floor beckons the eye into the [printed name]."

In this example, of course, you’re defining the room’s description property. This is by far the most common case, which is why the I7 term is “the item described”.

1 Like

(With “first thing held by / next thing held after”: )

You stop when you see nothing. If there are no contents at all, “first thing held by” will be nothing. Otherwise, “next thing held after” will be nothing when the chain runs out.

These phrases expose the underlying I6 object tree to I7 code. You will almost never have a use for them.

2 Likes

Thanks, both these responses help clarify a lot.

I think this is what you’re after:

Move player to The Secret House, without printing a room description;

Oh, never mind, you found it :slight_smile:

3 Likes

Oh my gosh I missed this too! I usually just do a convoluted hack saying various room description rules do nothing in specific circumstances!

Oh that’s clever!

Similarly, I couldn’t get this to work in my first game so made a custom netherworld – I think I hadn’t fully internalized the hyphens in on- and off-stage so was confused when “now OBJECT is offstage” didn’t work.

Bees!

Looking forward to seeing your analysis when this comes up for full treatment – I feel like for some reason this way of doing loops really throws a lot of experienced programmers and I’m not sure why.

Wait is there not an “enclosed by” example? That’s the one most in need of an example, I think, since it’s very very useful but not as intuitive as most of the rest.

Wow this really conjures up a scenario! (I like that the examples, and even the little code snippets like this, are quite evocative, for the most part)

Yeah I’m really wracking my brain to figure out when you would need these – I think in some of the Infocom games when you exceeded the carrying limit, you’d drop the first thing in your inventory, so this would help with that?

1 Like

Yes, Mike. Bees!

(Now what does that remind me of…)

2 Likes

Chapter 9 - Time

This is one of a few smaller chapters in a row.

Section 9.1 is 'When play begins"

This just does things that only happen once, when the game starts:

When play begins: say "Welcome to Old Marston Grange, a country house cut off by fog."

The “when play begins” rules are checked only at the start of a story, not when a saved session is restored from disc. What happens is that these rules are followed, then the story’s banner is printed, then the initial room description is printed up, and then the player is asked for a first command.

Example 135 is Clueless, and shows how you can use ‘when play begins’ for stuff besides talking:

The murderer is a person that varies.

When play begins:
now the murderer is a random person who is not the player.

The Billiards Room is a room. Colonel Mustard and Professor Plum are men in the Billiards Room. Miss Scarlet and Mrs White are women in the Billiards Room.

Section 9.2 is Awarding points (which isn’t really a time thing?)

Having a score used to be a default, but now must be turned on manually:

Use scoring.

This enables in-game commands SCORE, NOTIFY ON and NOTIFY OFF and allows the author to award points at any time by this:
increase the score by 5;

I have mixed feelings on scoring. I used to squarely be in the ‘it’s outdated’ camp, but the nice thing about having a score is it really helps with pacing in a game; it makes it clear how long the overall game and how fast you’re progressing.

They warn not to let scoring actions happen over and over again (my current game doesn’t use the built-in score, but has a custom scoring thing for one section, and one beta tester found a way to get an unlimited score).

They give an example of scoring that can be abused by repeating the action:

After taking the trophy:
    increase the score by 5;
    say "Well done!"

and a similar one that can not be abused:

After taking the trophy when the trophy was not handled:
    increase the score by 5;
    say "Well done!"

(It is very important to note that this rule uses the past tense in its verb ‘was handled’; this is the first time we’ve seen this, where using the past tense refers to the game state at the beginning of the turn).

You can establish a maximum score as so:

The maximum score is 10.

And you can change the maximum score and current score at any time.

Example 136 is Mutt’s Adventure:

A room can be scored or unscored.

Carry out going to a unvisited scored room:
increment the score.

The Treasure Room is scored.

Example 137 uses tables for advanced scoring:

Table of Point Values

item score
cow 10
incantations 4
chessman 1
Report taking an item listed in the Table of Point Values:
    increase the score by the score entry;
    blank out the whole row.

‘Blank out the whole row’ is something we’ll see a lot more later on.

Section 9.2 is Introducing tables: rankings, which again has nothing to do with time. It just gives a way to make a table of rankings. ‘Rankings’ is a special name in Inform, and if made with a column called score with numbers and a column called rank made with text:

Score Rank
0 “Beginner”
25 “Amateur Adventurer”
50 “Novice Adventurer”
100 “Junior Adventurer”
200 “Adventurer”
300 “Master”
330 “Wizard”
350 “Master Adventurer”

Customarily, the score in the final row should be the maximum possible achieved in the story - so that only a player with maximum possible score can be awarded the final ranking - and the value of “maximum score” is automatically set to this bottom-row value if it has not been explicitly set anywhere else in the source text.

Section 9.4 is When play ends, which introduces some phrases for ending everything.

These includes:
end the story, which ends the game and prints ‘The End’, but it isn’t final (the game won’t print this like author’s notes, etc.)
end the story finally, which does the same as above but is considered final and prints final menu options

You can also change the printed message from ‘the end’ to anything else you want:
end the story saying (text)
or `end the story finally saying (text)'.

The book gives this example:

end the story finally saying "You have defeated Sauron"

The closing message is printed between three asterisks on left and right, and looks weird if it’s too long. I usually use a say " " command first to give most of the ending or death message, then end the story finally with one last sentence.

I always get errors because I tend to time ‘end the game’ instead of ‘end the story’.

We can check if the story is over as follows:

if story has ended
if story has not ended
if story has ended finally
if story has not ended finally

Any commands in ‘when play ends’ happen before the final message, like

When play ends, say "Oh dear."

Surprisingly, you can also just take back the ending with the command resume the story:

When play ends:
    if the story has not ended finally:
        say "Oh dear. Still, here's another chance.";
        resume the story.

Example 138 is Big Sky Country:

When play ends when the story has not ended finally:
    say "Oh dear, that ought to be fatal! However, if you like I can get you out of it...

    Shall I? >";
    if the player consents:
        repeat with item running through things had by the player:
            move the item to a random visited room;
        say "A strong wind picks you up and sets you back at [the location], though perhaps minus a few of your things.";
        resume the story;
        try looking.

This introduces if the player consents, which gives a special yes/no prompt.

Section 9.5 is ‘Every turn’.

Inform is a turn-based system, with one command giving one action taking one turn, in general.

There is a variable called turn count that is a number equal to the number of turns in play. It is turn 0 when the banner is printed and turn 1 whn the first command is typed.

At the end of the turn, you can make commands run with ‘Every turn’:
Every turn, say "The summer breeze shakes the apple-blossom."

Apparently this is equivalent to:
An every turn rule: say "The summer breeze shakes the apple-blossom."

but I don’t understand rulebooks so I’ll learn about that later.

I should say that Inform lets you see all rules running with RULES, but rules without names just print their conditions, and so if you use ‘every turn’ a lot (like I do) it’ll just say ‘every turn rule’ ‘every turn rule’ etc. with no further clarification. It helps to either name rules (which we’ll get to later) or just add conditions like:
every turn when the player is in spell-region, because that’s easier to pick out when debugging.

Example 139 is Witnessed:

A battery is a kind of thing. A battery has a number called charge. The charge of a battery is usually 15.

Every turn:
    repeat with hollow running through battery compartments:
        if the hollow is part of a switched on device (called the machine):
            if a battery (called cell) is in the hollow:
                decrement the charge of the cell;
                carry out the warning about failure activity with the machine;
                if the cell is discharged, carry out the putting out activity with the machine;
            otherwise:
                carry out the putting out activity with the machine.

Example 140 is a rare four-star example: Text Foosball.

I actually made a foosball table in my current game, and I wondered if Inform had a sample foosball table in its documentation, and it did!

I ended up not using this code because it heavily involves an NPC and mine doesn’t, but it’s really cool.

It has stuff like this:

Every turn when the ball is still and Joey is active:
    let total be Joey's score + score;
    if total > 9, make no decision;
    if the ball is unreachable, make no decision;
    now Joey is inactive;
    if a random chance of 1 in 2 succeeds:
        now the ball is approaching;
        say "Joey hits the ball solidly down towards your goal. Now it is [small white ball condition].";
    otherwise:
        say "Joey fails to hit the ball in your direction. It remains [small white ball condition]."

Section 9.6 is The time of day

This weirded me out when I first saw it but I like it.

Inform keeps an internal time tracker for games. Each game starts at 9 AM and every turn takes one minute.

This is great for timed games where the exact sequence of events happens every time you play it.

You can change the time of day any time you want:
The time of day is 3:13 PM.

You can say stuff like:

At the time when the player loses consciousness:
    now the time of day is 10:12 AM;
    say "A mist comes over your vision, and when you come to, it is morning and you are in bed."

This is the first time we’ve seen ‘at the time when’ that I can remember so far.

Example 141 is IPA:

When play begins: now the right hand status line is "[time of day]".

The time of day is 9:50 AM.

A shop is a kind of room. A shop has a time called the opening hour. The opening hour of the shop is usually 8 AM. A shop has a time called the closing hour. A shop usually has closing hour 6 PM.

Check going to a shop (called the target):
    if the time of day is before the opening hour of the target,
        say "[The target] is locked up until [the opening hour of the target]." instead.

Check going to a shop (called the target):
    if the time of day is after the closing hour of the target,
        say "[The target] has been closed since [the closing hour of the target]." instead.

Every turn when the location is a shop:
    let deadline be the closing hour of the location;
    if the deadline is before the time of day:
        let target be a random adjacent room which is not a shop;
        say "You are gently but firmly ushered out, since [the location] is closing.";
        move the player to the target.

Section 9.7 is Tell the time:

The Clock Chamber is a room. "The dark chamber behind the clock face, a mill-room of gears which grind down the seconds. Through the glass you can see the reversed hands reading [the time of day]."

This prints numerals. To print words:
"Through the glass you can see the reversed hands reading [the time of day in words]."

You can also make the command prompt the time of day (not with any special syntax, just combining regular syntax):
When play begins: now the command prompt is "[time of day] >".

Example 142 is Situation Room.

To say (relevant time - a time) as 24h time:
    let H be the hours part of relevant time;
    let M be the minutes part of relevant time;
    say "[if H is less than 10]0[end if][H][if M is less than 10]0[end if][M]".

When play begins:
    now the time of day is 6:09 PM;
    now the right hand status line is "[time of day as 24h time]".

Section 9.8 is Approximate times, lengths of time

You can specify how rounded off to make the time:
The Clock Chamber is a room. "The dark chamber behind the clock face, a mill-room of gears which grind down the seconds. Through the glass you can see the reversed hands reading [the time of day to the nearest five minutes in words]."

Next we do a little type casting:

let X be 5;
if the player is in the Slow Room, now X is 10;
let deadline be the time of day plus X minutes

so X is a number but we turn it into a time. 1440 is the maximum time.

If we type ‘hours’ instead of ‘minutes’ it makes hours instead of minutes, which makes sense. 24 is the max of hours.

Section 9.9 is Comparing and shifting times:

The chronometer is in the Clock Chamber. “On one wall is a terribly self-important chronometer showing the time in major world cities. London: [time of day]. Paris: [one hour after the time of day]. Tokyo: [9 hours after the time of day]. Cupertino, California: [7 hours before the time of day].”

This shows how you can shift the time of day when printing.

You can also do it in conditions:
if time of day is before 11AM, etc.

Obviously since time is periodic, every time is both before and after every other time, but Inform restricts it to one day, and assumes days start at 4:00 AM.

Section 9.10 is Calculating times

You can split time up into the minutes part and hours part:

minutes part of 12:41 PM
hours part of 8:21 AM

And like early you can ‘cast’ any integer to a time by putting hours or minutes after it:

The clock error is a number that varies. To thump the mechanism: now the clock error is a random number from -10 to 10.

The broken grandfather clock is in the Chamber. "An erratic grandfather clock seems to say it is [clock error minutes after the time of day]."

When play begins, thump the mechanism. Instead of attacking the broken clock: thump the mechanism; say "You thump the clock, which now reads [clock error minutes after the time of day].".

This is just like python where you have a number n but you want to concatenate it onto a string so you ‘cast’ it with print("The number is" + str(n).)

Section 9.11 is ‘Future events’, which I’ve used before but always feels like a weird pseud-way of making scenes, like a parallel development that was discarded.

 Instead of pushing the egg-timer:
    say "It begins to mark time.";
    the egg-timer clucks in four turns from now.

At the time when the egg-timer clucks:
    say "Cluck! Cluck! Cluck! says the egg-timer."

So this construction just lets you schedule things a certain amount of times in the advance.

This construction is great for making funny jokes in code (like ‘the goblin breakdances in five turns from now’), since you can just type anything.

I used it a ton in The Magpie Takes the Train, which was a one-room game with a lot of schedule events:

To say ParrotSing:
	now the parrot is musical;
	the musicing ceases in three turns from now;
	
At the time when the musicing ceases:
	say "Horus stops singing and preens his feathers. He seems eager to sing again.";
	now Music is not TargetGiven;
	now the parrot is not musical;
	say "[line break][bracket]Renewed topic for the parrot - [bold type]Music[roman type][close bracket][line break]";

Every turn:
	if the parrot is musical:
		say "Horus is currently singing at the top of his lungs[if the parrot is offended], but he's glaring at you while he does it[end if].";

You can phrase it in minutes or in turns (which are minutes by default) or for specific times of day:

the egg-timer clucks in 18 minutes from now;
the egg-timer clucks in four turns from now;
the egg-timer clucks at 11:35 AM;

These are all used inside of other rules. If you know a specific time you can just declare it as its own rule (don’t know if this is a technical ‘rule’ but it’s like them):

At 4 PM: say "The great bells of the clock tower chime four."

It says that the scenes index lists these. Let’s try this with a sample game:

Adding:
At 9:03 AM: say "The rooster crows".
to a sandbox game makes the following appear in the index:

image

Note that I got an error the first time I tried this because I didn’t type ‘AM’.

Lots of examples!

Example 143 is MRE, with a hunger timer:

Food is a kind of thing. Food is usually edible. Food has a time called the satisfaction period. The satisfaction period of a food is usually 5 minutes.

A person can be hungry or replete. The player is hungry.

The Larder contains an apple, a candy bar, and a large plate of pasta. The apple, the candy bar, and the pasta are food. The satisfaction period of the apple is 2 minutes. The satisfaction period of the pasta is 125 minutes.

Carry out eating something:
    now the player is replete;
    hunger resumes in the satisfaction period of the noun from now.

At the time when hunger resumes:
    starvation occurs in three minutes from now;
    now the player is hungry.

At the time when starvation occurs:
    if the player is hungry, end the story saying "You have starved".

I noticed they changed ‘carry out’ here. Wouldn’t that get rid of regular eating rules, and not delete the object? Let’s try it out.

Huh, compiling this example, the apple does go away. Does adding our own ‘carry out’ rules just stack with older carry out rules instead of replacing them completely?

Example 144 is Totality:

At the time when the penumbra appears:
    say "The sunlight dies away to an eerie, brownish penumbra."

At the time when the eclipse begins:
    say "The moon passes across the disc of the sun, plunging the world into darkness.";
    now the Chamber is dark.

At the time when the eclipse ends:
    say "The moon passes away from the sun, and a gloomy penumbral light returns.";
    now the Chamber is lighted.

At the time when normal sunlight returns:
    say "The sun shines once more bright in the sky, not to be eclipsed again on this spot for another thirty-seven years."

To schedule an eclipse for (totality - a time):
    the penumbra appears at two minutes before totality;
    the eclipse begins at totality;
    the eclipse ends at three minutes after totality;
    normal sunlight returns at five minutes after totality.

‘To schedule an eclipse’ is an example of a Phrase.

Example 145 is Empire:

At 4:45 PM:
    if the player is in the train or the player is in the station of the train, say "The train pulls out of [the station of the Train]!";
    now the station of the Train is the Train.

At 5:10 PM:
    now the station of the Train is Edmonds;
    if the player is in the train or the player is in the station of the train, say "The train pulls into Edmonds and comes to a stop."

At 5:17 PM:
    if the player is in the train or the player is in the station of the train, say "The train pulls out of [the station of the Train], running north along the shore towards Everett.";
    now the station of the Train is the Train.

I’ve only reproduced a small part of this.

Example 146 is Hour of the Wren:

The player carries a card. The description of the card is "Typed: 'Active astrology - dislike your fortunes? change your stars! - make an appointment now - hour of the wren STILL AVAILABLE.'".

The time of day is 1:55 PM.

Understand "pick [time]" or "choose [time]" or "make appointment for [time]" or "make an appointment for [time]" as making an appointment for. Making an appointment for is an action applying to one time.

Carry out making an appointment for:
say "Fate cannot be commanded more than once."

Instead of making an appointment for the time understood for the first time:
say "You settle on [the time understood] for your appointment. The woman makes a note of it in an appointment book, which she carries in a brown paper bag. 'Excellent choice, ma'am,' she says in a low, urgent voice. 'You'll be very satisfied.'";
stars shift at the time understood.

Understand "hour of the wren" as 2:00 PM.

At the time when stars shift:
end the story saying "insert cataclysm here".

Section 9.12 is Actions as conditions:

We can use actions as conditions, like this:
if we are taking a container, ...
or the abbreviated form:
if taking a container, ...

I didn’t know this! I always did ‘if the current action is the player looking’ or ‘if the current action is looking’. This is similar but slightly more natural, which is nice.

You can also use the past tense:
Instead of waiting when we have taken the lantern, say "No, your acquisitive nature is roused now, and simply waiting will no longer do."

This only works if someone has ever successfully taken the lantern.

This past tense stuff is really heavy; I feel like it could be a massive game changer but I’m just learning it now.

Example 147 is Night Sky:
The Planetarium is a room. "[if we have examined the sinister message]A dark room where it seems something is about to jump out at you![otherwise]A tranquil dark room with a ceilingful of stars.[end if]"

There is also an example that doesn’t work since it uses ‘instead’ so the action that matters isn’t successful:
The sinister message is a thing in the Planetarium. "A message plays very softly, so that you would have to listen to hear it." Instead of doing anything other than listening to the message: say "It's only a sound, after all.". Instead of listening to the sinister message: say "A voice whispers, 'BEWARE'."

Example 148 is Zero:

Weight is a kind of value. The weights are light, manageable, and horribly heavy. Everything has a weight.

A thing is usually manageable.

Before printing the name of a horribly heavy thing (called weighty object):
    if we have taken the weighty object, say "[weight] ".

This includes ‘before printing the name of’, which to me is in the category of ‘mystical phrases I only see in random examples’.

Section 9.13 is past and perfect tenses.

There are three ways to do conditions in inform:
if X is Y...., which is what we’ve used the most.
if X has been Y' (which checks if X is Y has ever been true), and if X was Y` which only checks if X was Y at the start of the current turn

This is fantastic! I’ve rolled my own rules for this kind of thing many times, setting a flag at the beginning of every turn and then checking if the flag was still true at the end. This is great:

if the lantern was switched on, now the lantern is switched off;
if the lantern was switched off, now the lantern is switched on;

can be used for ‘push button’, for instance.

There is also the past perfect text which checks if ‘X has been Y’ was true at the beginning of the current action.

Do not say things like ‘if the noun has been open’, the manual warns, as ‘the noun’ is a variable phrase and when using ‘has been’ it checks past values of the noun.

Example 149 is Tense Boxing:

The mysterious box is in the Temporal Prism. It is an openable closed container.

To assess the box:
    if the box was not open, say "The box was not open.";
    if the box was open, say "The box was open.";
    if the box had not been open, say "The box had not been open.";
    if the box had been open, say "The box had been open.";
    if the box is not open, say "The box is not open.";
    if the box is open, say "The box is open.";
    if the box has not been open, say "The box has not been open.";
    if the box has been open, say "The box has been open."

Before opening the mysterious box:
    say "You are about to open the box.";
    assess the box.

Before closing the mysterious box:
    say "You are about to close the box.";
    assess the box.

After taking the mysterious box:
    if the box had not been carried by the player, say "You lift the mysterious box for the first time.";
    if the box had been carried by the player, say "You again pick up the mysterious box."

Example 150 is Brunesau’s Journey

Carry out burning the candle:
    now the candle is lit.

Report burning:
    if the candle had been lit, say "You relight the candle.";
    otherwise say "You light the candle for the first time.".

Carry out blowing out the candle:
    now the candle is unlit.

Report blowing out:
    if the noun is the candle and the candle was lit, say "You blow out [the noun].";
    otherwise say "You blow on [the noun], to little effect."

Example 151 is Elsie:

Every turn when the sliding door was open:
    now the sliding door is closed;
    if the player can see the sliding door:
        say "The sliding door slips back into place, sealing the wall as though there had never been a breach."

I wondered what would happen if you typed ‘close door’ when the door was open; would this rule fire anyway?

Yes, it does, but it fits in. It prints the following:

You close the sliding door.

The sliding door slips back into place, sealing the wall as though there had never been a breach.

In my current game I have the following:

Every turn when wax-doors are open:
	now wax-doors are closed;
	say "The double doors swing closed."

This has the negative effect of never letting the player open the doors without immediately closing. So I might switch to this new way.

Section 9.14 is How many times? This is some phrasing I’ve tried using but usually fail and just make some counter variable I increment myself:

if the player is in the Ballroom for the third time ...

This only works if the condition is true then false then true then false then true. So staying in the ballroom three turns doesn’t trigger it, but leaving and returning does.

You can also say:

if the player is in the Ballroom for more than the third time ...
if the player has been in the Ballroom three times ...

‘only’ and ‘exactly’ mean the same thing, so:
‘if the player has been in the Ballroom only three times …’

can be written. How is this different from not adding ‘exactly’? I don’t know. I think when using ‘has been’ that it defaults to ‘at least __ times’, so exactly avoids that. IDK though.

Examples 152 is Infiltration:
The Secure Zone has the description "[if the player is in the Zone for the second time]Re-entering the Zone has not made you any more comfortable inside. [end if]Despite your carefully-chosen outfit and the walk you have been practicing, you are sure those inside can tell you don't belong. Not that very many people are visible here[if the player is in the Zone for more than the second time] -- the place seems more desolate than ever[end if]."

Trying this example out, the first part of the message only prints the second time, and never again. The second part is ‘sticky’ and keeps printing.

If we change the first condition to if the player has been in the Zone two times, it plays the second time and every time after that.

Finally, 9.15 is How many turns?

This is for conditions that are holding now and the previous turn and so on:

if the floppy hat has been worn for three turns ...

This is an ‘at least’ kind of thing so will fire if it has been worn every turn for at least 3 turns.

You can instead say any of these three things to mean ‘exactly three turns’:

if the floppy hat is worn for the third turn ...
if the floppy hat has been worn for only 3 turns ...
if the floppy hat has been worn for exactly three turns ...

Again, we shouldn’t use variable nouns like ‘if the noun has been open’, since ‘the noun’ might have meant something in the past.

Every turn:
    if the player has been in the Minivan for 5 turns, say "'Are we there [if saying no]now?'[otherwise]yet?' asks Pete.[end if]"

Whew! Not the biggest chapter, but some pretty intense stuff.

3 Likes