[CF-Devel] Missing archetypes used by python plugin

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Mon Dec 20 14:53:32 CST 2004


Lalo Martins wrote:
>
     
      > The python plugin code uses the non-existent archetypes
     
     >
     
      > "player_info" and "player_force". Can someone add them (or give me a
     
     >
     
      > hint how to define them)?
     
     >
     
     
     >
     
      You don want to create those; you want to fix the plugin.  They are
     
     >
     
      legacy code.
     
     
OK. According to the cvs logs these archetypes were removed about two
years ago. But the log message did not reveal why they have been
removed.

After examining the code, my impression is that most invisible objects
are created from the "force" archetype and possibly changing some
attributes (such as expiry timeout/slaying/name).

The Python plugin currently implements the following functions that
access invisible objects:

 - CheckInvisibleObjectInside(who, str):

   Returns the first object obj in who's inventory with obj->type=FORCE
   and obj->slaying=str.

 - CreateInvisibleObjectInside(who, str):

   Inserts a new object obj (archetype "force") into who's inventory.
   Sets obj->speed=0 and obj->slaying=str.

 - CreatePlayerForce(who, str):

   Inserts a new object obj (archetype "player_force") into who's
   inventory. Sets obj->name=str.

 - CreatePlayerInfo(who, str):

   Inserts a new object obj (archetype "player_info") into who's
   inventory. Sets obj->name=str.

 - GetPlayerInfo(who, str), GetNextPlayerInfo(who, prev_obj):

   Returns the first/next object obj from who's inventory that has
   obj->arch->name="player_info" and obj->name=str.

 - SetAlignment(who, str), SetGender(who, str), SetGuildForce(who, str),
   SetRank(who, str):

   Modifies the first object obj in who's inventory that has
   obj->name="ALIGNMENT_FORCE/GENDER_FORCE/GUILD_FORCE/RANK_FORCE" or
   obj->arch->name="alignment_force/gender_force/guild_force/rank_force".
   Sets obj->title to a new value depending on str.

 - GetGuildForce(who):

   Returns the first object obj from who's inventory that has
   obj->name="GUILD_FORCE" or obj->arc->name="guild_force".

>
     
     From my point of view only the functions CheckInvisibleObject() and
     
     CreateInvisibleObject() are useful (and currently working). The
remaining functions should be removed. Is this "fix" of the plugin code
acceptable?

_______________________________________________
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