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

Revision 668, 5.3 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: Synnove Niitty
17AVATAR_PATH: gui/icons/synnove.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "Hi there!  I don't recognize you.  Are you new here?"
22    RESPONSES:
23    -   REPLY: "Yes, I am new.  And who are you?"
24        CONDITION: "not pc.met('synnove')"
25        GOTO: meeting
26       
27    -   REPLY: "You don't remember me?  We just talked!"
28        CONDITION: "pc.met('synnove')"
29        GOTO: future_meetings
30       
31    -   REPLY: "I'm looking for stuff to make beer with "
32        CONDITION: "quest.hasActiveQuest('beer') and not\
33           \ quest.hasFinishedQuest('beer') and\
34           \ quest['beer'].isGoalValue('beer_instructions')"
35        GOTO: help_beer
36       
37    -   REPLY: "I'm got my beer made, finally!"
38        CONDITION: "quest['beer'].getValue('beer_quality') >= 1"
39        GOTO: gratitude
40       
41    -   REPLY: "I'm looking for Pekko, you seen him?"
42        CONDITION: "quest.hasActiveQuest('fedex') and not\
43           \ quest.hasFinishedQuest('fedex') and not\
44           \ quest['fedex'].isGoalValue('found_pekko')"
45        GOTO: help_fedex
46       
47    -   REPLY: "Never mind, thought you were someone else."
48        GOTO: end
49       
50-   ID: meeting
51    SAY: "My name's Synnove.  I live here."
52    ACTIONS:
53    -   meet:
54        - synnove
55    RESPONSES:
56    -   REPLY: "Good to meet you.  What do you do around here."
57        GOTO: synnove_job
58       
59    -   REPLY: "Ah."
60        GOTO: back
61       
62-   ID: synnove_job
63    SAY: "Do?"
64    RESPONSES:
65    -   REPLY: "Oh, never mind."
66        GOTO: main_dialog
67       
68-   ID: future_meetings
69    SAY: "Oh, I don't think so.  I would have definitely remembered you if we\
70       \ hadn't met."
71    RESPONSES:
72    -   REPLY: "You would have? But... how ... would... uh.  What?"
73        GOTO: back
74       
75-   ID: help_beer
76    SAY: "Hmmm... beer.  Doesn't it come in bottles?  Anyway, I am always happy\
77       \ to give intimate details of our home to strangers, what are you looking\
78       \ for?"
79    RESPONSES:
80    -   REPLY: "Where do you folks get water from.  The more pure, the better."
81        GOTO: help_water
82       
83    -   REPLY: "Some kind of grain, or fruit or something."
84        GOTO: help_grain
85       
86    -   REPLY: "I'm really looking for some brewer's yeast."
87        GOTO: help_yeast
88       
89    -   REPLY: "I need a pot to cook the mash in."
90        GOTO: help_pot
91       
92    -   REPLY: "It would be great if I had some bottles to put the brew in!"
93        GOTO: help_bottles
94       
95    -   REPLY: "I think I can handle it from here."
96        GOTO: back
97       
98-   ID: help_water
99    SAY: "I would think that you could find water in a water tank."
100    RESPONSES:
101    -   REPLY: "Well, the water has to be pure to make good beer.  Where do you\
102           \ folks keep purified water?"
103        GOTO: expand_water
104       
105    -   REPLY: "Yes, you would think that..."
106        GOTO: back
107       
108-   ID: expand_water
109    SAY: "In the purified water tank?"
110    RESPONSES:
111    -   REPLY: "Never mind."
112        GOTO: help_beer
113       
114-   ID: help_grain
115    SAY: "You mean like stuff to cook with?  That goes in beer?"
116    RESPONSES:
117    -   REPLY: "Yes, the yeast need to eat sugars to make alcohol."
118        GOTO: expand_grain
119       
120    -   REPLY: "You really aren't much help, are you?"
121        GOTO: back
122       
123-   ID: expand_grain
124    SAY: "Oh, I don't think I've seen any sugar in years."
125    RESPONSES:
126    -   REPLY: "It doesn't have to be purified sugar..."
127        GOTO: help_beer
128       
129-   ID: help_yeast
130    SAY: "Oh, Skwisgaar has some.  He talks about it all the time."
131    RESPONSES:
132    -   REPLY: "The wood cutter?  You have conversations with him?  Figures."
133        GOTO: back
134       
135-   ID: help_pot
136    SAY: "Nope, don't know where you can find anything like that.  Don't you\
137       \ have one?"
138    RESPONSES:
139    -   REPLY: "No, if I did, I wouldn't... forget it."
140        GOTO: back
141       
142-   ID: help_bottles
143    SAY: "Oh yeah, like I said!  Bottles!  That's what beer comes in.  Or does\
144       \ it come only in cans now?"
145    RESPONSES:
146    -   REPLY: "You are a strange lady"
147        GOTO: back
148       
149-   ID: help_fedex
150    SAY: "Who's Pekko?  I never heard of him."
151    RESPONSES:
152    -   REPLY: "Kimmo's brother.  You never heard of him?"
153        GOTO: back
154       
155-   ID: gratitude
156    SAY: "Wow, that's great!  But where did you find it?"
157    RESPONSES:
158    -   REPLY: "I made it!"
159        GOTO: make_beer
160       
161-   ID: make_beer
162    SAY: "Oh, you are so silly.  Make beer.  Indeed.  I suppose you think I was\
163       \ born yesterday."
164    RESPONSES:
165    -   REPLY: "Uh, yeah.  You got me.  'Just Kidding'."
166        GOTO: main_dialog
167       
168...
Note: See TracBrowser for help on using the repository browser.