Fun with Participles

Example 245
★★

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:

"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".
Test me with "look / Clark, jump / look / Clark, look / look / Clark, wait".
Lab
Clark is here, standing about.

You can also see a fedora here.

>(Testing.)

>[1] look
Lab
Clark is here, standing about.

You can also see a fedora here.

>[2] clark, jump
"Fine, have it your way!" Clark exclaims. "But I have pirouetted for the last time!"

>[3] look
Lab
Clark is here, jumping.

You can also see a fedora here.

>[4] clark, look
"Fine, have it your way!" Clark exclaims. "But I have looked around for the last time!"

>[5] look
Lab
Clark is here, looking around.

You can also see a fedora here.

>[6] clark, wait
"Fine, have it your way!" Clark exclaims. "But I have wasted time for the last time!"