| Autor |
Nachricht |
| < Nachfragen |
|
Verfasst am:
Fr, 10 Dez 2010 - 10:03
|
|
|
Wasserträger

Anmeldungsdatum: 02.11.2010
Beiträge: 90
Wohnort: Schkeuditz
|
|
Wie kann man denn den Parser dazu bringen, nach einer Eingabe nachzufragen?
Ich würde gern so etwas machen:
>wirf Vase
Willst Du wirklich die Vase zerstören?
>ja
Krach! Bumm!
Ich würde jetzt eine instead-Rule schreiben, die eine globale Variable setzt. Wenn diese Variable gesetzt ist, prüfe ich dann alle Eingaben. Das erscheint mir aber irgendwie unschön. Da gibt's doch sicher auch etwas fertiges, oder? |
|
|
|
 |
|
Verfasst am:
Fr, 10 Dez 2010 - 10:16
|
|
|
Abenteurer

Anmeldungsdatum: 03.09.2009
Beiträge: 453
Wohnort: Cham
|
|
Ich würde es so machen:
| Code: |
"Warum" by Mikawa
Include German by Team Gerx.
Glaspalast is room. "Du befindest dich in einem riesigen Palast aus Glas."
The Vase is female thing in Glaspalast. "Hier steht eine zerbrechliche Vase."
The Scherben is a plural-named thing.
A person can be questioned.
Before attacking the vase:
say "Willst du die Vase wirklich zerbrechen?";
now the player is questioned;
stop the action.
Instead of doing something other than saying yes or saying no when the player is questioned:
say "Antworte zuerst mit ja oder nein."
Instead of saying no when the player is questioned:
say "Eine weise Entscheidung.";
now the player is not questioned.
Instead saying yes when the player is questioned:
say "Du zerbrichst die Vase in tausend Scherben.";
move the Scherben to the Glaspalast;
remove the Vase from play;
now the player is not questioned.
|
-- MI |
|
|
|
 |
|
Verfasst am:
Do, 16 Dez 2010 - 12:04
|
|
|
Wasserträger

Anmeldungsdatum: 02.11.2010
Beiträge: 90
Wohnort: Schkeuditz
|
|
Ich habe es gefunden.
| Code: | Before attacking the vase:
say "Willst Du die vase wirklich zerstören?";
if the player consents:
coninue the action;
otherwise:
say "Eine weise Entscheidung.";
stop the action. |
|
|
|
|
 |
|
Verfasst am:
Do, 16 Dez 2010 - 12:05
|
|
|
Abenteurer

Anmeldungsdatum: 03.09.2009
Beiträge: 453
Wohnort: Cham
|
|
Ok, das ist tatsächlich sehr kurz.
Man lernt nie aus.
-- MI |
|
|
|
 |
|
Verfasst am:
Do, 16 Dez 2010 - 14:57
|
|
|
Abenteurer

Anmeldungsdatum: 03.09.2009
Beiträge: 453
Wohnort: Cham
|
|
Ok, der code schaut jetzt so aus:
| Code: |
"Warum" by Mikawa
Include German by Team Gerx.
Glaspalast is room. "Du befindest dich in einem riesigen Palast aus Glas."
The Vase is female thing in Glaspalast. "Hier steht eine zerbrechliche Vase."
The Scherben is a plural-named thing.
Instead attacking the vase:
say "Willst du die Vase wirklich zerbrechen?";
if the player consents:
say "Du zerbrichst die Vase in tausend Scherben.";
move the Scherben to the Glaspalast;
remove the Vase from play;
rule succeeds;
otherwise:
say "Eine weise Entscheidung.";
stop the action.
|
-- MI |
|
|
|
 |
|