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

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Mon Apr 26 19:13:56 CDT 2010


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

Date        : 2010/04/26 19:13
User        : cavehippo
Edit Summary: describe include

@@ -28,28 +28,34 @@
    "match" : ["*"],
    "pre" : [["token", "seenbefore", "yes"]],
    "post": [],
    "msg" : ["Hello again $you."]
+   },{
+   "include" : ["filewithmoredialog1.msg"]
    },{
    "match" : ["*"],
    "pre" : [],
    "post": [["settoken", "seenbefore", "yes"]],
    "msg" : ["Hello I'm $me."]
+   },{
+   "include" : ["filewithmoredialog2.msg", "filewithmoredialog3.msg"]
    }
  ]}
  </code>
  
  ===== Taking it apart =====
  
  Each potential line of dialog forms a 'rule' these rules are checked in sequence, from the top of the file down.
+ 
+ Some of the 'rules' say "include" followed by one or more files, when these are encountered, these files are read in in the order they appear, and are added to the rest of the rules in the order they appear. This is useful for 'generic' lines of dialog that several npcs may say.
  
    * The first part of each rule is the 'match' - This is what the player has said to the NPC - These ones are all * so will match on anything the player might say.
    * Next are the 'pre' conditions, in order to match a rule, **all** of the pre-conditions must be true.
    * After that we have 'post' actions, these are things that happen after
    * Then we have the 'msg' which is what the NPC will say.
    * Finally, there is an optional last part, which can have two forms, 'suggests' or 'requires' - these hold responses that the client can give.
  
- Because we check from the top down, the most restrictive rule goes first.
+ Because we check from the top down, the most restrictive rule goes first. Note that in the example above, the rules in filewithmoredialog2.msg and filewithmoredialog3.msg can never be matched because there is a rule which matches everything before they are reached.
  
  ==== Rule 1 ====
  
  We'll look at the topmost rule first.
@@ -114,8 +120,21 @@
  
  ===== Full List of options =====
  
  The options that can be used vary in the different blocks:
+ 
+ ==== The Include Block ====
+ 
+ If a rule has an include block, it should have no other blocks and should list one or more files.
+ 
+ eg
+ <code>
+ "include": ["gateguardcommon.msg"]
+ </code>
+ 
+ Each of these files should contain additional rules that the npc should follow.
+ 
+ Included files can include more files, there is no limit to the depth of recursion, but do be careful not to get a situation where file A includes file B and file B includes file A, the python interpreter should stop that running away indefinitely, but your speech will not work correctly.
  
  ==== The Match Block ====
  
  This holds the text that the player should say before we check if the rule applies.


IP-Address  : 81.141.58.188
Old Revision: http://wiki.metalforge.net/doku.php/user:cavesomething:guide_to_quest_dialogs?rev=1269968867
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