New Tools for Script Writers

Amadeus

The Maestro
Staff member
Code:
July 4, 2007 -- By Amadeus
[ISXEQ2-20070628.0102]
********************
*** PLEASE NOTE ****
Today I have added members for returning your own custom arrays (indexes) of things such as actors and inventory.  While this can be
extremely powerful in your scripting (and you should definately use it!), it also requires that you keep in mind that once you create the array, any
of the data within it can go invalid at any point.  So, while it should not cause a crash or instability, if you keep a created custom index around too
long, you may find that some of the members of the index return NULL once they're out of scope.  Of course, the easy answer to this is to use your custom
arrays soon after you create them and/or to re-populate them often in your scripts.
*********************
* Added new MEMBER to the 'eq2' datatype:
  1. GetActors[<index>,<optional parameters>,...]                (int type) 
  ~ In LavishScript, this method requires at least one argument, and that argument must be of the type 'index:actor'.  If no optional parameters are used, 
    then the given index is filled with an array of actors visible to the client at the point of creation (sorted by distance.)  The optional parameters 
    can be anything typically used with the actor search routines (including 'sorting' parameters).  An example of this might be: "EQ2:GetActors[Actors,NPC,levels,1,5]"
  ~ The return value is the number of actors in your newly created index.
  ~ Here is an example lavishscript script that would illustrate the functionality of this particular member.  Please keep this example handy as any other
    methods provided for custom array handling will use the same concepts:
              function main()
              {
                  variable index:actor Actors
                  echo Populating Actors List:: ${EQ2.GetActors[Actors]} actors total
    
                  echo The second actor in the array is: ${Actors.Get[2].Name}, level ${Actors.Get[2].Level}, at ${Actors.Get[2].Loc}.
                  echo The third actor in the array is: ${Actors.Get[3].Name}, level ${Actors.Get[3].Level}, at ${Actors.Get[3].Loc}.
              }
  ~ For more information about using the 'index' datatype, please see http://www.lavishsoft.com/wiki/index.php/ObjectType:index  
* Added new MEMBER to the 'character' datatype:
  1. GetInventory[<index>,<optional parameters>,...]            (int type)  
  ~ In LavishScript, this method requires at least one argument, and that argument must be of the type 'index:item'.  If no optional parameters are 
    used, then the given index is filled with an array of inventory items on the current character at the point of creation.  The
    optional parameters can be anything typically used with the inventory search routines.  
  ~ The index returned here will return EVERYTHING: your InventoryAtHand, bank, vaults, etc., everything but your currently equipped 'equipment'.
  2. GetInventoryAtHand[<index>,<optional parameters>,...]      (int type)  
  ~ In LavishScript, this method requires at least one argument, and that argument must be of the type 'index:item'.  If no optional parameters are 
    used, then the given index is filled with an array of inventory items on the current character at the point of creation.  The
    optional parameters can be anything typically used with the inventory search routines.  
  ~ The index returned will only include the items you have on your person (ie, similar to the NONBANKONLY flag with the old custom inventory array.)
  3. GetEquipment[<index>,<optional parameters>,...]            (int type)  
  ~ In LavishScript, this method requires at least one argument, and that argument must be of the type 'index:item'.  If no optional parameters are 
    used, then the given index is filled with an array of inventory items on the current character at the point of creation.  The
    optional parameters can be anything typically used with the inventory search routines.    
* Added new MEMBER to the 'actor' datatype:
  1. Loc       (point3f type)
 
Top Bottom