§14.3. More on adapting verbs

If we need an adaptive message with a verb which doesn't belong to Inform's built-in set, all we need do is define it. In the previous chapter we defined verbs by giving them meanings, but in fact that's optional. For example:

To retrofit is a verb.

defines a verb without telling Inform what it means. Inform will throw a Problem message if we try to write text like:

Flash retrofits the meteor beam.

because, after all, it doesn't know what "retrofit" means. But it does still know how to print it, so this works:

"[The actor] [retrofit] the Mecha-Mole."

which might come out as "Dale retrofits the Mecha-Mole", or "Barin's archers retrofitted the Mecha-Mole", and so on.

This is especially neat for writing a single response to an action which works regardless of who the actor was. For example, the Standard Rules include:

say "[The actor] [put] [the noun] on [the second noun]."

And this can make either:

You put the revolver on the table.
General Lee puts the revolver on the table.


arrow-up.pngStart of Chapter 14: Adaptive Text and Responses
arrow-left.pngBack to §14.2. Adaptive text
arrow-right.pngOnward to §14.4. Adapting text about the player

**ExampleVariety 2
This builds on the Variety example to add responses such as "You are now carrying the fedora" that describe relations that result from a given verb, as alternate responses.

**ExampleVariety
Suppose we want all of our action responses to display some randomized variety. We could do this by laboriously rewriting all of the response texts, but this example demonstrates an alternative.

Mostly the Standard Rules use verbs adapted to finite forms ("he jumped", "we take the hammer", and so on). But Inform can also produce participles to describe actions that are ongoing: "he is carrying the fedora" or "taking the hammer..."

In this example, we give non-player characters actions to perform and then have Inform dynamically describe what they're doing when the player chooses to look.

We start by establishing the idea that a verb can describe a particular action:

paste.png "Fun with Participles"

Section 1 - Descriptive Functionality

Describing relates various verbs to various action names. The verb to describe means the describing relation.

To look around is a verb. The verb look around describes the looking action.

To stand about is a verb. The verb stand about describes the waiting action. To look bored is a verb. The verb look bored describes the waiting action. To waste time is a verb. The verb waste time describes the waiting action.

To jump is a verb. To leap is a verb. To pirouette is a verb. The verb jump describes the jumping action. The verb leap describes the jumping action. The verb pirouette describes the jumping action.

Now we need to give every character some sort of idle activity. By default, we'll have people just be waiting, but allow for that idle activity to change into something more interesting if the player has told them to do something else.

A person has an action name called the current idle. The current idle of a person is usually the waiting action.

Rule for writing a paragraph about someone (called chosen person) when a verb describes the current idle of the chosen person:
    say "[The chosen person] [are] here, [present participle of a random verb that describes (the current idle of the chosen person)]."

Instead of someone doing something:
    now the current idle of the person asked is (the action name part of the current action);
    continue the action.

A persuasion rule:
    persuasion succeeds.

Section 2 - Scenario

Lab is a room. The fedora is a wearable thing in the Lab. Clark is a man in the Lab.

And just to give past participles a test-drive as well, let's make Clark a bit of a drama king:

After Clark doing something when a verb describes (the action name part of the current action):
    say "'Fine, have it your way!' Clark exclaims. 'But I have [past participle of a random verb that describes (the action name part of the current action)] for the last time!'";
    rule succeeds.

Test me with "look / Clark, jump / look / Clark, look / look / Clark, wait".

**ExampleFun with Participles
Creating dynamic room descriptions that contain sentences such as "Clark is here, wasting time" or "Clark is here, looking around" depending on Clark's idle activity.

Mostly the Standard Rules use verbs adapted to finite forms ("he jumped", "we take the hammer", and so on). But Inform can also produce participles to describe actions that are ongoing: "he is carrying the fedora" or "taking the hammer..."

In this example, we give non-player characters actions to perform and then have Inform dynamically describe what they're doing when the player chooses to look.

We start by establishing the idea that a verb can describe a particular action:

paste.png "Fun with Participles"

Section 1 - Descriptive Functionality

Describing relates various verbs to various action names. The verb to describe means the describing relation.

To look around is a verb. The verb look around describes the looking action.

To stand about is a verb. The verb stand about describes the waiting action. To look bored is a verb. The verb look bored describes the waiting action. To waste time is a verb. The verb waste time describes the waiting action.

To jump is a verb. To leap is a verb. To pirouette is a verb. The verb jump describes the jumping action. The verb leap describes the jumping action. The verb pirouette describes the jumping action.

Now we need to give every character some sort of idle activity. By default, we'll have people just be waiting, but allow for that idle activity to change into something more interesting if the player has told them to do something else.

A person has an action name called the current idle. The current idle of a person is usually the waiting action.

Rule for writing a paragraph about someone (called chosen person) when a verb describes the current idle of the chosen person:
    say "[The chosen person] [are] here, [present participle of a random verb that describes (the current idle of the chosen person)]."

Instead of someone doing something:
    now the current idle of the person asked is (the action name part of the current action);
    continue the action.

A persuasion rule:
    persuasion succeeds.

Section 2 - Scenario

Lab is a room. The fedora is a wearable thing in the Lab. Clark is a man in the Lab.

And just to give past participles a test-drive as well, let's make Clark a bit of a drama king:

After Clark doing something when a verb describes (the action name part of the current action):
    say "'Fine, have it your way!' Clark exclaims. 'But I have [past participle of a random verb that describes (the action name part of the current action)] for the last time!'";
    rule succeeds.

Test me with "look / Clark, jump / look / Clark, look / look / Clark, wait".

Mostly the Standard Rules use verbs adapted to finite forms ("he jumped", "we take the hammer", and so on). But Inform can also produce participles to describe actions that are ongoing: "he is carrying the fedora" or "taking the hammer..."

In this example, we give non-player characters actions to perform and then have Inform dynamically describe what they're doing when the player chooses to look.

We start by establishing the idea that a verb can describe a particular action:

paste.png "Fun with Participles"

Section 1 - Descriptive Functionality

Describing relates various verbs to various action names. The verb to describe means the describing relation.

To look around is a verb. The verb look around describes the looking action.

To stand about is a verb. The verb stand about describes the waiting action. To look bored is a verb. The verb look bored describes the waiting action. To waste time is a verb. The verb waste time describes the waiting action.

To jump is a verb. To leap is a verb. To pirouette is a verb. The verb jump describes the jumping action. The verb leap describes the jumping action. The verb pirouette describes the jumping action.

Now we need to give every character some sort of idle activity. By default, we'll have people just be waiting, but allow for that idle activity to change into something more interesting if the player has told them to do something else.

A person has an action name called the current idle. The current idle of a person is usually the waiting action.

Rule for writing a paragraph about someone (called chosen person) when a verb describes the current idle of the chosen person:
    say "[The chosen person] [are] here, [present participle of a random verb that describes (the current idle of the chosen person)]."

Instead of someone doing something:
    now the current idle of the person asked is (the action name part of the current action);
    continue the action.

A persuasion rule:
    persuasion succeeds.

Section 2 - Scenario

Lab is a room. The fedora is a wearable thing in the Lab. Clark is a man in the Lab.

And just to give past participles a test-drive as well, let's make Clark a bit of a drama king:

After Clark doing something when a verb describes (the action name part of the current action):
    say "'Fine, have it your way!' Clark exclaims. 'But I have [past participle of a random verb that describes (the action name part of the current action)] for the last time!'";
    rule succeeds.

Test me with "look / Clark, jump / look / Clark, look / look / Clark, wait".

***ExampleNarrative Register
Suppose we want all of our action responses to vary depending on some alterable quality of the narrator, so that sometimes they're slangy, sometimes pompous or archaic.