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_type | string representation of the type of object that's being registered |
| object | the 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_type | string representation of the type of object that's being registered |
| object | the object that is being registered |
| plan | the 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_type | string representation of the type of object that's being registered |
| object | the object that is being registered |
| slots | (optional) the number of individuals that this plan can have executed at once; defaults to -1 (infinite) |
| object_type | string representation of the type of object that's being removed |
| object | the object that is being removed |
| object_type | string representation of the type of object that's being removed |
| object | the 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_type | string 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
-
| searcher | can be a luaCharacter or a diguyCharacter object |
| object_type | string representation of the type of object that's searched for |
| arg_table | optional 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_objects | non-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