[CF-Devel] Some Python things

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Sat Oct 11 08:52:47 CDT 2003


On Sat, 2003-10-11 at 07:24, Andreas Vogl wrote:
>
     
      Todd Mitchell wrote:
     
     >
     
     
     >
     
      > [...]
     
     >
     
      > 
     
     >
     
      > 3. It would be great in the Java editor to be able to set event options 
     
     >
     
      > in the python script handling section (or I just don't know how.)  Prior 
     
     >
     
      > to adding the script handling parts (nice BTW) you could edit the line 
     
     >
     
      > event_x_options but now this is not available.  An option field you 
     
     >
     
      > could fill in when a script is hooked would be great.  Like you select 
     
     >
     
      > event say, set the associated script and fill in an option field.
     
     >
     
     
     >
     
      Event options are currently not supported because I really had no idea
     
     >
     
      about it. In the docs ("doc/Developers/pyhton", "doc/Developers/plugins")
     
     >
     
      event options don't seem to be mentioned, or did I overlook it?
     
     >
     
     
     >
     
      Currently, the CFJavaEditor would insert the following for a say event
     
     >
     
      script attached to a map-object:
     
     >
     
     
     >
     
         event_say_plugin Python
     
     >
     
         event_say WhateverScript.py
     
     >
     
     
     >
     
      How do event options come into play with this?
     
     >
     
     
     
Well currently the event options are not working properly as far as I
know but from looking at the code for the IPO buliten board and the
plugin code you can associate a option (a string I presume) with a
script by adding somehting like this:

arch sign
name Scorn Message Board
event_say_plugin Python
event_say /python/IPO/board.py
event_say_options ScornBOARD

the board.py script can then use the CFPython.GetOptions(who, event)
where who is the object calling the script and event is the type of
event, like say (event 6) or apply (event 1?).  This lets you pass a
string to the script (one script per event per object allowed) and makes
things a lot more reusable by letting you set up different states for
the scripts based on the options (like a message board name or insult
style.  Yann can hopefully correct me if I am wrong here.  
Now currently the plugin GetOptions() method always returns 'Python' but
I think that's a glitch and is certainly not the way the plugin was
supposed to work.
Anyway currently the java editor is reporting the event_say_options
field as a new script. Proir to the scripting support you could just
edit the text manually in the text window, but now the editor parses
these lines so you have to add the options manually to the map file.
I think it would be good to have a options field where you can enter
this string when you link a script to an object in the editor.  I have
seen also the line 'event_say_options_plugin X' but don't know where
that fits in with all this and am assuming it is a mistake... (?)


_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list