[Crossfire-wiki] [Crossfire DokuWiki] page changed: cfdialog
no-reply_wiki at metalforge.org
no-reply_wiki at metalforge.org
Thu Nov 13 20:10:34 CST 2008
A page in your DokuWiki was added or changed. Here are the details:
Date : 2008/11/13 20:10
User :
Edit Summary: Minor formatting; Add note about case insensitivity change.
@@ -28,14 +28,16 @@
* **Postconditions** are the status changes to apply to the player's conditions after the rule has been triggered. Their format is similar to preconditions. A value of "*" means that the condition will not be touched.
* A **prefunction** is an optional callback function that will be called when a rule's preconditions are all matched, but before the rule is validated. The callback can do additional tests, and should return 1 to allow the rule to be selected, 0 to block the rule. The function arguments are the player and the actual rule being tested.
+
* A **postfunction** is an optional callback that is called when a rule has been applied, and after the message is said. It can do additional custom .processing. The function arguments are the player and the actual rule having been used.
Once you have defined your rules, you have to assemble them into a dialog. Each dialog involves somebody who triggers it, somebody who answers, and has a unique name so it cannot be confused with other dialogs.
Typically, the "one who triggers" will be the player, and the "one who answers" is an NPC the player was taking to. You are free to chose whatever you want for the dialog name, as long as it contains no space or special characters, and is not used by another dialog. You can then add the rules you created to the dialog. Rules are parsed in a given order, so you must add the most generic answer last.
+ Like the @match system, CFDialog converts both match strings and the things the player says to lowercase before checking for a match.
==== A simple example ====
I want to create a dialog for an old man. If I say "hello" or "hi" for the first time, grandpa will greet me. If I say it for the second time, he'll grumble (because he's like that, you know :)). I also need a generic answer if I say whatever else.
IP-Address : 68.88.122.208
Old Revision: http://wiki.metalforge.net/doku.php/cfdialog?rev=1199249059
New Revision: http://wiki.metalforge.net/doku.php/cfdialog
--
This mail was generated by DokuWiki at
http://wiki.metalforge.net/
More information about the crossfire-wiki
mailing list