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
 
local painter = this_app->get_view_painter()
 
local res
 
local x
 
local y
 
local z = vcharacter->get_position()
 
static uaSmartObjects registry
 
static uaSmartObjects
 Register an object in the luaSmartObjects registry. More...
 
static object
 
static slots
 
static plan
 
static object_type
 
static arg_table
 
static num_objects
 

Variable Documentation

arg_table
static
luaSmartObjectsdraw_function_active = false
luaSmartObjectsregistry = {ui_options={expand=true}}
num_objects
static
static::object
static
static object_type
static
local painter = this_app->get_view_painter()

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.

plan
static
uaSmartObjects registry
static

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

local res
static::slots
static
static uaSmartObjects
static

Register an object 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.

Register an explict plan in the luaSmartObjects registry.

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

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

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.

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)

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

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)
object_typestring representation of the type of object that's being removed
objectthe object that is being removed
object_typestring representation of the type of object that's being removed
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.)

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()

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 (returns nil if nothing is that close)
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
size of avail objects
table of smart objects
table of strings containing type names
local x
local y
local z = vcharacter->get_position()