source: trunk/game/dialogue/ma.yaml @ 684

Revision 668, 4.2 KB checked in by technomage, 9 years ago (diff)

Ticket #269: Patch by Technomage.

  • Working prototype of the redesigned DialogueEngine? for the upcoming Techdemo2 release; major redesign of the existing DialogueEngine? and YAML dialogue file syntax.
  • Moved the redesigned DialogueEngine? class to the more descriptive dialogueengine.py module; the DialogueEngine? is now a singleton object and provides all functionality through class methods and attributes, and thus should not be instantiated
  • Abstracted the data structures used to store dialogue data away from the YAML data structures; the relevant classes are stored in the dialogue.py module
  • Abstracted the dialogue commands/actions from the DialogueEngine? code to make modifications and maintenance of dialogue logic easier; the relevant classes are stored in the dialogueactions.py module
  • The PyYAML loader has been replaced with a more robust YamlDialogueParser? class (see the dialogueparsers.py module) that interfaces with the new dialogue data structure classes and supports the new YAML dialogue file syntax; an OldYamlDialogueParser? class is provided to support reading the old Techdemo1 syntax
  • Removed the existing dialogue validator; runtime dialogue validation is not yet implemented
  • Added the convert_dialogue script, which converts dialogue files in the old Techdemo1 format to the new format; all existing dialogue files have been converted to work with the new parser
  • Added two support modules for the new classes and script: ordereddict.py, which provides a Python 2.7-like OrderedDict? class for Python versions 2.4-2.6; optionparser.py, which is a simplified command-line option parser for writing scripts as an alternative to argparse and optparse
  • Updated the dialogue_demo.py script to work with the new DialogueEngine?
  • fixes[s:trac, t:269]
  • Property svn:eol-style set to native
Line 
1#   This file is part of PARPG.
2
3#   PARPG is free software: you can redistribute it and/or modify
4#   it under the terms of the GNU General Public License as published by
5#   the Free Software Foundation, either version 3 of the License, or
6#   (at your option) any later version.
7
8#   PARPG is distributed in the hope that it will be useful,
9#   but WITHOUT ANY WARRANTY; without even the implied warranty of
10#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11#   GNU General Public License for more details.
12
13#   You should have received a copy of the GNU General Public License
14#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>.
15---
16NPC_NAME: Ma Niitty
17AVATAR_PATH: gui/icons/ma.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "Why hello there... I don't recognize your face..."
22    ACTIONS:
23    -   meet:
24        - ma
25    RESPONSES:
26    -   REPLY: "I am trying to make beer, can you help me?"
27        CONDITION: "quest.hasActiveQuest('beer') and not\
28           \ quest.hasFinishedQuest('beer') and\
29           \ quest['beer'].isGoalValue('beer_instructions')"
30        GOTO: help_beer
31       
32    -   REPLY: "I'm looking for Pekko, you seen him?"
33        CONDITION: "quest.hasActiveQuest('fedex') and not\
34           \ quest.hasFinishedQuest('fedex') and not\
35           \ quest['fedex'].isGoalValue('found_pekko')"
36        GOTO: help_fedex
37       
38    -   REPLY: "I'm new here, I don't believe we've been introduced?"
39        GOTO: introduce_ma
40       
41    -   REPLY: "Do you need a light?"
42        GOTO: light_cigarette
43       
44    -   REPLY: "I am sorry to tell you... Pekko's dead"
45        CONDITION: "quest['fedex'].isGoalValue('found_pekko')"
46        GOTO: dead_pekko
47       
48    -   REPLY: "Sorry to bother you, I didn't realize you were awake"
49        GOTO: end
50       
51-   ID: dead_pekko
52    SAY: "Oh, don't be silly.  I'm sure he is just off in the wilderness again"
53    RESPONSES:
54    -   REPLY: "No, really, I found the body"
55        GOTO: found_body
56       
57    -   REPLY: "Oh, maybe you are right. I'll keep looking.  You take care\
58           \ now."
59        GOTO: end
60       
61-   ID: found_body
62    SAY: "Well, I am sure you are mistaken."
63    RESPONSES:
64    -   REPLY: "You must believe me, I'm quite sure."
65        GOTO: dead_pekko
66       
67    -   REPLY: "I suppose I might be."
68        GOTO: end
69       
70-   ID: help_beer
71    SAY: "Beer?  Why don't you just get it at the supermarket?"
72    RESPONSES:
73    -   REPLY: "I don't think... Oh, never mind."
74        GOTO: back
75       
76-   ID: introduce_ma
77    SAY: "My name's Aino.  But everyone calls me 'Ma'.  Kimmo and Pekko are my\
78       \ boys. Good boys, both of 'em"
79    RESPONSES:
80    -   REPLY: "Oh, tell me about your son, Kimmo."
81        GOTO: talk_kimmo
82       
83    -   REPLY: "Oh, tell me about your son, Pekko."
84        GOTO: talk_pekko
85       
86    -   REPLY: "You must be very proud."
87        GOTO: main_dialog
88       
89-   ID: talk_kimmo
90    SAY: "Ah, Kimmo.  He is done such a good job here.  Everyone looks up to\
91       \ him, don't you think?  He's really a hero"
92    RESPONSES:
93    -   REPLY: "He's a born leader."
94        GOTO: back
95       
96-   ID: talk_pekko
97    SAY: "My Pekko.  Always the dreamer.  He spends so much time out in the\
98       \ woods, in his own head... He thinks we should move everyone!  "
99    RESPONSES:
100    -   REPLY: "Why does he want to leave?"
101        GOTO: explain_leaving
102       
103-   ID: explain_leaving
104    SAY: "He doesn't think it's going to be a very Nice Age.  It's just them\
105       \ crazy idea of the week.   Kimmo will keep us safe here."
106    RESPONSES:
107    -   REPLY: "Ah. [you nod understandingly]"
108        GOTO: main_dialog
109       
110-   ID: light_cigarette
111    SAY: "For the cigarette?  No, they last longer this way.  I've had this one\
112       \ for about 4 years now..."
113    RESPONSES:
114    -   REPLY: "Facinating."
115        GOTO: back
116       
117-   ID: help_fedex
118    SAY: "Ah, Pekko.  The apple of my eye.  Do you know where he is?"
119    RESPONSES:
120    -   REPLY: "Well, actually... forget it."
121        GOTO: back
122       
123-   ID: gratitude
124    SAY: "Well aren't you just a thick slice of awesome."
125    RESPONSES:
126    -   REPLY: "I try, I try."
127        GOTO: main_dialog
128       
129...
Note: See TracBrowser for help on using the repository browser.