2012-10-12 11 views
8

Chcę tylko poprosić użytkownika o linię tekstu w środku akcji. Efekt powinien wyglądać następująco:Jak mogę odczytać linię wprowadzania w Inform 7?

> north 

The robot steps in front of you as you approach the gate. 
"PAASSWAAAAWRD!!" it bellows. 

Enter the password: _ 

W tym momencie gra powinna się zatrzymać i pozwolić graczowi na odgadnięcie hasła. Załóżmy na przykład, myślę, „baraszkować”, który nie jest hasło:

Enter the password: fribble 

"WRONG PASSWAAARD!" roars the robot. "CHECK CAPS LAAAWWWWK!" 

> 

Zachowanie chcę jest podobna do if the player consents, ale chcę całą linię wejścia, a nie tylko tak lub nie.

Odpowiedz

11

Inform oferuje żadnych łatwy sposób to zrobić, choć może być w stanie dostać się do prymitywów klawiszowych przez upuszczenie aby poinformować 6.

Jednak jest to możliwe, aby osiągnąć pożądany efekt:

The Loading Zone is a room. "Concrete with yellow stripes. The Hold is north." 
The robot is an animal in the Loading Zone. "However, a robot the size of an Arcturan megaladon guards the way." 

North of the Loading Zone is the Hold. 

Instead of going north from the Loading Zone: 
    say "The robot steps in front of you as you approach the gate. 'PAASSWAAAAWRD!!' it bellows."; 
    now the command prompt is "Enter password: ". 

After reading a command when the command prompt is "Enter password: ": 
    if the player's command matches "xyzzy": 
     say "The robot folds itself up into a cube to let you pass."; 
     move the player to the Hold; 
    otherwise: 
     say "'WRONG PASSWAAARD!' roars the robot. 'CHECK CAPS LAAAWWWWK!'"; 
    now the command prompt is ">"; 
    reject the player's command. 

Myślę, że ten rodzaj rzeczy jest uważany za słabą rozgrywkę: zmusza gracza do odgadnięcia, co niweczy złudzenie gracza pod względem kontroli i wyboru. Im bardziej konwencjonalny sposób byłoby wymagać od gracza powiedzieć hasło:

The Loading Zone is a room. "Concrete with yellow stripes. The Hold is north." 
The robot is an animal in the Loading Zone. The robot is either awake or asleep. The robot is awake. "[if awake]However, a robot the size of an Arcturan megaladon guards the way.[otherwise]A cube of metal the size of an Arctural megaladon snores loudly.[end if]". 
North of the Loading Zone is the Hold. 

Instead of going north from the Loading Zone when the robot is awake: 
    say "The robot steps in front of you as you approach the gate. 'PAASSWAAAAWRD!!' it bellows." 

Instead of answering the robot that some text: 
    if the topic understood matches "xyzzy": 
     say "The robot folds itself up into a cube to let you pass."; 
     now the robot is asleep; 
    otherwise: 
     say "'WRONG PASSWAAARD!' roars the robot. 'CHECK CAPS LAAAWWWWK!'" 

Komendy powiedzieć xyzzy i odpowiedź xyzzy i robota xyzzy i powiedzieć xyzzy do robota będzie wszystko praca.

3

Przedłużenie Pytania udzielone przez Michaela Callaghana pomogą w tym. Zauważ, że możesz nie być w stanie rzetelnie przetestować wielkość liter wejściowych.

Powiązane problemy