source: trunk/game/dialogue/old_man.yaml @ 668

Revision 668, 2.9 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 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 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 module
  • The PyYAML loader has been replaced with a more robust YamlDialogueParser? class (see the 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:, which provides a Python 2.7-like OrderedDict? class for Python versions 2.4-2.6;, which is a simplified command-line option parser for writing scripts as an alternative to argparse and optparse
  • Updated the script to work with the new DialogueEngine?
  • fixes[s:trac, t:269]
1#   This file is part of PARPG.
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.
8#   PARPG is distributed in the hope that it will be useful,
9#   but WITHOUT ANY WARRANTY; without even the implied warranty of
11#   GNU General Public License for more details.
13#   You should have received a copy of the GNU General Public License
14#   along with PARPG.  If not, see <>.
16#   NOTE:  This is not a "real" dialogue file, it is meant to be a template for
17#   Any generic fortified mall (techdemo location) denizen
19NPC_NAME: Old Man
20AVATAR_PATH: gui/icons/crazy_swede.png
21START_SECTION: main_dialogue
23    - ID: main_dialogue
24      SAY: "The old man looks up at you from his chair with a dazed look
25        upon his face.
27        \"...Lucy?\""
28      ACTIONS:
29        - meet: old_man
30      RESPONSES:
31        - REPLY: "Who's Lucy?"
32          GOTO: help_find_lucy
34        - REPLY: "I found your ring."
35          CONDITION: "quest.hasActiveQuest('memories') and
36            pc.inventory.hasItem('RustyWeddingRing')"
37          ACTIONS:
38            - give_stuff:
39                - RustyWeddingRing
40            - complete_quest: memories
41          GOTO: good_memories
43        - REPLY: "I don't have time for your delusions old man!"
44          GOTO: parting_shot
46    - ID: good_memories
47      SAY: "An intense expression of joy spreads across the old man's face
48        as you hand him the rusty wedding ring. He tries to mouth a
49        word of thanks but is so overcome that no words come out. The old
50        man begins caressing the ring, oblivious to the decay and rot of
51        the world around him."
52      RESPONSE:
53        - REPLY: "[Walk away.]"
54          GOTO: end
56    - ID: help_find_lucy
57      SAY: "The old man looks at you expectedly.
59        \"Can you help me find Lucy?\""
60      RESPONSES:
61        - REPLY: "Where is Lucy?"
62          GOTO: rusted_lockbox
64        - REPLY: "I have better things to do."
65          GOTO: parting_shot
67    - ID: rusted_lockbox
68      SAY: "The old man gazes over his shoulder to the far side of the
69        shanty where a metal lockbox rests on the floor.
71        \"Can't open it any more... rusted...\""
72      RESPONSES:
73        - REPLY: "I'll see what I can do."
74          ACTIONS:
75            - start_quest: memories
76          GOTO: parting_shot
78        - REPLY: "Fix your own problems, old man!"
79          ACTIONS:
80          GOTO: parting_shot
82    - ID: parting_shot
83      SAY: "The old man sighs and begins to stare remorsefully at the
84        smouldering embers in the fireplace."
85      RESPONSES:
86        - REPLY: "[Walk away.]"
87          GOTO: end
Note: See TracBrowser for help on using the repository browser.