German Reactable Quips by Michael Martin translated_by frob begins here. "Gespräche mit NPC auf Grundlage von Tabellen; außerdem Regeln, die auf einzelne Gesprächsthemen reagieren." Include German by Banbury & Christian Bluemke. [Initial German Version based on english Version 9] Section 1 - Quips A quip is a kind of value. The quips are defined by the Table of Quip Texts. The specification of quip is "Represents a line or exchange of dialogue, which may be linked to other quips via followups or linked to ask or tell responses." The current quip is a quip that varies. The current quip is quip_null. The pertinent quip is a quip that varies. The pertinent quip is quip_null. A person has a quip called default ask quip. The default ask quip of a person is usually quip_null. A person has a quip called default tell quip. The default tell quip of a person is usually quip_dtell. Quipping is an activity. The last for quipping rule (this is the basic quipping rule): say "[quiptext of the current quip][paragraph break]"; To deliver the (q - quip) quip: change the current quip to q; carry out the quipping activity; let rq_index be 0; repeat through Table of Quip Followups: if the current quip is the quip entry: increase rq_index by 1; say "[bracket][rq_index][close bracket] [option entry][line break]"; if rq_index is not 0: change the pertinent quip to the current quip; change the number understood to 0; otherwise: change the pertinent quip to quip_null. To nest the (q - quip) quip: let x be the current quip; change the current quip to q; carry out the quipping activity; change the current quip to x. To decide whether RQ is active: If the pertinent quip is quip_null, no; yes. Requesting a recap is an action out of world applying to nothing. Understand "Auswahl" or "wie bitte" as requesting a recap when RQ is active. Carry out requesting a recap (this is the perform recap rule): let rq_index be 0; repeat through Table of Quip Followups: if the quip entry is the pertinent quip: increase rq_index by 1; if rq_index is 1, say "Du hast folgende Möglichkeiten zur Auswahl:[paragraph break]"; say "[bracket][rq_index][close bracket] [option entry][line break]"; if rq_index is 0, say "[bracket]Du hast im Augenblick nichts zu sagen.[close bracket][paragraph break]". Responding with is an action applying to one number. Understand "[number]" or "sag [number]" as responding with when RQ is active. [This rule Can't Run, as the Understand commands stand..] [Carry out responding with when the pertinent quip is quip_null (this is the can't talk out of conversations rule): say "[bracket]BUG: Responded despite there being no conversation options available![close bracket]".] [Likewise, this test is redundant.] Carry out responding with [when the pertinent quip is not quip_null] (this is the perform responding rule): let rq_index be 0; repeat through Table of Quip Followups: if the quip entry is the pertinent quip: increase rq_index by 1; if rq_index is the number understood: deliver the result entry quip; rule succeeds; say "[bracket]Du hast Möglichkeiten von 1-[rq_index] zur Auswahl. Gib AUSWAHL ein, um die Auswahlmöglichkeiten nochmal anzuzeigen.[close bracket][paragraph break]". Before doing something [other than requesting a recap or responding with] when the pertinent quip is not quip_null (this is the force conversation rule): unless the current action is requesting a recap or the current action is responding with: say "[bracket]Du musst etwas tun, damit es weitergeht. Gib eine Zahl ein oder tippe AUSWAHL um die Auswahlmöglichkeiten nochmal anzuzeigen.[close bracket][paragraph break]"; stop the action. The force conversation rule is listed first in the before rules. A procedural rule when RQ is active: ignore the every turn stage rule; ignore the timed events rule; ignore the advance time rule; ignore the update chronological records rule. Section 2 - Hitword-based conversation Instead of asking someone about something: repeat through Table of Ask Results: if the noun is the NPC entry: if the topic understood includes topic entry: deliver the result entry quip; rule succeeds; if the noun is a person: say "[quiptext of the default ask quip of the noun][paragraph break]"; rule succeeds; say "[bracket]BUG: Managed to talk to [dem noun], who is not a person![close bracket]". Telling someone about something is reactable quips speech. Answering someone that something is reactable quips speech. Instead of reactable quips speech: repeat through Table of Tell Results: if the noun is the NPC entry: if the topic understood includes topic entry: deliver the result entry quip; rule succeeds; if the noun is a person: say "[quiptext of the default tell quip of the noun][paragraph break]"; rule succeeds; say "[bracket]BUG: Managed to talk to [dem noun], who is not a person![close bracket][paragraph break]" Section 3 - Quip Tables Table of Quip Texts quip quiptext quip_null "Dazu fällt [dir] nichts ein." quip_dtell "Dazu fällt [dir] nichts ein." Table of Quip Followups quip option result a quip text a quip Table of Ask Results NPC topic result a person a topic a quip Table of Tell Results NPC topic result a person a topic a quip Section 4 - Straightening out the parser To rq_fixerror: (- etype = STUCK_PE; -) Before printing a parser error when RQ is active and the parser error is didn't understand that number: rq_fixerror. German Reactable Quips ends here. ---- DOCUMENTATION ---- German Reactable Quips stellt ein tabellengestütztes System für Gespräche mit NPC zur Verfügung und erlaubt eine Mischung aus dem traditionellen ask/tell-System und Auswahlmenüs. Das funktioniert typischerweise so: Die Spielerfigur beginnt ein Gespräch damit, dass sie einem NPC etwas über einen text (topic) fragt oder etwas mitteilt. Der NPC antwortet darauf. NPC können aber Dinge tun oder sagen, die bestimmte Reaktionen der Spielerfigur vorgeben -- der Spieler muss dann aus einem Menü "seine" Reaktion auswählen. Unabhängig davon ist es mit dieser Erweiterung möglich, ein reines ask/tell-System zu implementieren. Das grundlegende Konzept in dieser Erweiterung ist das "quip". Quips sind keine Objekte, sondern (Text-)Werte, die als Indices in einer Quip-Tabelle dienen. Wer diese Extension verwenden will, muss immer die "Table of Quip Texts" nach seinen Bedürfnissen ausgefüllt bereitstellen. Nur der Tabellenkopf ist bereits definiert, so dass eine Fortsetzung geschrieben werden muss, etwa so: Table of Quip Texts (continued) quip quiptext greeting "'Grüezi miteinand!'" discuss weather "'Sieht nach Regen aus, oder ich will Helmut Kohl hei[ß]en.'" standoff "'Kümmere [dich] um [deinen] eigenen Kram, ja?'" Wer ein ask/tell-Modell benutzen will, muss nun zwei weitere Tabellen ausfüllen, die "Table of Ask Results" und die "Table of Tell Results". Diese beiden Tabellen verbinden NPC und die erkannten Gesprächsthemen (topic understood) mit quips. Jeder ask/tell/answer-Befehl wird durch diese Tabellen gedreht, um einzur Eingabe des Spielers passendes quip zu finden. Die Einträge unter topic können einfacher Text, aber auch einfache Textmuster sein, etwa so wie bei "understanding commands as actions". Ist irgendeines der eingetragenen Muster in dem vom Parser erkannten text (topic understood) enthalten, gibt es einen Treffer, denn der Vergleich erfolgt mit dem Operator "includes" (siehe Manual Kapitel 17.31, Example 233: "Complimentary Peanuts"). Das Ergebnis in der Spalte "result" ist wieder ein quip. Table of Ask Results (continued) NPC topic result Bob "wetter" or "schoener tag" or "sonne/regen/hagel/schnee" discuss weather Table of Tell Results (continued) NPC topic result Bob "moin/hallo" greeting Es gibt für jede Person ein "default ask quip" und ein "default tell quip", die dazu dienen, eine Standardantwort für nicht erkannte Themen vorzugeben. Das sind allgemein die ersten beiden Einträge in der "Table of Quip Texts", beide vorbelegt mit: "Dazu fällt [dir] nichts ein." Diese Standardtexte können allgemein geändert werden wie folgt: change the quiptext entry of row 1 of the Table of Quip Texts to "Das ist eine neue Standardantwort, wenn man einen NPC nach einem nicht bekannten Thema fragt." change the quiptext entry of row 2 of the Table of Quip Texts to "Das ist eine neue Standardantwort, wenn man einem NPC ein nicht erkanntes Thema erzählt oder antwortet." Quips können mit "deliver the ... quip" auch direkt abgerufen werden: Instead of examining Bob, deliver the greeting quip. Quips können in Regeln (rules) verwendet werden; sie sind aber keine Objekte (things) und können nicht als "something" oder "anything" gelten. Statt dessen können Regelwerke (Rulebooks) für das Quipping erstellt werden: Before quipping when the current quip is greeting: say "Du gehst hin und sagst 'Grü[ß] Gott'." Quips können eine Auswahlantwort erfordern. Mögliche Antworten (und die quips, zu denen sie führen), stehen dann in der "Table of Quip Followups": Table of Quip Followups (continued) quip option result greeting "Mach ein wenig Smalltalk" discuss weather greeting "Werde dienstlich" standoff Steht ein quip in der "table of quip followups" geht das Spiel nicht weiter, bis eine Auswahl getroffen worden ist. Steht ein quip nicht in der Tabelle, wird der dazugehörende Text ausgegeben (das quip wird ausgeliefert, "delivered") und der Spielablauf geht normal (ohne Auswahlmenu) weiter. Um aus dem Programm zu prüfen, ob eine Auswahl getroffen werden muss oder nicht, steht folgende Abfragebedingung zur Verfügung: if RQ is active Example: ** Der Affe Sehr Possierlich Ist - Matching von Schlüsselworten in einem Satz oder Matching ganzer Sätze und quips mit Regeln (rules). *:"Der Affe Sehr Possierlich Ist" Include German Reactable Quips by Michael Martin translated_by frob. Use no scoring and capitalized Du.. Horatios Haus is a room. A man called Horatio is here. "Dein exzentrischer Nachbar Horatio ist hier, er trägt ein T-Shirt mit der Aufschrift 'ERZÄHL MIR VON DIR.'". Table of Quip Texts (continued) quip quiptext suggest monkeys "'Schön, schön. Aber -- habe ich [dir] schon erzählt, wie toll Affen sind? Frage mich doch was über Affen!'" yay monkeys "'Affen sind einfach toll! Jeder mit [italic type]etwas[roman type] Geist liebt Affen. Wusstest [du], dass es Menschen waren, die den 'Blauen Bock' auf ein nichts ahnendes Universum losgelassen haben?.'" hate aybabtu "Horatio bricht in unirdisches Heulen aus: 'AIIIEEEEE! NEIN! Sprich es nicht aus! Nicht nochmal! Ich hasse [dich]! Du musst tot. tot-tot!!!!'[paragraph break]Er springt [dir] an die Kehle, ringt [dich] zu Boden und würgt [dich] bis zur Bewusstlosigkeit. Du bist reif für den Sensenmann..." apes ok "'Ja, ok, aber mir geht es um AFFEN.'" humans lousy "'Menschen sind im allgemeinen weniger hoch entwickelte Wesen als Affen.'" kindred spirit "'Endlich ein verwandter Geist! Meine Suche ist zu Ende. Nimm diesen Aktenkoffer als Zeichen meiner Verehrung!'[paragraph break]Er gibt [dir] einen Aktenkoffer voll goldener Tscherwonzen." speciesist "'Ach, du bist nur ein menschlicher Chauvinist, wie alle.'" Table of Quip Followups (continued) quip option result humans lousy "Stimme Horatio zu" kindred spirit humans lousy "Zucke die Schultern" speciesist Table of Ask Results (continued) NPC topic result Horatio "affen" yay monkeys Horatio "lemuren/meerkatzen/gibbons/orang-utangs/bonobos/gorillas" apes ok Horatio "menschen/leute/du/ich/dich/mich/mir/selbst" humans lousy Horatio "Apfel/Aepfel" or "Apfelwein/Aeppelwei/Bembel" or "Heinz Schenk" or "Zum/Der/dem/den blaue/blauen Bock" hate aybabtu Table of Tell Results (continued) NPC topic result Horatio "selbst/ich/mich/mir/dich/dir" suggest monkeys After quipping when the current quip is hate aybabtu: end the game saying "Du hattest keine Chance, das zu überleben. Bis zum nächsten Mal...". After quipping when the current quip is kindred spirit: end the game in victory. test winning with "Frage Horatio nach Menschen / 3 / 1". test me with "Erzähle Horatio von mir / frage horatio ob affen toll sind / frage horatio über menschen / e / auswahl / 2 / frage horatio nach gibbons / frage horatio nach Apfelwein".