[CF-Devel] More questions about the plugin code

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Wed Nov 10 01:47:08 CST 2004


I'm currently updating the Python documentation doc/Developers/python
and checking that the Python functions are working.

Currently, I have the following questions:

 - CFPython.SetQuantity() allows to set ob->nrof=0. I tried this with a
   random object ("cloak"), but it did not work very well: most objects
   did not merge anymore, other objects just disappeared after picking
   up or dropping.

   Therefore: should the function CFPython.SetQuantity() make sure that
   "nrof>0" or is "nrof=0" actually useful for some kind of objects?

 - CFPython.SetName() sets ob->name only, but I think it should set
   ob->name_pl as well. For example, the IPO script creates objects
   named "mailscroll: T: xxx F: yyy" but two of these objects are called
   "scrolls".

   I'd like to add another (optional) parameter to CFPython.SetName():

      # set obj->name="single" and obj->name_pl="multiple"
      CFPython.SetName(obj, "single", "multiple")

      # set obj->name=obj->name_pl="name"
      CFPython.SetName(obj, "name")

   This solution would not break existing scripts but allows (new)
   scripts to generate proper plural names.

 - The functions CFPython.SetPreviousObject(who, what) and
   CFPython.SetNextObject(who, what) basically do
   "who->above=what" and "who->below=what".

   I think, this interface is (too) dangerous because it is difficult to
   use correctly but it allows a script to (easily) create loops in the
   linked list or link objects from different environments into one
   list.

   Therefore I'd like to remove (or at least disable) these functions
   from the Python script interface. (No existing script in
   maps-bigworld uses these functions.)

_______________________________________________
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