I just want to prompt the user for a line of text in the middle of an action. The effect should be like this:
> north
The robot steps in front of you as you approach the gate.
"PAASSWAAAAWRD!!" it bellows.
Enter the password: _
At this point the game should pause and let the player try to guess the password. For example, suppose I guess “fribble”, which is not the password:
Enter the password: fribble
"WRONG PASSWAAARD!" roars the robot. "CHECK CAPS LAAAWWWWK!"
>
The behavior I want is similar to if the player consents, but I want the whole line of input, not just a yes or no.
Inform offers no easy way to do this, though you might be able to get to the keyboard primitives by dropping to Inform 6.
However it is possible to achieve the desired effect:
I think this sort of thing is considered poor gameplay: it forces the player to guess, which damages the player's illusion of control and choice. The more conventional way would be to require the player to say the password:
The commands say xyzzy and answer xyzzy and robot, xyzzy and say xyzzy to robot will all work.