[crossfire] Quest system - Error reporting needs work

Brendan Lally brenlally at gmail.com
Fri May 7 09:50:28 CDT 2010


On Fri, 7 May 2010 02:05:16 -0500
Kevin Bulgrien <kbulgrien at att.net> wrote:

> I tried to play test some of the new quests tonight and nothing
> worked.  None of the dialog paths did anything.  I could not get past
> go.

Having looked at this a couple of hours ago, the token check I had was
bad, and failed with multiple token options, this was a regression
caused by my breaking out the dialog actions into separate files and
I've now fixed this.

It isn't something I hadn't picked up before because not many dialogs
use tokens in that way, thank you for reporting it.
 
> Something needs work.  So digging around, I find:
> 
>   python/dialog/dialog_check.py
> 
> I decide to see what it does:
> 
>   $ python python/dialog/dialog_check.py scorn/kar/gork.msg
> Traceback (most recent call last):
>   File "python/dialog/dialog_check.py", line 11, in <module>
>     import cjson
> ImportError: No module named cjson

When you run the npc_dialog script as part of the server process then
it runs through the cfpython plugin which includes cjson as part of the
source tree, it gets be compiled at the same time the cfpython
plugin is (if it weren't you'd see a similar message in your server
output)

This doesn't add cjson to the normally available pool of python
libraries, so running the dialog_check.py script would require that you
have cjson installed for python normally. (there isn't really a good
way around this as far as I can see, from the maps/ folder there isn't
a clear idea of where crossfire plugins are installed - I suppose
crossfire could install cjson globally, but that will probably cause
more problems than it would solve).

> 
> Ah...
> 
> Yeah, that should be reported to the server admin as a major error.
> If the quest system is going to start depending on this, then
> packaging, etc. needs to make sure people know what is required to
> get basics of the game operational.  So in my case, the package is
> probably python-cjson...

The dialog_check script isn't really part of the basics of the game, it
is a tool I've created for my own purposes while writing dialogs which
others may find useful too, anyone who isn't a map-maker
writing npc dialog shouldn't need to care about it (and anyone running
into characters with dialogs should find that the cfpython version of
json works correctly).
 
> So then I wonder if the player shouldn't also be told too...

There may still be a question around player feedback on errors, I'm not
sure what the best way to approach that is, mostly because it is
sometimes difficult to define what an error is - in some cases having
no matches to a set of rules is a bad thing, in others, it might be
fine.
 
> Let's try again...
> 
> :-)
> 
> # urpmi python-cjson
> 
> [trunk]$ python python/dialog/dialog_check.py scorn/kar/gork.msg
> Error: No script to support action:  settoken Expected:
> post/settoken.py ERROR: verification of action file
> post/settoken.py  failed for rule 1  condition  ['settoken',
> 'gork_speak', 'hoard'] ...
> 
> Gaack!
> 
> [trunk] cd python/dialog
> [dialog]$ python dialog_check.py ../../scorn/kar/gork.msg
> checked  9 rules from file ../../scorn/kar/gork.msg Found  0  errors
> and  0 warnings
> 
> Ok...
> 
> Umm... its a computer.  Can't it figure out where to look for its
> stuff? It's only relative path...

Yeah, that script does still need a bit of work in terms of figuring
out where to look for things. (as well as extending the checking to
verify that named quests exist, etc), I've committed it now because it
is still a lot nicer than trying to navigate through maps to where a
character is found, trying to speak to them and finding that there was
a typo in the .msg file.

Brendan.



More information about the crossfire mailing list