[Crossfire-wiki] [Crossfire DokuWiki] page changed: user:cavesomething:guide_to_quest_dialogs

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Thu Mar 25 01:09:21 CDT 2010


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2010/03/25 01:09
User        : cavehippo
Edit Summary: update description of quest definition

@@ -2,13 +2,13 @@
  
  
  The following is a guide to creating your own dialog-driven quest.
  
- By dialog-driven, I mean that most of the events in the quest occur from talking to NPCs.
+ By dialog-driven, I mean that most (but not all) of the events in the quest occur from talking to NPCs.
  
- Dialogs can be used separately from any quests at all, but because quests are going to use them, we will cover them first.
+ Dialogues can be used without having any associated quests at all, likewise you can create a quest without having any dialog, but you will find it much easier if you use dialogue to drive a narrative forward. 
  
- You can construct a quest without speaking to any NPCs, but it is harder to write a narrative when you do that.
+ The first section of this guide covers dialogues.
  
  ===== Dialogs =====
  
  Dialogs are specified using a JSON syntax, we'll have a simple example first, followed by a general explanation of all the options:
@@ -280,18 +280,18 @@
  ["giveitem", "biccie", "2"]
  or
  ["giveitem", "money", "74"]
  </code>
- The first of these gives the player an 2 'biccie's - There **must** be at least one such an item in the NPC's inventory already for this to work. This item may be customised in any manner you want in the map editor. It does not matter how many biccies the NPC actually has, one is enough; when they give items, they create copies of the ones they already have.
+ The first of these gives the player a stack of 2 'biccie's - There **must** be at least one such item in the NPC's inventory already for this to work. This item may be customised in any manner you want in the map editor. It does not matter how many biccies the NPC actually has, one is enough; when they give items, they create copies of the ones they already have.
  
  The second of these gives the player 74 money, made up of the smallest possible number of platinum, gold and silver coins. The NPC does **not** need to have money in his inventory in order to give it.
  
  The name should be the name of the item to be given, or money. The number may be omitted, if so it is treated as 1.
  
  Note that items which are given away are in the NPCs inventory, so if the NPC is killed, they will drop. 
- If you **don't** want to be able to acquire these items through killing the NPC, then you should create an NPC_Gift_Box item in the NPCs inventory, and put the items in there. This is checked before the rest of the NPCs inventory is, so if you want to give an item that is similar to one that might come from the NPCs treasure list, then that should go their too.
+ If you **don't** want to be able to acquire these items through killing the NPC, then you should create an 'NPC_Gift_Box' item in the NPCs inventory, and put the items in there. This is checked before the rest of the NPCs inventory is, so if you want to give an item that is similar to one that might be generated from the NPCs treasure list, then it is probably better to put that in their also.
  
- You will particularly want to use the NPC_Gift_Box if you have any easily accessible NPCs who are rewarding Inaccessible quests. (eg, someone in a town who asks you to fetch something from a very deep dungeon).
+ You will particularly want to use the NPC_Gift_Box if you have any easily accessible NPCs who are rewarding inaccessible quests. (eg, someone in a town who asks you to fetch something from a very deep dungeon).
  
  == givecontents ==
  
  This is like giveitem, except that it gives whatever is in the container specified, rather than the container.
@@ -385,17 +385,172 @@
  ==== Quest Definition ====
  
  Quests are defined in a text file, in a similar way to archetypes. There are a collection of fields that may be used to express different properties of the quest.
  
+ The following is an example of a quest definition.
+ 
+ <code>
+ quest scorn/GorksTreasure
+ title Gorks Treasure Hoard
+ description
+ Gain access to Gork's treasure
+ end_description
+ stopstep 50
+ restart 1
+ step 10
+ description
+ I have been told that there is a troll in town called Gork, who guards a stash of treasure, it may be worth paying him a visit.
+ end_description
+ end_step
+ step 20
+ description
+ I have spoken to a peaceful, but distinctly unpleasant troll called Gork, who is guarding a stash of treasure. Maybe if I continue to speak with him I can find a way to get access to his stash.
+ end_description
+ end_step
+ step 30
+ description
+ Gork has indicated that his friend Mork can also open the treasure room. Maybe if I can find Mork he will be more agreeable than Gork is
+ end_description
+ end_step
+ step 40
+ description
+ I have spoken to Mork, and he has given me the key to Mork's treasure room
+ end_description
+ end_step
+ step 50
+ description
+ I have used Mork's key to gain access to Gork's treasure room.
+ end_description
+ end_step
+ end_quest
+ </code>
+ 
+ Again, I'll take this apart step by step:
+ 
+ === The header ===
+ 
+ quest scorn/GorksTreasure
+ title Gorks Treasure Hoard
+ description
+ Gain access to Gork's treasure
+ end_description
+ stopstep 50
+ restart 1
+ 
+ There are a number of entries here, I'll cover them in the order they appear, then explain the other options this quest doesn't use.
+ 
+ == quest ==
+ The start of any quest is the 'quest' line, which gives the name the quest is known by internally. This is a mandatory entry
+ Good practice is to set up quests as region/questname - 
+  
+ == title ==
+ The title provides the name that the players will know the quest by - This is optional (but recommended)
+ 
+ ==description==
+ 'description' appears on a line on its own on a line on its own, everything that follows until a line containing 'end_description' is a summary of the purpose of the quest overall. - This is optional (but recommended for non-hidden quests)
+ 
+ ==stopstep==
+ This is the step after which the quest will be consider 'complete'
+ you need to specify a stopstep if you want your quest to be able to end.
+ 
+ ==restart==
+ either 0 or 1.
+ Whether it is permitted for a player to play through this quest multiple times. 1 indicates a restartable quest, 0 a non-restartable one. If constructing a quest which is restartable, then you should be careful of items like keys, which might be able to be kept between attempts allowing parts of the quest to be bypassed. consider also the use of a marktime/age combination in a conversation to stop the quest restarting immediately.
+ 
+ Other options:
+ 
+ ==hidden==
+ **TODO**: Indicates that the quest is tracked, but that updates are not sent to the player. You can use this to create convenience quests which silently track progress in other quests.
+ 
+ ==party==
+ **TODO**: define how the quest should interact with party membership, options are:
+   * solo - No members of the player's party can assist with this quest at all.
+   * assist - members of the player's party can choose to assist with this quest, and can trigger updates for the player if they are on the same map.
+   * team - members of the player's party can choose to work with the player on this quest, and any updates triggered act for all players if they are on the same map. (regardless of what the state was for non-triggering players)
+   * globalteam - members of the player's party can choose to work with the player on this quest, and any updates triggered act for all players regardless of where they are in the world. (regardless of what the state was for non-triggering players)
+ 
+ Members of a party can find quests to help their party members with by using the 'party quest' command **TODO ** Not implemented yet.
+ 
+ ===The Quest Steps===
+ A quest step is a single 'state' within a quest. Any given player may only be in one state in a quest at any one time.
+ 
+ A quest step looks like this:
+ 
+ <code>
+ step 40
+ description
+ I have spoken to Mork, and he has given me the key to Mork's treasure room
+ end_description
+ end_step
+ </code>
+ 
+ entries are as follows:
+ 
+ == step ==
+ Followed by a number, this marks the start of the step definition, which continues until you reach the next end_step
+ The step numbers are what you will need to use to refer to this quest in dialogs and other events. It is good practice (though not required) to number steps 10,20,30, etc, that way if it is necessary to add additional steps at a later date, it will not be necessary to hunt through maps and dialogs for existing step numbers to change.
+ 
+ == description ==
+ 
+ descriptions act the same as the description for the quest overall, but have a slightly different meaning. The description of a step should be thought of as a 'what just happened/what should I be doing now' type of text, whereas the quest description is more abstract.
+ 
+ == solo ==
+ ** TODO **
+ may appear on its own, and indicates that an update **to** this step should not apply to other members of the team, this can be used for steps where items are given out so that all players in a team can get the item(s) in question.
+ 
+ ====Interacting with quests outside of Dialog ====
+ We have covered how to handle quest updates in Dialog, and how to define the quests that are updated, but what about updating a quest in response to picking up an object, killing a particular monster or reaching a certain place?
+ 
+ In the map editor there is the option to bind events to objects, you will already have used this to bind event_say to an NPC.
+ 
+ In order to have map-based updates, you will want to bind other events to items.
+ 
+ The following page lists the types of events you can bind to, and describes when they trigger.
+ 
+ [[http://wiki.metalforge.net/doku.php/server_plugin#hooking_to_an_object-specific_event]]
+ 
+ For quest building, you will probably find that apply, attack, death, pickup and trigger are the most useful events, although you may find occasional use for other events too.
+ 
+ When you bind events to objects, you need to pick a script to use, so far you will have been using python/dialog/npc_dialog.py, but you can use any script you want.
+ 
+ For general-purpose quest updating the first place to look will be QuestAdvance.py
+ 
+ == QuestAdvance.py ==
+ 
+ QuestAdvance.py should be used as in the following example:
+ 
+ {{user:cavesomething:questadvance.png|}}
+ 
+ Here we see that the script is bound to event_pickup, which means it will trigger whenever this item is picked up.
+ 
+ First the name of the quest is specified, then the update rules.
+ 
+ An update rule is a step number or range of step numbers and then a step number to move to.
+ 
+ So 0>3 means, if the player is currently at step 0 (ie, haven't started the quest yet) then move them to step 3
+ 1>2 means, if the player is currently at step 1, move them to step 2
+ 
+ if the player were not at either step 0 or 1 in this example, then nothing would happen when the event triggered.
+ 
+ NB: Be careful about binding to event_pickup for items that are not taken away as part of a quest soon afterwards, especially for restartable quests, an event_pickup will return 
  
  ==== How Do I? ====
  
  The following are common things to want to do, and how to go about doing them.
  
-   - Make an object either be given in a dialogue, or be found on the corpse of the NPC when killed, but not both?
+ == Make an object either be given in a dialogue, or be found on the corpse of the NPC when killed, but not both? ==
    * First of all, put one copy of the item in an NPC_Gift_Box (this is the copy that will be tied to the dialog), and one on the NPC directly.
    * Make sure that the same messages that cause the item(s) to be given to the player, also set a quest step (if you have no suitable quest, then you can create a simple one-step quest which is hidden ** TODO **)
    * Next, put an event_death listener on the NPC
    * Use the script **Script not written yet** with the options **TODO** to remove the copy of the object from the monster's inventory if they are killed by a player who is past a certain stage in the given quest.
  
  Now the player can either kill the NPC and claim the item, or he can talk to him and claim the item, but can not talk to the NPC, get the item, then kill the NPC and get another copy of the item.
  
+ == Make a quest update on a player reaching a certain point on a map?==
+ Put a small button under the floor, add to the small button's inventory a 'trigger' event. point the event at python/dialog/QuestAdvance.py and give the appropriate stage update rules.
+ 
+ == Do something really complex that no one has considered before? ==
+ 
+ Hop on IRC and and ask for advice.
+ 
+ == Make the outcome of a quest determine which map an exit leads to (ie, define aftermath maps for quests that players can return to) ==
+ I don't know yet, working on it.


IP-Address  : 81.141.60.247
Old Revision: http://wiki.metalforge.net/doku.php/user:cavesomething:guide_to_quest_dialogs?rev=1269395781
New Revision: http://wiki.metalforge.net/doku.php/user:cavesomething:guide_to_quest_dialogs

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list