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

Revision 668, 3.7 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: Anyone
17AVATAR_PATH: gui/icons/npc.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "Hello.  How can I help you?"
22    RESPONSES:
23    -   REPLY: "I'm looking for stuff to make beer with "
24        CONDITION: "quest.hasActiveQuest('beer') and not\
25           \ quest.hasFinishedQuest('beer') and\
26           \ quest['beer'].isGoalValue('beer_instructions')"
27        GOTO: help_beer
28       
29    -   REPLY: "I'm the beer savior, remember?"
30        CONDITION: "quest['beer'].getValue('beer_quality') >= 1"
31        GOTO: gratitude
32       
33    -   REPLY: "I'm looking for Pekko, you seen him?"
34        CONDITION: "quest.hasActiveQuest('fedex') and not\
35           \ quest.hasFinishedQuest('fedex') and not\
36           \ quest['fedex'].isGoalValue('found_pekko')"
37        GOTO: help_fedex
38       
39    -   REPLY: "Whoa!  It talks!  Never mind"
40        GOTO: end
41       
42-   ID: help_beer
43    SAY: "I am always happy to give intimate details of our home to strangers,\
44       \ shoot!"
45    RESPONSES:
46    -   REPLY: "Where do you folks get water from.  The more pure, the better."
47        GOTO: help_water
48       
49    -   REPLY: "Some kind of grain, or fruit or something."
50        GOTO: help_grain
51       
52    -   REPLY: "I'm really looking for some brewer's yeast."
53        GOTO: help_yeast
54       
55    -   REPLY: "I need a pot to cook the mash in."
56        GOTO: help_pot
57       
58    -   REPLY: "It would be great if I had some bottles to put the brew in!"
59        GOTO: help_bottles
60       
61    -   REPLY: "I think I can handle it from here."
62        GOTO: back
63       
64-   ID: help_water
65    SAY: "Oh, that is the one thing we have plenty of.  We have an old tanker\
66       \ trunk that we shovel the snow in and melt it.  You can see it from up\
67       \ here, but you have to go downstairs to tap it.  But the water's been\
68       \ tasting a little funny lately."
69    RESPONSES:
70    -   REPLY: "Great, that's a huge help."
71        GOTO: back
72       
73-   ID: help_grain
74    SAY: "You could try the farm, and there should be some food in the\
75       \ storerooms"
76    RESPONSES:
77    -   REPLY: "Thanks, I'll try that."
78        GOTO: back
79       
80-   ID: help_yeast
81    SAY: "You got me.  I wonder if there is even any left at all."
82    RESPONSES:
83    -   REPLY: "Someone must have some!"
84        GOTO: back
85       
86-   ID: help_pot
87    SAY: "Did you try the kitchen?  Or the storerooms?"
88    RESPONSES:
89    -   REPLY: "Uh, yeah.  I guess that was obvious."
90        GOTO: back
91       
92-   ID: help_bottles
93    SAY: "All the random junk is downstairs in old parking lot.  We have our\
94       \ own little junkyard."
95    RESPONSES:
96    -   REPLY: "Oooh... there is probably lots of good stuff down there."
97        GOTO: back
98       
99-   ID: help_fedex
100    SAY: "Pekko... I thought he was out scouting?  Did you try the Inn?"
101    RESPONSES:
102    -   REPLY: "OK, the Inn, thanks."
103        GOTO: back
104       
105-   ID: gratitude
106    SAY: "Well aren't you just a thick slice of awesome."
107    RESPONSES:
108    -   REPLY: "I try, I try."
109        GOTO: main_dialog
110       
111...
Note: See TracBrowser for help on using the repository browser.