Nah, I’m going to do my other trick, which is to code it up quick-and-dirty. You have to catch when multiple commands are being issued in a turn, so you can execute the first one and intercept the rest for the queue, and then you have to empty the queue at the right time. Also I discovered a limitation in Inform’s model for queued commands: If your first command takes the NPC out of sight, then Inform won’t allow you to issue the second one, since it’s just as if you’d typed them one after the other.
[code]the living room is a room. the lower hallway is north of living room. the upper hallway is up from the lower hallway. the study is south of the upper hallway.
Taylor is a person in Living Room.
Taylor’s future actions is a list of stored actions that varies.
Caching action is a truth state that varies.
First action this turn is a truth state that varies.
Taylor commandable is a truth state that varies. [Tracks whether Taylor was in scope at the beginning of the queue of commands.]
After reading a command:
now first action this turn is true;
now caching action is false;
now Taylor commandable is false.
Every turn: now first action this turn is false. [This means that first action this turn will be false only when we’ve done or requested multiple actions in one turn]
Persuasion rule when first action this turn is true:
if the number of entries in Taylor’s future actions is greater than 0: [we’ve interrupted a previous sequence of commands]
say “Taylor says, ‘OK, never mind that stuff you said before.’”;
truncate Taylor’s future actions to 0 entries;
now Taylor commandable is true; [Taylor should remain commandable throughout these commands]
persuasion succeeds.
After deciding the scope of the player when Taylor commandable is true: place Taylor in scope.
Persuasion rule when first action this turn is false: [we’ve queued up multiple requests]
now caching action is true;
persuasion succeeds.
First before Taylor doing something when caching action is true: [so we are now executing one of the subsequent requested action on the turn when multiple requests were made–that means we add it to the queue and then stop it completely]
add the current action to Taylor’s future actions;
rule succeeds.
Every turn when the number of entries in Taylor’s future actions is greater than 0 and caching action is false: [if it’s true, then we added actions to Taylor’s queue this turn, and we don’t want to empty it again]
try entry 1 in Taylor’s future actions;
remove entry 1 from Taylor’s future actions.
A clock is a door. It is up from the Living Room and down from the Study.
After going when the door gone through is the clock:
say “You slip through the secret passage in the clock and go [noun] to [the room gone to].”
Last report Taylor going to the Study when the Study encloses the player and the Upper Hallway is unvisited:
say “‘Oh! I didn’t expect you here!’ [if the clock is open]Taylor looks at the open clock. ‘Ah, I see.’ [otherwise]Taylor says. [end if][paragraph break]”.
Test me with “Taylor, jump then wave then jump/z/Taylor, go north then go up then go south/open clock/up”.[/code]