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

Revision 668, 2.6 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: Cali
17AVATAR_PATH: gui/icons/grifter_temp.png
18START_SECTION: main_dialog
19SECTIONS:
20-   ID: main_dialog
21    SAY: "Hi there stranger.  Buy a gal a drink?"
22    ACTIONS:
23    -   meet:
24        - cali
25    RESPONSES:
26    -   REPLY: "I'm looking for stuff to make beer with. "
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: "My new beer is a great success..."
33        CONDITION: "quest['beer'].getValue('beer_quality') >= 1"
34        GOTO: gratitude
35       
36    -   REPLY: "I'm looking for Pekko, you seen him?"
37        CONDITION: "quest.hasActiveQuest('fedex') and not\
38           \ quest.hasFinishedQuest('fedex') and not\
39           \ quest['fedex'].isGoalValue('found_pekko')"
40        GOTO: help_fedex
41       
42    -   REPLY: "Sorry, I'm broke."
43        GOTO: end
44       
45-   ID: help_beer
46    SAY: "Trying to horn in on old Jacob here, huh?  I wouldn't if I were you."
47    RESPONSES:
48    -   REPLY: "Hey, we all do what we have to.  I'm sure you understand."
49        GOTO: back
50       
51-   ID: help_fedex
52    SAY: "[sigh] The cute one?.  He's in here all the time.  I guess it has\
53       \ been a couple days since I've seen him."
54    RESPONSES:
55    -   REPLY: "Yes, no one has seen him for a couple of days."
56        GOTO: back
57       
58    -   REPLY: "Was Camilla here all night the last time you saw Pekko here?"
59        CONDITION: "quest['fedex'].isGoalValue('drunkard_evidence')"
60        GOTO: check_alibi
61       
62-   ID: check_alibi
63    SAY: "Hmmmm... Yeah, I think so.  She's here almost every night."
64    RESPONSES:
65    -   REPLY: "OK, thanks."
66        GOTO: main_dialog
67       
68-   ID: gratitude
69    SAY: "Huh.  Well, how about that.  You won't forget your friend Cali when\
70       \ you are famous, right?"
71    RESPONSES:
72    -   REPLY: "No way, babe."
73        GOTO: main_dialog
74       
75...
Note: See TracBrowser for help on using the repository browser.