Tools:Questedit:Contents: Difference between revisions
Jump to navigation
Jump to search
Asipicabad (talk | contribs) No edit summary |
m Reverted edits by Asipicabad (talk) to last revision by Ksterker |
||
Line 1: | Line 1: | ||
''(Preliminary)'' | ''(Preliminary)'' | ||
== Overview == | == Overview == | ||
<tt>Questedit</tt> is used to create the quest tree that represents all the quests available in the game and the steps required to complete them. The quest tree is necessary for: | |||
* keeping track of the player's progress in the game | * keeping track of the player's progress in the game | ||
Line 24: | Line 16: | ||
== Creating Quest Data File == | == Creating Quest Data File == | ||
Until the completion of the graphical quest editor (of which so far only the user interface designed with [http://glade.gnome.org/ glade] exists), a little Python script exists to create the quest tree from an XML file. The script is called | Until the completion of the graphical quest editor (of which so far only the user interface designed with [http://glade.gnome.org/ glade] exists), a little Python script exists to create the quest tree from an XML file. The script is called <tt>convert_quests.py</tt> and is located in the ''test/'' directory [http://cvs.savannah.nongnu.org/viewcvs/adonthell/test/convert_quests.py?root=adonthell&only_with_tag=HEAD&view=markup]. To use it, run | ||
python convert_quests.py | python convert_quests.py <quest_tree.xml> | ||
The syntax of the XML file is the following: | The syntax of the XML file is the following: | ||
<quests> | |||
<quest name="Quest_1"> | |||
& | <code>Part_1 and (Step_1 or Step_2)</code> | ||
<log> | |||
<on_start> | |||
<topic>Quest 1</topic> | |||
<text>Quest 1 Started</text> | |||
<id>logbook.quest_1a</id> | |||
</on_start> | |||
<on_completion> | |||
<topic>Quest 1</topic> | |||
<text>Quest 1 Completed</text> | |||
<id>logbook.quest_1b</id> | |||
</on_completion> | |||
</log> | |||
<parts> | |||
<quest name="Part_1"> | |||
& | <code>(Step_3 and Step_4) or (Step_4 and Step_5)</code> | ||
<parts> | |||
<quest name="Step_3"/> | |||
<quest name="Step_4"/> | |||
<quest name="Step_5"/> | |||
</parts> | |||
</quest> | |||
<quest name="Step_1"/> | |||
<quest name="Step_2"/> | |||
</parts> | |||
</quest> | |||
</quests> | |||
* '''quests''' is the root of the quest tree. It can contain ''1'' to ''n'' | * '''quests''' is the root of the quest tree. It can contain ''1'' to ''n'' <tt>quest</tt> nodes as its only children. | ||
* '''quest''' nodes represent a single node in the quest tree. They can have one | * '''quest''' nodes represent a single node in the quest tree. They can have one <tt>code</tt>, <tt>log</tt> and <tt>parts</tt> element, either of which is optional. If no <tt>parts</tt> element is given, the node is a leaf of the quest tree. The <tt>name</tt> attribute is the name used to address the quest node from within the engine. | ||
* '''code''', if present, will contain the [[Scripting:Quest Completion Rule|completion rule]], i.e. which combination of child nodes need to be completed in order to complete the quest step represented by this node. It is not allowed in leaf nodes. | * '''code''', if present, will contain the [[Scripting:Quest Completion Rule|completion rule]], i.e. which combination of child nodes need to be completed in order to complete the quest step represented by this node. It is not allowed in leaf nodes. | ||
* '''log''', if present, can be used to specify automatic entries into a log book. It can contain the elements | * '''log''', if present, can be used to specify automatic entries into a log book. It can contain the elements <tt>on_start</tt> and <tt>on_completion</tt>. | ||
* '''on_start''' contains the log entry that is added to the log book when this quest step is started, i.e. when at least one of it's direct childs is completed. Mandatory elements are | * '''on_start''' contains the log entry that is added to the log book when this quest step is started, i.e. when at least one of it's direct childs is completed. Mandatory elements are <tt>topic</tt>, <tt>text</tt> and <tt>id</tt>. | ||
* '''on_completion''' contains the log entry that is added to the log book when this quest is completed, i.e. when either all child quests or those denoted by the completion rule are completed. Mandatory elements are | * '''on_completion''' contains the log entry that is added to the log book when this quest is completed, i.e. when either all child quests or those denoted by the completion rule are completed. Mandatory elements are <tt>topic</tt>, <tt>text</tt> and <tt>id</tt>. | ||
* '''topic''' is the heading that is displayed in the log book above each entry. | * '''topic''' is the heading that is displayed in the log book above each entry. | ||
* '''text''' is the actual text for the log entry. | * '''text''' is the actual text for the log entry. | ||
* '''id''' is a unique identifier for each log book entry. | * '''id''' is a unique identifier for each log book entry. | ||
* '''parts''', if present contains ''1'' to ''n'' | * '''parts''', if present contains ''1'' to ''n'' <tt>quest</tt> nodes, which further divide the current quest part into more steps. | ||
[[Category:Questedit]] | [[Category:Questedit]] |
Revision as of 18:13, 27 November 2010
(Preliminary)
Overview
Questedit is used to create the quest tree that represents all the quests available in the game and the steps required to complete them. The quest tree is necessary for:
- keeping track of the player's progress in the game
- conditionals in dialogues, based on quest completion
- automatic entry creation in the log book.
- triggering quest-related events
Contents
Creating Quest Data File
Until the completion of the graphical quest editor (of which so far only the user interface designed with glade exists), a little Python script exists to create the quest tree from an XML file. The script is called convert_quests.py and is located in the test/ directory [1]. To use it, run
python convert_quests.py <quest_tree.xml>
The syntax of the XML file is the following:
<quests> <quest name="Quest_1"> <code>Part_1 and (Step_1 or Step_2)</code> <log> <on_start> <topic>Quest 1</topic> <text>Quest 1 Started</text> <id>logbook.quest_1a</id> </on_start> <on_completion> <topic>Quest 1</topic> <text>Quest 1 Completed</text> <id>logbook.quest_1b</id> </on_completion> </log> <parts> <quest name="Part_1"> <code>(Step_3 and Step_4) or (Step_4 and Step_5)</code> <parts> <quest name="Step_3"/> <quest name="Step_4"/> <quest name="Step_5"/> </parts> </quest> <quest name="Step_1"/> <quest name="Step_2"/> </parts> </quest> </quests>
- quests is the root of the quest tree. It can contain 1 to n quest nodes as its only children.
- quest nodes represent a single node in the quest tree. They can have one code, log and parts element, either of which is optional. If no parts element is given, the node is a leaf of the quest tree. The name attribute is the name used to address the quest node from within the engine.
- code, if present, will contain the completion rule, i.e. which combination of child nodes need to be completed in order to complete the quest step represented by this node. It is not allowed in leaf nodes.
- log, if present, can be used to specify automatic entries into a log book. It can contain the elements on_start and on_completion.
- on_start contains the log entry that is added to the log book when this quest step is started, i.e. when at least one of it's direct childs is completed. Mandatory elements are topic, text and id.
- on_completion contains the log entry that is added to the log book when this quest is completed, i.e. when either all child quests or those denoted by the completion rule are completed. Mandatory elements are topic, text and id.
- topic is the heading that is displayed in the log book above each entry.
- text is the actual text for the log entry.
- id is a unique identifier for each log book entry.
- parts, if present contains 1 to n quest nodes, which further divide the current quest part into more steps.