|
DI-Guy Lua AI SDK
|
Public Member Functions | |
Standard infrastructure | |
| init_package () | |
| Standard per-package init function, called at time 0 ADAM CHECK: all functions in this package. More... | |
| reset_package () | |
| Standard per-package reset function. More... | |
| update_package () | |
| Standard per-package update function. More... | |
Messages and minds | |
| send_message (lua_character, message, fraction, params) | |
| Sends a message to given character. More... | |
| queue_message (lua_character, message, fraction, delay, params) | |
| Queues a message that will go to send_message() at a future time. More... | |
| get_lua_minds (group_name, lua_class_name) | |
| looks up lua_characters having the given lua package name in the given diguyCharacterGroup More... | |
Schedule event helper functions | |
| get_schedule_event_actions (package_name) | |
| Get all the schedule event actions that are provided by the named package, if any exist. More... | |
| get_schedule_event_roles (package_name, action_name) | |
| Get all the schedule event roles that are provided by the named package, if any exist. More... | |
| get_schedule_event_args (package_name, action_name, role_name, arg_num) | |
| Get all the argument options that are in the named package, for a particular action, role, and argument number, if any exist. More... | |
| get_schedule_event_param_desc (package_name, action_name, role_name, arg_num) | |
| Get information about a particular schedule event argument. More... | |
| add_location_table (the_table, action_name, action_func, role_list, location_list) | |
| A helper function for populating a schedule event table entry that issues a location-related command. More... | |
| static | do_schedule_action (lua_class_name, group, message_string, location, percent, time_window, params) |
| Executes the action for a schedule event. More... | |
Internal infrastructure | |
| test_schedule_event_roles (entry, desired_role_name) | |
| Verify that a schedule event table handles the desired role. More... | |
| trigger_event (package_name, action_name, role_and_group_name, params) | |
| Launch a schedule event once it has been triggered. More... | |
| static | build_event_table (the_package) |
| Creates the schedule event table and attaches it to package. More... | |
| static | add_package_signals_to_table (the_package) |
| Extracts schedule-able signals from package and adds them to event table. More... | |
| static | handle_signal (the_package, action_name, role, group, real_action_name, percent, time_window) |
| Does an action based on a schedule-able signal. More... | |
| luaScheduleEvents::add_location_table | ( | the_table | , |
| action_name | , | ||
| action_func | , | ||
| role_list | , | ||
| location_list | |||
| ) |
A helper function for populating a schedule event table entry that issues a location-related command.
| the_table | schedule event table from character package |
| action_name | the action |
| action_func | the function to be run when event is triggered |
| role_list | a table containing string values |
| location_list | a table containing location values |
|
static |
Extracts schedule-able signals from package and adds them to event table.
Uses luaMyPackage:get_schedule_signals(), if specified
The results resemble the event table found in luaSimpleSoldier. The signals are packaged in this form as well.
Part of internal schedule editor workings
| the_package | name of package |
|
static |
Creates the schedule event table and attaches it to package.
Uses the table returned by luaMyPackage:export_schedule_events() and luaMyPackage:get_schedule_signals()
The results resemble the event table found in luaSimpleSoldier. The signals are packaged in this form as well.
Part of internal schedule editor workings
| the_package | name of package |
|
static |
Executes the action for a schedule event.
Meant to be called by schedule event handler function specified in luaYourCharacterPackage. See comments of get_schedule_event_actions() for explanation of event table
| lua_class_name | name of luaYourCharacterPackage |
| group | name of character group |
| message_string | a message that process_message() in luaYourCharacterPackage |
| knows | how to handle |
| location | a location string that process_message() knows how to handle |
| percent | the percent of characters in the class/group that will |
| execute | the action |
| time_window | the number of seconds over which characters will receive the message |
| params | a string containing comma-separated parameters (OPTIONAL) |
| luaScheduleEvents::get_lua_minds | ( | group_name | , |
| lua_class_name | |||
| ) |
looks up lua_characters having the given lua package name in the given diguyCharacterGroup
update_package() processes the message queue.
| group_name | name of character group |
| lua_class_name | name of Lua class |
| luaScheduleEvents::get_schedule_event_actions | ( | package_name | ) |
Get all the schedule event actions that are provided by the named package, if any exist.
Requires that the package provide an export_shedule_events() function
Example of event table entry in a package:
| package_name |
| luaScheduleEvents::get_schedule_event_args | ( | package_name | , |
| action_name | , | ||
| role_name | , | ||
| arg_num | |||
| ) |
Get all the argument options that are in the named package, for a particular action, role, and argument number, if any exist.
See comments of get_schedule_event_actions() for explanation of event table
| package_name | |
| action_name | |
| role_name | |
| arg_num | currently between 1 and 3 (may change) |
| luaScheduleEvents::get_schedule_event_param_desc | ( | package_name | , |
| action_name | , | ||
| role_name | , | ||
| arg_num | |||
| ) |
Get information about a particular schedule event argument.
See comments of get_schedule_event_actions() for explanation of event table
| package_name | |
| action_name | |
| role_name | |
| arg_num | currently between 1 and 3 (may change) |
| luaScheduleEvents::get_schedule_event_roles | ( | package_name | , |
| action_name | |||
| ) |
Get all the schedule event roles that are provided by the named package, if any exist.
See comments of get_schedule_event_actions() for explanation of event table
| package_name | |
| action_name |
|
static |
Does an action based on a schedule-able signal.
Part of internal schedule editor workings
| the_package | name of package |
| action_name | ought to be "Trigger Signal" |
| role | the name of the Lua class |
| group | ought to be "all" |
| real_action_name | equivalent to the signal name |
| percent | |
| time_window | number of seconds over which actions will be launched for a character group |
| luaScheduleEvents::init_package | ( | ) |
Standard per-package init function, called at time 0 ADAM CHECK: all functions in this package.
Queues a message that will go to send_message() at a future time.
update_package() processes the message queue.
| lua_character | the character |
| message | the message |
| fraction | what fraction of the time to send the message |
| delay | how many seconds to delay for |
| params | the message parameters |
| luaScheduleEvents::reset_package | ( | ) |
Standard per-package reset function.
Sends a message to given character.
| lua_character | the character |
| message | the message |
| fraction | what fraction of the time to send the message |
| params | the message parameters |
| luaScheduleEvents::test_schedule_event_roles | ( | entry | , |
| desired_role_name | |||
| ) |
Verify that a schedule event table handles the desired role.
Part of internal schedule editor workings
| entry | entry from schedule event table |
| desired_role_name |
| luaScheduleEvents::trigger_event | ( | package_name | , |
| action_name | , | ||
| role_and_group_name | , | ||
| params | |||
| ) |
Launch a schedule event once it has been triggered.
This fires off the handler function that has been specified in the package's schedule event table.
Part of internal schedule editor workings
| package_name | |
| action_name | |
| role_and_group_name | string containing comma-separated pair |
| params | string containing the three chosen arguments, comma-separated |
| luaScheduleEvents::update_package | ( | ) |
Standard per-package update function.
Makes sure that any queued schedule event messages that have come due are sent.