[Crossfire-wiki] [Crossfire DokuWiki] page changed: cfpython

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Thu Nov 22 16:52:25 CST 2007


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2007/11/22 16:52
User        : tchize
Edit Summary: moved default script top, mught interrest more people

@@ -45,8 +45,55 @@
  Check ''[[cfpython#RegisterCommand|Crossfire.RegisterCommand]]''.
  
  ===== Return value =====
  The return value of the script can be manipulated through the ''[[cfpython#GetReturnValue|GetReturnValue]]'' and ''[[cfpython#SetReturnValue|SetReturnValue]]'' functions. Signification of this value depends on the event being handled.
+ 
+ ====== Scripts part of Crossfire default maps ======
+ Those Python scripts reside in the [[http://crossfire.svn.sourceforge.net/viewvc/crossfire/maps/trunk/python/|python]] subdirectory of the maps tree. They provide additional functionality, and may be considered as always present.
+ FIXME {describe existing ones}
+ 
+ ===== Dialog Helper =====
+ Script location: ''/python/CFDialog.py''
+ 
+ This script provides two utility classes a map maker can use to easily create complex dialogs.
+ Go [[cfdialog#here]] for a complete explanation on how it works.
+ 
+ ===== Death message =====
+ Script location: ''/python/misc/death_message.py''
+ 
+ This script makes the monster/living thing containing it display a message when it dies. It should be hooked through an ''event_death'' archetype in monster's inventory.
+ 
+ Message is specified in event object's options field. It can contain %m and %k, which will be replaced by respectively dead item's name and killer's name (if no killer, replaced by an empty string).
+ 
+ ===== Greeting message =====
+ Script location: ''/python/misc/greet_message.py''
+ 
+ This script makes the monster/living thing containing it display a message when it attacks for the first time an enemy. It should be hooked through an ''event_time'' archetype in monster's inventory.
+ 
+ Message is specified in event object's options field. It can contain %m and %e, which will be replaced by respectively monster's name and enemy's name.
+ 
+ 
+ ===== Experience rewarder =====
+ Script location: ''/python/items/experience_rewarder.py''
+ 
+ This script will give experience to the "activating" player. It should be linked through the "trigger" event of an altar, or similar thing.
+ 
+ Options are specified in the event object's fields.
+ 
+ A key/value will be used to store in the player if she activated the item already.
+ 
+ Available options are:
+   * exp: experience to gain
+   * skill: skill to add experience to. Can be empty, in which case exp is given to the general exp only
+   * wc: what to do when the player doesn't know the skill:
+      * 0: give the player the skill
+      * 1: give player exp to total, no skill
+      * 2: player gets nothing
+   * race: if set, the player can only use once this item.
+ ===== Time of the day =====
+ Scripts location: ''/python/tod/*.py''
+ 
+ Those scripts add behaviour to items based on time of the day. Want to open doors at specific time, make werewolfes, deactivate a magic_mouth during the Season of Winter? Those scripts are ready to use. See [[cfpython:tod|time of day based python scripts]]
  
  ====== Crossfire module ======
  
  To use the crossfire module, add to your python script:
@@ -806,51 +853,4 @@
    * Next: ''Crossfire.Region''
  
  ==== Parent ====
  Return value: a ''Crossfire.Region'', or ''None'' if no parent region.
- 
- ====== Scripts part of Crossfire default maps ======
- Those Python scripts reside in the [[http://crossfire.svn.sourceforge.net/viewvc/crossfire/maps/trunk/python/|python]] subdirectory of the maps tree. They provide additional functionality, and may be considered as always present.
- FIXME {describe existing ones}
- 
- ===== Dialog Helper =====
- Script location: ''/python/CFDialog.py''
- 
- This script provides two utility classes a map maker can use to easily create complex dialogs.
- Go [[cfdialog#here]] for a complete explanation on how it works.
- 
- ===== Death message =====
- Script location: ''/python/misc/death_message.py''
- 
- This script makes the monster/living thing containing it display a message when it dies. It should be hooked through an ''event_death'' archetype in monster's inventory.
- 
- Message is specified in event object's options field. It can contain %m and %k, which will be replaced by respectively dead item's name and killer's name (if no killer, replaced by an empty string).
- 
- ===== Greeting message =====
- Script location: ''/python/misc/greet_message.py''
- 
- This script makes the monster/living thing containing it display a message when it attacks for the first time an enemy. It should be hooked through an ''event_time'' archetype in monster's inventory.
- 
- Message is specified in event object's options field. It can contain %m and %e, which will be replaced by respectively monster's name and enemy's name.
- 
- 
- ===== Experience rewarder =====
- Script location: ''/python/items/experience_rewarder.py''
- 
- This script will give experience to the "activating" player. It should be linked through the "trigger" event of an altar, or similar thing.
- 
- Options are specified in the event object's fields.
- 
- A key/value will be used to store in the player if she activated the item already.
- 
- Available options are:
-   * exp: experience to gain
-   * skill: skill to add experience to. Can be empty, in which case exp is given to the general exp only
-   * wc: what to do when the player doesn't know the skill:
-      * 0: give the player the skill
-      * 1: give player exp to total, no skill
-      * 2: player gets nothing
-   * race: if set, the player can only use once this item.
- ===== Time of the day =====
- Scripts location: ''/python/tod/*.py''
- 
- Those scripts add behaviour to items based on time of the day. Want to open doors at specific time, make werewolfes, deactivate a magic_mouth during the Season of Winter? Those scripts are ready to use. See [[cfpython:tod|time of day based python scripts]]


IP-Address  : 91.177.206.171
Old Revision: http://wiki.metalforge.net/doku.php/cfpython?rev=1195771832
New Revision: http://wiki.metalforge.net/doku.php/cfpython

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list