
|
|
This file was automatically generated from diguyCrowd.h. Do not edit this file directly; the changes will be lost.Includes: diguyMotionSpeedType.h | declspec_diguy.h
Contents:
class diguyCrowd
|
class BDI_DECLSPEC_diguy diguyCrowd { public: const char* get_name(); int set_name(const char* name); const char* get_ui_name(); int set_ui_name(const char* ui_name); const char* get_type_name(); int set_enabled(int enabled); int get_enabled(); void set_all_members_enabled(int enabled); float get_awareness_radius(); int set_awareness_radius(float radius); int add_member(diguyCharacter* character); int add_all_characters_in_group(diguyCharacterGroup* group); int remove_member(diguyCharacter* character); int remove_all_members(); int is_member(diguyCharacter* character); int get_num_members(); diguyCharacter* get_member_at_index(int index); int get_index_of_member(diguyCharacter* member); diguyCharacterGroup* get_associated_group(); int agents_attack_character(const char* character_name); int agents_attack_group(const char* group_name); int agents_flee_character(const char* character_name, float distance, int danger_level = 50); int agents_flee_group(const char* group_name, float distance, int danger_level = 50); int agents_flee_crowd(const char* crowd_name, float distance, int danger_level = 50); int agents_flee_location(float x, float y, float z, float distance, int danger_level = 50); void agents_remove_all_flee_objects(); int agents_mingle_in_region(const char* region_name = NULL, const char* subregion = NULL); int agents_pursue_character(const char* character_name); int agents_pursue_group(const char* group_name); int agents_chain_pursue(const char* leader_name); int agents_travel_behavior_path(const char* direction = NULL, const char* at_end = NULL, int waypoint_index = -1, float offset_y = 0.5f); int agents_travel_path_shape(const char* path_shape_name, const char* direction = NULL, const char* at_end = NULL, int waypoint_index = -1, float offset_y = 0.5f); int agents_travel_region_border(const char* region_name, const char* subregion = NULL); int agents_wander_region(const char* region_name = NULL, // NULL -> populate region const char* subregion = NULL); int agents_stop_behavior(); int set_current_behavior(const char* behavior_name); const char* get_current_behavior(int member_index = 0); int set_current_behavior_path_shape(const char* behavior_path_shape_name, float max_time_until_move_on = 0.0f); int set_current_behavior_region(const char* behavior_region_name, const char* subregion = NULL, float max_time_until_move_on = 0.0f); int set_current_focus_character(const char* focus_character_name); int set_current_focus_group(const char* focus_group_name); int set_current_params_from_profile(const char* profile_name, int retain_focus_objects = 1, int retain_navigation_values = 1); void set_current_behavior_region_border_is_solid(int is_solid); void set_current_postures(diguyMotionPosture posture); void set_current_variants(diguyMotionVariant variant); int set_initial_params_from_profile(const char* profile_name); int is_current_behavior(const char* behavior_name, float threshold = 0.5f); int is_current_behavior_and_focus_character(const char* behavior_name, const char* focus_character_name, float threshold = 0.5f); int is_current_behavior_and_focus_group(const char* behavior_name, const char* group_name, float threshold = 0.5f); int is_crowd_dead(float threshold = 0.5f); int add_companion_crowd(diguyCrowd* companion_crowd); int remove_companion_crowd(diguyCrowd* companion_crowd); void set_dynamic_object_avoidance_method(diguyDynamicAvoidanceMethod method); diguyDynamicAvoidanceMethod get_dynamic_object_avoidance_method(); void set_static_object_avoidance_method(diguyStaticAvoidanceMethod method); diguyStaticAvoidanceMethod get_static_object_avoidance_method(); diguyCharacter* get_callback_character(); diguyImpact* get_callback_impact(); enum { CALLBACK_ID_CREATE = 1, CALLBACK_ID_DESTROY, CALLBACK_ID_CROWD_MEMBER_KILLED, CALLBACK_ID_CROWD_MEMBER_IMPACT, CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT, CALLBACK_ID_NEARBY_WEAPON_FIRED, }; #ifdef CPLUSPLUS_ONLY int add_callback(int callback_id, diguyCrowdCallback* callback, void* callback_params = 0, void* callback_user_data = 0); int remove_callback(int callback_id, diguyCrowdCallback* callback); int remove_callback_with_user_data(int callback_id, void* callback_user_data); #endif int add_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int remove_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); #ifdef CPLUSPLUS_ONLY void all_members_add_character_callback(int callback_id, diguyCharacterCallback* callback, void* callback_params = NULL, void* callback_user_data = NULL); void all_members_remove_character_callback(int callback_id, diguyCharacterCallback* callback); void all_members_remove_character_callback_with_user_data(int callback_id, void* callback_user_data); #endif void all_members_add_character_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); void all_members_remove_character_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int map_event_handler_to_callback_id(int callback_id, const char* handler_name); int unmap_event_handler_from_callback_id(int callback_id, const char* handler_name, int unmap_all_matches = 0); diguyRegion* find_or_create_region(); diguyRegion* get_region(); void send_message_to_all_members(const char* message_type, const char* message, const char* message_params = NULL); void set_unit_type(diguyTacticsUnitType tut); diguyTacticsUnitType get_unit_type(); int set_unit_leader(diguyCharacter* leader); diguyCharacter* get_unit_leader();
function diguyCrowd::get_name |
Prototype:
Returns:const char* get_name();
name of this object; this value will never be NULLCallable From:
- C++
- Script
function diguyCrowd::set_name |
Prototype:
Description:int set_name(const char* name);
This function sets the name of this object.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::get_ui_name |
Prototype:
Returns:const char* get_ui_name();
UI name of this object; this value will never be NULLCallable From:
- C++
- Script
function diguyCrowd::set_ui_name |
Prototype:
Description:int set_ui_name(const char* ui_name);
This function sets the UI name of this object. The UI name is what shows up in user interface windows that show information about this crowd.
For example, the crowd name may be "crowd_squad1", the UI name may be "Squad 1".
By default the UI name matches the internal name.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::get_type_name |
Prototype:
Description:const char* get_type_name();
Returns the type name of the object. This pointer will never be NULL.Returns:
type name of the objectCallable From:
- C++
- Script
function diguyCrowd::set_enabled |
Prototype:
Description:int set_enabled(int enabled);
This function enables or disables the crowd.
Disabling a crowd does not disable or hide the members of the crowd. It does turn off any effects the crowd may have on agent actions, position, orientation, etc. To enable or disable all agents in the crowd, use set_all_members_enabled() instead.
Disabled crowds also will not interact with companion crowds.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::get_enabled |
Prototype:
Returns:int get_enabled();
1 if enabled, 0 if notCallable From:
- C++
- Script
- Decision
function diguyCrowd::set_all_members_enabled |
Prototype:
Description:void set_all_members_enabled(int enabled);
This function enables or disables all agents in the crowd. This is the equivalent to calling diguyCharacter::set_enabled() for all members of the crowd.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::get_awareness_radius |
Prototype:
Returns:float get_awareness_radius();
The size of the radius around the crowd's character that certain callbacks will be triggered within. Callbacks such as: CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT, and CALLBACK_ID_NEARBY_WEAPON_FIRED, are affected by this value.Callable From:
- C++
- Script
function diguyCrowd::set_awareness_radius |
Prototype:
Description:int set_awareness_radius(float radius);
Sets the crowd awareness radius. See get_awareness_radius().Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
| Crowd Member Functions |
function diguyCrowd::add_member |
Prototype:
Description:int add_member(diguyCharacter* character);
Adds the passed character to the crowd if not already in it.Returns:
0 if the character is now a part of the crowd; -1 if notCallable From:
- C++
- Script
function diguyCrowd::add_all_characters_in_group |
Prototype:
Description:int add_all_characters_in_group(diguyCharacterGroup* group);
Adds all characters of the group as members of the crowd.Returns:
Always return 0.Callable From:
- C++
- Script
function diguyCrowd::remove_member |
Prototype:
Description:int remove_member(diguyCharacter* character);
Removes the passed character from the crowd if it is a member.Returns:
0 if the character was part of the crowd and removed; -1 if notCallable From:
- C++
- Script
function diguyCrowd::remove_all_members |
Prototype:
Description:int remove_all_members();
Removes all members of the crowd.Returns:
Always return 0.Callable From:
- C++
- Script
function diguyCrowd::is_member |
Prototype:
Returns:int is_member(diguyCharacter* character);
1 if the passed character is a member of the crowd; 0 if notCallable From:
- C++
- Script
function diguyCrowd::get_num_members |
Prototype:
Returns:int get_num_members();
number of member characters in crowdCallable From:
- C++
- Script
function diguyCrowd::get_member_at_index |
Prototype:
Returns:diguyCharacter* get_member_at_index(int index);
crowd member at specified index; NULL if no character at specified indexCallable From:
- C++
- Script
function diguyCrowd::get_index_of_member |
Prototype:
Returns:int get_index_of_member(diguyCharacter* member);
index of crowd member; -1 if not a member of the crowdCallable From:
- C++
- Script
function diguyCrowd::get_associated_group |
Prototype:
Returns:diguyCharacterGroup* get_associated_group();
diguyCharacterGroup associated with the crowd
| Behavior Functions |
| Attack Functions |
function diguyCrowd::agents_attack_character |
Prototype:
Description:int agents_attack_character(const char* character_name);
This is a shortcut for calling diguyCharacter::agent_attack_character() for all members of the crowd.
This function will implicitly put agents into the attack behavior.
The current focus character will be set the specified character. Pass NULL or the empty string ("") to not change the focus character, but still change to the pursue behavior.
The current focus group will be un-set.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::agents_attack_group |
Prototype:
Description:int agents_attack_group(const char* group_name);
This is a shortcut for calling diguyCharacter::agent_attack_group() for all members of the crowd.
This function will implicitly put agents into the attack behavior.
The current focus group will be set the specified group. Pass NULL or the empty string ("") to not change the focus group, but still change to the pursue behavior.
The current focus character will be un-set.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
| Flee Functions |
function diguyCrowd::agents_flee_character |
Prototype:
Description:int agents_flee_character(const char* character_name, float distance, int danger_level = 50);
This is a shortcut for calling diguyCharacter::agent_flee_character() for all members of the crowd.
This function will implicitly put agents into the flee behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::agents_flee_group |
Prototype:
Description:int agents_flee_group(const char* group_name, float distance, int danger_level = 50);
This is a shortcut for calling diguyCharacter::agent_flee_group() for all members of the crowd.
This function will implicitly put agents into the flee behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::agents_flee_crowd |
Prototype:
Description:int agents_flee_crowd(const char* crowd_name, float distance, int danger_level = 50);
This is a shortcut for calling diguyCharacter::agent_flee_crowd() for all members of the crowd.
This function will implicitly put agents into the flee behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::agents_flee_location |
Prototype:
Description:int agents_flee_location(float x, float y, float z, float distance, int danger_level = 50);
This is a shortcut for calling diguyCharacter::agent_flee_location() for all members of the crowd.
This function will implicitly put agents into the flee behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::agents_remove_all_flee_objects |
Prototype:
Description:void agents_remove_all_flee_objects();
This is a shortcut for calling diguyCharacter::agent_remove_all_flee_objects() for all members of the crowd.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
| Mingle Functions |
function diguyCrowd::agents_mingle_in_region |
Prototype:
Description:int agents_mingle_in_region(const char* region_name = NULL, const char* subregion = NULL);
This is a shortcut for calling diguyCharacter::agent_mingle_in_region() for all members of the crowd.
This function will implicitly put agents into the mingle behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
| Pursue Functions |
function diguyCrowd::agents_pursue_character |
Prototype:
Description:int agents_pursue_character(const char* character_name);
This is a shortcut for calling diguyCharacter::agent_pursue_character() for all members of the crowd.
This function will implicitly put agents into the pursue behavior.
The current focus character will be set the specified character. Pass NULL or the empty string ("") to not change the focus character, but still change to the pursue behavior.
The current focus group will be un-set.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::agents_pursue_group |
Prototype:
Description:int agents_pursue_group(const char* group_name);
This is a shortcut for calling diguyCharacter::agent_pursue_group() for all members of the crowd.
This function will implicitly put agents into the pursue behavior.
The current focus group will be set to the specified group. Pass NULL or the empty string ("") to not change the focus group, but still change to the pursue behavior.
The current focus character will be un-set.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::agents_chain_pursue |
Prototype:
Description:int agents_chain_pursue(const char* leader_name);
This causes all members of the crowd to start pursuing the individual that is closer to the leader then they are.
This function will implicitly put all agents except the leader into the pursue behavior.
The current focus character will be set to the next nearest character.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
| Travel Functions |
function diguyCrowd::agents_travel_behavior_path |
Prototype:
Description:int agents_travel_behavior_path(const char* direction = NULL, const char* at_end = NULL, int waypoint_index = -1, float offset_y = 0.5f);
This is a shortcut for calling diguyCharacter::agent_travel_behavior_path() for all members of the crowd.
This function will implicitly put agents into the travel behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::agents_travel_path_shape |
Prototype:
Description:int agents_travel_path_shape(const char* path_shape_name, const char* direction = NULL, const char* at_end = NULL, int waypoint_index = -1, float offset_y = 0.5f);
This is a shortcut for calling diguyCharacter::agent_travel_path_shape() for all members of the crowd.
This function will implicitly put agents into the travel behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::agents_travel_region_border |
Prototype:
Description:int agents_travel_region_border(const char* region_name, const char* subregion = NULL);
This is a shortcut for calling diguyCharacter::agent_travel_region_border() for all members of the crowd.
This function will implicitly put agents into the travel behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
| Wander Functions |
function diguyCrowd::agents_wander_region |
Prototype:
Description:int agents_wander_region(const char* region_name = NULL, // NULL -> populate region const char* subregion = NULL);
This is a shortcut for calling diguyCharacter::agent_wander_region() for all members of the crowd.
This function will implicitly put agents into the wander behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
| Other Behavior Functions |
function diguyCrowd::agents_stop_behavior |
Prototype:
Description:int agents_stop_behavior();
This is a shortcut for calling diguyCharacter::agent_stop_behavior() for all members of the crowd.
This function will implicitly put agents into the none behavior.
Neither the current focus character nor group will be changed by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::set_current_behavior |
Prototype:
Description:int set_current_behavior(const char* behavior_name);
This is a shortcut for calling diguyCharacter::set_current_behavior() for all members of the crowd.
It's recommended that one of the higher level functions above that set behavior, for example agent_wander_region(), is used. These functions allow for setting the most common parameters that affect the behavior in one function call.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::get_current_behavior |
Prototype:
Description:const char* get_current_behavior(int member_index = 0);
Returns the current behavior used by crowd, expressed as a string (e.g. "travel").Returns:
string describing current crowd behavior, NULL on errorCallable From:
- C++
- Script
function diguyCrowd::set_current_behavior_path_shape |
Prototype:
Description:int set_current_behavior_path_shape(const char* behavior_path_shape_name, float max_time_until_move_on = 0.0f);
Similar to diguyAgentParams::set_behavior_path_shape(). This is a shortcut for setting the current behavior path shape for all characters in the crowd.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::set_current_behavior_region |
Prototype:
Description:int set_current_behavior_region(const char* behavior_region_name, const char* subregion = NULL, float max_time_until_move_on = 0.0f);
Similar to diguyAgentParams::set_behavior_region(). This is a shortcut for setting the current behavior region for all characters in the crowd.
This function does take an additional argument, max_time_until_move_on. Setting this to 0 will cause all agents that occasionally pause their movement (for example, characters in the wander behavior) to move on to the new behavior region immediately. Passing a higher number will allow agents to finish their "natural" wait interval before moving on to the new region.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::set_current_focus_character |
Prototype:
Description:int set_current_focus_character(const char* focus_character_name);
Similar to diguyAgentParams::set_focus_character(). This is a shortcut for setting the current focus character for all characters in the crowd.
The current focus group will not be affected by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::set_current_focus_group |
Prototype:
Description:int set_current_focus_group(const char* focus_group_name);
Similar to diguyAgentParams::set_focus_group(). This is a shortcut for setting the current focus group for all characters in the crowd.
The current focus character will not be affected by this function.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::set_current_params_from_profile |
Prototype:
Description:int set_current_params_from_profile(const char* profile_name, int retain_focus_objects = 1, int retain_navigation_values = 1);
This is a shortcut for calling diguyCharacter::agent_set_current_params_from_profile() for all members of the crowd.
This will affect most of the parameters of agents in this crowd, including behavior, posture and variant, etc. Focus character and group by default are changed, but can be left alone by passing 0 for retain_focus_objects.Arguments:
Returns:
profile_name name of crowd profile whose default parameters should be used retain_focus_objects pass 1 to change focus objects to those of the named profile, 0 to retain existing settings retain_navigation_values Documentation Pending
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyCrowd::set_current_behavior_region_border_is_solid |
Prototype:
Description:void set_current_behavior_region_border_is_solid(int is_solid);
This is a shortcut for calling diguyCharacter::agent_set_current_behavior_region_border_is_solid() for all members of the crowd.
Sets whether the walls of the region the agent is in are solid. If they are, the agent will treat the walls as if they are solid walls in the environment. If not, the agent is free to walk through them.
Pass 1 to make border walls solid, 0 to make them freely passable.Callable From:
- C++
- Script
- Decision
function diguyCrowd::set_current_postures |
Prototype:
Description:void set_current_postures(diguyMotionPosture posture);
Sets the posture of all members of the crowd and restarts their behaviors.
function diguyCrowd::set_current_variants |
Prototype:
Description:void set_current_variants(diguyMotionVariant variant);
Sets the variant of all members of the crowd and restarts their behaviors.
function diguyCrowd::set_initial_params_from_profile |
Prototype:
Description:int set_initial_params_from_profile(const char* profile_name);
This function is similar to set_current_params_from_profile(), but instead sets initial params.Arguments:
Returns:
profile_name name of crowd profile whose default parameters should be used
0 on success, -1 on failureCallable From:
- C++
- Script
| Query Functions |
function diguyCrowd::is_current_behavior |
Prototype:
Description:int is_current_behavior(const char* behavior_name, float threshold = 0.5f);
This is a query function meant to allow for flexible behavior when dealing with a crowd. If more than threshold ratio are doing behavior_name then the function will return 1. The default 0.5 yields a simple majority check.Returns:
1 if true, 0 if falseCallable From:
- C++
- Script
- Decision
function diguyCrowd::is_current_behavior_and_focus_character |
Prototype:
Description:int is_current_behavior_and_focus_character(const char* behavior_name, const char* focus_character_name, float threshold = 0.5f);
Similar to is_current_behavior(), but checks both behavior and focus character.
function diguyCrowd::is_current_behavior_and_focus_group |
Prototype:
Description:int is_current_behavior_and_focus_group(const char* behavior_name, const char* group_name, float threshold = 0.5f);
Similar to is_current_behavior(), but checks both behavior and focus group.
function diguyCrowd::is_crowd_dead |
Prototype:
Description:int is_crowd_dead(float threshold = 0.5f);
Similar to is_current_behavior(), but checks whether characters are dead.
| Companion Crowd Functions |
function diguyCrowd::add_companion_crowd |
Prototype:
Description:int add_companion_crowd(diguyCrowd* companion_crowd);
This function makes the specified crowd a "companion crowd" of this crowd. Crowd members of companion crowds know about each other and will attempt to avoid each other.
If two crowds are not companions, their respective crowd members will make no attempt to avoid each other.Arguments:
Returns:
companion_crowd name of crowd to become a companion
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::remove_companion_crowd |
Prototype:
Description:int remove_companion_crowd(diguyCrowd* companion_crowd);
This function removes the specified crowd as a companion crowd.Arguments:
Returns:
companion_crowd name of former companion
0 on success, -1 on failureCallable From:
- C++
- Script
| Avoidance Method Functions |
function diguyCrowd::set_dynamic_object_avoidance_method |
Prototype:
Description:void set_dynamic_object_avoidance_method(diguyDynamicAvoidanceMethod method);
This function sets the dynamic avoidance method that members of this crowd will use to avoid each other. Dynamic objects are objects that are moving around; these are almost always characters.
The enumeration is defined in diguy_constants.h.Arguments:
Returns:
method avoidance method to use
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::get_dynamic_object_avoidance_method |
Prototype:
Returns:diguyDynamicAvoidanceMethod get_dynamic_object_avoidance_method();
current dynamic object avoidance method; see set_dynamic_object_avoidance_method()Callable From:
- C++
- Script
function diguyCrowd::set_static_object_avoidance_method |
Prototype:
Description:void set_static_object_avoidance_method(diguyStaticAvoidanceMethod method);
This function sets the static avoidance method that members of this crowd will use to avoid walking through fixed walls and objects. Usually these are scene objects and fixed props.
The enumeration is defined in diguy_constants.h.Arguments:
Returns:
method avoidance method to use
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::get_static_object_avoidance_method |
Prototype:
Returns:diguyStaticAvoidanceMethod get_static_object_avoidance_method();
current static object avoidance method; see set_static_object_avoidance_method()Callable From:
- C++
- Script
| Callback Functions |
function diguyCrowd::get_callback_character |
Prototype:
Description:diguyCharacter* get_callback_character();
Many of the diguyCrowd callbacks set a callback character which represents if there was a particular character that the callback relates to. A few of the callbacks do not set this value.Returns:
pointer of type diguyCharacter; NULL if there was no associated characterCallable From:
- C++
- Script
function diguyCrowd::get_callback_impact |
Prototype:
Description:diguyImpact* get_callback_impact();
Many of the diguyCrowd callbacks set a callback impact which represents if there was impact that the callback relates to. A few of the callbacks do not set this value.Returns:
pointer of type diguyImpact; NULL if there was no associated impactCallable From:
- C++
- Script
enumeration |
Description:enum { CALLBACK_ID_CREATE = 1, CALLBACK_ID_DESTROY, CALLBACK_ID_CROWD_MEMBER_KILLED, CALLBACK_ID_CROWD_MEMBER_IMPACT, CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT, CALLBACK_ID_NEARBY_WEAPON_FIRED, };
This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script().CALLBACK_ID_CREATE
This callback will be called when a new crowd is created.
Note that this callback can only be added by calling diguyScenario::add_default_crowd_callback(); adding it with diguyCrowd::add_callback() will have no effect, as by that time the crowd has already been created. There is no associated callback character.CALLBACK_ID_DESTROY
This callback will be called when a crowd is destroyed. There is no associated callback character.CALLBACK_ID_CROWD_MEMBER_KILLED
This callback will be called when a member of the crowd is killed.
CALLBACK_ID_CROWD_MEMBER_IMPACT
- The callback character is the crowd member that was killed.
- The callback impact contains the impact information.
Similar to diguyCharacter::CALLBACK_ID_IMPACT, this callback will be called when a member of the crowd is hit by a detonation. If this callback isn't present the impacted character automatically will die. Handling this callback allows for the implementation of custom damage models at a crowd level.
CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT
- The callback character is the crowd member that was hit.
- The callback impact contains the impact information.
This callback will be called when a detonation occurs within the awareness radius (as set by set_awareness_radius()) of the crowd's current bounds.
CALLBACK_ID_NEARBY_WEAPON_FIRED
- The callback character is the character that caused the detonation.
- The callback impact contains the impact information.
This callback will be called when a weapon is fired within the awareness radius (as set by set_awareness_radius()) of the crowd's current bounds.
- The callback character is the character that fired the weapon.
Callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the callback returns DIGUY_CALLBACK_STOP, the default handler of the function will not be called; the callback is asserting that it has done everything necessary for the function call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default handler for the function will be called after the callback.Usable From:
- C++
- Script
function diguyCrowd::add_callback |
Prototype:
Description:int add_callback(int callback_id, diguyCrowdCallback* callback, void* callback_params = 0, void* callback_user_data = 0);
This function adds a user callback. Callbacks can be removed with remove_callback() or remove_callback_with_user_data().Arguments:
Returns:
callback pointer to function with prototype diguyCrowdRegionCallback (typedefed above) callback_id integer id of when this callback is to be called callback_params not currently used; pass NULL callback_user_data pointer for user's own use; DI-Guy will do nothing to the contents of this pointer beyond passing it back when the callback is invoked
0 on success, -1 on failureCallable From:
- C++
function diguyCrowd::remove_callback |
Prototype:
Description:int remove_callback(int callback_id, diguyCrowdCallback* callback);
This function removes a user callback. All callbacks matching the specified callback_id and callback function will be removed.Arguments:
Returns:
callback_id integer id of when this callback is to be called callback pointer to function with prototype diguyCrowdCallback (typedefed above)
0 on success, -1 on failure
function diguyCrowd::remove_callback_with_user_data |
Prototype:
Description:int remove_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a user callback. All callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Returns:
callback_id integer id of when this callback is to be called callback_user_data pointer for user's own use
0 on success, -1 on failure
function diguyCrowd::add_callback_script |
Prototype:
Description:int add_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function adds a user callback script. Callback scripts can be removed with remove_callback_script().
See diguyCharacter::add_callback_script() for an example of use.Arguments:
callback_id integer id of the callback callback_script script text of callback to be added callback_script_type the type of script contained in callback_script If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.lua specific:
When the script is called, the object for which it is being called will be in the callback_object global.
To pass NULL when calling from a lua script, use nil.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::remove_callback_script |
Prototype:
Description:int remove_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a user callback script previously added with add_callback_script().
See diguyCharacter::remove_callback_script() for an example of use.Arguments:
callback_id integer id of the callback callback_script script text of callback previously added callback_script_type the type of script contained in callback_script If NULL is passed for callback_script, all callback scripts whose ids match callback_id and whose types match callback_script_type will be removed.
If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.lua specific:
To pass NULL when calling from a lua script, use nil.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::all_members_add_character_callback |
Prototype:
Description:void all_members_add_character_callback(int callback_id, diguyCharacterCallback* callback, void* callback_params = NULL, void* callback_user_data = NULL);
Equivalent to calling diguyCharacter::add_callback() for all members of the crowd.
Note: callback_id should be a diguyCharacter id, not a diguyCrowd id.
function diguyCrowd::all_members_remove_character_callback |
Prototype:
Description:void all_members_remove_character_callback(int callback_id, diguyCharacterCallback* callback);
Equivalent to calling diguyCharacter::remove_callback() for all members of the crowd.
Note: callback_id should be a diguyCharacter id, not a diguyCrowd id.
function diguyCrowd::all_members_remove_character_callback_with_user_data |
Prototype:
Description:void all_members_remove_character_callback_with_user_data(int callback_id, void* callback_user_data);
Equivalent to calling diguyCharacter::remove_callback_with_user_data() for all members of the crowd.
Note: callback_id should be a diguyCharacter id, not a diguyCrowd id.
function diguyCrowd::all_members_add_character_callback_script |
Prototype:
Description:void all_members_add_character_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
Equivalent to calling diguyCharacter::add_callback_script() for all members of the crowd.
Note: callback_id should be a diguyCharacter id, not a diguyCrowd id.
function diguyCrowd::all_members_remove_character_callback_script |
Prototype:
Description:void all_members_remove_character_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
Equivalent to calling diguyCharacter::remove_callback_script() for all members of the crowd.
Note: callback_id should be a diguyCharacter id, not a diguyCrowd id.
| Event Handler Functions |
function diguyCrowd::map_event_handler_to_callback_id |
Prototype:
Description:int map_event_handler_to_callback_id(int callback_id, const char* handler_name);
This function maps the event handler with the given name to a callback id. This mapping will be saved in the .dss file and restored when the .dss file is loaded.
Mappings can also be made via the DI-Guy Scenario UI.
The event handler is one of the following:
Arguments:
- a scene object callback function registered by diguyScenario::register_crowd_event_handler() or diguyScenario::register_crowd_event_handler_from_library()
- a script registered by diguyScenario::register_crowd_event_handler_script()
- a Script, Decision, or Library Function in the scenario whose "Event Type" is "Crowd"
Returns:
callback_id integer id of callback handler_name name of the event handler to map
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyCrowd::unmap_event_handler_from_callback_id |
Prototype:
Description:int unmap_event_handler_from_callback_id(int callback_id, const char* handler_name, int unmap_all_matches = 0);
This function unmaps the event handler with the given name from a callback id.Arguments:
Returns:
callback_id integer id of callback handler_name name of the event handler to map unmap_all_matches pass 0 to unmap only the first match, pass 1 to unmap all matches
0 on success, -1 on failureCallable From:
- C++
- Script
| Region Functions |
function diguyCrowd::find_or_create_region |
Prototype:
Returns:diguyRegion* find_or_create_region();
diguyRegion associated with the crowd; will be created if it doesn't currently exist
function diguyCrowd::get_region |
Prototype:
Returns:diguyRegion* get_region();
diguyRegion associated with the crowd; may be NULL
| Message Functions |
function diguyCrowd::send_message_to_all_members |
Prototype:
Description:void send_message_to_all_members(const char* message_type, const char* message, const char* message_params = NULL);
Equivalent to calling diguyCharacter::agent_accept_message() for all members of the crowd.Arguments:
Callable From:
message_type what type of message is being sent message the message string message_params optional parameter string
- C++
- Script
| Unit Functions |
function diguyCrowd::set_unit_type |
Prototype:
void set_unit_type(diguyTacticsUnitType tut);
function diguyCrowd::get_unit_type |
Prototype:
diguyTacticsUnitType get_unit_type();
function diguyCrowd::set_unit_leader |
Prototype:
int set_unit_leader(diguyCharacter* leader);
function diguyCrowd::get_unit_leader |
Prototype:
diguyCharacter* get_unit_leader();
| Experimental Functions |
The following functions are experimental and may change or disappear with no warning.
ALL RIGHTS RESERVED.
These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.
Contractor/Manufacturer is:
Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.