James Hess This is a big snippet intended to take a stock Circle-3.1 distribution and add: DG Scripts pl 11 circle-3.1-oasis-2.0.4 AND Apply modifications to support extension languages in the command interpreter. (A flex/bison parser is used to read the command table from lib/etc/commands) A module to support for Python scripting language The documentation will be in doc/script/* This file is doc/script/status.txt You may need to examine the framework source code and examples in the lib/script/ directory. and src/python_script.c To understand this snippet. I don't yet have time to write much useful documentation. Oh, you need to use the command 'py.restart' in the mud if you want changes to any script to take effect once it's loaded. If a script has a compile error, then it won't run. If the compile error is in init.py, then the whole system will not run. ---------------------------------------------------------------------------------- The purpose of this snippet is to allow mud commands (and eventually, triggers and spells) to be written in Python. [It is an extension environment, not a system for builders to use. Python scripts have privileges equivalent to all of the mud server's C code, full access to all game variables, and can easily crash the mud server.] This is Alpha, Experimental Code, circle_py version 1.0, not quite suitable for a production mud without additional work. It's been seen to work against python2.3 and gcc 3.3.1. Making it work with anything else will probably require more work. You will need the python libraries from a full compile of python [i.e. the "libpython2.3-devel" package on a Mandrake system, just the interpreter isn't enough] If your python libraries are installed in a place other than /usr/include and /usr/lib, then you will need to specify --with-pythonprefix=XXX when runnng configure. You may need to edit cnf/configure.in manually and rebuild configure if you have a non-standard layout. Most kinds of events are not yet supported. Only 'null events', those where the actor = the subject, or the subject = Null. It is possible to implement skills and commands, however. - The master command table is no longer hard coded or stored in interpreter.c It is now parsed when the game boots up. - You will need flex and bison to regenerate source files if you make further changes to interp_db.l or interp_db.y Some of the wrapper code is generated by SWIG 1.3.21. So this snippet is only likely to work on a clean mud. You will need to get SWIG and run: swig -python py_mudstructs.i To regenerate the files and copy server.py to ../lib/script if you change functions or data structures in the mud. ----------------------------------------------------------------------------------- The server expects certain python scripts to be in lib/script server.py Provides access to SWIG-wrapped structures and functions from the mud. Macros are unavailable. mud.py Is an interface implemented in python_script.c for dealing with characters and objects init.py Is loaded on boot, and defines functions that will be called to drive event handlers. In particular: Event hooks attached to a mob, object, room, spell, zone, player, skill, ... are not yet supported. Although it is possible to use a DG script to call a python script. Example scripts are provided implementing 'score', 'who', and 'tell'-like capabilities. Additional changes will be required to implement spells or special procedures in python.