[Crossfire-wiki] [Crossfire DokuWiki] page changed: cfdialog

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Tue May 8 05:45:13 CDT 2007


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

Date        : 2007/05/08 05:45
User        : lauwenmark
Edit Summary: Completed the example script.

@@ -35,8 +35,15 @@
  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.
  
  In this example, the player is stored in 'player', and the old man in 'grandpa'. What the player said is in 'message'.
  
+   import Crossfire
+   import string
+   from CFDialog import Dialog, DialogRule
+   #
+   player=Crossfire.WhoIsActivator()
+   grandpa=Crossfire.WhoAmI()
+   message=Crossfire.WhatIsMessage()
    # Dialog creation:
    speech = Dialog(player, grandpa, "test_grandpa_01")
    #
    # The first rule is the "hello" answer, so we place it at index 0 of the


IP-Address  : 217.136.39.8
Old Revision: http://wiki.metalforge.net/doku.php/cfdialog?rev=1178620168
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