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

Classes

class  math
 Lua's built in math library. More...
 
class  string
 Lua's built in string library. More...
 
class  table
 Lua's built in table library. More...
 
class  luaCrowdObject
 A simple object for agents to use as a shared blackboard for storing arbitrary information. More...
 

Functions

for select ('#',...) do
 
function get_formatted_warning (...)
 
function print_formatted_warning (...)
 
function warn (...)
 
function traceback ()
 
function bdi_require (object_name)
 
function diguy_core_class_register (object_name)
 
function is_core_class (object_name)
 
function update_variables ()
 
function deepcopy (object)
 
function diguy_package_registry init_packages ()
 Called by c++ at time sero. More...
 
function diguy_package_registry update_packages ()
 Called by c++ every update tick. More...
 
function diguy_package_registry draw_packages ()
 Called by c++ every frame when lua objects are visible. More...
 
function diguy_package_registry reset_packages ()
 Called by c++ on reset. More...
 
function diguy_package_registry check_package_existance (package_name)
 returns "valid" or "invalid" depending on if the package exists More...
 
function diguy_package_registry get_super_class (package_name)
 returns the name of the base class of the package More...
 
function diguy_package_registry get_package_registry ()
 returns a formated list of classes with hierarchical limited to character classes More...
 
function diguy_package_registry get_full_package_registry ()
 returns a formated list of classes with hierarchical info More...
 
function diguy_package_registry register_package (package_name, add_to_base_classes)
 
function diguy_package_registry unregister_package (package_name)
 
 setmetatable (lua_character_registry,{__mode= 'v'})
 
function find_lua_character (character)
 Function for retrieving the associated lua character object given a diguyCharacter pointer or the name of a character. More...
 
function find_lua_crowd (crowd)
 Function for retrieving the associated lua crowd object given a diguyCrowd pointer or the name of a crowd. More...
 
function destroy_lua_crowd (crowd_ptr)
 
function inheritsFrom (baseClassName, package_name, add_to_character_classes)
 Create a new class that inherits from a base class. More...
 

Variables

local global_meta = getmetatable(_G)
 
global_meta __index = diguy
 
string local s = ""
 
for i =1
 
local v = select(i, ...)
 
_G print = print
 
 diguy_package_registry = {}
 A global registry for storing package objects. More...
 
diguy_package_registry character_array = {}
 an array of character base classes More...
 
diguy_package_registry character_hash = {}
 an hash table of character base classes More...
 
diguy_package_registry full_array = {}
 an array of all the packages More...
 
diguy_package_registry full_hash = {}
 an hash table of all the packages More...
 
string diguy_package_registry package_init_code =
 package template string More...
 
 lua_character_registry = {}
 A global registry for storing luaCharacter objects and decendants. More...
 
 lua_crowd_registry = {}
 A global registry for storing luaCrowdObjects. More...
 
functions to enable the state var list in the code browser
 type_to_constant = {}
 
Additions to math library
 mathLONG_TIME = 900000
 

Additions to table library

 luaMessageObject = {}
 A object that wraps an incoming diguy message. More...
 
string sender
 who sent the message; More...
 
string message_type
 typically 'signal', 'broadcast', 'callback' or user defined; More...
 
string message
 the actual contents of the message; More...
 
string params
 optional additional information in the message; More...
 
 luaMessageObject_mt = { __index = luaMessageObject }
 
function luaMessageObject_mt __tostring (e)
 
function luaMessageObject new (sender, message_type, message, params)
 luaMessageObject constructor More...
 

Function Documentation

function bdi_require ( object_name  )
function diguy_package_registry check_package_existance ( package_name  )

returns "valid" or "invalid" depending on if the package exists

function deepcopy ( object  )
function destroy_lua_crowd ( crowd_ptr  )
function diguy_core_class_register ( object_name  )
function diguy_package_registry draw_packages ( )

Called by c++ every frame when lua objects are visible.

function find_lua_character ( character  )

Function for retrieving the associated lua character object given a diguyCharacter pointer or the name of a character.

Parameters
characterthe name or pointer to the character
function find_lua_crowd ( crowd  )

Function for retrieving the associated lua crowd object given a diguyCrowd pointer or the name of a crowd.

Parameters
crowdthe name or pointer to the crowd
function get_formatted_warning (   ...)
function diguy_package_registry get_full_package_registry ( )

returns a formated list of classes with hierarchical info

function diguy_package_registry get_package_registry ( )

returns a formated list of classes with hierarchical limited to character classes

function diguy_package_registry get_super_class ( package_name  )

returns the name of the base class of the package

function inheritsFrom ( baseClassName  ,
package_name  ,
add_to_character_classes   
)

Create a new class that inherits from a base class.

This function is the building block of the inheritance system

Parameters
baseClassNameThe name of the base class in quotes, (for backwards compatablity with diguy 10 we support the object itself.) Object names make nil and package dependancy identification easier.
package_nameThe name of the new package to create that desends from the base class
add_to_character_classesif this package name should be registered as one of the character level base classes
function diguy_package_registry init_packages ( )

Called by c++ at time sero.

function is_core_class ( object_name  )
function print_formatted_warning (   ...)
function diguy_package_registry register_package ( package_name  ,
add_to_base_classes   
)
function diguy_package_registry reset_packages ( )

Called by c++ on reset.

for select ( '#'  ,
  ... 
)
setmetatable ( lua_character_registry  ,
{__mode= 'v'}   
)
function traceback ( )
function diguy_package_registry unregister_package ( package_name  )
function diguy_package_registry update_packages ( )

Called by c++ every update tick.

function update_variables ( )
function warn (   ...)

Variable Documentation

luaFocusStack __index = diguy
diguy_package_registry character_array = {}

an array of character base classes

diguy_package_registry character_hash = {}

an hash table of character base classes

diguy_package_registry full_array = {}

an array of all the packages

diguy_package_registry full_hash = {}

an hash table of all the packages

global_meta = getmetatable(_G)
for i =1
mathLONG_TIME = 900000
string diguy_package_registry package_init_code =

package template string

_G print = print
s = ""
string type_to_constant = {}
local v = select(i, ...)