I don’t think there’s a way to check if an event is scheduled. One thing you can do is set a flag that says that the trigger has been set, and then key a say phrase to that:
[code]The ruined hall is a room. “He had a clear view of the room. Bare and barren.”
There is a tapestry in the ruined hall. “Bare, barren, except for the bit of golden tapestry.”
Chun awakened is a truth state that varies.
Instead of taking the tapestry for the first time:
say “He stepped forward and swiftly jerked the tapestry down from the wall.[paragraph break]And behind was Chun the Unavoidable.”;
now Chun awakened is true;
the inevitable occurs in eight turns from now.
Every turn when Chun awakened is true: say “[one of]He turned on paralyzed legs and they were leaden, like legs in a dream which refused to run.[or]He dropped out of the wall and advanced. Over his shiny black back he wore a robe of eyeballs threaded on silk.[or]He sprang, he soared. The tips of his toes scarcely touched the ground. And behind came Chun, running like a dog.[or]He sped along the crest of a wall and sprang a great gap to a shattered fountain. Behind came Chun.[or]He darted up a narrow alley, climbed over a pile of refuse, over a roof, down into a court. Behind came Chun.[or]He sped down a wide avenue lined with a few stunted old cypress trees, and he heard Chun close at his heels.[or]He felt a stir behind him, a breath of air.[or][stopping]”.
At the time when the inevitable occurs:
end the story saying “At his elbow a voice said, ‘I am Chun the Unavoidable.’”[/code]
Althooough it might be better not to have two separate mechanisms, one to print the messages and one to cause the player’s doom. If you try my program you’ll notice that I run out of messages before Chun shows up.
Another way to handle the whole thing might be to make a variable that’s a countdown timer:
[code]The ruined hall is a room. “He had a clear view of the room. Bare and barren.”
There is a tapestry in the ruined hall. “Bare, barren, except for the bit of golden tapestry.”
Turns since Chun awakened is a number that varies.
Instead of taking the tapestry for the first time:
say “He stepped forward and swiftly jerked the tapestry down from the wall.[paragraph break]And behind was Chun the Unavoidable.”;
now turns since Chun awakened is 1.
Every turn when turns since Chun awakened is greater than 0:
if turns since Chun awakened is:
– 1:
say “He turned on paralyzed legs and they were leaden, like legs in a dream which refused to run.”;
– 2:
say “Chun dropped out of the wall and advanced. Over his shiny black back he wore a robe of eyeballs threaded on silk.”;
– 3:
say “He sprang, he soared. The tips of his toes scarcely touched the ground. And behind came Chun, running like a dog.”;
– 4:
say “He sped along the crest of a wall and sprang a great gap to a shattered fountain. Behind came Chun.”;
– 5:
say “He darted up a narrow alley, climbed over a pile of refuse, over a roof, down into a court. Behind came Chun.”;
– 6:
say “He sped down a wide avenue lined with a few stunted old cypress trees, and he heard Chun close at his heels.”;
– 7:
say “He felt a stir behind him, a breath of air.”;
– 8:
end the story saying “At his elbow a voice said, ‘I am Chun the Unavoidable.’”;
increment turns since Chun awakened.
[/code]
(Check out §11.8 of the documentation to see how the – syntax works. And, if it makes you feel better as a newcomer, I had to try about five times before I got all the correct punctuation.)
The advantage of this is that it keeps all the code in one place so you can be sure that the turns till doom doesn’t get out of sync with the messages.
Another thing to watch out for you if you use the timed events is to make sure that you don’t accidentally reset the timer. In Draconis’s code you can avoid Chun by taking the tapestry again–this triggers “The inevitable happens eight turns from now” once more, which reschedules the event for eight turns in the future.