[Crossfire-wiki] [Crossfire DokuWiki] page changed: cfpython
www-data at wiki.metalforge.net
www-data at wiki.metalforge.net
Wed Nov 15 11:05:00 CST 2006
A page in your DokuWiki was added or changed. Here are the details:
Date : 2006/11/15 11:04
User : ryo
Edit Summary: add [SG]etReturnValue
@@ -21,9 +21,8 @@
Python plugin is a [[server plugin]], thus you need to insert in this object one of the //event_xxx// archetype (see ''arch/system'' directory). The fields to fill are:
* **title** : should be //Python// to call the Python plugin.
* **slaying** : contains the path to the Python script to execute. Root refers to the map directory.
-
===== How do I hook a script to a global event? =====
Create a script, and put it in the ''/maps/trunk/python/events/xxx'' subdirectory, where ''xxx'' is the event's name. Existing events are:
@@ -60,8 +59,12 @@
It is possible to override a built-in server command by specifying an existing command name.
FIXME {check that}
There is no way to unregister a command.
+
+ ===== Return value =====
+
+ The return value of the script can manipulated through the ''GetReturnValue'' and ''SetReturnValue'' functions. Signification of this value depends on the event being handled.
====== Python API reference ======
Constants are available to wrap values used in Crossfire code like object types, movements, ...
IP-Address : 213.174.127.3
Old Revision: http://wiki.metalforge.net/doku.php?id=cfpython&rev=1163609524
New Revision: http://wiki.metalforge.net/doku.php?id=cfpython
--
This mail was generated by DokuWiki at
http://wiki.metalforge.net/
More information about the crossfire-wiki
mailing list