Hello! I’m writing my first IF in Inform, and I’m having trouble with a “riddle” section I’m trying to write using Michael Callaghan’s “Questions” extension. (I’ll take this over to the Extensions forum if it’d be more appropriate there, but I’m assuming at the moment that this has an easy solution in normal Inform language that I just don’t know yet.)
Here’s a sample (actual riddles substituted for generic):
[code]Introduction is a scene. Introduction begins when play begins. Stage is a number that varies. Introduction ends when stage is 4.
When introduction begins:
now stage is 1;
follow the stage1 rule.
Every turn when stage is 1 (this is the stage1 rule):
now current prompt is "What walks on four legs in the morning, two in the day, and three in the evening?
";
now current question is “”;
now punctuation removal is true;
ask a closed question, in text mode.
Every turn when stage is 2:
now current prompt is "30 white horses on a red hill: first they champ, then they stamp, then they stand still.
";
now current question is “”;
now punctuation removal is true;
ask a closed question, in text mode.
Every turn when stage is 3:
now current prompt is "He who makes it does not need it. He who uses it does not know it.
";
now current question is “”;
now punctuation removal is true;
ask a closed question, in text mode.
A text question rule (this is the riddle rule):
if stage is 1:
if the current answer is “man”:
now stage is 2;
exit;
otherwise:
do nothing;
otherwise if stage is 2:
if the current answer is “teeth”:
now stage is 3;
exit;
otherwise:
do nothing;
otherwise if stage is 3:
if the current answer is “coffin”:
say “You win!”;
now stage is 4;
exit;
otherwise:
do nothing.
[/code]
Currently, anything other than the correct answer just spits out the prompt again, as it should, but when the player inputs the correct answer, the game tries to parse it as a command before providing the next prompt, like so.
What do I need to do to suppress the parser’s attempt to read the riddle answer as a command? I’ve already tried including “do nothing” and “stop action” in the riddle rule - am I not putting them in the right place? Do I need to create separate rules for the three riddles? I’ve also tried instructing the parser to follow the stage2 rule (named as stage2 rule when I was trying it) but no dice.
Thank you in advance!
(This takes place in empty space, as I’ve instructed the parser to suppress the room descriptions and banner while the introduction is happening, and then to have the “overture” once the riddles are answered. Currently having problems making that happen successfully, but I’ll address that later )