maps/python/dialog/pre
ryo_saeba 8870b46365 Quanties can be 0 for non merging, take that into account.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@14497 282e977c-c81d-0410-88c4-b93c2d0d6712
2011-05-29 17:50:39 +00:00
..
README Break out the CFDialog python script into a dispatcher for a number of smaller, action oriented scripts. 2010-04-27 23:43:20 +00:00
age.py Add dialog_check.py - a script to check dialog files for common errors. 2010-05-05 11:11:23 +00:00
archininventory.py Pre-condition script, checking for some archetype in the inventory. 2010-06-12 16:50:41 +00:00
item.py Quanties can be 0 for non merging, take that into account. 2011-05-29 17:50:39 +00:00
knowledgeknown.py Fix comments. 2010-06-06 15:14:56 +00:00
level.py Add dialog_check.py - a script to check dialog files for common errors. 2010-05-05 11:11:23 +00:00
npctoken.py Add 'npctoken' and 'setnpctoken' pre and post conditions, to keep data in NPC instead of player. 2010-05-30 10:11:58 +00:00
quest.py Remove stub code, this is likely to be handled in a separate check 2010-05-15 21:40:22 +00:00
questdone.py Add a 'questdone' precondition to vary dialogs. 2010-05-30 10:43:07 +00:00
token.py Add 'npctoken' and 'setnpctoken' pre and post conditions, to keep data in NPC instead of player. 2010-05-30 10:11:58 +00:00

README

Dialog 'Pre' block check handlers:

Every .py file in this directory corresponds to a handler for a class of checks in a dialog file.
Each file describes in its comments the check that it performs.

When writing a new check, you have the variable 'verdict' which you are able to write to. 
It is passed in with the value 'True' In order to have a check be treated as 'passed' then 
ensure that this variable is still true when you are done, if you want to have your check fail
then set the verdict to 'False' at the point where control goes back to your caller.

The following variables are also avaiable to you:

character, speaker, location
which hold the CFObject of the player and the NPC and the location where tokens are being 
written to and read from.

These should probably be treated as read-only by your check, otherwise you might cause strange
side-effects on other checks.

Other than that, there are no technical limits on what you can do with a check, although it is 
probably good form not to make drastic changes to the player's character.