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

Revision 668, 2.1 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: Rasmus
17AVATAR_PATH: gui/icons/farm_boy_temp.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "Hi, I'm Rasmus.  What can I do for 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: "Tell me about the farm"
30        GOTO: describe_farm
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: "Oh, I was looking for Sami."
39        GOTO: end
40       
41-   ID: help_beer
42    SAY: "Not my place to hand out any stuff.  I just work here.  Talk to\
43       \ Manslow."
44    RESPONSES:
45    -   REPLY: "Alright."
46        GOTO: back
47       
48-   ID: help_fedex
49    SAY: "Kimmo's brother?  Nope, he never comes down here, and we basically\
50       \ live here."
51    RESPONSES:
52    -   REPLY: "At least it's warm."
53        GOTO: back
54       
55-   ID: describe_farm
56    SAY: "It was just an empty lot before.  I don't envy the folks who had to\
57       \ break up all this ground."
58    RESPONSES:
59    -   REPLY: "That must have been some effort."
60        GOTO: back
61       
62...
Note: See TracBrowser for help on using the repository browser.