Commit Graph

38 Commits (c3829410d7081c73c74c64398684cc0f79b7710e)

Author SHA1 Message Date
Kevin Zheng 18abd151e1 Add 'resetdialog' for DMs to reset dialog state
Help DMs test and debug dialogs by adding a hidden 'resetdialog' match
that resets per-character dialog state.
2021-07-24 21:03:56 -07:00
ryo_saeba 93c80bd357 Fix script conditions, round 3.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@21649 282e977c-c81d-0410-88c4-b93c2d0d6712
2020-12-27 13:24:26 +00:00
ryo_saeba 02f585973c Fix script conditions, round 2.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@21648 282e977c-c81d-0410-88c4-b93c2d0d6712
2020-12-27 13:07:28 +00:00
ryo_saeba 9dbb9fdaa9 Fix script conditions not working with Python3.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@21647 282e977c-c81d-0410-88c4-b93c2d0d6712
2020-12-27 12:38:58 +00:00
akirschbaum c018d89c01 Remove redundant semicolons.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@20286 282e977c-c81d-0410-88c4-b93c2d0d6712
2016-06-19 15:19:52 +00:00
silvernexus a874adeb8a Replace two uses of dict.has_key() in python dialog scripts with use of "in" operator.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@20269 282e977c-c81d-0410-88c4-b93c2d0d6712
2016-05-21 03:50:17 +00:00
akirschbaum 5e430c833f Remove trailing whitespace.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@18703 282e977c-c81d-0410-88c4-b93c2d0d6712
2013-05-09 11:08:11 +00:00
ryo_saeba ec18147f56 Fix exception syntax for Python 2.5.2.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13363 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-06-06 08:32:03 +00:00
ryo_saeba 287eb34c9e Fix animation query.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13349 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-30 14:57:02 +00:00
ryo_saeba 27e16a4a78 Disable talking while the NPC is animated.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13345 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-30 14:28:30 +00:00
ryo_saeba e0538867c4 Add 'npctoken' and 'setnpctoken' pre and post conditions, to keep data in NPC instead of player.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13336 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-30 10:11:58 +00:00
ryo_saeba 38295fe7da Force reply type to be an integer.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13328 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-29 21:51:55 +00:00
cavesomething 4aa31a8f4d Handle the Include rule subclass of Dialog class more sanely, this fixes an issue with include rules and pre-functions.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13264 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-17 13:10:11 +00:00
cavesomething c011312943 Replace LOG messages with proper exception handling, ensure that a check which raises an exception causes a rule to fail, as well as being reported in the server log
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13238 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-15 21:42:10 +00:00
ryo_saeba 0d07667c50 Add a 'prefunction' to rules to have special processing.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13163 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-10 17:50:57 +00:00
ryo_saeba b66dcbeb89 Remove the requirements, assuming player can always say anything.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13162 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-10 17:20:36 +00:00
ryo_saeba b5b9dfda24 Add 'replies' to the dialog system, to let the player know what she can say.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13158 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-08 13:16:13 +00:00
ryo_saeba 4f0c75aac3 Use Crossfire.NPCSay() to have NPCs talk after the player.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13157 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-05-08 12:28:49 +00:00
cavesomething 1c6503f49c Allow include rules to contain a "pre" block which will be evaluated to decide
whether to allow the file(s) to be included. This is treated in exactly the same
way as the "pre" blocks for all other rules.
A test map demonstrating this in use is included.


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13049 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-04-30 17:19:34 +00:00
cavesomething bb1f5d66cf Break out the CFDialog python script into a dispatcher for a number of smaller, action oriented scripts.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13014 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-04-27 23:43:20 +00:00
cavesomething a2fe1ab50d Updates to the dialog handling files to support more powerful syntax
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@12992 282e977c-c81d-0410-88c4-b93c2d0d6712
2010-04-27 08:43:11 +00:00
anmaster c589e07ec3 Replace deprecated string.find() amd string.lower() in /python/*.py
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11452 282e977c-c81d-0410-88c4-b93c2d0d6712
2009-02-11 21:47:17 +00:00
anmaster f813901342 Replace deprecated string.split() calls in /python/CFDialog.py
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11450 282e977c-c81d-0410-88c4-b93c2d0d6712
2009-02-11 21:36:27 +00:00
anmaster 364f9f2d3c Try to be a bit more future compatible with Python 3
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11329 282e977c-c81d-0410-88c4-b93c2d0d6712
2009-02-03 19:24:16 +00:00
anmaster fdbcb1b6ff Run whitespace cleanup script in maps/python.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11283 282e977c-c81d-0410-88c4-b93c2d0d6712
2009-01-30 01:22:22 +00:00
kbulgrien 5308835604 - Document how to successfully create rules that do not need any pre or post
conditions (by supplying and empty list).
- Add exception handling to matchConditions() and setConditions() and output
  a debug log message to facilitate debugging broken dialogs when the rules
  contain malformed condition lists.


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10635 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-21 07:30:14 +00:00
kbulgrien 9fbc7d83ea - Add a comment noting that when debugging, a server restart is needed to put
code changes into effect.
- No functional changes.
- Whitespace changes.


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10634 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-21 07:02:53 +00:00
kbulgrien 2db9e437fd - Reinstate an comment accidental deletion that occurred in revision 10421.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10471 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-15 09:08:11 +00:00
kbulgrien 9977b1298f - Add in a comment that was edited into the CFDialog page on the wiki.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10470 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-15 08:43:40 +00:00
kbulgrien ba2f19f2dc Modify CFDialog.py to use a list of strings for the keywords instead of the "|"
delimited string for consistency and to reduce the need to specially parse the
string.  There seems no particular reason to stay with the "|" delimiter (and
@match use of it does not seem compelling enough to override the benefit of
removing the oddball parameter from both CFDialog.py and npc_dialog.py scripts.
This commit also updates every known dialog that is affected.  Also updated
are the comments in both dialog scripts to reflect the change.  In CFDialog.py
also pluralize some identifers to better reflect that they are used for lists.


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10469 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-15 07:55:59 +00:00
kbulgrien 5f6869717a Comment the code, convert a few odd tabs to spaces, and make a couple minor
formatting changes to improve the consistency of the class structure.  No
functional changes made.


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10466 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-15 04:52:11 +00:00
kbulgrien dcecb2b60d The prior modification to CFDialog used "|" as a delimiter for multiple
precondition values and overlooked the fact that the precondition syntax was
already defined to be a list that could contain multiple values without
resorting to packing them into a single string.  This modification dispenses
with the prior un-pythonic enhancement to CFDialog, and establishes a format
that is more consistent with the rest of the rule structure.  As a result of
this change, Gork's conversation is also updated to work with the new version.
A dependent script ./misc/npc_dialog.py remains unaffected by this change.


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10465 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-15 04:07:05 +00:00
kbulgrien 1da5f75c92 Add an OR function to the CFDialog prefunction as it presently only supports
AND.  To follow precedent of using "|" in the match string (in both CFDialog
and @match), use it as a delimiter inside the prefunction value.  The value
add is particularly that one can design conversations to loop back into
prior states without requiring the conversation to reset and start back
at the beginning.


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10428 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-14 06:28:19 +00:00
kbulgrien 5ca76c340c Like the @match system, CFDialog now converts both match strings and things
the player says to lowercase before checking for a match.


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10421 282e977c-c81d-0410-88c4-b93c2d0d6712
2008-11-14 01:28:30 +00:00
tchize 0f8c2e86ab Update match rules of CFDialog, add a script to use it
easily in maps, update newbie house so the wise sigmund
can provide more interactive support to players



git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@7968 282e977c-c81d-0410-88c4-b93c2d0d6712
2007-12-18 22:29:42 +00:00
tchize cfa5773ef8 Add a simple to use script that make use of NPC dialog
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@7930 282e977c-c81d-0410-88c4-b93c2d0d6712
2007-12-16 15:15:41 +00:00
ryo_saeba 21b86eeaa0 Add callbacks to even more customize the rules.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@7421 282e977c-c81d-0410-88c4-b93c2d0d6712
2007-10-28 14:54:24 +00:00
gros 0aa089654c Added dialog utility classes, to help creating scripted dialogs.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@6212 282e977c-c81d-0410-88c4-b93c2d0d6712
2007-05-08 10:01:23 +00:00