A not-infrequent desire in IF is to provide a few lines of comment when the player first enters a new room, after the objects are described but before anything else (such as an every turn rule) can fire. The cleanest, most systematic solution is to add a rule to the carry out looking rulebook, so:
"Saint Eligius"
The first look rule is listed after the room description paragraphs about objects rule in the carry out looking rules. A room can be commented or uncommented. A room is usually uncommented.
This is the first look rule:
if the location is uncommented, carry out the gawking at activity with the location.
Gawking at something is an activity.
Rule for gawking at the Diamond Market:
say "Your throat closes and your eyes begin to sting. You have long disdained pomp and luxury, and railed against the oppression that brings such wealth to some men at the cost of the lives of others; you were not prepared for the magnificence."
After gawking at a room (called the target): now the target is commented.
And now the scene itself:
The Cobbled Alley is a room. "The Alley has never been made into a proper street: the buildings on either side are simply too important to tear down. For all that, there isn't much sign of the magnificence nearby. The entrance you seek is set below street level, four grimy steps down to a half-basement."
After going to Diamond Market:
say "You descend the steps quickly and step into the small foyer, allowing yourself to be searched for weapons, before going on to...";
continue the action.
Diamond Market is down from Cobbled Alley. "The roof is vaulted and painted in allegorical images representing Plenty, the Riches of the Earth, and Saint Eligius, patron of goldsmiths and jewelers.
Under their watchful eye, dozens of men in sober black robes sit; and on the tables before them are rubies, emeralds, sapphires from oversea, but most of all diamonds, both raw and cut."
The burly guard is a man in Diamond Market. "A burly guard patrols quite close to you, but even he is more sumptuously dressed than the average burly guard, and his buttons shine."
Test me with "d / look".
Suppose a game in which all actions take a very long time. Here's a simple implementation:
"Uptempo"
The fast time rule is listed instead of the advance time rule in the turn sequence rules.
This is the fast time rule:
increment the turn count;
increase the time of day by 15 minutes.
When play begins: now the right hand status line is "[time of day]".
The Temporal Hot Spot is a room.
Test me with "z / z".
This works fine as it stands, but we may run into some difficulty with it if we add scheduled events:
At 9:30 AM:
say "Two turtles run by, almost too fast to see."
At 9:37 AM:
say "A snail blitzes past."
At 9:42 AM:
say "The grass grows."
At 9:50 AM:
say "Several flowers burst open."
Time is counted forward after the schedule has already been consulted, so that only the 9:30 AM event happens between 9:30 and 9:45; the next two appear to occur between 9:45 and 10:00 AM, and the 9:50 AM event is not reported until the 10:00 AM to 10:15 wait. To get around this, we might schedule events only on the fifteen-minute mark when we want them to occur. Alternatively, we might try instead
"Uptempo"
The fast time rule is listed before the timed events rule in the turn sequence rules.
The advance time rule is not listed in the turn sequence rules.
This is the fast time rule:
increment the turn count;
increase the time of day by 15 minutes.
When play begins: now the right hand status line is "[time of day]".
The Temporal Hot Spot is a room.
At 9:30 AM:
say "Two turtles run by, almost too fast to see."
At 9:37 AM:
say "A snail blitzes past."
At 9:42 AM:
say "The grass grows."
At 9:50 AM:
say "Several flowers burst open."
Test me with "z / z / z / z".
This time our revised time-advancing rule is listed just before the event scheduler, not just afterwards.
Suppose that we want the player always to see full room descriptions, even if he tries to reset the defaults -- perhaps because there is vital information there which he will miss if he turns off full-length room descriptions.
To do this, we might want to remove the standard behavior of the three actions associated with BRIEF, SUPERBRIEF, and VERBOSE, replacing them with explanatory messages about how the game behaves. We cannot use Instead to override these actions, because Instead rules do not apply to actions out of world. Instead, we will want to remove and replace the carry out rules.
We can do this easily by going to the Actions Index, looking up the detail panel for, say, "preferring abbreviated room descriptions", and click the "unlist" button to paste in the sentence that will remove this rule from the rulebook.
Let's remove all three of the carry out rules and substitute our own:
"Verbosity 2"
Section 1 - Procedure
The prefer unabbreviated room descriptions rule is not listed in the carry out preferring unabbreviated room descriptions rulebook.
The prefer sometimes abbreviated room descriptions rule is not listed in the carry out preferring sometimes abbreviated room descriptions rulebook.
The prefer abbreviated room descriptions rule is not listed in the carry out preferring abbreviated room descriptions rulebook.
Carry out preferring unabbreviated room descriptions:
say "[story title] always provides full-length descriptions for your reading pleasure."
Carry out preferring sometimes abbreviated room descriptions:
say "For your playing protection, [story title] provides only full-length room descriptions."
Carry out preferring abbreviated room descriptions:
try preferring sometimes abbreviated room descriptions instead.
The standard report preferring abbreviated room descriptions rule is not listed in the report preferring abbreviated room descriptions rulebook.
The standard report preferring unabbreviated room descriptions rule is not listed in the report preferring unabbreviated room descriptions rulebook.
The standard report preferring sometimes abbreviated room descriptions rule is not listed in the report preferring sometimes abbreviated room descriptions rulebook.
Use full-length room descriptions.
Section 2 - Scenario
The Wilkie Memorial Research Wing is a room. "The research wing was built onto the science building in 1967, when the college's finances were good but its aesthetic standards at a local minimum. A dull brown corridor recedes both north and south; drab olive doors open onto the laboratories of individual faculty members. The twitchy fluorescent lighting makes the whole thing flicker, as though it might wink out of existence at any moment.
The Men's Restroom is immediately west of this point."
The Men's Restroom is west of the Research Wing. "Well, yes, you really shouldn't be in here. But the nearest women's room is on the other side of the building, and at this hour you have the labs mostly to yourself. All the same, you try not to read any of the things scrawled over the urinals which might have been intended in confidence."
Test me with "west / east / brief / w / e / superbrief / w / e / verbose".
Suppose we want to let the player explicitly sit, stand, or lie down on different enterable objects. (Normally Inform treats all these actions as entering, but there may be cases where we want to distinguish between the player sitting on a chair and the player standing on it.)
Our implementation gives each kind of enterable a range of allowed postures, and one preferred posture. If the player enters the supporter or container without specifying a posture (as in ENTER CHAIR), he will be put in the preferred posture. If he explicitly says, e.g., STAND ON CHAIR, he will be put in the standing position as long as standing is a posture that suits the chair.
"Slouching"
Section 1 - Posture Rules
A posture is a kind of value. The postures are seated, standing, and reclining.
A person has a posture. The posture of a person is usually standing.
A supporter has a posture. A container has a posture.
Posture-permission relates various things to various postures. The verb to allow means the posture-permission relation.
Understand the commands "stand" and "sit" and "lie" as something new.
Understand "sit on/in [something]" as sitting on.
Understand "lie on/in [something]" as lying on.
Understand "stand on/in [something]" as standing up on.
Sitting on is an action applying to one thing.
Lying on is an action applying to one thing.
Standing up on is an action applying to one thing.
Carry out an actor sitting on:
if the holder of the actor is not the noun, silently try the actor entering the noun;
if the holder of the actor is the noun:
if the actor is not seated, try the actor taking position seated;
otherwise follow the report taking position rules.
Carry out an actor lying on:
if the holder of the actor is not the noun, silently try the actor entering the noun;
if the holder of the actor is the noun:
if the actor is not reclining, try the actor taking position reclining;
otherwise follow the report taking position rules.
Carry out an actor standing up on:
if the holder of the actor is not the noun, silently try the actor entering the noun;
if the holder of the actor is the noun:
if the actor is not standing, try the actor taking position standing;
otherwise follow the report taking position rules.
Understand "lie down" as lying down.
Understand "sit down" or "sit" or "sit up" as sitting down.
Understand "stand" or "stand up" as standing up.
Lying down is an action applying to nothing.
Sitting down is an action applying to nothing.
Standing up is an action applying to nothing.
Taking position is an action applying to one posture.
Instead of an actor lying down:
try the actor taking position reclining; rule succeeds.
Instead of an actor sitting down:
try the actor taking position seated; rule succeeds.
Instead of an actor standing up:
try the actor taking position standing; rule succeeds.
Check an actor taking position:
if the holder of the actor is not a room and the holder of the actor does not allow the posture understood:
if the actor is the player:
say "You can't take that position [in-on the holder of the actor].";
otherwise if the actor is visible:
say "[The actor] can't take that position.";
stop the action.
Check an actor taking position:
if the posture understood is the posture of the actor:
if the actor is the player:
say "You are already [the posture understood].";
otherwise:
if the actor is visible, say "[The actor] is already [the posture understood].";
stop the action.
Carry out an actor taking position:
now the posture of the actor is the posture understood.
Report someone taking position (this is the position-report rule):
say "[The actor] is now [the posture of the actor][if the holder of the actor is not the location of the actor] [in-on the holder of the actor][end if]."
Report taking position:
say "You are now [the posture of the player][if the holder of the player is not the location] [in-on the holder of the player][end if]."
To say in-on (item - a thing):
if the item is a container, say "in [the item]";
otherwise say "on [the item]".
Carry out an actor exiting (this is the departure-posture rule):
let N be the holder of the actor;
if N is a container or N is a supporter,
now the posture of the actor is the posture of N;
otherwise now the posture of the actor is standing.
The departure-posture rule is listed after the standard exiting rule in the carry out exiting rulebook.
The departure-posture rule is listed after the standard getting off rule in the carry out getting off rulebook.
Carry out an actor entering something (this is the arrival-posture rule):
if the noun is a container or the noun is a supporter,
now the posture of the actor is the posture of the noun.
The arrival-posture rule is listed after the standard entering rule in the carry out entering rulebook.
Check an actor going somewhere:
if the actor is in a room and the actor is not standing:
say "([if the actor is not the player][the actor] [end if]first standing up)[command clarification break]";
silently try the actor taking position standing;
if the actor is not standing, stop the action.
Section 2 - Some Generic Kinds
A chair is a kind of supporter. A chair is always enterable. Every chair allows seated and standing. A chair is usually seated.
A sofa is a kind of supporter. A sofa is always enterable. Every sofa allows seated, standing and reclining. A sofa is usually seated.
A hammock is a kind of container. A hammock is always enterable. Every hammock allows seated and reclining. A hammock is usually reclining.
Section 3 - The Scenario
The Resort is a room.
The banana hammock is a hammock in the Resort. The stone bench is a sofa in the resort.
Clark is a man in the Resort. A persuasion rule: persuasion succeeds.
Rule for writing a paragraph about someone (called target):
say "[The target] is [posture] [if the holder of the target is the location]nearby[otherwise][in-on the holder of the target][end if]."
Rule for writing a paragraph about something which encloses an unmentioned person (called target):
carry out the writing a paragraph about activity with the target instead.
Test me with "sit on bench / stand on bench / get up / lie on hammock / sit up / g / clark, sit on bench / look / clark, lie down / g / look / clark, get up / look / clark, lie down / look / enter bench".
Inform's default assumption is that if a player on an enterable object drops something, the dropped article winds up beside him on the same supporter or in the same container. This makes lots of sense for a dais, say, or a king-sized bed. It's a little less sensible if the enterable supporter in question is a bar stool or the like. So suppose we want to add a new kind of supporter called a perch, where everything dropped lands on the floor.
There are actually several ways of implementing this, but one of them is to reach right into the drop action and replace the "standard dropping rule" with a different one of our own invention -- like this:
"Swigmore U."
Moe's Tavern is a room. The bar is an enterable supporter in Moe's. A drink is a kind of thing. On the bar is a drink called a flaming Homer.
A perch is a kind of supporter. A perch is always enterable. The stool is a perch in Moe's.
The player carries a dead field mouse and a tomacco fruit.
The sophisticated dropping rule is listed instead of the standard dropping rule in the carry out dropping rulebook.
This is the sophisticated dropping rule:
if the player is on a perch (called the awkward position):
let place be the holder of the awkward position;
move the noun to the place;
otherwise:
move the noun to the holder of the player.
Test me with "sit on stool / drop mouse / look / get up / look".
Now the carry-out behavior of the dropping action has been changed, but we haven't had to interfere in the checks or reporting at all. The rest of the action works just as it always did.
Of course, maybe we do want to change the way the action is reported, to make it clearer to the player where the dropped article wound up:
The sophisticated report dropping rule is listed instead of the standard report dropping rule in the report dropping rulebook.
This is the sophisticated report dropping rule:
say "You drop [the noun] on [if the holder of the noun is a room]the ground[otherwise][the holder of the noun][end if]."