Approaches
version 4 by Emily Short
Example: ** The Jade Amphitheater - A replacement for the ordinary describing path rule to produce text output such as "You go to Crimson Chamber by way of Grooved Channel, Shallow Jade Amphitheater, Silver Filigree Prison and Mandarin Casket Room."
Here we want to change both the individual pieces of the movement description (using only room names and not directions traveled) and the order in which this output is presented. Therefore, we need a new rule to write the player's described motion using just the room names, and also a new describing path rule to put the description together:
"Jade Amphitheater"
Section 1 - Rules for Revising Output
Include Approaches by Emily Short.
The new creating a path history rule is listed instead of the creating a path history rule in the carry out going rules.
Carry out going while the player is hurrying (this is the new creating a path history rule):
add the approach-heading to the path so far of the player;
let N be indexed text;
let N be "[the approach-destination]";
if approach-destination is improper-named, now N is "[N in lower case]";
add N to the described motion of the player;
say "[run paragraph on]"; [a mildly inelegant hack to correct for the fact that the indexed-text handling is inserting gratuitous line breaks here]
Rule for describing path of the player:
let N be the number of entries in the described motion of the player;
say "You go [if the location is the noun]to[otherwise]toward[end if] [entry N of described motion of the player]";
if N is greater than 1
begin;
truncate the described motion of the player to (N - 1) entries;
say " by way of [the described motion of the player]";
end if;
say ". [run paragraph on]";
clear the path-walked for the player;
Section 2 - Scenario
The Crimson Chamber is north of the Mandarin Casket Room. The Mandarin Casket Room is west of the Silver Filigree Prison. The Silver Filigree Prison is northwest of the Shallow Jade Amphitheater. The Shallow Jade Amphitheater is north of the Grooved Channel. Below the Grooved Channel is the Carved Basin.
A room is usually proper-named.
Test me with "s / e / se / s / d / go to the Crimson Chamber".