DI-Guy Lua AI SDK
 All Classes Files Functions Variables Groups Pages
luaSmartObjects.lua File Reference
#include <inheritsFrom.lua>

Variables

 luaSmartObjectsregistry = {ui_options={expand=true}}
 
luaSmartObjectsregistry __index = luaSmartObjects.registry
 
 luaSmartObjectsdraw_function_active = false
 
static uaSmartObjects
 Register an explict plan in the luaSmartObjects registry. More...
 
static uaSmartObjects registry
 
static object
 
static plan
 
static slots
 
static object_type
 
static arg_table
 
static num_objects
 
local obj_list = selfregistry[object_type]
 

Variable Documentation

arg_table
static
luaSmartObjectsdraw_function_active = false
luaSmartObjectsregistry = {ui_options={expand=true}}
num_objects
static
local obj_list = selfregistry[object_type]
static::object
static
object_type
static
plan
static
uaSmartObjects registry
static

fill out a tostring function in the registry to allow it to show something in the mind editor ]]

static::slots
static
static::uaSmartObjects
static

Register an explict plan in the luaSmartObjects registry.

Gets a list of smart object types.

Gets a list of all smart objects.

Gets the number smart objects of a given type.

Returns the nearest object and plan that satisfies the object_type look up.

Returns an object and plan that satisfies the object_type look up.

Removes all plans of a given object from the luaSmartObjects registry.

Removes all plans of a given type from the luaSmartObjects registry.

Removes an object and its plans from the luaSmartObjects registry.

Description:

  This is a framework function that defaults to no-oping unless
  self.draw_function_active is set to true. Will draw a line from the
  origin to the various smart objects in the world.  
    Register an explict plan in the luaSmartObjects registry.  This allows
    a lookup by object_type later on. This is useful in allowing an object
    to register multiple planning functions.

Arguments:

Parameters
object_typestring representation of the type of object that's being registered
objectthe object that is being registered
planthe planning function that is being registered
slots(optional) the number of individuals that this plan can have executed at once; defaults to -1 (infinite)

Description:

    Register an explict object without a plan in the luaSmartObjects registry.       This allows
    a lookup by object_type later on. 

Arguments:

Parameters
object_typestring representation of the type of object that's being registered
objectthe object that is being registered
slots(optional) the number of individuals that this plan can have executed at once; defaults to -1 (infinite)

Arguments:

Parameters
object_typestring representation of the type of object that's being removed
objectthe object that is being removed

Arguments:

Parameters
object_typestring representation of the type of object that's being removed

Arguments:

Parameters
objectthe object that's being removed
    If the object has a slot size specified, then only an object with available
    slots will be used.     (It's up to the object to increment and decrement
    the nslots_in_use field.)

Arguments:

Parameters
object_typestring representation of the type of object that's searched for

Returns Multiple Values:

Returns
object and planning function on success, nil on failure
     If the object has a slot size specified then only an object
    with available slots will be used.      (It's up to the object to increment
    and decrement the nslots_in_use field.)

    The object and its plan function are registered in register_plan()

Arguments:

Parameters
searchercan be a luaCharacter or a diguyCharacter object
object_typestring representation of the type of object that's searched for
arg_tableoptional list of arguments, described below
arg_table["exclusion_list"]list of objects of the given type to exclude from the search
arg_table["max_radius"]maximum radial distance from searcher of returned object
(returnsnil if nothing is that close)
arg_table["instance_name"]must have this instance name
num_objectsnon-nil if we want to return more than one object

Returns Multiple Values:

Returns
object and planning function on success, nil on failure
OR array of objects, sorted nearest to farest

Returns:

Returns
size of avail objects

Returns:

Returns
table of smart objects

Returns:

Returns
table of strings containing type names