
|
|
This file was automatically generated from diguyScenario.h. Do not edit this file directly; the changes will be lost.Includes: declspec_diguy.h | diguyViewCamera.h | diguyViewFog.h | diguyViewLight.h | diguyMotionDirection.h | diguyMotionPosture.h | diguyMotionVariant.h | diguyCharacterTypeMap.h | diguyCharacterFaceExpression.h | diguy_vector_classes.h | diguy_constants.h | diguy_typedefs.h | diguyCharacterPath.h | diguyInteractionMachine.h | diguySensorRegion.h | diguySignal.h | diguyVariable.h | diguyView.h
Contents:
Link against: libdiguy
class diguyScenario
|
class BDI_DECLSPEC_diguy diguyScenario { public: static diguyScenario* get_current_scenario(); const char* get_name(); const char* get_type_name(); const char* get_description(); #ifdef CPLUSPLUS_ONLY int update(float t); int update2(float t, float realtime_t); int set_playback_loop(int playback_loop); int set_tick_dt(float tick_dt); #endif float get_t(); float get_realtime_t(); float get_desired_t(); int set_tout(float tout); float get_tout(); void set_tout_enabled(int tout_enabled); int get_tout_enabled(); int get_playback_loop(); float get_tick_dt(); int get_ticks_can_be_dropped(); void set_ticks_can_be_dropped(int ticks_can_be_dropped); long get_max_ticks_behind_until_drop(); void set_max_ticks_behind_until_drop(long max_ticks_behind_until_drop); int set_playback_mode(diguyScenarioPlaybackMode playback_mode); int set_playback_mode_stop(); int set_playback_mode_play(); diguyScenarioPlaybackMode get_playback_mode(); float derive_playback_mode_dt(float dt_in); int reset(); #ifdef CPLUSPLUS_ONLY int load(const char* filename); int save(); int save_as(const char* filename); const char* get_filename(); const char* get_filename_without_directory(); int get_unsaved(); void set_unsaved(int unsaved); #ifdef CPLUSPLUS_ONLY int draw(); int draw_pass1(); int draw_pass2(int also_call_post_draw = 1); #endif // CPLUSPLUS_ONLY int post_draw(int call_plugins_post_draw = 1, int call_lua_packages_draw = 1, int call_post_draw_callback = 1); int set_graphics_attach_ptr(void* graphics_attach_ptr); #endif // CPLUSPLUS_ONLY diguyScenarioMergeSettings* create_merge_settings(diguyScenarioMergeInitialSettings initial_settings = DIGUY_MERGE_INITIAL_SETTINGS_DEFAULT); void destroy_merge_settings(diguyScenarioMergeSettings* merge_settings); int merge(const char* filename, diguyScenarioMergeSettings* merge_settings = NULL); int merge_object(const char* string); int include_object_library(const char* library_name); int uninclude_object_library(const char* library_name); void set_base_datetime(int year = -1, int month = -1, int day = -1, int hour = -1, int minute = -1, int second = -1, int msec = -1); void set_base_datetime(const char* datetime_string, const char* format); void get_base_datetime(int* year = NULL, int* month = NULL, int* day = NULL, int* hour = NULL, int* minute = NULL, int* second = NULL, int* msec = NULL); void set_base_datetime_default_to_now(int to_now); int get_base_datetime_default_to_now(); void set_base_datetime_default_to_today(int to_today); int get_base_datetime_default_to_today(); void set_current_datetime(int year = -1, int month = -1, int day = -1, int hour = -1, int minute = -1, int second = -1, int msec = -1); void set_current_datetime(const char* datetime_string, const char* format); void get_current_datetime(int* year = NULL, int* month = NULL, int* day = NULL, int* hour = NULL, int* minute = NULL, int* second = NULL, int* msec = NULL); const char* get_current_datetime_string(const char* format); void set_datetimes_are_utc(int are_utc); int get_datetimes_are_utc(); void set_utc_offset_hours(float utc_offset_hours); float get_utc_offset_hours(); void set_use_local_tz_utc_offset_hours(int use_local_tz); int get_use_local_tz_utc_offset_hours(); void set_current_datetime_advance_method(diguyDatetimeAdvanceMethod advance_method); diguyDatetimeAdvanceMethod get_current_datetime_advance_method(); void set_current_datetime_advance_factor(float advance_factor); float get_current_datetime_advance_factor(); void get_network_datetime(int* year = NULL, int* month = NULL, int* day = NULL, int* hour = NULL, int* minute = NULL, int* second = NULL, int* msec = NULL); int set_tin_time_of_day(float t); float get_tin_time_of_day(); float get_time_of_day(); #ifdef CPLUSPLUS_ONLY int add_appearance(const char* appearance, char** equipment_list, char** character_types, const char* actor); int add_appearance_based_on_existing_appearance(const char* appearance, const char* existing_appearance, char** equipment_list); int remove_appearance(const char* appearance); #endif // CPLUSPLUS_ONLY int get_num_character_types_with_appearance(const char* appearance_name); const char *get_character_type_from_appearance(const char* appearance_name, int index = 0); int preload_character_type(const char* character_type); int preload_appearance(const char* appearance); int preload_gesture(const char* character_type, const char* gesture_name); void set_character_culling_enabled(int character_culling); int get_character_culling_enabled(); void set_scene_object_culling_enabled(int object_culling); int get_scene_object_culling_enabled(); void set_scene_object_sub_culling_enabled(int object_culling); int get_scene_object_sub_culling_enabled(); void set_character_visualize_bounds_enabled(int visualize_bounds); int get_character_visualize_bounds_enabled(); void set_scene_object_visualize_bounds_enabled(int val); int get_scene_object_visualize_bounds_enabled(); int get_num_character_types(); const char* get_character_type_at_index(int index); const char* get_character_type_abbreviation(const char* character_type); const char* get_character_type_deprecated_at_version(const char* character_type); const char* get_character_type_deprecated_suggested_alternatives(const char* character_type); int get_character_type_quality_bias(const char* character_type); diguyCharacterTypeMap* get_character_type_map(const char* character_type); const char* get_character_type_default_appearance(const char* character_type); const char* get_character_type_default_skinned_appearance(const char* character_type); int get_character_type_num_appearances(const char* character_type); const char* get_character_type_appearance_at_index(const char* character_type, int index); int get_character_type_num_head_appearances(const char* character_type); const char* get_character_type_head_appearance_at_index(const char* character_type, int index); int get_character_type_num_actions(const char* character_type); const char* get_character_type_action_at_index(const char* character_type, int index); float get_character_type_action_speed(const char* character_type, const char* action_name); float get_character_type_action_duration(const char* character_type, const char* action_name); float get_character_type_action_distance(const char* character_type, const char* action_name); diguyMotionDirection get_character_type_action_direction( const char* character_type, const char* action_name); float get_character_type_action_facing_angle_in(const char* character_type, const char* action_name); float get_character_type_action_facing_angle_out(const char* character_type, const char* action_name); int get_character_type_num_gestures(const char* character_type); const char* get_character_type_gesture_at_index(const char* character_type, int index); diguyCharacter* create_character(const char* name, const char* character_type, const char* appearance = NULL); diguyCharacter* create_temporary_character(const char* name, const char* character_type, const char* appearance = NULL); int destroy_character(diguyCharacter* character); int send_character_to_recycle_bin(diguyCharacter* character); diguyCharacter* retrieve_character_from_recycle_bin(const char* name, const char* character_type, const char* appearance, int make_character_temporary = 0); int get_num_characters(); diguyCharacter* get_character_at_index(int index); diguyCharacter* find_character(const char* name); void look_at_character(diguyCharacter* character); diguyCharacter* this_character(); diguyCharacterPathEvent* this_event_bead(); int get_num_path_shapes(); diguyPathShape* get_path_shape_at_index(int index); diguyPathShape* get_current_path_shape(); diguyPathShape* find_path_shape(const char* name); diguyPathShape* create_path_shape(const char* name); diguyPathShape* copy_path_shape(diguyPathShape* existing_path_shape, const char* name); int destroy_path_shape(diguyPathShape* path_shape); diguyWaypoint* create_waypoint(float x = 0.0f, float y = 0.0f, float z = 0.0f, float yaw = 0.0f, float roll = 0.0f, float pitch = 0.0f, float weight_in = DIGUY_DEFAULT_FLOAT, float weight_out = DIGUY_DEFAULT_FLOAT); int destroy_waypoint(diguyWaypoint* waypoint); diguyCharacterTypeMap* get_nearest_character_type_map( diguyCharacterTypeMapField field1, const char* field1_value, const char* field1_alternate_value, diguyCharacterTypeMapField field2 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field2_value = NULL, const char* field2_alternate_value = NULL, diguyCharacterTypeMapField field3 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field3_value = NULL, const char* field3_alternate_value = NULL, diguyCharacterTypeMapField field4 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field4_value = NULL, const char* field4_alternate_value = NULL, diguyCharacterTypeMapField field5 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field5_value = NULL, const char* field5_alternate_value = NULL, diguyCharacterTypeMapField field6 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field6_value = NULL, const char* field6_alternate_value = NULL, diguyCharacterTypeMapField field7 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field7_value = NULL, const char* field7_alternate_value = NULL, diguyCharacterTypeMapField field8 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field8_value = NULL, const char* field8_alternate_value = NULL); diguyCharacterTypeMap* get_nearest_character_type_map_using_field_strings( const char* field1_string, const char* field1_value, const char* field1_alternate_value, const char* field2_string = NULL, const char* field2_value = NULL, const char* field2_alternate_value = NULL, const char* field3_string = NULL, const char* field3_value = NULL, const char* field3_alternate_value = NULL, const char* field4_string = NULL, const char* field4_value = NULL, const char* field4_alternate_value = NULL, const char* field5_string = NULL, const char* field5_value = NULL, const char* field5_alternate_value = NULL, const char* field6_string = NULL, const char* field6_value = NULL, const char* field6_alternate_value = NULL, const char* field7_string = NULL, const char* field7_value = NULL, const char* field7_alternate_value = NULL, const char* field8_string = NULL, const char* field8_value = NULL, const char* field8_alternate_value = NULL); diguyCharacterTypeMap* get_nearest_character_type_map_id_match(const char* type_map_id); int get_num_character_type_map_entries(); diguyCharacterTypeMap* get_character_type_map_entry_at_index(int index); int get_num_type_map_character_classes(); const char* get_type_map_character_class_at_index(int index); int get_num_type_map_categories(const char* character_class); const char* get_type_map_category_at_index(const char* character_class, int index); int get_num_type_map_subcategories(const char* character_class, const char* category); const char* get_type_map_subcategory_at_index(const char* character_class, const char* category, int index); int get_num_signals(); diguySignal* get_signal_at_index(int index); diguySignal* find_signal(const char* name); diguySignal* create_signal(const char* name); int destroy_signal(diguySignal* signal); void reset_signals(); int signal_palette_hide_all(const char* filter = NULL); int signal_palette_show_all(const char* filter = NULL); int get_num_sounds(); diguySound* get_sound_at_index(int index); diguySound* find_sound(const char* name); diguySound* create_sound(const char* name, const char* sound_filename = NULL, const char* phoneme_filename = NULL); int destroy_sound(diguySound* sound); int preload_sound(diguySound* sound); int stop_all_sounds(float rampdown_time = 0.0f); int play_3d_sound(const char* name, float x, float y, float z, float gain, int save_event); int get_num_groups(); diguyCharacterGroup* get_group_at_index(int index); diguyCharacterGroup* find_group(const char* name); diguyCharacterGroup* create_group(const char* name); diguyCharacterGroup* find_or_create_group(const char* name); int destroy_group(diguyCharacterGroup* group); int get_num_sensor_regions(); diguySensorRegion* get_sensor_region_at_index(int index); diguySensorRegion* find_sensor_region(const char* name); int get_num_scene_objects(); diguySceneObject* get_scene_object_at_index(int index); diguySceneObject* find_scene_object(const char* name); void set_scene_objects_enabled(int scene_objects_enabled); int get_scene_objects_enabled(); diguySceneObject* create_scene_object(const char* name, const char* filename); diguySceneObject* create_user_defined_scene_object(const char* name); int destroy_scene_object(diguySceneObject* scene_object); diguyView* get_primary_view(); int get_num_secondary_views(); diguyView* get_secondary_view_at_index(int index); diguyView* find_view(const char* name); diguyViewCamera* get_scenario_camera(); diguyViewCamera* find_camera(const char* name); void set_scenario_camera_affected_by_script_events(int flag); int get_scenario_camera_affected_by_script_events(); void set_scenario_camera_affected_by_script_events_when_iguy_active(int flag); int get_scenario_camera_affected_by_script_events_when_iguy_active(); int get_num_camera_settings(); diguyViewCameraSettings* get_camera_settings_at_index(int index); diguyViewCameraSettings* find_camera_settings(const char* settings_name); int load_camera_settings(const char* settings_name, int update_current_camera = 1); void set_render_camera(diguyViewCamera* camera); diguyViewFog* get_scenario_fog(); diguyViewFog* find_fog(const char* name); diguyViewFog* find_or_create_fog(const char* name); void load_current_fog(const char* name); int get_num_fog_settings(); diguyViewFogSettings* get_fog_settings_at_index(int index); diguyViewFogSettings* find_fog_settings(const char* settings_name); int load_fog_settings(const char* settings_name); diguyViewLight* get_scenario_light(int i = 0); diguyViewLight* find_light(const char* name); int get_num_light_settings(); diguyViewLightSettings* get_light_settings_at_index(int index); diguyViewLightSettings* find_light_settings(const char* settings_name); int load_light_settings(const char* settings_name, int light_num = 0); int get_num_info_popups(); diguyInfoPopup* get_info_popup_at_index(int index); diguyInfoPopup* find_info_popup(const char* name); int set_info_popup_default_encoding(const char* info_popup_default_encoding); const char* get_info_popup_default_encoding(); int get_num_variables(); diguyVariable* get_variable_at_index(int index); diguyVariable* find_variable(const char* name); diguyVariable* find_or_create_variable(const char* name); int destroy_variable(diguyVariable* variable); int get_num_face_expressions(); diguyCharacterFaceExpression* get_face_expression_at_index(int index); diguyCharacterFaceExpression* find_face_expression(const char* name); diguyCharacterFaceExpression* create_face_expression(const char* name, const char* target_actor = "exface"); int destroy_face_expression(diguyCharacterFaceExpression* face_expression); int get_num_chain_settings(); diguyChainSettings* get_chain_settings_at_index(int index); diguyChainSettings* find_chain_settings(const char* name); diguyChainSettings* create_chain_settings(const char* name); int destroy_chain_settings(diguyChainSettings* chain_settings); enum { CALLBACK_ID_CREATE = 1, CALLBACK_ID_DESTROY, CALLBACK_ID_RESET, CALLBACK_ID_WAIT_CURSOR_SHOW, CALLBACK_ID_WAIT_CURSOR_HIDE, CALLBACK_ID_LOAD, CALLBACK_ID_SAVE, CALLBACK_ID_LOAD_SCENARIO_FILE, CALLBACK_ID_SAVE_SCENARIO_FILE, CALLBACK_ID_SCENE_OBJECT_IMPACT, CALLBACK_ID_TIMED_EVENT, CALLBACK_ID_MANUALLY_INVOKED, CALLBACK_ID_POST_DRAW, CALLBACK_ID_PLAYBACK_MODE_CHANGED, CALLBACK_ID_INPUT_MODE_CHANGED, CALLBACK_ID_RENDER_MODE_CHANGED, CALLBACK_ID_PRE_REINITIALIZE, CALLBACK_ID_POST_REINITIALIZE, CALLBACK_ID_POST_LOAD_CHECKPOINT }; #ifdef CPLUSPLUS_ONLY int add_callback(int callback_id, diguyScenarioCallback* callback, void* callback_params = 0, void* callback_user_data = 0, int remove_on_scenario_load = 1); int remove_callback(int callback_id, diguyScenarioCallback* callback); int remove_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_character_callback(int callback_id, diguyCharacterCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_character_callback(int callback_id, diguyCharacterCallback* callback); int remove_default_character_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_path_callback(int callback_id, diguyCharacterPathCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_path_callback(int callback_id, diguyCharacterPathCallback* callback); int remove_default_path_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_sensor_region_callback(int callback_id, diguySensorRegionCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_sensor_region_callback(int callback_id, diguySensorRegionCallback* callback); int remove_default_sensor_region_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_signal_callback(int callback_id, diguySignalCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_signal_callback(int callback_id, diguySignalCallback* callback); int remove_default_signal_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_variable_callback(int callback_id, diguyVariableCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_variable_callback(int callback_id, diguyVariableCallback* callback); int remove_default_variable_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_view_callback(int callback_id, diguyViewCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 1, int remove_on_scenario_load = 1); int remove_default_view_callback(int callback_id, diguyViewCallback* callback); int remove_default_view_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_camera_callback(int callback_id, diguyViewCameraCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_camera_callback(int callback_id, diguyViewCameraCallback* callback); int remove_default_camera_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_fog_callback(int callback_id, diguyViewFogCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_fog_callback(int callback_id, diguyViewFogCallback* callback); int remove_default_fog_callback_with_user_data(int callback_id, void* callback_user_data); int add_default_light_callback(int callback_id, diguyViewLightCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_light_callback(int callback_id, diguyViewLightCallback* callback); int remove_default_light_callback_with_user_data(int callback_id, void* callback_user_data); #endif void manually_invoke_callbacks_now(int callback_id); int add_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int remove_on_scenario_load = 1); int remove_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int add_default_character_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_character_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int add_default_sensor_region_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_sensor_region_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int add_default_signal_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_signal_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int add_default_variable_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_variable_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int add_default_view_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_view_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int add_default_camera_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_camera_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int add_default_fog_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_fog_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int add_default_light_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1); int remove_default_light_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); diguyCallbackReturn manually_invoke_event_handler(const char* handler_name); #ifdef CPLUSPLUS_ONLY int register_character_event_handler(const char* handler_name, diguyCharacterCallback* callback, void* callback_user_data = 0); #endif int register_character_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0); int register_character_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = 0); int has_registered_character_event_handler(const char* handler_name); int unregister_character_event_handler(const char* handler_name); #ifdef CPLUSPLUS_ONLY int register_signal_event_handler(const char* handler_name, diguySignalCallback* callback, void* callback_user_data = 0); #endif int register_signal_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0); int register_signal_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = 0); int has_registered_signal_event_handler(const char* handler_name); int unregister_signal_event_handler(const char* handler_name); #ifdef CPLUSPLUS_ONLY int register_sensor_region_event_handler(const char* handler_name, diguySensorRegionCallback* callback, void* callback_user_data = 0); #endif int register_sensor_region_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0); int register_sensor_region_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = 0); int has_registered_sensor_region_event_handler(const char* handler_name); int unregister_sensor_region_event_handler(const char* handler_name); #ifdef CPLUSPLUS_ONLY int register_variable_event_handler(const char* handler_name, diguyVariableCallback* callback, void* callback_user_data = 0); #endif int register_variable_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0); int register_variable_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = 0); int has_registered_variable_event_handler(const char* handler_name); int unregister_variable_event_handler(const char* handler_name); int save_review_data(const char* filename); int get_loaded_from_review_data(); int set_history_type(diguyHistoryType history_type); diguyHistoryType get_history_type(); void set_overall_history_type(diguyHistoryType overall_history_type); diguyHistoryType get_overall_history_type(); int get_replaying_history(); void set_history_max_sound_instances(int num_sound_instances); void set_automatic_graphics_lod_switching(int enable_graphics_lod_switching); int get_automatic_graphics_lod_switching(); #ifdef CPLUSPLUS_ONLY void set_default_lod_ranges(const char* character_type, float* ranges); #endif void set_scale_graphics_lod_ranges_from_view_settings(int do_scale); int get_scale_graphics_lod_ranges_from_view_settings(); void set_automatic_motion_lod_switching(int enable_motion_lod_switching); int get_automatic_motion_lod_switching(); int eval_script(const char* script_text, int save_as_transient = 0, const char* script_type = NULL, const char* script_source = NULL); int eval_script_file(const char* filename, const char* script_type = NULL); int trigger_script(const char* script_name); void trigger_script_delayed(const char* script_name, float t_delay); int trigger_decision(const char* decision_name); void trigger_decision_delayed(const char* decision_name, float t_delay); void push_transient_script_event(float t, const char* script_text, const char* script_type); void clear_transient_script_events(); int save_transient_script_events(const char* filename); int load_transient_script_events(const char* filename); int load_package(const char* filename, const char* language = NULL, int warn_if_not_found = 1); int load_package_with_dependancy(const char* filename, const char* depends_on_package, const char* language = NULL, int warn_if_not_found = 1); int get_character_type_num_postures(const char* character_type); diguyMotionPosture get_character_type_posture_at_index(const char* character_type, int index); diguyMotionPosture get_character_type_action_posture(const char* character_type, const char* action_name); int get_character_type_num_variants(const char* character_type); diguyMotionVariant get_character_type_variant_at_index(const char* character_type, int index); diguyMotionVariant get_character_type_action_primary_variant(const char* character_type, const char* action_name); int get_character_type_action_num_variants(const char* character_type, const char* action_name); diguyMotionVariant get_character_type_action_variant_at_index(const char* character_type, const char* action_name, int index); int get_character_type_num_directions(const char* character_type); diguyMotionDirection get_character_type_direction_at_index(const char* character_type, int index); int get_num_interaction_machines(); diguyInteractionMachine* create_interaction_machine(const char* name); void destroy_interaction_machine(diguyInteractionMachine* interaction_machine); diguyInteractionMachine* get_interaction_machine_at_index(int index); diguyInteractionMachine* find_interaction_machine(const char* name); diguyInteractionMachine* get_active_interaction_machine(); diguyInteractionMachine* get_shared_interaction_machine(); int show_notification_with_shared_interaction_machine(const char* heading, const char* info, int pause_scenario = 0, const char* input_text = NULL, int ui_appearance = diguyInteractionMachine::UI_APPEARANCE_NOTIFICATION); diguyIGuyController* get_iguy_controller(); diguyViewLabel* find_or_create_label(const char* name); diguyViewLabel* find_label(const char* name); int destroy_label(diguyViewLabel* label); int get_num_labels(); diguyViewLabel* get_label_at_index(int index); void reset_labels(); void send_label_to_front(diguyViewLabel* label); void send_label_to_back(diguyViewLabel* label); diguyViewButtonPanel* find_or_create_panel(const char* name, int horizontal = 0, int title = 1); diguyViewButtonPanel* find_panel(const char* name); int destroy_panel(diguyViewButtonPanel* panel); int get_num_panels(); diguyViewButtonPanel* get_panel_at_index(int index); int get_num_minds(); const char* get_mind_name_at_index(int index); int is_valid_character_pointer(diguyCharacter* character); int is_valid_character_group_pointer(diguyCharacterGroup* character_group); diguyCrowd* create_crowd(const char* name, int make_companion_of_all = 1); int destroy_crowd(diguyCrowd* crowd, int also_destroy_crowd_members = 0, int also_destroy_path_shapes = 0, int delay_destruction = 0); int get_num_crowds(); diguyCrowd* get_crowd_at_index(int index); const char* get_unique_crowd_name(const char* base_name); diguyCrowd* find_crowd(const char* crowd_name); diguyCrowd* find_or_create_crowd(const char* crowd_name, int make_companion_of_all = 1); void set_create_network_crowds(int do_create); int get_create_network_crowds(); diguyCrowdProfile* create_crowd_profile(const char* name); int destroy_crowd_profile(diguyCrowdProfile* crowd_profile); int get_num_crowd_profiles(); diguyCrowdProfile* get_crowd_profile_at_index(int index); diguyCrowdProfile* find_crowd_profile(const char* name); diguyLoadManager* get_character_load_manager(); int force_octtree_generation(); void add_character_to_octtree(diguyCharacter* character, int use_bounding_box_only = 0); void remove_character_from_octtree(diguyCharacter* character); int preload_octtree(const char* character_type, const char* appearance); int check_visibility(float x1, float y1, float z1, float x2, float y2, float z2); #ifdef CPLUSPLUS_ONLY int set_default_character_altitude_function(diguyAltitudeFunction* altitude_function); void set_altitude_function(diguyScenarioAltitudeFunction* altitude_function); diguyScenarioAltitudeFunction* get_altitude_function(); #endif void set_altitude_max_climb(float altitude_max_climb); float get_altitude_max_climb(); void set_altitude_max_drop(float altitude_max_drop); float get_altitude_max_drop(); static void set_default_intersection_function(diguyScenarioIntersectionFunction* intersection_function); void set_intersection_function(diguyScenarioIntersectionFunction* intersection_function); int trigger_detonation(const char* munition_name, float x, float y, float z, const char* attacker_name = NULL, float radius_override = -1.0f, int broadcast_on_network = 1); diguyImpact* find_character_at_screen_coords(diguyView* view, float sx, float sy); diguyImpact* get_impact_at_screen_coords(diguyView* view, float sx, float sy, int use_octtree = 0); diguyImpact* get_intersection_at_screen_coords(diguyView* view, float sx, float sy, int use_octtree = 0); int intersect_static_geometry( float origin_x, float origin_y, float origin_z, float dir_x, float dir_y, float dir_z, float max_distance_to_test, float* intersection_x, float* intersection_y, float* intersection_z, float* normal_x = NULL, float* normal_y = NULL, float* normal_z = NULL, int use_callback = 1); float ground_clamp(float x, float y, float z, int* valid = NULL, int use_altitude_function = 1, int use_octtree = 0); #ifdef CPLUSPLUS_ONLY int set_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function); static void set_default_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function); #endif diguyImpact* map_color_to_impact(char r, char g, char b); diguyImpact* get_last_env_impact_info(); void set_last_impact_been_processed(); void set_last_env_impact_info(const diguyImpact& impact); void set_max_unprocessed_impacts(int max_unprocessed_impacts); #ifdef CPLUSPLUS_ONLY int set_default_point_los_function(diguyPointLOSFunction* point_los_function); int set_default_character_los_function(diguyCharacterLOSFunction* character_los_function); int set_default_agent_feeler_function(diguyFeelerFunction* feeler_function); #endif diguyIntersectionResult exp_intersect_geometry( float origin_x, float origin_y, float origin_z, float dir_x, float dir_y, float dir_z, float max_distance_to_test, int use_callback = 1); diguyRegion* find_or_create_region(const char* name); diguyRegion* find_region(const char* name); diguyRegion* create_region(const char* name); void destroy_region(diguyRegion* region); int get_num_regions(); diguyRegion* get_region_at_index(int index); int find_navigation_path(float x1, float y1, float z1, float x2, float y2, float z2, const char* via_region, diguyPathShape* path_shape, float cost_bias_for_preferred_regions = 0.25f, int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE, float cost_bias_for_neutral_regions = 1.1f, int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE, float cost_bias_for_repulsive_regions = 100.0f); void set_max_distance_planning_multiplier(float mul); float get_max_distance_planning_multiplier(); float get_time_spent_path_planning_this_frame(); void set_multithreaded_path_planning_enabled(int value); int get_multithreaded_path_planning_enabled(); int get_num_formations(); diguyFormation* get_formation_at_index(int index); diguyFormation* find_formation(const char* name); diguyFormation* find_formation_of_size(int size); diguyFormation* create_formation(const char* name); diguyFormation* find_or_create_formation(const char* name); int destroy_formation(diguyFormation* formation); void set_action_bead_labels_visible(diguyVisibleFlag vflag); void set_aim_trajectories_visible(diguyVisibleFlag vflag); void set_author_selection_handles_visible(diguyVisibleFlag vflag); void set_bead_array_visible(diguyVisibleFlag vflag); void set_character_labels_visible(diguyVisibleFlag vflag); void set_character_visible(diguyVisibleFlag vflag); void set_crowd_behavior_visible(diguyVisibleFlag flag); void set_crowd_feelers_visible(diguyVisibleFlag flag); void set_crowd_influence_visible(diguyVisibleFlag flag); void set_crowd_regions_visible(diguyVisibleFlag flag); void set_light_array_visible(diguyVisibleFlag vflag); void set_lua_objects_visible(diguyVisibleFlag flag); void set_mesh_region_array_visible(diguyVisibleFlag vflag); void set_sensor_region_array_visible(diguyVisibleFlag vflag); void set_spath_visible(diguyVisibleFlag vflag); void set_waypoint_array_visible(diguyVisibleFlag vflag); diguyVisibleFlag get_action_bead_labels_visible(); diguyVisibleFlag get_aim_trajectories_visible(); diguyVisibleFlag get_author_selection_handles_visible(); diguyVisibleFlag get_bead_array_visible(); diguyVisibleFlag get_character_labels_visible(); diguyVisibleFlag get_character_visible(); diguyVisibleFlag get_crowd_behavior_visible(); diguyVisibleFlag get_crowd_feelers_visible(); diguyVisibleFlag get_crowd_influence_visible(); diguyVisibleFlag get_crowd_regions_visible(); diguyVisibleFlag get_light_array_visible(); diguyVisibleFlag get_lua_objects_visible(); diguyVisibleFlag get_mesh_region_array_visible(); diguyVisibleFlag get_sensor_region_array_visible(); diguyVisibleFlag get_spath_visible(); diguyVisibleFlag get_waypoint_array_visible(); void set_hide_author_selection_handles_during_play(int visible); int get_hide_author_selection_handles_during_play(); int get_weapon_fire_effects_enabled(); int set_weapon_fire_effects_enabled(int enabled); int get_num_active_fire_effects(); int get_weapon_fire_effect_data(int index, float * radius, float * position_x, float * position_y, float * position_z, float * color_r, float * color_g, float * color_b, float * falloff_r, float * falloff_rsq); int set_current_character(diguyCharacter* current_character); diguyCharacter* get_current_character(); int set_current_crowd(diguyCrowd* current_crowd); diguyCrowd* get_current_crowd(); int set_current_crowd_profile(diguyCrowdProfile* current_profile); int set_current_crowd_profile_by_name(const char* crowd_profile_name); diguyCrowdProfile* get_current_crowd_profile(); int set_current_region(diguyRegion* current_region); diguyRegion* get_current_region(); void set_particle_module_disabled(int disable_particle_module); int create_particle_system(const char* description_name, float x, float y, float z, int record_transient_event = 1, float duration = -1.0f); int create_particle_system_with_orientation(const char* description_name, float x, float y, float z, float rz, float rx, float ry, int record_transient_event = 1, float duration = -1.0f); int has_particle_description(const char* description_name); void set_global_wind(float x, float y, float z); const char* lua_get_object_field_as_string(const char* lua_object, const char* field_name); const char* lua_evaluate_object_function(const char* lua_object, const char* function_name, const char* argument = NULL, int has_return_string = 0); const char* lua_evaluate_object_function_2a(const char* lua_object, const char* function_name, const char* argument, const char* argument2, int has_return_string = 0); const char* lua_evaluate_object_function_3a(const char* lua_object, const char* function_name, const char* argument, const char* argument2, const char* argument3, int has_return_string = 0); const char* lua_evaluate_object_function_4a(const char* lua_object, const char* function_name, const char* argument, const char* argument2, const char* argument3, const char* argument4, int has_return_string = 0); int lua_send_message_to_object(const char* lua_object, const char* sender, const char* message_type, const char* message, const char* message_params = NULL); #ifdef CPLUSPLUS_ONLY void* get_lua_state(); int push_qt_pointer_to_lua(void* lua_state, const char* class_name, void* ptr); const char* lua_evaluate_object_function_4a_flex(const char* lua_object, const char* function_name, const char* arg1_type, void* argument1, const char* arg2_type, void* argument2, const char* arg3_type, void* argument3, const char* arg4_type, void* argument4, int has_return_string = 0); const char* lua_evaluate_global_function_4a_flex(const char* function_name, const char* arg_type, void* argument, const char* arg_type2, void* argument2, const char* arg_type3, void* argument3, const char* arg_type4, void* argument4, int has_return_string = 0); #endif int lua_log_printf(int notify_level, const char* string); const char* dump_package_info(const char* package_name); int get_eval_decisions_as_scripts(); void set_eval_decisions_as_scripts(int eval_decisions_as_scripts); diguyImpact* get_impact_on_line(float from_x, float from_y, float from_z, float to_x, float to_y, float to_z); void wait_cursor_push(); void wait_cursor_pop(); #ifdef CPLUSPLUS_ONLY void set_graphics_api_node_ptr(void* node_ptr); void* get_graphics_api_node_ptr(); #endif void set_draw_character_shadow_disks(int draw_character_shadow_disks); int get_draw_character_shadow_disks(); int get_shadow_map_size(); int set_shadow_map_size(int shadow_size); void set_default_character_scene_graph_mask(unsigned long mask); unsigned long get_default_character_scene_graph_mask(); void set_default_scene_object_scene_graph_mask(unsigned long mask); unsigned long get_default_scene_object_scene_graph_mask(); void set_internal_int(int var, int val); void set_internal_float(int var, float val); int set_num_active_point_lights(int active_lights); int get_num_active_point_lights(); int optimized_update(float t); int set_world_bounds(float x_min, float y_min, float z_min, float x_max, float y_max, float z_max); int get_world_bounds(float* x_min, float* y_min, float* z_min, float* x_max, float* y_max, float* z_max); void set_checkpoint_frequency(float freq); float get_checkpoint_frequency(); void set_checkpointing_enabled(int enable_checkpointing); int get_checkpointing_enabled(); void set_initial_render_mode(const char* render_mode); const char* get_initial_render_mode(); void set_current_render_mode(const char* render_mode); const char* derive_render_mode_from_light_settings(int set_current_to_derived = 1); const char* get_current_render_mode(); void set_default_character_shader(const char* render_mode, const char* shader_name, int update_existing_characters = 1); const char* get_default_character_shader(const char* render_mode); void set_default_scene_object_shader(const char* render_mode, const char* shader_name, int update_existing_scene_objects = 1); const char* get_default_scene_object_shader(const char* render_mode); void set_default_particle_system_shader(const char* render_mode, const char* shader_name, int update_existing_particle_systems = 1); const char* get_default_particle_system_shader(const char* render_mode); int facefx_mount_animset(const char* actor_name, const char* file_name); int set_vehicle_smoothing_enabled(int enable_smoothing); int get_vehicle_smoothing_enabled(); int set_character_culling_distance(float dist); float get_character_culling_distance(); int set_vehicle_culling_distance(float dist); float get_vehicle_culling_distance(); int set_prop_culling_distance(float dist); float get_prop_culling_distance(); #ifdef CPLUSPLUS_ONLY static int add_default_callback(int callback_id, diguyScenarioCallback* callback, void* callback_params = 0, void* callback_user_data = 0); static int remove_default_callback(int callback_id, diguyScenarioCallback* callback); #endif static int remove_default_callback_with_user_data(int callback_id, void* callback_user_data); static int add_default_callback_script(int callback_id, const char* callback_script, const char* callback_script_type); static int remove_default_callback_script(int callback_id, const char* callback_script, const char* callback_script_type); const char* get_character_type_class(const char* character_type); int merge_asset(const char* string); void print_to_log(int notify_level, const char* string); #ifdef CPLUSPLUS_ONLY diguyCharacter* create_pending_reflected_character(const char* name, const char* character_type, const char* appearance = NULL); int set_network_translation(float x, float y, float z); int get_network_translation(float* x, float* y, float* z); void set_project_filename(const char* project_filename); const char* get_project_filename();
| General Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_current_scenario |
Prototype:
Description:static diguyScenario* get_current_scenario();
This static function returns a pointer to the current scenario object. All functions below can then be called through this pointer. This is the same pointer returned by the call diguy_create_scenario().
lua scripts get the current scenario through the variable this_scenario.Returns:
a pointer of type diguyScenarioC++ Example:
Lua Example:
diguyScenario* sc = diguyScenario::get_current_scenario(); sc->reset();
this_scenario:reset();
function diguyScenario::get_name |
Prototype:
Description:const char* get_name();
Returns the name of the object. This pointer will never be NULL.Returns:
name of the object
function diguyScenario::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 object
function diguyScenario::get_description |
Prototype:
Returns:const char* get_description();
the scenario description as specified in the scenario info page
| Time Control and Playback Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::update |
Prototype:
Description:int update(float t);
Sets the desired simulation time of the scenario.
Some update operations will use the simulation desired time directly.
Many other scenario operations -- notably character position and pose updates -- will not happen until the desired t passes each subsequent tick dt threshold. See set_tick_dt().
This function sets both elapsed simulation time and elapsed realtime to the same value. This is usually desired in DI-Guy applications. To pass separate values for simulation time and realtime time, call update2().
Time can be run backwards. This happens if the passed t is lower than any t previously passed to the update() function; the scenario remembers the highest t it has reached. If t is set to less that the highest t reached, characters that have history data will replay what they were doing at the specified time. Characters that do not have history will remain motionless until t advances past the previous highest t.
Scenario time will never go below 0.
If t reaches the scenario tout ("T Out") time (as set by set_tout(), a number of things may happen. The scenario may:
- simply stop at the tout time
- continue past the tout time
- rewind to time 0 and play back recorded history
- reset and re-simulate the scenario from time 0
The default tout time is 60000 for DI-Guy applications. The tout can be enabled and disabled with set_tout_enabled().
This function cannot explicitly be called for DI-Guy Scenario, but the effects of t reaching tout during scenario simulation are outlined here anyway.For a DI-Guy application:
- If the scenario tout is enabled the scenario will stop.
- If the scenario tout is disabled the scenario will continue indefinitely, regardless of scenario tout.
Note that no playback looping happens in a DI-Guy application if tout is reached. Only in DI-Guy Scenario does the loop flag have an effect.For DI-Guy Scenario:
Arguments:
- If the loop flag is not set (see set_playback_loop()) or a movie is being recorded, the scenario will stop.
- If the loop flag is set, and any character in the scenario has history data (see the History Functions for diguyCharacter), the scenario will be rewound to 0 and play back history data.
- If the loop flag is set, but no characters in the scenario have history data, the scenario will be reset to 0 and re-simulate from there.
Returns:
t desired time in seconds
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::update2 |
Prototype:
Description:int update2(float t, float realtime_t);
Similar to update(), but the realtime time can be explicitly passed in.Arguments:
Returns:
t desired simulation time in seconds realtime_t elapsed real time in seconds
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::set_playback_loop |
Prototype:
Description:int set_playback_loop(int playback_loop);
This function sets whether the scenario is designed to loop at tout. The default is for scenarios to loop.
Note that this has an effect only in DI-Guy Scenario. DI-Guy applications do not use this flag.
See get_playback_loop().Arguments:
Returns:
playback_loop pass 1 to have scenario loop at tout, 0 to not
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::set_tick_dt |
Prototype:
Description:int set_tick_dt(float tick_dt);
Scenarios progress at discrete time steps, called "ticks". Each tick is of the same duration. This function sets the amount of time each tick takes.
Because changing the tick interval of a scenario changes when event beads occur, any change may introduce subtle differences in scenario playback.
Note that loading a .dss file will change the tick dt, as tick dt is set on a per scenario basis.
The default tick dt of a new scenario is 0.03125 seconds, or 32 frames per second.Arguments:
Returns:
tick_dt duration, in seconds, of each scenario tick
0 on success, -1 on failureCallable From:
C++ Example:
- C++
diguyScenario* sc = diguy_create_scenario(); if (sc) { sc->load("my_scenario.dss"); sc->set_tick_dt(0.033333); // 30 fps }
function diguyScenario::get_t |
Prototype:
Description:float get_t();
This function returns the time in seconds that the scenario is currently at. See update().
Note that this value will not necessarily track the t passed in the update() function. This t advances only when the scenario's current tick changes. See set_tick_dt() and update().Returns:
current time in seconds
function diguyScenario::get_realtime_t |
Prototype:
Description:float get_realtime_t();
This function returns the realtime time in seconds that the scenario is currently at. This may be different than get_desired_t() if the scenario is stopped or the time passed in update() is not tracking realtime.Returns:
current time in seconds
function diguyScenario::get_desired_t |
Prototype:
Description:float get_desired_t();
This function returns the desired time in seconds that the scenario is currently at. This may be different than get_t(), which advances only when the scenario's current tick changes.Returns:
current time in seconds
function diguyScenario::set_tout |
Prototype:
Description:int set_tout(float tout);
This function sets the tout ("T Out") time of the scenario. What will happen when the scenario reaches this time depends on a number of factors. See update() for more information.Returns:
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::get_tout |
Prototype:
Description:float get_tout();
This function returns the tout time of the scenario. This is the time at which a scenario is designed to end.
See set_tout() and update().Returns:
tout of scenario
function diguyScenario::set_tout_enabled |
Prototype:
Description:void set_tout_enabled(int tout_enabled);
This function sets what will happen when the scenario reaches its tout time. If set to 0, the scenario will ignore the tout time and continue indefinitely.
See update() for more information.
function diguyScenario::get_tout_enabled |
Prototype:
Description:int get_tout_enabled();
This function returns the whether tout is enabled.
See set_tout_enabled() and update().Returns:
1 if tout enabled, 0 if not
function diguyScenario::get_playback_loop |
Prototype:
Description:int get_playback_loop();
This function returns whether the scenario is designed to loop when the scenario's tout time is reached.
See update() for more information about looping.Returns:
0 if no loop desired; 1 if loop desired
function diguyScenario::get_tick_dt |
Prototype:
Description:float get_tick_dt();
This function returns the most recent setting of set_tick_dt().
function diguyScenario::get_ticks_can_be_dropped |
Prototype:
Returns:int get_ticks_can_be_dropped();
This function returns the most recent setting of set_ticks_can_be_dropped().
function diguyScenario::set_ticks_can_be_dropped |
Prototype:
Description:void set_ticks_can_be_dropped(int ticks_can_be_dropped);
This function sets whether a scenario can "drop" ticks in order to catch up if it falls behind.
Scenario updates progress in discrete time steps called ticks (see set_tick_dt() and update()). If the difference in times specified in subsequent calls to update() is greater than the tick dt, which can happen if calls to update() are taking too long because the scenario is too complex or if the caller is attempting to "fast forward" to a particular time in the scenario, the scenario may skip processing of intermediate ticks in order to catch up.
The scenario will not consider itself behind until the number of ticks covered by a particular call to update() is equal to or greater than the value set by set_max_ticks_behind_until_drop().
Dropping ticks, while it improves performance, may have unintended side effects, including:
- event beads of characters on paths that fall on the dropped ticks -- including aim beads, decision beads, gaze beads, and script beads -- will not be evaluated and will therefore have no effect on the scenario
- review playback of characters (see diguyCharacter::set_history_type()) over the dropped intervals will be choppy
Not dropping ticks also has potential side effects:
- if a scenario is falling behind more and more on each call to update(), it may never be able to catch up and performance of DI-Guy will increasingly degrade
The default setting is that ticks can be dropped.Arguments:
ticks_can_be_dropped pass 1 for ticks to be dropped; else pass 0
function diguyScenario::get_max_ticks_behind_until_drop |
Prototype:
Returns:long get_max_ticks_behind_until_drop();
This function returns the most recent setting of set_max_ticks_behind_until_drop().
function diguyScenario::set_max_ticks_behind_until_drop |
Prototype:
Description:void set_max_ticks_behind_until_drop(long max_ticks_behind_until_drop);
This function sets how many ticks a scenario must be behind before it starts dropping ticks in order to catch up.
For a discussion of how a scenario may fall behind, see set_ticks_can_be_dropped().
Note that if ticks cannot be dropped, (e.g., 0 is passed to set_ticks_can_be_dropped()) this function will have no effect.
The default value is 2.Arguments:
max_ticks_behind_until_drop how many ticks a scenario must be behind until it drops ticks
function diguyScenario::set_playback_mode |
Prototype:
Description:int set_playback_mode(diguyScenarioPlaybackMode playback_mode);
This function sets the current playback mode of DI-Guy Scenario. It currently will have no effect in applications using the DI-Guy API.Arguments:
Returns:
playback_mode new playback mode
0 on success, -1 on failure
function diguyScenario::set_playback_mode_stop |
Prototype:
Description:int set_playback_mode_stop();
This function is shorthand for the function call set_playback_mode(DIGUY_SCENARIO_PLAYBACK_MODE_STOP). It is useful for pausing the scenario in decisions and decision beads.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyScenario::set_playback_mode_play |
Prototype:
Description:int set_playback_mode_play();
This function is shorthand for the function call set_playback_mode(DIGUY_SCENARIO_PLAYBACK_MODE_PLAY). It is useful for resuming a paused scenario in decisions and decision beads.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision
function diguyScenario::get_playback_mode |
Prototype:
Returns:diguyScenarioPlaybackMode get_playback_mode();
current playback mode as set by set_playback_mode() or the DI-Guy Scenario user interface
function diguyScenario::derive_playback_mode_dt |
Prototype:
Description:float derive_playback_mode_dt(float dt_in);
This function derives a dt based on an input dt (usually derived from change in realtime from previous to current frame) and the scenario's current playback mode. The resulting dt can then be used to advance the time passed to diguyScenario::update() so that it emulates the effect of the VCR buttons in DI-Guy Scenario.
This function does not change the scenario's current time or playback mode.
Examples based on a dt_in of 0.03 seconds:
- DIGUY_SCENARIO_PLAYBACK_MODE_STOP: derived_dt = 0.0
- DIGUY_SCENARIO_PLAYBACK_MODE_PLAY: derived_dt = 0.03
- DIGUY_SCENARIO_PLAYBACK_MODE_PLAY_REVERSE: derived_dt = -0.03
- DIGUY_SCENARIO_PLAYBACK_MODE_FF: derived_dt = 0.12
- DIGUY_SCENARIO_PLAYBACK_MODE_FF_REVERSE: derived_dt = -0.12
- DIGUY_SCENARIO_PLAYBACK_MODE_SS: derived_dt = frame dt
- DIGUY_SCENARIO_PLAYBACK_MODE_SS_REVERSE: derived_dt = - frame dt
- DIGUY_SCENARIO_PLAYBACK_MODE_REWIND: derived_dt = - scenario t
Note that the playback mode should be set to DIGUY_SCENARIO_PLAYBACK_MODE_STOP after time advances in either of the single step ("SS") modes or the rewind mode.Arguments:
dt_in delta time in seconds from advancing simulation time
function diguyScenario::reset |
Prototype:
Description:int reset();
This function resets all scenario characters, signals, variables, and all other scenario objects to their original state. Scenario time will be set to 0.Returns:
0 on success, -1 on failure
| Load and Save Functions |
function diguyScenario::load |
Prototype:
Description:int load(const char* filename);
This function loads the specified scenario. Any previously loaded scenario objects will be deleted. To merge a scenario into the existing scenario (load without deleting existing objects), use the call merge().
The passed filename can be either a ".dss" file, which is a DI-Guy Scenario file, or a ".dsr" file, which is a DI-Guy Review file.
Once the file has been loaded an implicit reset() will occur.Arguments:
Returns:
filename filename of scenario to be loaded
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::save |
Prototype:
Description:int save();
Saves the scenario into its current filename. This filename will be the most recent of:
The filename that will be used can be retrieved using the get_filename() or get_filename_without_directory() functions.
Once saved the "unsaved" flag (as returned by get_unsaved()) will be set to 0.Returns:
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::save_as |
Prototype:
Description:int save_as(const char* filename);
Similar to save(), but new filename is specified by the filename argument.Arguments:
Returns:
filename new filename of scenario
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::get_filename |
Prototype:
Description:const char* get_filename();
Returns the most recent of:
Returns:
filename of saved scenarioCallable From:
- C++
function diguyScenario::get_filename_without_directory |
Prototype:
Description:const char* get_filename_without_directory();
Similar to get_filename(), but with any leading directories removed.Callable From:
- C++
function diguyScenario::get_unsaved |
Prototype:
Returns:int get_unsaved();
1 if scenario has been modified since save or load, else 0Callable From:
- C++
function diguyScenario::set_unsaved |
Prototype:
Description:void set_unsaved(int unsaved);
Manually sets the "unsaved" flag to the passed value.Arguments:
Callable From:
unsaved new unsaved status; 1 for unsaved, 0 for saved
- C++
| Draw Functions |
function diguyScenario::draw |
Prototype:
Description:int draw();
This function draws all visible elements of the loaded scenario in immediate mode graphics environments (see below). This is the equivalent of calling draw_pass1(), immediately followed by draw_pass2(), immediately followed by post_draw().
Note that any character graphics culling, far position rendering, etc., depend on the render camera set by the set_render_camera() function. A render camera does not always need to be set; see set_render_camera() for more details.Returns:
0 on success, -1 on failureOpenGL Version:
Direct3D Version:
This function immediately draws all scenario elements. Either this function, or draw_pass1(), draw_pass2(), and post_draw(), should be called once per frame.Callable From:
- C++
function diguyScenario::draw_pass1 |
Prototype:
Description:int draw_pass1();
This function, along with draw_pass2(), allows the drawing of opaque and transparent polygons to be separated. This function draws all opaque polygons.Returns:
0 on success, -1 on failureOpenGL Version:
Direct3D Version:
This function immediately draws the opaque scenario elements. Either this function or draw() should be called once per frame.Callable From:
- C++
function diguyScenario::draw_pass2 |
Prototype:
Description:int draw_pass2(int also_call_post_draw = 1);
Same as draw_pass1(), but draws transparent scenario elements. The also_call_post_draw argument is set to 1 for backwards compatiblity.Callable From:
- C++
function diguyScenario::post_draw |
Prototype:
Description:int post_draw(int call_plugins_post_draw = 1, int call_lua_packages_draw = 1, int call_post_draw_callback = 1);
This function draws visual elements that must be drawn after the main render has been done.
Note that this function is called automatically by the draw() call. Only call this function if draw() is not called; e.g., if draw_pass1() and draw_pass2() are used.
This function can be called from scene graph type renderers which typically don't need or want to have the draw() function called.Arguments:
Returns:
call_plugins_post_draw pass 1 to call plugin post_draw() functions call_lua_packages_draw pass 1 to call lua package draw functions call_post_draw_callback pass 1 to invoke callbacks with callback id CALLBACK_ID_POST_DRAW
0 on success, -1 on failure
function diguyScenario::set_graphics_attach_ptr |
Prototype:
Description:int set_graphics_attach_ptr(void* graphics_attach_ptr);
This function sets the attachment point that to be used for graphics created by the library.Arguments:
Returns:
graphics_attach_ptr this is a pointer to a group-type object; the specific type is dependent on graphics environment
0 on success, -1 on failureOpenGL Version:
This function does not have any effect.Direct3D Version:
The passed pointer should be a LPDIRECT3DRMFRAME2.
Callable From:
LPDIRECT3DRMFRAME2 attach_frame = get_scene_frame(); scenario->set_graphics_attach_ptr(attach_frame);
- C++
| Merge Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::create_merge_settings |
Prototype:
Description:diguyScenarioMergeSettings* create_merge_settings(diguyScenarioMergeInitialSettings initial_settings = DIGUY_MERGE_INITIAL_SETTINGS_DEFAULT);
This function creates a merge settings object. This object can allow for fine control over which elements in a scenario are merged during a merge() call, and what to do if there is a collision with an existing element.
Once the initial settings are made based on the initial_settings argument, the settings can be fine-tuned by calling member functions of the diguyScenarioMergeSettings object.
Destroy the object with a call to destroy_merge_settings().Arguments:
DIGUY_MERGE_INITIAL_SETTINGS_DEFAULT
initial_settings what the initial settings should be when the object is created
DIGUY_MERGE_INITIAL_SETTINGS_MERGE_EVERYTHING
scenario settings DIGUY_MERGE_FLAG_DONT_MERGE current view settings DIGUY_MERGE_FLAG_OVERWRITE_EXISTING character DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN decision DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN formation DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN group DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN guide DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN info popup DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN library function DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN script DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN sensor region DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN signal DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN variables DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN camera settings DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL face exp DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL fog settings DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL light settings DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL particle system DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL path shape DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL scene object DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL scene object grid DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL sound DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
DIGUY_MERGE_INITIAL_SETTINGS_MERGE_NOTHING
scenario settings DIGUY_MERGE_FLAG_OVERWRITE_EXISTING current view settings DIGUY_MERGE_FLAG_OVERWRITE_EXISTING character DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN decision DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN formation DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN group DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN guide DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN info popup DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN library function DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN script DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN sensor region DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN signal DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN variables DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN camera settings DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL face exp DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL fog settings DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL light settings DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL particle system DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL path shape DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL scene object DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL scene object grid DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL sound DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
DIGUY_MERGE_INITIAL_SETTINGS_DIGUY6_COMPATIBLE
scenario settings DIGUY_MERGE_FLAG_DONT_MERGE current view settings DIGUY_MERGE_FLAG_DONT_MERGE character DIGUY_MERGE_FLAG_DONT_MERGE decision DIGUY_MERGE_FLAG_DONT_MERGE formation DIGUY_MERGE_FLAG_DONT_MERGE group DIGUY_MERGE_FLAG_DONT_MERGE guide DIGUY_MERGE_FLAG_DONT_MERGE info popup DIGUY_MERGE_FLAG_DONT_MERGE library function DIGUY_MERGE_FLAG_DONT_MERGE script DIGUY_MERGE_FLAG_DONT_MERGE sensor region DIGUY_MERGE_FLAG_DONT_MERGE signal DIGUY_MERGE_FLAG_DONT_MERGE variables DIGUY_MERGE_FLAG_DONT_MERGE camera settings DIGUY_MERGE_FLAG_DONT_MERGE face exp DIGUY_MERGE_FLAG_DONT_MERGE fog settings DIGUY_MERGE_FLAG_DONT_MERGE light settings DIGUY_MERGE_FLAG_DONT_MERGE particle system DIGUY_MERGE_FLAG_DONT_MERGE path shape DIGUY_MERGE_FLAG_DONT_MERGE scene object DIGUY_MERGE_FLAG_DONT_MERGE scene object grid DIGUY_MERGE_FLAG_DONT_MERGE sound DIGUY_MERGE_FLAG_DONT_MERGE
Returns:
scenario settings DIGUY_MERGE_FLAG_OVERWRITE_EXISTING current view settings DIGUY_MERGE_FLAG_OVERWRITE_EXISTING character DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN decision DIGUY_MERGE_FLAG_KEEP_BOTH formation DIGUY_MERGE_FLAG_KEEP_BOTH group DIGUY_MERGE_FLAG_KEEP_BOTH guide DIGUY_MERGE_FLAG_KEEP_BOTH info popup DIGUY_MERGE_FLAG_KEEP_BOTH library function DIGUY_MERGE_FLAG_KEEP_BOTH script DIGUY_MERGE_FLAG_KEEP_BOTH sensor region DIGUY_MERGE_FLAG_KEEP_BOTH signal DIGUY_MERGE_FLAG_KEEP_BOTH variables DIGUY_MERGE_FLAG_KEEP_BOTH camera settings DIGUY_MERGE_FLAG_KEEP_BOTH face exp DIGUY_MERGE_FLAG_KEEP_BOTH fog settings DIGUY_MERGE_FLAG_KEEP_BOTH light settings DIGUY_MERGE_FLAG_KEEP_BOTH particle system DIGUY_MERGE_FLAG_KEEP_EXISTING_ONLY_AND_WARN path shape DIGUY_MERGE_FLAG_KEEP_BOTH scene object DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL scene object grid DIGUY_MERGE_FLAG_KEEP_BOTH sound DIGUY_MERGE_FLAG_KEEP_BOTH
object of type diguyScenarioMergeSettings
function diguyScenario::destroy_merge_settings |
Prototype:
Description:void destroy_merge_settings(diguyScenarioMergeSettings* merge_settings);
This function destroys a merge settings object created by a call to create_merge_settings().
function diguyScenario::merge |
Prototype:
Description:int merge(const char* filename, diguyScenarioMergeSettings* merge_settings = NULL);
This function merges the specified scenario. Any previously loaded scenario elements will be retained, depending on settings in the merge_settings argument.Arguments:
Returns:
filename filename of scenario to be merged merge_settings object that controls how elements are merged; pass NULL for default merge handling
0 on success, -1 on failure
function diguyScenario::merge_object |
Prototype:
Description:int merge_object(const char* string);
This function performs a "micro merge", allowing a scenario to merge in the contents of a text string representing a single object.
On example of use is for a Lua Package to contain a number of text strings representing particle systems or sounds that an agent need will need. When needed objects in text form can be merged into the scenario using this function.
The DI-Guy Scenario Particle System page has a "Display Object Text" button that can display the object text of a particle system that is appropriate for use by this function. Other object pages that have this button are Sound, Formation, and Crowd Profile.
Text can also be taken directly from .dss files.
See also the diguyCharacter::merge_object() function.
Note: the parser is very sensitive to tabs and formatting!
function diguyScenario::include_object_library |
Prototype:
Description:int include_object_library(const char* library_name);
This function makes the objects in the specified library available for use in the scenario.
Object libraries allow new content to be created in one scenario and automatically shared to other scenarios. When including a library, objects that are already in the scenario are preserved.
A library with specified name must be available for inclusion. Object libraries are located in the $(DIGUY)configdiguy/object_libraries and $(DIGUY)customconfigdiguyobject_libraries directories. The filename for the library must be "library_[libname].cfg".
Available object libraries in these directories will automatically be detected by the scenario, but objects in the libraries will not be included in the scenario until this function is called.
For example, if the objects in the file "library_crowd_sounds.cfg" should be made available in the scenario, the library name "crowd_sounds" should be passed into this function.
Currently the following object types can be in libraries:
Arguments:
- particle system
- formation
- crowd profile
- sound
Returns:
library_name name of library
0 on success, -1 on failure
function diguyScenario::uninclude_object_library |
Prototype:
Description:int uninclude_object_library(const char* library_name);
This function is the opposite of include_object_library(). Objects in the named library are made unavailable to the scenario.Arguments:
Returns:
library_name name of library
0 on success, -1 on failure
| Time and Date Functions |
Unless otherwise specified, callable from:
- C++
- Script
| Datetime Functions |
function diguyScenario::set_base_datetime |
Prototype:
Description:void set_base_datetime(int year = -1, int month = -1, int day = -1, int hour = -1, int minute = -1, int second = -1, int msec = -1);
This function will set what the current datetime will be when the scanario is reset.
Pass -1 for values that should be set based on current datetime.
Note that if set_base_datetime_default_to_now() and set_base_datetime_default_to_today() can override these values.
function diguyScenario::set_base_datetime |
Prototype:
Description:void set_base_datetime(const char* datetime_string, const char* format);
Similar to set_base_datetime(), but datetime is stored in the passed string, formatted in the passed format string.
function diguyScenario::get_base_datetime |
Prototype:
Description:void get_base_datetime(int* year = NULL, int* month = NULL, int* day = NULL, int* hour = NULL, int* minute = NULL, int* second = NULL, int* msec = NULL);
Retrieves the base datetime. Pass NULL for arguments that aren't needed.
function diguyScenario::set_base_datetime_default_to_now |
Prototype:
Description:void set_base_datetime_default_to_now(int to_now);
Setting this value to 1 will cause the time part of the datetime to be set to whatever "real" time it is when reset() is called, instead of the time stored in the base datetime as set by set_base_datetime(). For example, if it is 10:30 AM in "real time" when the scenario is reset, the current time will be set to 10:30:00:000 on reset.
Setting this value to 0 will restore the default behavior.
function diguyScenario::get_base_datetime_default_to_now |
Prototype:
Returns:int get_base_datetime_default_to_now();
1 if the current time will be set to the "real time" on reset, 0 is not
function diguyScenario::set_base_datetime_default_to_today |
Prototype:
Description:void set_base_datetime_default_to_today(int to_today);
Similar to set_base_datetime_default_to_now(), but for the date part of the datetime.
function diguyScenario::get_base_datetime_default_to_today |
Prototype:
Returns:int get_base_datetime_default_to_today();
1 if the current date will be set to the "real date" on reset, 0 is not
function diguyScenario::set_current_datetime |
Prototype:
Description:void set_current_datetime(int year = -1, int month = -1, int day = -1, int hour = -1, int minute = -1, int second = -1, int msec = -1);
Allows current datetime to be explicitly set. Note that in most cases the current datetime should be set by the base datetime plus how much time has advanced in the scenario.
This function can be useful if the datetime needs to be syncronized with that from another source, say, from network exercise data.
function diguyScenario::set_current_datetime |
Prototype:
Description:void set_current_datetime(const char* datetime_string, const char* format);
Similar to set_current_datetime(), but datetime is stored in the passed string, formatted in the passed format string.
function diguyScenario::get_current_datetime |
Prototype:
Description:void get_current_datetime(int* year = NULL, int* month = NULL, int* day = NULL, int* hour = NULL, int* minute = NULL, int* second = NULL, int* msec = NULL);
Retrieves the current datetime. Pass NULL for arguments that aren't needed.
function diguyScenario::get_current_datetime_string |
Prototype:
Description:const char* get_current_datetime_string(const char* format);
Retrieves the current datetime in string format.Arguments:
format format returned string should be in; pass NULL for default "Mdyyyy h:mm:ss AP" format
function diguyScenario::set_datetimes_are_utc |
Prototype:
Description:void set_datetimes_are_utc(int are_utc);
Pass 1 to specify that datetimes use UTC time, 0 to specify they are local time.
function diguyScenario::get_datetimes_are_utc |
Prototype:
Returns:int get_datetimes_are_utc();
1 if datetimes use UTC time, 0 if not
function diguyScenario::set_utc_offset_hours |
Prototype:
Description:void set_utc_offset_hours(float utc_offset_hours);
If datetimes use UTC time, this function sets the offset hours of the current time from UTC.
function diguyScenario::get_utc_offset_hours |
Prototype:
Returns:float get_utc_offset_hours();
offset in hours of datetimes from UTC
function diguyScenario::set_use_local_tz_utc_offset_hours |
Prototype:
Description:void set_use_local_tz_utc_offset_hours(int use_local_tz);
Documentation Pending
function diguyScenario::get_use_local_tz_utc_offset_hours |
Prototype:
Description:int get_use_local_tz_utc_offset_hours();
Documentation Pending
function diguyScenario::set_current_datetime_advance_method |
Prototype:
Description:void set_current_datetime_advance_method(diguyDatetimeAdvanceMethod advance_method);
Documentation Pending
function diguyScenario::get_current_datetime_advance_method |
Prototype:
Description:diguyDatetimeAdvanceMethod get_current_datetime_advance_method();
Documentation Pending
function diguyScenario::set_current_datetime_advance_factor |
Prototype:
Description:void set_current_datetime_advance_factor(float advance_factor);
Documentation Pending
function diguyScenario::get_current_datetime_advance_factor |
Prototype:
Description:float get_current_datetime_advance_factor();
Documentation Pending
function diguyScenario::get_network_datetime |
Prototype:
Description:void get_network_datetime(int* year = NULL, int* month = NULL, int* day = NULL, int* hour = NULL, int* minute = NULL, int* second = NULL, int* msec = NULL);
Documentation Pending
| Simple Time Functions |
function diguyScenario::set_tin_time_of_day |
Prototype:
Description:int set_tin_time_of_day(float t);
This function sets the time of day which corresponds to scenario tin. It is a wall-clock time, and has no date content.
Note that if more detailed time and date information is needed refer to the "datetime" functions.Arguments:
Returns:
t number of seconds after midnight; zero means midnight; 86399.0 means 11:59:59 pm
0 on success, -1 on failure
function diguyScenario::get_tin_time_of_day |
Prototype:
Description:float get_tin_time_of_day();
This function returns what time of day corresponds to scenario tin. It is a wall-clock time, and has no date content.
See set_tin_time_of_day().
Note that if more detailed time and date information is needed refer to the "datetime" functions.Returns:
number of seconds after midnight
function diguyScenario::get_time_of_day |
Prototype:
Description:float get_time_of_day();
This function returns what the simulated time of day is right now. It is computed by adding (scenario t - tin) to the value passed to set_tin_time_of_day();
See set_tin_time_of_day().
Note that if more detailed time and date information is needed refer to the "datetime" functions.Returns:
number of seconds after midnight (simulated time of day)
| Appearance Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::add_appearance |
Prototype:
Description:int add_appearance(const char* appearance, char** equipment_list, char** character_types, const char* actor);
This function adds an appearance with the given name to the list of available appearances. If an appearance with the given name already exists the operation will fail and a message will be printed at debug level to the output log.
Internal copies are made of the passed strings.Arguments:
appearance name of the appearance equipment_list NULL-terminated list of equipment that makes up the appearance character_types NULL-terminated list of character types that this appearance will be available to actor name of the actor this appearance fits If NULL is passed for the actor argument the actor will be set to match the actor of the first character type in the character_types array.Returns:
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::add_appearance_based_on_existing_appearance |
Prototype:
Description:int add_appearance_based_on_existing_appearance(const char* appearance, const char* existing_appearance, char** equipment_list);
This function is similar to add_appearance(), but adds equipment_list shapes to an existing appearance.
The character types that the new appearance will be available to will match that of the specified existing appearance.Arguments:
appearance name of the new appearance existing_appearance name of the existing appearance on which to base new appearance equipment_list NULL-terminated list of equipment to add to the existing appearanceReturns:
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::remove_appearance |
Prototype:
Description:int remove_appearance(const char* appearance);
This function removes an appearance with the given name from the list of available appearances. If an appearance with the given name does not exist the operation will fail and a message will be printed at debug level to the output log.NOTE:
Currently no check is made for whether the appearance is in use by a character. Removing an in-use appearance will result in undefined behavior.Arguments:
Returns:
appearance name of the appearance
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::get_num_character_types_with_appearance |
Prototype:
Description:int get_num_character_types_with_appearance(const char* appearance_name);
This function returns the number of character types associated with the given appearance, if any.Arguments:
Returns:
appearance name of the appearance
the number of character types, or 0
function diguyScenario::get_character_type_from_appearance |
Prototype:
Description:const char *get_character_type_from_appearance(const char* appearance_name, int index = 0);
This function returns one of the character types associated with the appearance, if any existsArguments:
Returns:
appearance name of the appearance index which character type of the set to return
a character type name on success, "none" on failure
| Preload Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::preload_character_type |
Prototype:
Description:int preload_character_type(const char* character_type);
This function preloads all base motions and the default appearance for the specified character type.
This can be done during initialization to preload characters that will be needed later in a scenario, to avoid a hitch in frame rate when the characters are loaded.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example
0 on success, -1 on failure
function diguyScenario::preload_appearance |
Prototype:
Description:int preload_appearance(const char* appearance);
This function preloads all geometry for the specified appearance. This can be done during initialization to preload geometry that will be needed later in a scenario, to avoid a hitch in frame rate when the geometry is loaded.Arguments:
Returns:
appearance name of the appearance whose geometry is to be preloaded
0 on success, -1 on failure
function diguyScenario::preload_gesture |
Prototype:
Description:int preload_gesture(const char* character_type, const char* gesture_name);
This function preloads all motions for the specified gesture for the specified character type.
This can be done during initialization to preload gestures that will be needed later in a scenario, to avoid a hitch in frame rate when the motions are loaded.Arguments:
Returns:
character_type character's type gesture_name name of the gesture to preload
0 on success, -1 on failure
| Culling Functions |
These functions control culling of various object types.
Note that these functions only work only in the OpenGL version, when a valid render camera is set. See set_render_camera().
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::set_character_culling_enabled |
Prototype:
Description:void set_character_culling_enabled(int character_culling);
This function enables character culling.
This function works only in the OpenGL version when a valid render camera is set.
function diguyScenario::get_character_culling_enabled |
Prototype:
Description:int get_character_culling_enabled();
This function gets the state of character culling.
This function works only in the OpenGL version when a valid render camera is set.Returns:
1 if enabled, 0 if disabled.
function diguyScenario::set_scene_object_culling_enabled |
Prototype:
Description:void set_scene_object_culling_enabled(int object_culling);
This function enables scene object culling.
This function works only in the OpenGL version when a valid render camera is set.
function diguyScenario::get_scene_object_culling_enabled |
Prototype:
Description:int get_scene_object_culling_enabled();
This function get the state of scene object culling.
This function works only in the OpenGL version when a valid render camera is set.Returns:
1 if enabled, 0 if disabled
function diguyScenario::set_scene_object_sub_culling_enabled |
Prototype:
Description:void set_scene_object_sub_culling_enabled(int object_culling);
This function enables scene object sub object culling.
This function works only in the OpenGL version when a valid render camera is set.
function diguyScenario::get_scene_object_sub_culling_enabled |
Prototype:
Description:int get_scene_object_sub_culling_enabled();
This function get the state of scene object sub culling.
This function works only in the OpenGL version when a valid render camera is set.Returns:
1 if enabled, 0 if disabled
function diguyScenario::set_character_visualize_bounds_enabled |
Prototype:
Description:void set_character_visualize_bounds_enabled(int visualize_bounds);
This function enables visualizing a character's bounding volume.
This function works only in the OpenGL version when a valid render camera is set.
function diguyScenario::get_character_visualize_bounds_enabled |
Prototype:
Description:int get_character_visualize_bounds_enabled();
This function get the state of character bounding volume visualization.
This function works only in the OpenGL version when a valid render camera is set.Returns:
1 if enabled, 0 if disabled
function diguyScenario::set_scene_object_visualize_bounds_enabled |
Prototype:
Description:void set_scene_object_visualize_bounds_enabled(int val);
This function enables visualizing a scene object's bounding volume.
This function works only in the OpenGL version when a valid render camera is set.
function diguyScenario::get_scene_object_visualize_bounds_enabled |
Prototype:
Description:int get_scene_object_visualize_bounds_enabled();
This function gets the state of scene objects bounding volume visualization.
This function works only in the OpenGL version when a valid render camera is set.Returns:
1 if enabled, 0 if disabled
| Query Functions |
These functions query the scenario for what specific types of scenario elements are available. This includes:
- character types
- appearances
- actions
Unless otherwise specified, callable from:
C++ Example:
- C++
- Script
int num_character_types = diguy_scenario->get_num_character_types(); int character_type_index; for (character_type_index = 0; character_type_index < num_character_types; character_type_index++) { const char* character_type = diguy_scenario->get_character_type_at_index(character_type_index); bdi_log_printf(BDI_LOG_INFO, "Character type at index %d: %s\n", character_type_index, character_type); int num_appearances = diguy_scenario->get_character_type_num_appearances(character_type); int appearance_index; for (appearance_index = 0; appearance_index < num_appearances; appearance_index++) { const char* appearance = diguy_scenario->get_character_type_appearance_at_index(character_type, appearance_index); bdi_log_printf(BDI_LOG_INFO, "\tAppearance at index %d: %s\n", appearance_index, appearance); } int num_actions = diguy_scenario->get_character_type_num_actions(character_type); int action_index; for (action_index = 0; action_index < num_actions; action_index++) { const char* action_name = diguy_scenario->get_character_type_action_at_index(character_type, action_index); bdi_log_printf(BDI_LOG_INFO, "\tAction at index %d: %s\n", action_index, action_name); } }
function diguyScenario::get_num_character_types |
Prototype:
Returns:int get_num_character_types();
number of available character types
function diguyScenario::get_character_type_at_index |
Prototype:
Returns:const char* get_character_type_at_index(int index);
the string identifying the character type at the given indexArguments:
index index of the character type; indices start at 0
function diguyScenario::get_character_type_abbreviation |
Prototype:
Returns:const char* get_character_type_abbreviation(const char* character_type);
abbreviation of the given character type, when a shorter identifier is neededArguments:
character_type character type name, as returned by get_character_type_at_index(), for example
function diguyScenario::get_character_type_deprecated_at_version |
Prototype:
Description:const char* get_character_type_deprecated_at_version(const char* character_type);
This function returns the version at which the specified character type was deprecated.
If the character type has not been deprecated, the empty string ("") is returned.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example
version at which character became deprecated; empty string ("") if it hasn't beenC++ Example:
const char* version = scenario->get_character_type_deprecated_at_version(); if (strlen(version) > 0) { // do something }
function diguyScenario::get_character_type_deprecated_suggested_alternatives |
Prototype:
Description:const char* get_character_type_deprecated_suggested_alternatives(const char* character_type);
This function returns the suggested character type(s) that are recommended for deprecated character types.
If the character type has not been deprecated, the empty string ("") is returned.
If there is more than one suggested alternative, they will be separated by spaces.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example
suggested replacement character type(s)C++ Example:
const char* alternatives = scenario->get_character_type_deprecated_suggested_alternatives(); if (strlen(version) > 0) { // do something }
function diguyScenario::get_character_type_quality_bias |
Prototype:
Description:int get_character_type_quality_bias(const char* character_type);
As the number of character types DI-Guy provides has grown, newer character types tend to be better than older ones. This can be because of a greater selection of actions, better quality motions, and other factors.
This function returns a value representing a qualitative "bias" of this character they relative to other character types. The higher the bias, the more recommended the character type is. A bias of 1 means strongly not recommended, 5 means average, 10 means highly recommended.Returns:
quality bias, a unitless value from 1 to 10Arguments:
character_type character type name, as returned by get_character_type_at_index(), for example
function diguyScenario::get_character_type_map |
Prototype:
Description:diguyCharacterTypeMap* get_character_type_map(const char* character_type);
This function returns the type map of the specified character type. See the documentation for diguyCharacterTypeMap for what this information means.
Only the character type fields will have useful information; the appearance fields will contain default wildcard values.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example
pointer to type diguyCharacterTypeMap; will never be NULL
function diguyScenario::get_character_type_default_appearance |
Prototype:
Returns:const char* get_character_type_default_appearance(const char* character_type);
default appearance of the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example
function diguyScenario::get_character_type_default_skinned_appearance |
Prototype:
Returns:const char* get_character_type_default_skinned_appearance(const char* character_type);
default skinned appearance of the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example
function diguyScenario::get_character_type_num_appearances |
Prototype:
Returns:int get_character_type_num_appearances(const char* character_type);
number of available appearances for the given character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example
function diguyScenario::get_character_type_appearance_at_index |
Prototype:
Returns:const char* get_character_type_appearance_at_index(const char* character_type, int index);
the string identifying the appearance at the given index for the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example index index of the appearance; indices start at 0
function diguyScenario::get_character_type_num_head_appearances |
Prototype:
int get_character_type_num_head_appearances(const char* character_type);Similar to get_character_type_num_appearances(), but for head appearances.
function diguyScenario::get_character_type_head_appearance_at_index |
Prototype:
const char* get_character_type_head_appearance_at_index(const char* character_type, int index);Similar to get_character_type_appearance_at_index(), but for head appearances.
function diguyScenario::get_character_type_num_actions |
Prototype:
Returns:int get_character_type_num_actions(const char* character_type);
number of available actions for the given character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example
function diguyScenario::get_character_type_action_at_index |
Prototype:
Returns:const char* get_character_type_action_at_index(const char* character_type, int index);
the string identifying the action at the given index for the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example index index of the action name; indices start at 0
function diguyScenario::get_character_type_action_speed |
Prototype:
Returns:float get_character_type_action_speed(const char* character_type, const char* action_name);
the average speed of the specified action for the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
function diguyScenario::get_character_type_action_duration |
Prototype:
Returns:float get_character_type_action_duration(const char* character_type, const char* action_name);
the duration of one rep of the specified action for the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
function diguyScenario::get_character_type_action_distance |
Prototype:
Returns:float get_character_type_action_distance(const char* character_type, const char* action_name);
the distance covered by one rep of the specified action for the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
function diguyScenario::get_character_type_action_direction |
Prototype:
Returns:diguyMotionDirection get_character_type_action_direction( const char* character_type, const char* action_name);
the diguyMotionDirection identifying the direction of travel of the specified action for the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
function diguyScenario::get_character_type_action_facing_angle_in |
Prototype:
Returns:float get_character_type_action_facing_angle_in(const char* character_type, const char* action_name);
the facing angle at the start of each repetition of the specified action for the specified character type, in degreesArguments:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
function diguyScenario::get_character_type_action_facing_angle_out |
Prototype:
Returns:float get_character_type_action_facing_angle_out(const char* character_type, const char* action_name);
the facing angle at the end of each repetition of the specified action for the specified character type, in degreesArguments:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
function diguyScenario::get_character_type_num_gestures |
Prototype:
Returns:int get_character_type_num_gestures(const char* character_type);
the number of gestures available to the specified character typeArguments:
character_type character type name, as returned by get_character_type_at_index(), for example; pass "all" to get all gestures available, regardless of character type
function diguyScenario::get_character_type_gesture_at_index |
Prototype:
Returns:const char* get_character_type_gesture_at_index(const char* character_type, int index);
the name of the gesture available to the specified character type at the specified indexArguments:
character_type character type name, as returned by get_character_type_at_index(), for example; pass "all" to get all gestures available, regardless of character type index index of the gesture; indices start at 0
| Character Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::create_character |
Prototype:
Description:diguyCharacter* create_character(const char* name, const char* character_type, const char* appearance = NULL);
This function creates a new character and returns a pointer to it.
The function preload_character_type() should be called at the beginning of a scenario in which this call will be made to avoid a hitch in frame rate.
See also retrieve_character_from_recycle_bin() for a potentially faster way of creating a character.Arguments:
Returns:
name name of the new character character_type character's type appearance base appearance of character; pass NULL to use default appearance
pointer of type diguyCharacter; NULL if creation failed
function diguyScenario::create_temporary_character |
Prototype:
Description:diguyCharacter* create_temporary_character(const char* name, const char* character_type, const char* appearance = NULL);
This function is very similar to create_character(), but the character created is temporary.
Temporary characters will be destroyed automatically when the scenario is reset, and are not saved in .dss files. They are commonly used for projectiles, effects, and other objects that can come and go multiple times.
Temporary characters can be destroyed before scenario reset by calling destroy_character(), and can be sent to the character recycle bin by calling send_character_to_recycle_bin().Arguments:
Returns:
name name of the new character character_type character's type appearance base appearance of character; pass NULL to use default appearance
pointer of type diguyCharacter; NULL if creation failed
function diguyScenario::destroy_character |
Prototype:
Description:int destroy_character(diguyCharacter* character);
This function destroys a character.
If a character of the same character type and appearance may be needed later in the scenario, consider using send_character_to_recycle_bin() instead. Characters can be retrieved from the recycle bin more quickly than creating them "from scratch" with create_character().Arguments:
Returns:
character pointer to a diguyCharacter
0 on success, -1 on failureDI-Guy Networking Notes:
This function should not be called on characters that are reflected network characters. Such characters are destroyed automatically by DI-Guy Networking.
function diguyScenario::send_character_to_recycle_bin |
Prototype:
Descriptionint send_character_to_recycle_bin(diguyCharacter* character);
This function is an alternative way of removing a character from the scenario. When a character is recycled it is removed from the scenario's list of active characters, but the memory associated with it is not freed. Instead, the character is placed in a "character recycle bin" from which it may be later retrieved with a call to retrieve_character_from_recycle_bin().
For an application that is creating and destroying a lot of characters with the same character types and appearances, this can avoid performance hiccups that happen when memory is allocated for new characters.
If it is known ahead of time what types and appearances of characters will be needed in the future, the recycle bin can be "pre-stocked" at scenario load time by first creating and then recycling a large number of characters all at once.Returns:
0 on success, -1 on failure
function diguyScenario::retrieve_character_from_recycle_bin |
Prototype:
DescriptiondiguyCharacter* retrieve_character_from_recycle_bin(const char* name, const char* character_type, const char* appearance, int make_character_temporary = 0);
This function is an alternative way of creating a character. The character recycle bin is checked for a recycled character whose character type and appearance match that requested by this call. Characters are sent to the recycle bin by a call to send_character_to_recycle_bin().
If a match is found the recycled character will be removed from the recycle bin, given the passed name, and placed in the scenario's list of characters, for the most part just as if the character had been created by a call to create_character(). Some things such as position, current action, etc., may need to be immediately set.
If a match is not found, this function returns NULL and a call to create_character() must be made instead.Arguments:
Returns:
name new name for the character retrieved from bin character_type the character type to retrieve from the bin appearance the appearance to retrieve from the bin, pass NULL or "default" to retrieve the default appearance make_character_temporary pass 1 to make character temporary, 0 to leave permanent
0 on success, -1 on failure
function diguyScenario::get_num_characters |
Prototype:
Returns:int get_num_characters();
number of characters in the scenario
function diguyScenario::get_character_at_index |
Prototype:
Returns:diguyCharacter* get_character_at_index(int index);
pointer of type diguyCharacter; NULL if no character at the specified indexArguments:
index index of the character; indices start at 0
function diguyScenario::find_character |
Prototype:
Description:diguyCharacter* find_character(const char* name);
This function returns a pointer to the specified character.Arguments:
Returns:
name name of character to be found
pointer of type diguyCharacter; NULL if not found
function diguyScenario::look_at_character |
Prototype:
Description:void look_at_character(diguyCharacter* character);
This function changes the scenario camera's position and fix point so it will be looking at the specified character.
function diguyScenario::this_character |
Prototype:
Description:diguyCharacter* this_character();
This function returns a pointer to the target character of an event bead.Returns:
pointer of type diguyCharacter; NULL if no current character
function diguyScenario::this_event_bead |
Prototype:
Description:diguyCharacterPathEvent* this_event_bead();
This function returns a pointer to the current event bead.Returns:
pointer of type diguyCharacterPathEvent; NULL if no current event bead
| Path Shape Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_path_shapes |
Prototype:
Returns:int get_num_path_shapes();
number of path shapes in the scenario
function diguyScenario::get_path_shape_at_index |
Prototype:
Returns:diguyPathShape* get_path_shape_at_index(int index);
pointer of type diguyPathShape; NULL if no path shape at the specified indexArguments:
index index of the path shape; indices start at 0
function diguyScenario::get_current_path_shape |
Prototype:
Returns:diguyPathShape* get_current_path_shape();
pointer of type diguyPathShape; NULL if no path shape at the specified index
function diguyScenario::find_path_shape |
Prototype:
Description:diguyPathShape* find_path_shape(const char* name);
This function returns a pointer to the specified path shape.Arguments:
Returns:
name name of path shape to be found
pointer of type diguyPathShape; NULL if not found
function diguyScenario::create_path_shape |
Prototype:
Description:diguyPathShape* create_path_shape(const char* name);
This function creates a new path shape and returns a pointer to it.Arguments:
Returns:
name name of the new path shape
pointer of type diguyPathShape; NULL if creation failed
function diguyScenario::copy_path_shape |
Prototype:
Description:diguyPathShape* copy_path_shape(diguyPathShape* existing_path_shape, const char* name);
This function creates a new path shape based on an existing path shape and returns a pointer to it.Arguments:
Returns:
existing_path_shape pointer to diguyPathShape to be copied name name of the new path shape
pointer of type diguyPathShape; NULL if creation failed
function diguyScenario::destroy_path_shape |
Prototype:
Description:int destroy_path_shape(diguyPathShape* path_shape);
This function destroys a path shape.Arguments:
Returns:
path_shape pointer to a diguyPathShape
0 on success, -1 on failure
| Waypoint Functions |
function diguyScenario::create_waypoint |
Prototype:
Description:diguyWaypoint* create_waypoint(float x = 0.0f, float y = 0.0f, float z = 0.0f, float yaw = 0.0f, float roll = 0.0f, float pitch = 0.0f, float weight_in = DIGUY_DEFAULT_FLOAT, float weight_out = DIGUY_DEFAULT_FLOAT);
This function creates a new waypoint that can be used for creating new paths and path shapes.
The returned pointer must be destroyed using destroy_waypoint(). The scenario keeps no record of waypoints created with this function.
The weights of the waypoint control how long the "control handles" of the waypoint are, in meters. The longer the control handle, the more the path will be stretched in the direction of the waypoint's orientation.
Unless otherwise specified, callable from:
Arguments:
- C++
- Script
tx, ty, tz position in meters from the origin rz, rx, ry orientations in degrees counter-clockwise from the positive X axis weight_in how much influence this waypoint exerts over the path curve entering this waypoint weight_out how much influence this waypoint exerts over the path curve leaving this waypoint By default, weight_in will be set to 1, and weight_out will be coupled to weight_in so that changes to one will affect the other. See diguyWaypoint::set_weight_in(). If a non-default value is passed for weight_out the weights of the waypoint will not be coupled.Returns:
pointer to type diguyWaypoint
function diguyScenario::destroy_waypoint |
Prototype:
Description:int destroy_waypoint(diguyWaypoint* waypoint);
This function destroys a waypoint created by create_waypoint(). Path shapes created using this waypoint will not be affected; they make internal copies of the waypoints that are used to create them.
Do not call this function on waypoints not created by create_waypoint()! e.g., a waypoint returned by a call to diguyCharacterPath::get_waypoint_at_index().Arguments:
Returns:
waypoint waypoint to destroy
0 on success, -1 on failure
| Character Type Map Functions |
See the top-level description of the diguyCharacterTypeMap for extensive information about character type maps.
See the DIGuyDigest programming example for examples on how to use these functions.
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_nearest_character_type_map |
Prototype:
Description:diguyCharacterTypeMap* get_nearest_character_type_map( diguyCharacterTypeMapField field1, const char* field1_value, const char* field1_alternate_value, diguyCharacterTypeMapField field2 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field2_value = NULL, const char* field2_alternate_value = NULL, diguyCharacterTypeMapField field3 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field3_value = NULL, const char* field3_alternate_value = NULL, diguyCharacterTypeMapField field4 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field4_value = NULL, const char* field4_alternate_value = NULL, diguyCharacterTypeMapField field5 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field5_value = NULL, const char* field5_alternate_value = NULL, diguyCharacterTypeMapField field6 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field6_value = NULL, const char* field6_alternate_value = NULL, diguyCharacterTypeMapField field7 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field7_value = NULL, const char* field7_alternate_value = NULL, diguyCharacterTypeMapField field8 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field8_value = NULL, const char* field8_alternate_value = NULL);
This function searches DI-Guy's available character types and appearances for the closest match to the specified fields and values. See the documentation for diguyCharacterTypeMap for information on what fields are available, and what values they may take.Arguments:
field1 field in type map to check field1_value value to check for field1_alternate_value acceptable alternate value (Arguments for fields 2 through 8 are the same.)Returns:
pointer to type diguyCharacterTypeMap
function diguyScenario::get_nearest_character_type_map_using_field_strings |
Prototype:
Description:diguyCharacterTypeMap* get_nearest_character_type_map_using_field_strings( const char* field1_string, const char* field1_value, const char* field1_alternate_value, const char* field2_string = NULL, const char* field2_value = NULL, const char* field2_alternate_value = NULL, const char* field3_string = NULL, const char* field3_value = NULL, const char* field3_alternate_value = NULL, const char* field4_string = NULL, const char* field4_value = NULL, const char* field4_alternate_value = NULL, const char* field5_string = NULL, const char* field5_value = NULL, const char* field5_alternate_value = NULL, const char* field6_string = NULL, const char* field6_value = NULL, const char* field6_alternate_value = NULL, const char* field7_string = NULL, const char* field7_value = NULL, const char* field7_alternate_value = NULL, const char* field8_string = NULL, const char* field8_value = NULL, const char* field8_alternate_value = NULL);
Same as above, but fields to check are specified by string name instead of enumeration value.
function diguyScenario::get_nearest_character_type_map_id_match |
Prototype:
Description:diguyCharacterTypeMap* get_nearest_character_type_map_id_match(const char* type_map_id);
Same as above, but field values to match against are specified by the given type map id. No alternate values can be provided, though wildcards can be used by putting a "*" in for a field.
function diguyScenario::get_num_character_type_map_entries |
Prototype:
Description:int get_num_character_type_map_entries();
This function returns the total number of type map entries that are in DI-Guy. It is against these entries that matches will be made.
This function, along with get_character_type_map_entry_at_index(), enables all type map information to be queried.Returns:
number of total type map entries against which matches will be made
function diguyScenario::get_character_type_map_entry_at_index |
Prototype:
Returns:diguyCharacterTypeMap* get_character_type_map_entry_at_index(int index);
type map entry at specified index; see get_num_character_type_map_entries()
function diguyScenario::get_num_type_map_character_classes |
Prototype:
Description:int get_num_type_map_character_classes();
This function returns the total number of values that may be specified or returned in the character class field.
This function, along with get_type_map_character_class_at_index(), enables all available character classes to be queried.Returns:
number of character classes
function diguyScenario::get_type_map_character_class_at_index |
Prototype:
Returns:const char* get_type_map_character_class_at_index(int index);
character class field value at specified index; see get_num_type_map_character_classes()
function diguyScenario::get_num_type_map_categories |
Prototype:
Description:int get_num_type_map_categories(const char* character_class);
This function returns the total number of values that may be specified or returned in the category field of a type map with the given character class.
This function, along with get_type_map_category_at_index(), enables all available categories available to each character class to be queried.Returns:
number of categories
function diguyScenario::get_type_map_category_at_index |
Prototype:
Returns:const char* get_type_map_category_at_index(const char* character_class, int index);
category field value at specified index; see get_num_type_map_categories()
function diguyScenario::get_num_type_map_subcategories |
Prototype:
Description:int get_num_type_map_subcategories(const char* character_class, const char* category);
This function returns the total number of values that may be specified or returned in the subcategory field of a type map with the given character class and category.
This function, along with get_type_map_subcategory_at_index(), enables all available subcategories available to each character class and category to be queried.Returns:
number of subcategories
function diguyScenario::get_type_map_subcategory_at_index |
Prototype:
Returns:const char* get_type_map_subcategory_at_index(const char* character_class, const char* category, int index);
subcategory field value at specified index; see get_num_type_map_subcategories()
| Signal Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_signals |
Prototype:
Returns:int get_num_signals();
number of signals in the scenario
function diguyScenario::get_signal_at_index |
Prototype:
Returns:diguySignal* get_signal_at_index(int index);
pointer of type diguySignal; NULL if no signal at the specified indexArguments:
index index of the signal; indices start at 0
function diguyScenario::find_signal |
Prototype:
Description:diguySignal* find_signal(const char* name);
This function returns a pointer to the specified signal.Arguments:
Returns:
name name of signal to be found
pointer of type diguySignal; NULL if not found
function diguyScenario::create_signal |
Prototype:
Description:diguySignal* create_signal(const char* name);
This function creates a new signal and returns a pointer to it.Arguments:
Returns:
name name of the new signal
pointer of type diguySignal
function diguyScenario::destroy_signal |
Prototype:
Description:int destroy_signal(diguySignal* signal);
This function destroys a signal.Arguments:
Returns:
signal pointer to a diguySignal
0 on success, -1 on failure
function diguyScenario::reset_signals |
Prototype:
Description:void reset_signals();
This function resets all signals in the scenario.
function diguyScenario::signal_palette_hide_all |
Prototype:
Description:int signal_palette_hide_all(const char* filter = NULL);
This function hides all signals in the signal palette.Arguments:
filter optional filter, will only hide signals tagged with info_text equaling filter
function diguyScenario::signal_palette_show_all |
Prototype:
Description:int signal_palette_show_all(const char* filter = NULL);
This function shows all signals in the signal palette.Arguments:
filter optional filter, will only show signals tagged with info_text filter
| Sound Functions |
Note that sounds are not played directly. Instead they are used as templates for sound instances. See diguyCharacter::play_sound() and diguyCharacter::create_sound_instance().
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_sounds |
Prototype:
Returns:int get_num_sounds();
number of sounds in the scenario
function diguyScenario::get_sound_at_index |
Prototype:
Returns:diguySound* get_sound_at_index(int index);
pointer of type diguySound; NULL if no sound at the specified indexArguments:
index index of the sound; indices start at 0
function diguyScenario::find_sound |
Prototype:
Description:diguySound* find_sound(const char* name);
This function returns a pointer to the specified sound.Arguments:
Returns:
name name of sound to be found
pointer of type diguySound; NULL if not found
function diguyScenario::create_sound |
Prototype:
Description:diguySound* create_sound(const char* name, const char* sound_filename = NULL, const char* phoneme_filename = NULL);
This function creates a new sound and returns a pointer to it.
Note that sounds are not played directly. Instead they are used as templates for sound instances. See diguyCharacter::play_sound() and diguyCharacter::create_sound_instance().Arguments:
name name of the new sound sound_filename filename of the sound phoneme_filename optional phoneme file; see diguySound::set_phoneme_filename() Note that name isn't the filename of the sound; it is the descriptive name that will show up in the UI and used in diguyCharacter calls that play sounds.
Pass the filename in the sound_filename argument or use the function diguySound::set_sound_filename() to set the filename of the sound.
See diguyCharacter::set_current_voice_actor() for information about naming sounds for different voice actors.Returns:
pointer of type diguySound
function diguyScenario::destroy_sound |
Prototype:
Description:int destroy_sound(diguySound* sound);
This function destroys a sound.Arguments:
Returns:
sound pointer to diguySound to be destroyed
0 on success, -1 on failure
function diguyScenario::preload_sound |
Prototype:
Description:int preload_sound(diguySound* sound);
This function preloads data for the sound.Arguments:
Returns:
sound pointer to diguySound
0 on success, -1 on failure
function diguyScenario::stop_all_sounds |
Prototype:
Description:int stop_all_sounds(float rampdown_time = 0.0f);
This function stops all sounds playing within the scenario.Arguments:
Returns:
rampdown_time how long to allow the sounds to fade out
0 on success, -1 on failure
function diguyScenario::play_3d_sound |
Prototype:
Description:int play_3d_sound(const char* name, float x, float y, float z, float gain, int save_event);
This function plays a non looping sound.Arguments:
Returns:
name name of the sound x, y, z location in the world the sound comes from gain a volume multiplier save_event if review data should record the creation of this sound
0 on success, -1 on failure
| Group Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_groups |
Prototype:
Returns:int get_num_groups();
number of groups in the scenario
function diguyScenario::get_group_at_index |
Prototype:
Returns:diguyCharacterGroup* get_group_at_index(int index);
pointer of type diguyCharacterGroup; NULL if no group at the specified indexArguments:
index index of the group; indices start at 0
function diguyScenario::find_group |
Prototype:
Description:diguyCharacterGroup* find_group(const char* name);
This function returns a pointer to the specified group.Arguments:
Returns:
name name of group to be found
pointer of type diguyCharacterGroup; NULL if not found
function diguyScenario::create_group |
Prototype:
Description:diguyCharacterGroup* create_group(const char* name);
This function creates a new group and returns a pointer to it.Arguments:
Returns:
name name of the new group
pointer of type diguyCharacterGroup
function diguyScenario::find_or_create_group |
Prototype:
Description:diguyCharacterGroup* find_or_create_group(const char* name);
This function finds the group with the given name or creates it if it doesn't exist.Arguments:
Returns:
name name of the group to find or create
pointer of type diguyGroup; should never be NULL
function diguyScenario::destroy_group |
Prototype:
Description:int destroy_group(diguyCharacterGroup* group);
This function destroys a group.Arguments:
Returns:
group pointer to a diguyCharacterGroup
0 on success, -1 on failure
| Sensor Region Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_sensor_regions |
Prototype:
Returns:int get_num_sensor_regions();
number of sensor regions in the scenario
function diguyScenario::get_sensor_region_at_index |
Prototype:
Returns:diguySensorRegion* get_sensor_region_at_index(int index);
pointer of type diguySensorRegion; NULL if no sensor region at the specified indexArguments:
index index of the sensor region; indices start at 0
function diguyScenario::find_sensor_region |
Prototype:
Description:diguySensorRegion* find_sensor_region(const char* name);
This function returns a pointer to the specified sensor region.Arguments:
Returns:
name name of sensor region to be found
pointer of type diguySensorRegion; NULL if not found
| Scene Object Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_scene_objects |
Prototype:
Returns:int get_num_scene_objects();
number of scene objects in the scenario
function diguyScenario::get_scene_object_at_index |
Prototype:
Returns:diguySceneObject* get_scene_object_at_index(int index);
pointer of type diguySceneObject; NULL if no scene object at the specified indexArguments:
index index of the scene object; indices start at 0
function diguyScenario::find_scene_object |
Prototype:
Returns:diguySceneObject* find_scene_object(const char* name);
pointer of type diguySceneObject; NULL if no scene object with specified name
function diguyScenario::set_scene_objects_enabled |
Prototype:
Description:void set_scene_objects_enabled(int scene_objects_enabled);
This function sets whether scene objects defined in the scenario are enabled, and therefore potentially visible.
Scene objects are not enabled by default.Arguments:
scene_objects_enabled flag determining whether scene objects are enabled; 1 for enabled, 0 for disabled
function diguyScenario::get_scene_objects_enabled |
Prototype:
Returns:int get_scene_objects_enabled();
the most recent setting made by a call to set_scene_objects_enabled()
function diguyScenario::create_scene_object |
Prototype:
Description:diguySceneObject* create_scene_object(const char* name, const char* filename);
This function creates a new scene object and returns a pointer to it.Arguments:
Returns:
name name of the new scene object filename file the scene object should use
pointer of type diguySceneObject; NULL if creation failed
function diguyScenario::create_user_defined_scene_object |
Prototype:
Description:diguySceneObject* create_user_defined_scene_object(const char* name);
This function creates a new user defined scene object and returns a pointer to it.Arguments:
Returns:
name name of the new scene object
pointer of type diguySceneObject; NULL if creation failed
function diguyScenario::destroy_scene_object |
Prototype:
Description:int destroy_scene_object(diguySceneObject* scene_object);
This function destroys a scene object.Arguments:
Returns:
scene_object pointer to a diguySceneObject
0 on success, -1 on failure
| View Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_primary_view |
Prototype:
Returns:diguyView* get_primary_view();
pointer to the scenario's primary view; there is one and only one primary view in the scenario
function diguyScenario::get_num_secondary_views |
Prototype:
Returns:int get_num_secondary_views();
number of secondary views in the scenario
function diguyScenario::get_secondary_view_at_index |
Prototype:
Returns:diguyView* get_secondary_view_at_index(int index);
pointer of type diguyView; NULL if no secondary view at the specified indexArguments:
index index of the secondary view; indices start at 0
function diguyScenario::find_view |
Prototype:
Description:diguyView* find_view(const char* name);
This function returns a pointer to the view with the given name. The primary view and all of the secondary views are checked for a name match.Returns:
pointer of type diguyView; NULL if not found
| Camera Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_scenario_camera |
Prototype:
Description:diguyViewCamera* get_scenario_camera();
This function returns a pointer to the primary view's camera. This is equivalent to:
Returns:
diguyView* v = scenario->get_primary_view(); return v->get_camera();
pointer of type diguyViewCamera; should never be NULL
function diguyScenario::find_camera |
Prototype:
Description:diguyViewCamera* find_camera(const char* name);
This function returns a pointer to the camera with the given name. The primary view's camera and all of the secondary views' cameras are checked for a name match.Returns:
pointer of type diguyViewCamera; NULL if not found
function diguyScenario::set_scenario_camera_affected_by_script_events |
Prototype:
Description:void set_scenario_camera_affected_by_script_events(int flag);
This function sets a flag that determines whether script calls can set the primary view's camera settings. Specifically, if flag is 0, calls to diguyViewCamera::load() will have no effect; the camera should remain completely under user control.Arguments:
flag 1 to enable, 0 to disable
function diguyScenario::get_scenario_camera_affected_by_script_events |
Prototype:
Returns:int get_scenario_camera_affected_by_script_events();
the most recent setting made by set_scenario_camera_affected_by_script_events()
function diguyScenario::set_scenario_camera_affected_by_script_events_when_iguy_active |
Prototype:
Description:void set_scenario_camera_affected_by_script_events_when_iguy_active(int flag);
This function, like set_scenario_camera_affected_by_script_events(), determines whether script calls can set the primary view's camera settings, but only disables camera changes if there is an active I-Guy character as set by the set_iguy_character() call.
If set_scenario_camera_affected_by_script_events() has been called with a value of 0, then this function has no effect.Arguments:
flag 1 to enable, 0 to disable
function diguyScenario::get_scenario_camera_affected_by_script_events_when_iguy_active |
Prototype:
Returns:int get_scenario_camera_affected_by_script_events_when_iguy_active();
the most recent setting made by set_scenario_camera_affected_by_script_events()
function diguyScenario::get_num_camera_settings |
Prototype:
Returns:int get_num_camera_settings();
number of camera settings saved in the scenario
function diguyScenario::get_camera_settings_at_index |
Prototype:
Returns:diguyViewCameraSettings* get_camera_settings_at_index(int index);
pointer of type diguyViewCameraSettings; NULL if no camera settings at the specified indexArguments:
index index of the camera settings; indices start at 0
function diguyScenario::find_camera_settings |
Prototype:
Description:diguyViewCameraSettings* find_camera_settings(const char* settings_name);
This function returns a pointer to the specified camera settings.Arguments:
Returns:
settings_name name of camera settings to be found
pointer of type diguyViewCamera; NULL if not found
function diguyScenario::load_camera_settings |
Prototype:
Description:int load_camera_settings(const char* settings_name, int update_current_camera = 1);
This function loads the specified camera settings into the primary view's camera.Arguments:
settings_name name of camera settings to be loaded update_current_camera whether the current camera should be updated; defaults to 1 Not updating the current camera will cause the camera history to be lost.Returns:
0 on success, -1 on failure
function diguyScenario::set_render_camera |
Prototype:
Description:void set_render_camera(diguyViewCamera* camera);
This function sets camera that will be used for down-stream camera-related operations. This includes:
- far position rendering in the OpenGL renderer
- various culling operations (e.g. set_character_culling_enabled())
- graphics LOD range scaling; see set_scale_graphics_lod_ranges_from_view_settings()
Typically the passed camera should be the primary view's camera.
A render camera does not always need to be set. If one is not set, the above camera-related operations will not be performed.
If a render camera is set the actual rendering environment camera settings (e.g. as set by gluLookAt() in OpenGL) should match the settings in the render camera, or there may be unexpected visual results.Arguments:
camera camera to use for camera-related operations
| Fog Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_scenario_fog |
Prototype:
Description:diguyViewFog* get_scenario_fog();
This function returns a pointer to the scenario fog. This is the fog of the primary view.Returns:
pointer of type diguyViewFog; should never be NULL
function diguyScenario::find_fog |
Prototype:
Description:diguyViewFog* find_fog(const char* name);
This function returns a pointer to the fog with the given name. The primary view's fog and all of the secondary views' fogs are checked for a name match.Returns:
pointer of type diguyViewFog; NULL if not found
function diguyScenario::find_or_create_fog |
Prototype:
Description:diguyViewFog* find_or_create_fog(const char* name);
This function returns the fog object with the given name, or creates one if not found.Returns:
pointer of type diguyViewFog
name
function diguyScenario::load_current_fog |
Prototype:
Description:void load_current_fog(const char* name);
This function loads the named fog settings the currently active one.
name
function diguyScenario::get_num_fog_settings |
Prototype:
Returns:int get_num_fog_settings();
number of fog settings in the scenario
function diguyScenario::get_fog_settings_at_index |
Prototype:
Returns:diguyViewFogSettings* get_fog_settings_at_index(int index);
pointer of type diguyViewFogSettings; NULL if no fog at the specified indexArguments:
index index of the fog settings; indices start at 0
function diguyScenario::find_fog_settings |
Prototype:
Description:diguyViewFogSettings* find_fog_settings(const char* settings_name);
This function returns a pointer to the specified fog settings.Arguments:
Returns:
settings_name name of fog settings to be found
pointer of type diguyViewFogSettings; NULL if not found
function diguyScenario::load_fog_settings |
Prototype:
Description:int load_fog_settings(const char* settings_name);
This function loads the specified fog settings into the scenario fog.Arguments:
Returns:
settings_name name of fog settings to be loaded
pointer of type diguyViewFog; NULL if not found
| Light Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_scenario_light |
Prototype:
Description:diguyViewLight* get_scenario_light(int i = 0);
This function returns a pointer to the scenario light. These are the lights of the primary view.Arguments:
Returns:
number number of light to be found
pointer of type diguyViewLight; can be null if asked for a non-existent light
function diguyScenario::find_light |
Prototype:
Description:diguyViewLight* find_light(const char* name);
This function returns a pointer to the light with the given name. The primary view's light and all of the secondary views' lights are checked for a name match.Returns:
pointer of type diguyViewLight; NULL if not found
function diguyScenario::get_num_light_settings |
Prototype:
Returns:int get_num_light_settings();
number of light settings in the scenario
function diguyScenario::get_light_settings_at_index |
Prototype:
Returns:diguyViewLightSettings* get_light_settings_at_index(int index);
pointer of type diguyViewLightSettings; NULL if no light settings at the specified indexArguments:
index index of the light settings; indices start at 0
function diguyScenario::find_light_settings |
Prototype:
Description:diguyViewLightSettings* find_light_settings(const char* settings_name);
This function returns a pointer to the specified light settings.Arguments:
Returns:
name name of light settings to be found
pointer of type diguyViewLightSettings; NULL if not found
function diguyScenario::load_light_settings |
Prototype:
Description:int load_light_settings(const char* settings_name, int light_num = 0);
This function loads the specified light settings into the scenario light.Arguments:
Returns:
settings_name name of light settings to be loaded light_num which light to load into
pointer of type diguyViewLight; NULL if not found
| Info Popup Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_info_popups |
Prototype:
Returns:int get_num_info_popups();
number of info popups in the scenario
function diguyScenario::get_info_popup_at_index |
Prototype:
Returns:diguyInfoPopup* get_info_popup_at_index(int index);
pointer of type diguyInfoPopup; NULL if no info popup at the specified indexArguments:
index index of the info popup; indices start at 0
function diguyScenario::find_info_popup |
Prototype:
Description:diguyInfoPopup* find_info_popup(const char* name);
This function returns a pointer to the specified info popup.Arguments:
Returns:
name name of info popup to be found
pointer of type diguyInfoPopup; NULL if not found
function diguyScenario::set_info_popup_default_encoding |
Prototype:
Description:int set_info_popup_default_encoding(const char* info_popup_default_encoding);
This function sets the default encoding for info popups that do not have an encoding specified.Arguments:
Returns:
info_popup_default_encoding new default encoding
0 on success, -1 on failure
function diguyScenario::get_info_popup_default_encoding |
Prototype:
Description:const char* get_info_popup_default_encoding();
This function returns the default encoding of info popups.Returns:
default encoding; value will never be NULL, but may be the empty string ("") if no default encoding has been specified
| Variable Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_variables |
Prototype:
Returns:int get_num_variables();
number of variables in the scenario
function diguyScenario::get_variable_at_index |
Prototype:
Returns:diguyVariable* get_variable_at_index(int index);
pointer of type diguyVariable; NULL if no variable at the specified indexArguments:
index index of the variable; indices start at 0
function diguyScenario::find_variable |
Prototype:
Description:diguyVariable* find_variable(const char* name);
This function returns a pointer to the specified variable.Arguments:
Returns:
name name of variable to be found
pointer of type diguyVariable; NULL if not found
function diguyScenario::find_or_create_variable |
Prototype:
Description:diguyVariable* find_or_create_variable(const char* name);
This function finds the variable with the given name or creates it if it doesn't exist.Arguments:
Returns:
name name of the variable to find or create
pointer of type diguyVariable; should never be NULL
function diguyScenario::destroy_variable |
Prototype:
Description:int destroy_variable(diguyVariable* variable);
This function destroys the passed variable.Arguments:
Returns:
variable pointer to a diguyVariable
0 on success, -1 on failure
| Face Expression Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_face_expressions |
Prototype:
Returns:int get_num_face_expressions();
number of face_expressions in the scenario
function diguyScenario::get_face_expression_at_index |
Prototype:
Returns:diguyCharacterFaceExpression* get_face_expression_at_index(int index);
pointer of type diguyCharacterFaceExpression; NULL if no info popup at the specified indexArguments:
index index of the face_expression; indices start at 0
function diguyScenario::find_face_expression |
Prototype:
Description:diguyCharacterFaceExpression* find_face_expression(const char* name);
This function returns a pointer to the specified face expression.Arguments:
Returns:
name name of face_expression to be found
pointer of type diguyCharacterFaceExpression; NULL if not found
function diguyScenario::create_face_expression |
Prototype:
Description:diguyCharacterFaceExpression* create_face_expression(const char* name, const char* target_actor = "exface");
This function creates a new face expression with the given name.Arguments:
Returns:
name name of the new face expression target_actor name of the actor to use as template; defaults to "exface" for backwards compatiblity
pointer of type diguyCharacterFaceExpression
function diguyScenario::destroy_face_expression |
Prototype:
Description:int destroy_face_expression(diguyCharacterFaceExpression* face_expression);
This function destroys the passed face expression.Arguments:
Returns:
face_expression pointer to a diguyCharacterFaceExpression
0 on success, -1 on failure
| Chain Settings Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_chain_settings |
Prototype:
Returns:int get_num_chain_settings();
number of chain settings in the scenario
function diguyScenario::get_chain_settings_at_index |
Prototype:
Returns:diguyChainSettings* get_chain_settings_at_index(int index);
pointer of type diguyChainSettings; NULL if no chain settings at the specified indexArguments:
index index of the chain settings; indices start at 0
function diguyScenario::find_chain_settings |
Prototype:
Description:diguyChainSettings* find_chain_settings(const char* name);
This function returns a pointer to the specified chain settings.Arguments:
Returns:
name name of chain settings to be found
pointer of type diguyChainSettings; NULL if not found
function diguyScenario::create_chain_settings |
Prototype:
Description:diguyChainSettings* create_chain_settings(const char* name);
This function creates a new chain settings and returns a pointer to it.Arguments:
Returns:
name name of the new chain settings
pointer of type diguyChainSettings
function diguyScenario::destroy_chain_settings |
Prototype:
Description:int destroy_chain_settings(diguyChainSettings* chain_settings);
This function destroys a chain settings.Arguments:
Returns:
chain settings pointer to a diguyChainSettings
0 on success, -1 on failure
| Callback Functions |
Unless otherwise specified, callable from:
- C++
- Script
enumeration |
Description:enum { CALLBACK_ID_CREATE = 1, CALLBACK_ID_DESTROY, CALLBACK_ID_RESET, CALLBACK_ID_WAIT_CURSOR_SHOW, CALLBACK_ID_WAIT_CURSOR_HIDE, CALLBACK_ID_LOAD, CALLBACK_ID_SAVE, CALLBACK_ID_LOAD_SCENARIO_FILE, CALLBACK_ID_SAVE_SCENARIO_FILE, CALLBACK_ID_SCENE_OBJECT_IMPACT, CALLBACK_ID_TIMED_EVENT, CALLBACK_ID_MANUALLY_INVOKED, CALLBACK_ID_POST_DRAW, CALLBACK_ID_PLAYBACK_MODE_CHANGED, CALLBACK_ID_INPUT_MODE_CHANGED, CALLBACK_ID_RENDER_MODE_CHANGED, CALLBACK_ID_PRE_REINITIALIZE, CALLBACK_ID_POST_REINITIALIZE, CALLBACK_ID_POST_LOAD_CHECKPOINT };
This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script().
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.
CALLBACK_ID_CREATE
Callback Enums:
This callback will be called when a new scenario is created. It should only be used by diguyApp::add_default_scenario_callback(). Using it in set_callback() will have no effect, as by that time the scenario has already been created.CALLBACK_ID_RESET
This callback will be called when the scenario is reset.CALLBACK_ID_WAIT_CURSOR_SHOW
This callback will be called when a diguy operation is likely to take some time, allowing an application to display a wait cursor.CALLBACK_ID_WAIT_CURSOR_HIDE
This callback will be called when a diguy operation that caused a wait cursor to be shown has completed, allowing an application to hide the wait cursor.CALLBACK_ID_LOAD
This callback will be called when a scenario is loaded, thereby giving a chance for custom code to read extra elements from the loaded file.CALLBACK_ID_SAVE
This callback will be called when a scenario is saved, thereby giving a chance for custom code to insert extra elements into the saved file.CALLBACK_ID_LOAD_SCENARIO_FILE
This callback will be called just before a scenario loads a new file.CALLBACK_ID_SAVE_SCENARIO_FILE
This callback will be called just after a scenario saves a new file. With a char * pointer to the file name.CALLBACK_ID_MANUALLY_INVOKED
This callback id will be supplied to event handlers invoked by a call to manually_invoke_event_handler().
The user's returned diguyCallbackReturn value will be ignored.CALLBACK_ID_POST_DRAW
This callback will be called just after a scenario finishes it's draw commands. The diguyViewPainter class can be used to issue abstract draw commands in DI-Guy Scenario.Lua Example:
CALLBACK_ID_PLAYBACK_MODE_CHANGED
local painter = this_app:get_view_painter(); painter:set_pen_color(1,1,0); painter:draw_line(0,0,0, 1,1,1);
This callback will be called when the playback mode of the scenario has changed. For example, the Play or Stop buttons are pressed in DI-Guy Scenario, or set_playback_mode() is called.
The user's returned diguyCallbackReturn value will be ignored.CALLBACK_ID_INPUT_MODE_CHANGED
This callback will be called when the input mode of the scenario has changed. For example, when an Input Mode button is pressed in DI-Guy Scenario, or diguyApp::set_base_input_mode() is called.
The user's returned diguyCallbackReturn value will be ignored.CALLBACK_ID_RENDER_MODE_CHANGED
This callback will be called if the render mode of the scenario changes, typically due to a set_current_render_mode().
The user's returned diguyCallbackReturn value will be ignored.CALLBACK_ID_POST_LOAD_CHECKPOINT
This callback will be called just after a scenario finishes loading a checkpoint file.
function diguyScenario::add_callback |
Prototype:
Description:int add_callback(int callback_id, diguyScenarioCallback* callback, void* callback_params = 0, void* callback_user_data = 0, int remove_on_scenario_load = 1);
This function adds a scenario callback.Arguments:
Returns:
callback pointer to function with prototype diguyScenarioCallback (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 remove_on_scenario_load pass 1 to remove the callback on a scenario load, 0 to not
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::remove_callback |
Prototype:
Description:int remove_callback(int callback_id, diguyScenarioCallback* 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 callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::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 callback callback_user_data pointer for user's own use
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::add_default_character_callback |
Prototype:
Description:int add_default_character_callback(int callback_id, diguyCharacterCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function sets a default user callback that will be added to all new characters. See diguyCharacter::add_callback() for details.Callable From:
- C++
function diguyScenario::remove_default_character_callback |
Prototype:
Description:int remove_default_character_callback(int callback_id, diguyCharacterCallback* callback);
This function removes a user callback. All default character callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_character_callback_with_user_data |
Prototype:
Description:int remove_default_character_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback previously added by add_default_character_callback(). See diguyCharacter::remove_callback_with_user_data() for details.Callable From:
- C++
function diguyScenario::add_default_path_callback |
Prototype:
Description:int add_default_path_callback(int callback_id, diguyCharacterPathCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function add a default user callback that will be added to all new paths.Callable From:
- C++
function diguyScenario::remove_default_path_callback |
Prototype:
Description:int remove_default_path_callback(int callback_id, diguyCharacterPathCallback* callback);
This function removes a user callback. All default path callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_path_callback_with_user_data |
Prototype:
Description:int remove_default_path_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback. All default path callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Callable From:
callback_id integer id of callback callback_user_data pointer for user's own use
- C++
function diguyScenario::add_default_sensor_region_callback |
Prototype:
Description:int add_default_sensor_region_callback(int callback_id, diguySensorRegionCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function sets a default user callback that will be added to all new sensor regions. See diguySensorRegion::add_callback() for details.Callable From:
- C++
function diguyScenario::remove_default_sensor_region_callback |
Prototype:
Description:int remove_default_sensor_region_callback(int callback_id, diguySensorRegionCallback* callback);
This function removes a user callback. All default sensor region callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_sensor_region_callback_with_user_data |
Prototype:
Description:int remove_default_sensor_region_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback. All default sensor region callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Callable From:
callback_id integer id of callback callback_user_data pointer for user's own use
- C++
function diguyScenario::add_default_signal_callback |
Prototype:
Description:int add_default_signal_callback(int callback_id, diguySignalCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default user callback that will be added to all new signals.Callable From:
- C++
function diguyScenario::remove_default_signal_callback |
Prototype:
Description:int remove_default_signal_callback(int callback_id, diguySignalCallback* callback);
This function removes a user callback. All default signal callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_signal_callback_with_user_data |
Prototype:
Description:int remove_default_signal_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback. All default signal callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Callable From:
callback_id integer id of callback callback_user_data pointer for user's own use
- C++
function diguyScenario::add_default_variable_callback |
Prototype:
Description:int add_default_variable_callback(int callback_id, diguyVariableCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default user callback that will be added to all new variables.Callable From:
- C++
function diguyScenario::remove_default_variable_callback |
Prototype:
Description:int remove_default_variable_callback(int callback_id, diguyVariableCallback* callback);
This function removes a user callback. All default variable callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_variable_callback_with_user_data |
Prototype:
Description:int remove_default_variable_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback. All default variable callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Callable From:
callback_id integer id of callback callback_user_data pointer for user's own use
- C++
function diguyScenario::add_default_view_callback |
Prototype:
Description:int add_default_view_callback(int callback_id, diguyViewCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 1, int remove_on_scenario_load = 1);
This function adds a default user callback that will be added to all new views.
Note that unlike most of the other add default callback functions, this one's add_to_existing_objects_flag argument defaults to a value of 1, since views in scenarios always exist and are neither created nor destroyed.Callable From:
- C++
function diguyScenario::remove_default_view_callback |
Prototype:
Description:int remove_default_view_callback(int callback_id, diguyViewCallback* callback);
This function removes a user callback. All default view callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_view_callback_with_user_data |
Prototype:
Description:int remove_default_view_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback. All default view callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Callable From:
callback_id integer id of callback callback_user_data pointer for user's own use
- C++
function diguyScenario::add_default_camera_callback |
Prototype:
Description:int add_default_camera_callback(int callback_id, diguyViewCameraCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default user callback that will be added to all cameras.Callable From:
- C++
function diguyScenario::remove_default_camera_callback |
Prototype:
Description:int remove_default_camera_callback(int callback_id, diguyViewCameraCallback* callback);
This function removes a user callback. All default camera callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_camera_callback_with_user_data |
Prototype:
Description:int remove_default_camera_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback. All default camera callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Callable From:
callback_id integer id of callback callback_user_data pointer for user's own use
- C++
function diguyScenario::add_default_fog_callback |
Prototype:
Description:int add_default_fog_callback(int callback_id, diguyViewFogCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default user callback that will be added to all new fogs.Callable From:
- C++
function diguyScenario::remove_default_fog_callback |
Prototype:
Description:int remove_default_fog_callback(int callback_id, diguyViewFogCallback* callback);
This function removes a user callback. All default fog callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_fog_callback_with_user_data |
Prototype:
Description:int remove_default_fog_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback. All default fog callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Callable From:
callback_id integer id of callback callback_user_data pointer for user's own use
- C++
function diguyScenario::add_default_light_callback |
Prototype:
Description:int add_default_light_callback(int callback_id, diguyViewLightCallback* callback, void* callback_params, void* callback_user_data, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default user callback that will be added to all new lights.Callable From:
- C++
function diguyScenario::remove_default_light_callback |
Prototype:
Description:int remove_default_light_callback(int callback_id, diguyViewLightCallback* callback);
This function removes a user callback. All default light callbacks matching the specified callback_id and callback function will be removed.Arguments:
Callable From:
callback_id integer id of callback callback pointer to function with prototype diguyCharacterCallback (typedefed above)
- C++
function diguyScenario::remove_default_light_callback_with_user_data |
Prototype:
Description:int remove_default_light_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a default user callback. All default light callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Callable From:
callback_id integer id of callback callback_user_data pointer for user's own use
- C++
function diguyScenario::manually_invoke_callbacks_now |
Prototype:
Description:void manually_invoke_callbacks_now(int callback_id);
This function causes all of the scenario callbacks with the given callback_id to be called now.Arguments:
callback_id integer id of callback
function diguyScenario::add_callback_script |
Prototype:
Description:int add_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int remove_on_scenario_load = 1);
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 remove_on_scenario_load if the callback is removed when a new scenario is loaded 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 failure
function diguyScenario::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 failure
function diguyScenario::add_default_character_callback_script |
Prototype:
Description:int add_default_character_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default character callback script. The callback script will be added to all new characters. See diguyCharacter::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::remove_default_character_callback_script |
Prototype:
Description:int remove_default_character_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a default character callback script. See diguyCharacter::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::add_default_sensor_region_callback_script |
Prototype:
Description:int add_default_sensor_region_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default sensor region callback script. The callback script will be added to all new sensor regions. See diguySensorRegion::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::remove_default_sensor_region_callback_script |
Prototype:
Description:int remove_default_sensor_region_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a default sensor region callback script. See diguySensorRegion::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::add_default_signal_callback_script |
Prototype:
Description:int add_default_signal_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default signal callback script. The callback script will be added to all new signals. See diguySignal::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::remove_default_signal_callback_script |
Prototype:
Description:int remove_default_signal_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a default signal callback script. See diguySignal::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::add_default_variable_callback_script |
Prototype:
Description:int add_default_variable_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default variable callback script. The callback script will be added to all new variables. See diguySignal::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::remove_default_variable_callback_script |
Prototype:
Description:int remove_default_variable_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a default variable callback script. See diguySignal::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::add_default_view_callback_script |
Prototype:
Description:int add_default_view_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default view callback script. The callback script will be added to all new views. See diguyView::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::remove_default_view_callback_script |
Prototype:
Description:int remove_default_view_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a default character view script. See diguyView::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::add_default_camera_callback_script |
Prototype:
Description:int add_default_camera_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default camera callback script. The callback script will be added to all new cameras. See diguyViewCamera::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::remove_default_camera_callback_script |
Prototype:
Description:int remove_default_camera_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a default camera callback script. See diguyViewCamera::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::add_default_fog_callback_script |
Prototype:
Description:int add_default_fog_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default fog callback script. The callback script will be added to all new fogs. See diguyViewFog::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::remove_default_fog_callback_script |
Prototype:
Description:int remove_default_fog_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a default fog callback script. See diguyViewFog::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::add_default_light_callback_script |
Prototype:
Description:int add_default_light_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL, int add_to_existing_objects_flag = 0, int remove_on_scenario_load = 1);
This function adds a default light callback script. The callback script will be added to all new lights. See diguyViewLight::add_callback_script() for more details.Returns:
0 on success, -1 on failure
function diguyScenario::remove_default_light_callback_script |
Prototype:
Description:int remove_default_light_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a default light callback script. See diguyViewLight::remove_callback_script() for more details.Returns:
0 on success, -1 on failure
| Event Handler Functions |
DI-Guy event handlers are similar to callbacks, but have a name with which they can be referenced. This name allows DI-Guy Scenario to map event handlers to callback ids using a UI, and allows for these mappings to be saved and restored as part of the scenario.
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::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 scenario callback function registered by diguyApp::register_scenario_event_handler() or diguyApp::register_scenario_event_handler_from_library()
- a script registered by diguyApp::register_scenario_event_handler_script()
- a Script, Decision, or Library Function in the scenario whose "Event Type" is "Scenario"
Returns:
callback_id integer id of callback handler_name name of the event handler to map
0 on success, -1 on failure
function diguyScenario::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 failure
function diguyScenario::manually_invoke_event_handler |
Prototype:
Description:diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
This function manually invokes the named scenario event handler. The callback_id that will be passed to the event handler will be CALLBACK_ID_MANUALLY_INVOKED.
Note that care should be taken not to end up in an infinite loop of event calls. In general an event handler should not end up directly or indirectly invoking itself.
The event handler is one of the following:
Arguments:
- a scenario callback function registered by diguyApp::register_scenario_event_handler() or diguyApp::register_scenario_event_handler_from_library()
- a script registered by diguyApp::register_scenario_event_handler_script()
- a Script, Decision, or Library Function in the scenario whose "Event Type" is "Scenario"
Returns:
handler_name name of the event handler to invoke
DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOPCallable From:
- C++
- Script
- Decision
function diguyScenario::register_character_event_handler |
Prototype:
Description:int register_character_event_handler(const char* handler_name, diguyCharacterCallback* callback, void* callback_user_data = 0);
This function registers a character event handler function that can later be mapped via a call to diguyCharacter::map_event_handler_to_callback_id().
Call unregister_character_event_handler() to unregister the function.Arguments:
Returns:
handler_name name of the event handler callback pointer to handler function 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 handler function is called
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::register_character_event_handler_from_library |
Prototype:
Description:int register_character_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0);
This function registers a character event handler function that can later be mapped via a call to diguyCharacter::map_event_handler_to_callback_id().
Unlike register_character_event_handler(), which directly passes a function pointer, this function looks up the function pointer from a shared library (a .dll under Windows, a .so under Unix).
The passed library_name should not include the .dll or .so extension; these will be added automatically. This allows for cross-platform scenarios that don't have differing dynamic library extensions built into them.
Call unregister_character_event_handler() to unregister the function.Arguments:
Returns:
handler_name name of the event handler library_name pointer to handler function function_name pointer to handler function 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 handler function is called
0 on success, -1 on failure
function diguyScenario::register_character_event_handler_script |
Prototype:
Description:int register_character_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = 0);
This function registers a character event handler script that can later be mapped via a call to diguyCharacter::map_event_handler_to_callback_id().
Call unregister_character_event_handler() to unregister the script.Arguments:
Returns:
handler_name name of the event handler handler_script Script text handler_script_type type of script; pass NULL for scenario to use the default script interpreter
0 on success, -1 on failure
function diguyScenario::has_registered_character_event_handler |
Prototype:
Returns:int has_registered_character_event_handler(const char* handler_name);
1 if there is a character event handler with the given name, 0 if notArguments:
handler_name name of the event handler
function diguyScenario::unregister_character_event_handler |
Prototype:
Description:int unregister_character_event_handler(const char* handler_name);
This function unregisters a character event handler. This will unmap the event handler from any mappings it is a part of.Arguments:
Returns:
handler_name name of the event handler
0 on success, -1 on failure
function diguyScenario::register_signal_event_handler |
Prototype:
Description:int register_signal_event_handler(const char* handler_name, diguySignalCallback* callback, void* callback_user_data = 0);
This function is analogous to the register_character_event_handler() function, but is for signals rather than characters.Callable From:
- C++
function diguyScenario::register_signal_event_handler_from_library |
Prototype:
Description:int register_signal_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0);
This function is analogous to the register_character_event_handler_from_library() function, but is for signals rather than characters.
function diguyScenario::register_signal_event_handler_script |
Prototype:
Description:int register_signal_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = 0);
This function is analogous to the register_character_event_handler_script() function, but is for signals rather than characters.
function diguyScenario::has_registered_signal_event_handler |
Prototype:
Description:int has_registered_signal_event_handler(const char* handler_name);
This function is analogous to the has_registered_character_event_handler() function, but is for signals rather than characters.
function diguyScenario::unregister_signal_event_handler |
Prototype:
Description:int unregister_signal_event_handler(const char* handler_name);
This function is analogous to the unregister_character_event_handler() function, but is for signals rather than characters.
function diguyScenario::register_sensor_region_event_handler |
Prototype:
Description:int register_sensor_region_event_handler(const char* handler_name, diguySensorRegionCallback* callback, void* callback_user_data = 0);
This function is analogous to the register_character_event_handler() function, but is for sensor regions rather than characters.Callable From:
- C++
function diguyScenario::register_sensor_region_event_handler_from_library |
Prototype:
Description:int register_sensor_region_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0);
This function is analogous to the register_character_event_handler_from_library() function, but is for sensor regions rather than characters.
function diguyScenario::register_sensor_region_event_handler_script |
Prototype:
Description:int register_sensor_region_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = 0);
This function is analogous to the register_character_event_handler_script() function, but is for sensor regions rather than characters.
function diguyScenario::has_registered_sensor_region_event_handler |
Prototype:
Description:int has_registered_sensor_region_event_handler(const char* handler_name);
This function is analogous to the has_registered_character_event_handler() function, but is for sensor regions rather than characters.
function diguyScenario::unregister_sensor_region_event_handler |
Prototype:
Description:int unregister_sensor_region_event_handler(const char* handler_name);
This function is analogous to the unregister_character_event_handler() function, but is for sensor regions rather than characters.
function diguyScenario::register_variable_event_handler |
Prototype:
Description:int register_variable_event_handler(const char* handler_name, diguyVariableCallback* callback, void* callback_user_data = 0);
This function is analogous to the register_character_event_handler() function, but is for variables rather than characters.Callable From:
- C++
function diguyScenario::register_variable_event_handler_from_library |
Prototype:
Description:int register_variable_event_handler_from_library(const char* handler_name, const char* library_name, const char* function_name, void* callback_user_data = 0);
This function is analogous to the register_character_event_handler_from_library() function, but is for variables rather than characters.
function diguyScenario::register_variable_event_handler_script |
Prototype:
Description:int register_variable_event_handler_script(const char* handler_name, const char* handler_script, const char* handler_script_type = 0);
This function is analogous to the register_character_event_handler_script() function, but is for variables rather than characters.
function diguyScenario::has_registered_variable_event_handler |
Prototype:
Description:int has_registered_variable_event_handler(const char* handler_name);
This function is analogous to the has_registered_character_event_handler() function, but is for variables rather than characters.
function diguyScenario::unregister_variable_event_handler |
Prototype:
Description:int unregister_variable_event_handler(const char* handler_name);
This function is analogous to the unregister_character_event_handler() function, but is for variables rather than characters.
| Review Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::save_review_data |
Prototype:
Description:int save_review_data(const char* filename);
This function saves the current run of the scenario to the specified file, and other files whose names are derived from the passed filename. The passed filename should end with the extension ".dsr" (DI-Guy Review).
The review data can be reloaded later by calling the load() function, and passing the same filename.
The following is saved for later review:
- all character positions and poses
- sounds played by characters due to play_sound() and
fire_weapon_n_times() calls
Note that Paths, Waypoints, and Event Beads per se are not saved, but rather their effects on the characters' positions and poses.Arguments:
Returns:
filename file in which to save review data
0 on success, -1 on failureC++ Example:
// when shutting down the current run: scenario->save_review_data("review0.dsr"); // when after action review is needed: scenario->load("review0.dsr");
function diguyScenario::get_loaded_from_review_data |
Prototype:
Returns:int get_loaded_from_review_data();
1 if scenario was loaded from review data (from a .dsr file); 0 if not (from a .dss file)
function diguyScenario::set_history_type |
Prototype:
Description:int set_history_type(diguyHistoryType history_type);
This function sets what type of "history" will be kept for the scenario.
If time is run backwards in a scenario with history, the following will be "remembered" and replayed:
- camera settings currently in the primary view's camera
- signal trigger counts
- enabled/disabled status of scene objects
- sounds
The default is DIGUY_HISTORY_TYPE_NONE for scenarios created using the DI-Guy API, and DIGUY_HISTORY_TYPE_COMPLETE for scenarios created using the DI-Guy Scenario editor.Arguments:
history_type history type to be used for the scenario history_type should be one of the following values:DIGUY_HISTORY_TYPE_NONE
This history type saves no history.DIGUY_HISTORY_TYPE_COMPLETE
This history type saves a complete history.
DIGUY_HISTORY_TYPE_LAST and DIGUY_HISTORY_TYPE_FIRST are not supported for scenario history.Returns:
0 on success, -1 on failure
function diguyScenario::get_history_type |
Prototype:
Returns:diguyHistoryType get_history_type();
the current history type of the scenario; see set_history_type()
function diguyScenario::set_overall_history_type |
Prototype:
Description:void set_overall_history_type(diguyHistoryType overall_history_type);
This function sets the history type for this scenario, as well as the history types of all characters.
See also diguyScenario::set_history_type() and diguyCharacter::set_history_type().Arguments:
history_type history type to be used for the scenario and all characters
function diguyScenario::get_overall_history_type |
Prototype:
Description:diguyHistoryType get_overall_history_type();
This function returns the overall history type of the scenario.
The return value will be:
- DIGUY_HISTORY_TYPE_COMPLETE if history is enabled for the scenario and all characters
- DIGUY_HISTORY_TYPE_PARTIAL if history is enabled for at least one of the scenario or any character, but not all
- DIGUY_HISTORY_TYPE_NONE if history is not enabled for the scenario or any character
See also diguyScenario::get_history_type() and diguyCharacter::get_history_type().
function diguyScenario::get_replaying_history |
Prototype:
Returns:int get_replaying_history();
whether the scenario is playing back stored history
function diguyScenario::set_history_max_sound_instances |
Prototype:
Description:void set_history_max_sound_instances(int num_sound_instances);
This function sets how many sound instances are kept in memory when history is enabled. By keeping them in memory, users can "scrub" backwards in time and hear sounds that were started earlier in time and will be resumed at the proper offset into the sound. This function lets users balance that need with memory management.Arguments:
Returns:
num_sound_instances override system default of 100
none
| LOD Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::set_automatic_graphics_lod_switching |
Prototype:
Description:void set_automatic_graphics_lod_switching(int enable_graphics_lod_switching);
This function sets whether automatic graphics LOD switching should be enabled for certain graphics environments (see below).
By default it is enabled in DI-Guy Scenario, and disabled in a DI-Guy API application.
There are two ways that DI-Guy calculates the proper graphics LOD. For some graphics environments the calculation is done "manually", using data from a diguyViewCamera. In other environments the calculation is done by the graphics environment itself. The method used in each graphics environment is noted below.OpenGL Version:
This function enables or disables automatic LOD switching. In this graphics environment LOD calculations are done by the renderer; information from the diguyViewCamera is not used.Direct3D Version:
This function enables or disables automatic LOD switching. In this graphics environment LOD calculations are done relative to a diguyViewCamera.DI-Guy Graphics API Version:
This function enables or disables automatic LOD switching. In this graphics environment LOD calculations are done by the renderer; information from the diguyViewCamera is not used.
function diguyScenario::get_automatic_graphics_lod_switching |
Prototype:
Returns:int get_automatic_graphics_lod_switching();
most recent setting of set_automatic_graphics_lod_switching()
function diguyScenario::set_default_lod_ranges |
Prototype:
Description:void set_default_lod_ranges(const char* character_type, float* ranges);
Sets the distances at which level of detail switching occurs for characters of the specified type. Existing characters are not affected; only newly created characters will have the specified LOD switching ranges.
Characters will display with the highest level of detail when viewed from a distance between ranges[0] and ranges[1]. Characters will not display at all when viewed from further away than the highest switching range.
Note: ranges[0] should almost always be 0.0.Arguments:
character_type character type name, as returned by get_character_type_at_index() ranges an array of 8 non-negative floating point numbers, each larger than the one before, specifying the LOD switching ranges in meters Pass "all" for character_type to set the default ranges of all character types.
The table below indicates the number of polygons for one of the default soldier models in each level of detail, and the LOD switching ranges in effect before this function is called.
Callable From:
lod polys min max -------------------------- 1 2300 0 5 2 900 5 10 3 550 10 20 4 280 20 40 5 130 40 70 6 60 70 100 7 40 100 1000
- C++
function diguyScenario::set_scale_graphics_lod_ranges_from_view_settings |
Prototype:
Description:void set_scale_graphics_lod_ranges_from_view_settings(int do_scale);
This function sets whether view and camera settings such as field-of-view (FOV) and window size should be taken into account when determining the graphics LOD from a character's LOD ranges.
The camera settings that are used are taken from the current render camera, as set by set_render_camera(). This happens automatically in DI-Guy Scenario, but must be set manually in the DI-Guy SDK.
DI-Guy graphics LODs are distance-based, but this approach can be problematic if the current camera's FOV is very narrow; a narrow FOV essentially acts like a telephoto lens. In this case a character that is far away, and would therefore be rendered with few polygons, can actually be quite large in the 3D view.
Setting this flag to 1 will cause the FOV to be taken into account when calculating the effective distance of a character from the camera.
Many DI-Guy LOD distances assume that the vertical FOV of the view is around 40. Smaller FOVs will scale the distances larger so that LOD changes happen further out. Likewise larger FOVs will scale the distances smaller; in this case even nearby characters will appear small and therefore need less resolution.Arguments:
do_scale - pass 1 to enable scaling, 0 to disable
function diguyScenario::get_scale_graphics_lod_ranges_from_view_settings |
Prototype:
Returns:int get_scale_graphics_lod_ranges_from_view_settings();
most recent setting of set_scale_graphics_lod_ranges_from_view_settings()
function diguyScenario::set_automatic_motion_lod_switching |
Prototype:
Description:void set_automatic_motion_lod_switching(int enable_motion_lod_switching);
This function sets whether automatic motion LOD switching should be enabled.
By default it is enabled in DI-Guy Scenario, and disabled in a DI-Guy API application.
When running in a user application that uses the DI-Guy API, the primary view's camera's position and orientation must be kept consistent with the application's perception of current camera settings. A pointer to the primary view's camera can be obtained by calling get_scenario_camera().
The following describes the algorithm used by automatic motion LOD switching:
- if a character is in front of the primary view's camera, the motion LOD is set to 1 (animate all joints)
- else set motion LOD to 5 (stop animating everything but base position)
Note that if there are multiple views open on the scenario, the character must be behind all cameras for the motion LOD to be set to 5.
Also, if the history type of the character (as set by diguyCharacter::set_history_type()) is anything but DIGUY_HISTORY_TYPE_NONE, motion LOD 1 will be used since during scenario playback the character might be in front of any camera.
function diguyScenario::get_automatic_motion_lod_switching |
Prototype:
Description:int get_automatic_motion_lod_switching();
This function returns whether automatic motion LOD switching is be enabled for characters in the scenario, as set by set_automatic_motion_lod_switching().Returns:
1 if LODs enabled; 0 if not
| Script Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::eval_script |
Prototype:
Description:int eval_script(const char* script_text, int save_as_transient = 0, const char* script_type = NULL, const char* script_source = NULL);
This function sends the passed string through the script interpreter.Arguments:
Returns:
script_text string to be evaluated save_as_transient flag stating whether script_text should be remembered as a transient event at the current scenario t; see push_transient_script_event() script_type type of script contained in script_text; pass NULL to use scenario's default interpreter script_source string identifying the 'source' of the script; will be printed in error output if there are syntax errors in the script
0 on success, -1 on failureC++ Example:
scenario->eval_script("signal1:trigger();", 0, "lua", "User Script");
function diguyScenario::eval_script_file |
Prototype:
Description:int eval_script_file(const char* filename, const char* script_type = NULL);
This function sends the contents of the specified file through the script interpreter.Arguments:
Returns:
filename filename of script to be evaluated script_type type of script contained in file; pass NULL to use the scenario's default interpreter
0 on success, -1 on failureC++ Example:
scenario->eval_script_file("my_scripts.pl");
function diguyScenario::trigger_script |
Prototype:
Description:int trigger_script(const char* script_name);
This function manually triggers a script.Arguments:
Returns:
script_name name of the script to be triggered
return result of script; 0 if script not foundCallable From:
- C++
- Script
- Decision
function diguyScenario::trigger_script_delayed |
Prototype:
Description:void trigger_script_delayed(const char* script_name, float t_delay);
This function is similar to trigger_script(), but delays the trigger by the specified time.Arguments:
Callable From:
script_name name of the script to be triggered t_delay how many seconds to delay trigger
- C++
- Script
- Decision
function diguyScenario::trigger_decision |
Prototype:
Description:int trigger_decision(const char* decision_name);
This function manually triggers a decision.Arguments:
Returns:
decision_name name of the decision to be triggered
return result of decision; 0 if decision not foundCallable From:
- C++
- Script
- Decision
function diguyScenario::trigger_decision_delayed |
Prototype:
Description:void trigger_decision_delayed(const char* decision_name, float t_delay);
This function is similar to trigger_decision(), but delays the trigger by the specified time.Arguments:
Callable From:
decision_name name of the decision to be triggered t_delay how many seconds to delay trigger
- C++
- Script
- Decision
function diguyScenario::push_transient_script_event |
Prototype:
Description:void push_transient_script_event(float t, const char* script_text, const char* script_type);
This function places the passed script text on a list of scripts that should be re-evaluated when the scenario is replayed from review data.
Note that the script is not evaluated at this time. This can be done by calling eval_script() and passing 1 for the save_as_transient argument.
If the scenario is reset (as in a call to reset()), all transient scripts will be deleted. The transient script events can be saved and restored by calling save_transient_script_events() and load_transient_script_events(), respectively.Arguments:
t time at which script should be re-evaluated during scenario playback script_text Script to be evaluated script_type Scripting language to use (lua) A copy of the passed script text is made.Returns:
0 on success, -1 on failure
function diguyScenario::clear_transient_script_events |
Prototype:
Description:void clear_transient_script_events();
This function deletes all transient script events.
function diguyScenario::save_transient_script_events |
Prototype:
Description:int save_transient_script_events(const char* filename);
This function saves the transient script events to the specified file. They can be restored by calling load_transient_script_events() with the same filename.Arguments:
Returns:
filename file in which transient script events should be saved
0 on success, -1 on failure
function diguyScenario::load_transient_script_events |
Prototype:
Description:int load_transient_script_events(const char* filename);
This function loads transient script events saved by a call to save_transient_script_events().Arguments:
Returns:
filename file from which transient script events should be loaded
0 on success, -1 on failure
function diguyScenario::load_package |
Prototype:
Description:int load_package(const char* filename, const char* language = NULL, int warn_if_not_found = 1);
This function creates a package object that points to an external file. If the language is not specified it will be determined based on the filename's extension. DI-Guy will attempt to derive an appropriate name for the package. In DI-Guy Scenario package dependencies are also extracted and loaded; currently this must be done manually in the SDK.
function diguyScenario::load_package_with_dependancy |
Prototype:
Description:int load_package_with_dependancy(const char* filename, const char* depends_on_package, const char* language = NULL, int warn_if_not_found = 1);
Documentation Pending
| Meta-Action Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_character_type_num_postures |
Prototype:
Description:int get_character_type_num_postures(const char* character_type);
This function returns the number of postures the specified character type's actions support.
Use this function along with get_character_type_posture_at_index() to enumerate the character's postures.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example
the number of postures the specified character type's actions support
function diguyScenario::get_character_type_posture_at_index |
Prototype:
Description:diguyMotionPosture get_character_type_posture_at_index(const char* character_type, int index);
This function returns the posture at the specified index.
Use this function along with get_character_type_num_postures() to enumerate the character's postures.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example index index of the posture; indices start at 0
the posture at the specified index
function diguyScenario::get_character_type_action_posture |
Prototype:
Description:diguyMotionPosture get_character_type_action_posture(const char* character_type, const char* action_name);
This function returns the overall posture of the specified action.
The results of this function call can be useful in calls to the diguyCharacter::get_action_from_description() function, if for example an action with the same posture but a faster speed is desired.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
the overall posture of the specified action
function diguyScenario::get_character_type_num_variants |
Prototype:
Description:int get_character_type_num_variants(const char* character_type);
This function returns the number of variants the specified character type's actions support.
Use this function along with get_character_type_variant_at_index() to enumerate the character's variants.
This function differs from get_character_type_action_num_variants() in that this function returns the number of variants of all actions of the character. The other function returns the number of variants of a single action.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example
the number of variants the specified character type's actions support
function diguyScenario::get_character_type_variant_at_index |
Prototype:
Description:diguyMotionVariant get_character_type_variant_at_index(const char* character_type, int index);
This function returns the variant at the specified index.
Use this function along with get_character_type_num_variants() to enumerate the character's variants.
This function differs from get_character_type_action_variant_at_index() in that this function returns one of the variants of all actions of the character. The other function returns one of the variants of a single action.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example index index of the posture; indices start at 0
the variant at the specified index
function diguyScenario::get_character_type_action_primary_variant |
Prototype:
Description:diguyMotionVariant get_character_type_action_primary_variant(const char* character_type, const char* action_name);
This function returns the primary variant of the specified action.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
the overall variant of the specified action
function diguyScenario::get_character_type_action_num_variants |
Prototype:
Description:int get_character_type_action_num_variants(const char* character_type, const char* action_name);
This function returns the number of variants the specified action of the specified character type has.
Use this function along with get_character_type_action_variant_at_index() to enumerate the character's variants.
This function differs from get_character_type_num_variants() in that this function returns the number of variants of a single action of the character. The other function returns the number of variants of all actions.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example action_name the action to query
the number of variants of the specified action of the specified character type
function diguyScenario::get_character_type_action_variant_at_index |
Prototype:
Description:diguyMotionVariant get_character_type_action_variant_at_index(const char* character_type, const char* action_name, int index);
This function returns the variant at the specified index.
Use this function along with get_character_type_action_num_variants() to enumerate the character's variants.
This function differs from get_character_type_variant_at_index() in that this function returns one of the variants of a single action of the character. The other function returns one of the variants of all actions.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example index index of the posture; indices start at 0
the variant at the specified index
function diguyScenario::get_character_type_num_directions |
Prototype:
Description:int get_character_type_num_directions(const char* character_type);
This function returns the number of directions the specified character type's actions can move.
Use the get_character_type_direction_at_index() function to enumerate the directions available to a character.
The results of this function call can be useful in calls to the diguyCharacter::get_action_from_description() function.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example
the number of directions the specified character type's actions can move
function diguyScenario::get_character_type_direction_at_index |
Prototype:
Description:diguyMotionDirection get_character_type_direction_at_index(const char* character_type, int index);
Use the get_character_type_num_directions() function to get the number of directions available to a character.
The results of this function call can be useful in calls to the diguyCharacter::get_action_from_description() function.Arguments:
Returns:
character_type character type name, as returned by get_character_type_at_index(), for example index index of the direction; indices start at 0
the direction at the specified index
| Interaction Machine Functions |
Interaction machines are designed to provide "conversation tree" type interactions with the scenario user. Interactions occur in the form of information text and multiple choice responses shown to the user.
The interaction can be as simple as showing a quick notification to the user and waiting for them to acknowledge it, or as complex as having a full-fledged conversation with another character in the scenario.
The name "interaction machine" comes from the fact that the interactions are based on a straight-forward state machine approach.
Interaction machines are for use in DI-Guy Scenario only, not with the DI-Guy API.
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_interaction_machines |
Prototype:
Returns:int get_num_interaction_machines();
number of interaction machines in the scenario
function diguyScenario::create_interaction_machine |
Prototype:
Description:diguyInteractionMachine* create_interaction_machine(const char* name);
This function creates a new interaction machine and returns a pointer to it.
Note that there is a shared interaction machine that always exists; a pointer to it can be obtained by calling get_shared_interaction_machine(). See that function for more details.Arguments:
Returns:
name name of the new interaction machine
pointer of type diguyInteractionMachine; NULL if creation failed
function diguyScenario::destroy_interaction_machine |
Prototype:
Description:void destroy_interaction_machine(diguyInteractionMachine* interaction_machine);
This function destroys the passed interaction machine.
NOTE: This function should not be called on the shared interaction machine returned by get_shared_interaction_machine().Arguments:
interaction_machine pointer to a diguyInteractionMachine to be destroyed
function diguyScenario::get_interaction_machine_at_index |
Prototype:
Returns:diguyInteractionMachine* get_interaction_machine_at_index(int index);
pointer of type diguyInteractionMachine; NULL if no interaction machine at the specified indexArguments:
index index of the interaction machine; indices start at 0
function diguyScenario::find_interaction_machine |
Prototype:
Description:diguyInteractionMachine* find_interaction_machine(const char* name);
This function returns a pointer to the specified interaction machine.Arguments:
Returns:
name name of interaction machine to be found
pointer of type diguyInteractionMachine; NULL if not found
function diguyScenario::get_active_interaction_machine |
Prototype:
Description:diguyInteractionMachine* get_active_interaction_machine();
This function returns a pointer to the "active" interaction machine. Only one interaction machine can be showing and accepting input at a time.Returns:
pointer of type diguyInteractionMachine; NULL if no interaction machine is active.
function diguyScenario::get_shared_interaction_machine |
Prototype:
Description:diguyInteractionMachine* get_shared_interaction_machine();
This function returns a pointer to the shared interaction machine that is always available.
This shared interaction machine is convenient for quick alerts, notifications, or questions. Because it is shared, however, most or all of its parameters need to be set each time it is to be shown.
Do not call destroy_interaction_machine() on the returned object. It is owned by the scenario.Returns:
pointer of type diguyInteractionMachine; should never be NULL
function diguyScenario::show_notification_with_shared_interaction_machine |
Prototype:
Description:int show_notification_with_shared_interaction_machine(const char* heading, const char* info, int pause_scenario = 0, const char* input_text = NULL, int ui_appearance = diguyInteractionMachine::UI_APPEARANCE_NOTIFICATION);
This is a convenience function for using the shared interaction machine to show a notification to the user. It sets parameters of the shared interaction machine based on the passed info and shows/activates the machine.Arguments:
heading text that will be at the top of the dialog info informational text pause_scenario pass 1 to pause the scenario while the interaction machine is active, 0 to leave the scenario running if it was when this function was called input_text text that user will have to click to dismiss the interaction machine; something like "Ok" is typical ui_appearance the color theme of the interaction machine See the diguyInteractionMachine documentation for more information on what the various parameters mean.Returns:
0 on success, -1 on failureLua Example:
this_scenario:show_notification_with_shared_interaction_machine( "WARNING!", "Moving any closer to the harmful gas is not advised.", 0, "Ok", diguyInteractionMachine_UI_APPEARANCE_NOTIFICATION);
| I-Guy Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_iguy_controller |
Prototype:
Description:diguyIGuyController* get_iguy_controller();
This function returns a pointer to the I-Guy controller object of the scenario.Returns:
pointer of type diguyIGuyController; should never be NULL
| Label Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::find_or_create_label |
Prototype:
Description:diguyViewLabel* find_or_create_label(const char* name);
This function finds the diguyViewLabel with the given name or creates it if it doesn't exist.Arguments:
Returns:
name name of the diguyViewLabel to find or create
pointer of type diguyViewLabel; should never be NULL
function diguyScenario::find_label |
Prototype:
Description:diguyViewLabel* find_label(const char* name);
This function returns a pointer to the specified diguyViewLabel.Arguments:
Returns:
name name of diguyViewLabel to be found
pointer of type diguyViewLabel; NULL if not found
function diguyScenario::destroy_label |
Prototype:
Description:int destroy_label(diguyViewLabel* label);
This function destroys the passed in diguyViewLabel.Arguments:
Returns:
label pointer to a diguyViewLabel
0 on success, -1 on failure
function diguyScenario::get_num_labels |
Prototype:
Returns:int get_num_labels();
The number of diguyViewLabel objects in the scenario.
function diguyScenario::get_label_at_index |
Prototype:
Returns:diguyViewLabel* get_label_at_index(int index);
The diguyViewLabel at the given index.Arguments:
index index of the diguyViewLabel; indices start at 0
function diguyScenario::reset_labels |
Prototype:
Description:void reset_labels();
This function removes all diguyViewLabels in the scenario.
function diguyScenario::send_label_to_front |
Prototype:
Description:void send_label_to_front(diguyViewLabel* label);
This function moves the specified diguyViewLabel to the front of the drawing list. This is sometimes necessary if labels overlap.Arguments:
label pointer to diguyViewLabel to move
function diguyScenario::send_label_to_back |
Prototype:
Description:void send_label_to_back(diguyViewLabel* label);
This function moves the specified diguyViewLabel to the back of the drawing list. This is sometimes necessary if labels overlap.Arguments:
label pointer to diguyViewLabel to move
| Button Panel Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::find_or_create_panel |
Prototype:
Description:diguyViewButtonPanel* find_or_create_panel(const char* name, int horizontal = 0, int title = 1);
This function finds the diguyViewButtonPanel with the given name or creates it if it doesn't exist.Arguments:
Returns:
name name of the diguyViewButtonPanel to find or create
pointer of type diguyViewButtonPanel; should never be NULL
function diguyScenario::find_panel |
Prototype:
Description:diguyViewButtonPanel* find_panel(const char* name);
This function returns a pointer to the specified diguyViewButtonPanel.Arguments:
Returns:
name name of diguyViewButtonPanel to be found
pointer of type diguyViewButtonPanel; NULL if not found
function diguyScenario::destroy_panel |
Prototype:
Description:int destroy_panel(diguyViewButtonPanel* panel);
This function destroys the passed in diguyViewButtonPanel.Arguments:
Returns:
panel pointer to a diguyViewButtonPanel
0 on success, -1 on failure
function diguyScenario::get_num_panels |
Prototype:
Returns:int get_num_panels();
The number of diguyViewButtonPanel objects in the scenario.
function diguyScenario::get_panel_at_index |
Prototype:
Returns:diguyViewButtonPanel* get_panel_at_index(int index);
The diguyViewButtonPanel at the given index.Arguments:
index index of the diguyViewButtonPanel; indices start at 0
| Misc. DI-Guy AI Functions |
Note that these functions require a DI-Guy AI license, and that DI-Guy AI has been initialized by a call to diguy_ai_initialize().
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_minds |
Prototype:
Description:int get_num_minds();
This function returns the number of AI minds that are available to AI agent characters.Returns:
number of available minds
function diguyScenario::get_mind_name_at_index |
Prototype:
Returns:const char* get_mind_name_at_index(int index);
name of the AI mind at the specified index
function diguyScenario::is_valid_character_pointer |
Prototype:
Description:int is_valid_character_pointer(diguyCharacter* character);
This function tests if a diguyCharacter pointer is a valid pointer. This is done by comparing the passed address to those of all characters in the scenario. The function is not exceedingly fast but can be useful when building AI that functions in a networked environment.Returns:
0 if invalid, 1 if valid
function diguyScenario::is_valid_character_group_pointer |
Prototype:
Description:int is_valid_character_group_pointer(diguyCharacterGroup* character_group);
This function tests if a diguyCharacterGroup pointer is a valid pointer. This is done by comparing the passed address to those of all groups in the scenario. The function is not exceedingly fast but can be useful when building AI that functions in a networked environment.Returns:
0 if invalid, 1 if valid
| Crowd Functions |
These functions control accessing diguyCrowd objects. Crowds are used by DI-Guy AI.
Note that these functions require a DI-Guy AI license, and that DI-Guy AI has been initialized by a call to diguy_ai_initialize().
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::create_crowd |
Prototype:
Description:diguyCrowd* create_crowd(const char* name, int make_companion_of_all = 1);
This function creates a new crowd and returns a pointer to it.
A Lua object is also created that has a pointer to this crowd. This object can be retrieved by calling find_lua_crowd(crowd_name) or find_lua_crowd(diguyCrowd* pointer) in lua.Arguments:
Returns:
name name of crowd to be created make_companion_of_all pass 1 to make this crowd a companion of all existing crowds
pointer of type diguyCrowd
function diguyScenario::destroy_crowd |
Prototype:
Description:int destroy_crowd(diguyCrowd* crowd, int also_destroy_crowd_members = 0, int also_destroy_path_shapes = 0, int delay_destruction = 0);
This function destroys a crowd. It can also optionally destroy the characters that are crowd members, and the path shape that is associated with the crowd.Arguments:
Returns:
crowd pointer to a diguyCrowd also_destroy_crowd_members pass 1 to also destroy crowd member characters also_destroy_path_shapes pass 1 to also destroy crowd- associated path shapes delay_destruction pass 1 to wait till the next update call to destroy the crowd; can avoid crashes when AI's receive destruction messages
0 on success, -1 on failure
function diguyScenario::get_num_crowds |
Prototype:
Returns:int get_num_crowds();
the number of crowds in the scenario
function diguyScenario::get_crowd_at_index |
Prototype:
Returns:diguyCrowd* get_crowd_at_index(int index);
pointer of type diguyCrowd; NULL if no crowd at the specified indexArguments:
index index of the crowd; indices start at 0
function diguyScenario::get_unique_crowd_name |
Prototype:
Returns:const char* get_unique_crowd_name(const char* base_name);
A unique name based on base_name, e.g. "my_crowd7" from "my_crowd".Arguments:
base_name base string from which to build a unique name
function diguyScenario::find_crowd |
Prototype:
Description:diguyCrowd* find_crowd(const char* crowd_name);
This function returns a pointer to the specified crowd.Arguments:
Returns:
name name of crowd to be found
pointer of type diguyCrowd; NULL if not found
function diguyScenario::find_or_create_crowd |
Prototype:
Description:diguyCrowd* find_or_create_crowd(const char* crowd_name, int make_companion_of_all = 1);
This function returns a pointer to the crowd with the given name. A new crowd with the given name will be created if it doesn't already exist.Arguments:
Returns:
name name of the crowd to find or create make_companion_of_all pass 1 to make this crowd a companion of all existing crowds
pointer of type diguyCrowd; should never be NULL
function diguyScenario::set_create_network_crowds |
Prototype:
Description:void set_create_network_crowds(int do_create);
This function sets whether crowds should be created for incoming network entities.Arguments:
do_create pass 1 to create network crowds; 0 to not
function diguyScenario::get_create_network_crowds |
Prototype:
int get_create_network_crowds();
1 if network crowds will be created; 0 if not
| Crowd Profile Functions |
These functions control accessing diguyCrowdProfile objects. Crowd profiles are used by DI-Guy AI.
Note that these functions require a DI-Guy AI license.
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::create_crowd_profile |
Prototype:
Description:diguyCrowdProfile* create_crowd_profile(const char* name);
This function creates a new crowd profile and returns a pointer to it.Arguments:
Returns:
name name of crowd profile to be created
pointer of type diguyCrowdProfile
function diguyScenario::destroy_crowd_profile |
Prototype:
Description:int destroy_crowd_profile(diguyCrowdProfile* crowd_profile);
This function destroys a crowd profile.Arguments:
Returns:
crowd_profile pointer to a diguyCrowdProfile
0 on success, -1 on failure
function diguyScenario::get_num_crowd_profiles |
Prototype:
Returns:int get_num_crowd_profiles();
The number of crowd profiles in the scenario.
function diguyScenario::get_crowd_profile_at_index |
Prototype:
Returns:diguyCrowdProfile* get_crowd_profile_at_index(int index);
pointer of type diguyCrowdProfile; NULL if no crowd profile at the specified indexArguments:
index index of the crowd profile; indices start at 0
function diguyScenario::find_crowd_profile |
Prototype:
Description:diguyCrowdProfile* find_crowd_profile(const char* name);
This function returns a pointer to the specified crowd profile.Arguments:
Returns:
name name of crowd profile to be found
pointer of type diguyCrowdProfile; NULL if not found
| Load Manager Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_character_load_manager |
Prototype:
Returns:diguyLoadManager* get_character_load_manager();
pointer of type diguyLoadManager; this scenario's character load manager
| Octtree Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::force_octtree_generation |
Prototype:
Description:int force_octtree_generation();
This function forces the octtree to rebuild if it's out of date.
function diguyScenario::add_character_to_octtree |
Prototype:
Description:void add_character_to_octtree(diguyCharacter* character, int use_bounding_box_only = 0);
Documentation Pending
function diguyScenario::remove_character_from_octtree |
Prototype:
Description:void remove_character_from_octtree(diguyCharacter* character);
Documentation Pending
function diguyScenario::preload_octtree |
Prototype:
Description:int preload_octtree(const char* character_type, const char* appearance);
Documentation Pending
function diguyScenario::check_visibility |
Prototype:
Description:int check_visibility(float x1, float y1, float z1, float x2, float y2, float z2);
This function uses the octtree to check if the path between x1, y1, z1 and x2, y2, z2 has any static obstructions.Returns:
1 if the path is clear, 0 if static obstructions are present.
| Altitude Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::set_default_character_altitude_function |
Prototype:
Description:int set_default_character_altitude_function(diguyAltitudeFunction* altitude_function);
This function sets a default altitude function that will be added to all new characters. It can be overridden on a per-character basis by a call to diguyCharacter::set_altitude_function(). See that function for details.Callable From:
- C++
function diguyScenario::set_altitude_function |
Prototype:
Description:void set_altitude_function(diguyScenarioAltitudeFunction* altitude_function);
This function sets a generic altitude function for the scenario that is used for local path clamping and other operations that require the altitude at specific x, y coordinates to be calculated.
The ground_clamp() function can also optionally use the registered function.
DI-Guy Scenario has a default altitude function; replacing the default function is not recommended.Callable From:
- C++
function diguyScenario::get_altitude_function |
Prototype:
Returns:diguyScenarioAltitudeFunction* get_altitude_function();
the altitude function for the scenario as set by set_altitude_function()Callable From:
- C++
function diguyScenario::set_altitude_max_climb |
Prototype:
void set_altitude_max_climb(float altitude_max_climb);
function diguyScenario::get_altitude_max_climb |
Prototype:
float get_altitude_max_climb();
function diguyScenario::set_altitude_max_drop |
Prototype:
void set_altitude_max_drop(float altitude_max_drop);
function diguyScenario::get_altitude_max_drop |
Prototype:
float get_altitude_max_drop();
| Impact and Hit Detection Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::set_default_intersection_function |
Prototype:
Description:static void set_default_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
Sets the default intersection function. This function will be used to determine whether there is an intersection between a specified ray and the world.
function diguyScenario::set_intersection_function |
Prototype:
void set_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
function diguyScenario::trigger_detonation |
Prototype:
Description:int trigger_detonation(const char* munition_name, float x, float y, float z, const char* attacker_name = NULL, float radius_override = -1.0f, int broadcast_on_network = 1);
Creates a detonation using the specified munition name. If the DI-Guy networking module is enabled the detonation is broadcast over the network.Arguments:
munition_name name of the munition to detonate; this will potentially trigger special effects depending on the munition x, y, z location of the detonation attacker_name this MUST be specified if the detonation is being broadcast over the network radius_override defaults to the data in the munition config file broadcast_on_network pass 0 to not broadcast detonation on DIS network Note: Overriding the detonation radius will NOT work on broadcast detonations since the override value is not transmitted.
function diguyScenario::find_character_at_screen_coords |
Prototype:
Description:diguyImpact* find_character_at_screen_coords(diguyView* view, float sx, float sy);
This function checks for intersection against characters in the specified view.
To check for intersections against both characters and scene objects, call get_intersection_at_screen_coords().
The returned diguyImpact pointer is owned by the scenario and should not be deleted. It will remain valid until the next call to any one of the following functions:
This function should only be called from a DI-Guy Scenario Plugin.Arguments:
Returns:
view view to check sx, sy view coordinates to check
pointer of type diguyImpact; NULL if no character intersectedCallable From:
- DI-Guy Scenario Plugin
function diguyScenario::get_impact_at_screen_coords |
Prototype:
Description:diguyImpact* get_impact_at_screen_coords(diguyView* view, float sx, float sy, int use_octtree = 0);
This function creates an impact object based on the sx and sy in the specified view. This function will trigger an impact callback on individuals who are touched, (it will not however kill characters who don't have impact callbacks.
The returned diguyImpact pointer is owned by the scenario and should not be deleted. It will remain valid until the next call to any one of the following functions:
This function should only be called from a DI-Guy Scenario Plugin.Arguments:
Returns:
view view to check sx, sy view coordinates to check use_octtree use the octtree; will not test against all characters unless they are explicitly added, but much faster
pointer of type diguyImpact;Callable From:
- DI-Guy Scenario Plugin
function diguyScenario::get_intersection_at_screen_coords |
Prototype:
Description:diguyImpact* get_intersection_at_screen_coords(diguyView* view, float sx, float sy, int use_octtree = 0);
This function checks for intersection against the world and characters in the specified view. Unlike the function get_impact_at_screen_coords(), this function doesn't trigger callbacks; instead, it just fills out the impact info.
The returned diguyImpact pointer is owned by the scenario and should not be deleted. It will remain valid until the next call to any one of the following functions:
This function should only be called from a DI-Guy Scenario Plugin.Arguments:
Returns:
view view to check sx, sy view coordinates to check use_octtree use the octtree; will not test against all characters unless they are explicitly added, but much faster
diguyImpact with the xyz location of the intersection; NULL if there was nothing to intersect thereCallable From:
- DI-Guy Scenario Plugin
function diguyScenario::intersect_static_geometry |
Prototype:
Description:int intersect_static_geometry( float origin_x, float origin_y, float origin_z, float dir_x, float dir_y, float dir_z, float max_distance_to_test, float* intersection_x, float* intersection_y, float* intersection_z, float* normal_x = NULL, float* normal_y = NULL, float* normal_z = NULL, int use_callback = 1);
This function checks for intersection against the world and returns basic collision results.
This function will only return valid results in environments where the DI-Guy geometry octtree is available; currently that is when using OpenGL and the DI-Guy flight geometry loader. DI-Guy Scenario is such a case.Arguments:
origin_x, origin_y, origin_z starting location of the ray trace dir_x, dir_y, dir_z direction of ray trace max_distance_to_test max distance ray will travel; -1.0 will test an infinitely long ray intersection_x, _y, and _z world location of intersection normal_x, normal_y, normal_z normal of intersection surface Smaller values for max_distance_to_test will result in better performance.
The location of the intersection point is returned in the intersection x, y, and z pointers.
The normal of the surface intersected is returned in the normal x, y, and z pointers.Returns:
1 if intersection occurred, 0 if not.
function diguyScenario::ground_clamp |
Prototype:
Description:float ground_clamp(float x, float y, float z, int* valid = NULL, int use_altitude_function = 1, int use_octtree = 0);
This function returns the z height, or altitude, under the passed x, y, z point.
Two methods can be used to determine the altitude: using the scenario altitude function or using the internal octtree calculated from terrain geometry.
See set_altitude_function() for information on the scenario altitude function. In DI-Guy Scenario it defaults to using the octtree when it's available, and falls back on using a screen render and Z-buffer check when it's not.
Note that the octtree is not always available. In general it is available only in DI-Guy Scenario, or when the built-in OpenGL renderer and DI-Guy flight geometry loader are in use.Arguments:
Returns:
x, y, z world location to ground clamp valid optional pointer to get an explicit result if anything was hit use_altitude_function pass 1 to use scenario altitude function use_octtree pass 1 to use internal octtree
new_z if ground clamp was possible, original z if not
| Impact Callback Functions: |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::set_fire_weapon_intersection_function |
Prototype:
Description:int set_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
The following prototype should be used for the impact function:
int impact_func(diguyImpact* impact, float from_x, float from_y, float from_z, float to_x, float to_y, float to_z, diguyScenario* s);When a character fires their weapon, DI-Guy calls this function with a pointer to the diguyImpact that must be filled out, the x, y, z position of the shot, and the target x, y, z.
The impact function should then do an intersection test and return 1 if a hit occurred.
By default the impact should have both the attacker and the munition type already specified. The intersection function must at least call diguyImpact::set_valid_impact() for the system to consider the impact valid. See diguyImpact for a sample function.Callable From:
- C++
function diguyScenario::set_default_fire_weapon_intersection_function |
Prototype:
Description:static void set_default_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
This function sets an impact function that will be added to all new scenarios. It can be overridden by an explicit call to diguyScenario::set_fire_weapon_intersection_function(). See that function for details.Callable From:
- C++
function diguyScenario::map_color_to_impact |
Prototype:
Description:diguyImpact* map_color_to_impact(char r, char g, char b);
Most DI-Guy visual objects (e.g., characters, path shapes, waypoints) have a unique identified, or UID. In many cases these UID values can be coded into 24-bit color values. This can be useful for implementing some types of intersection detection functions, in which each visual object is rendered with a different color.
This function will take the passed color values and update internal DI-Guy state of which objects objects have been hit.
It will also return an impact record containing information a subset of that information.
This can include:
- the hit character, if one was hit
- the hit link and shape of the character
- the hit scene object, if one was hit
Note that the returned impact pointer is owned by DI-Guy and is temporary. The information you need from it should be immediately read, and the pointer should not be stored.
function diguyScenario::get_last_env_impact_info |
Prototype:
Description:diguyImpact* get_last_env_impact_info();
When the callback with id diguyScenario::CALLBACK_ID_SCENE_OBJECT_IMPACT is called, this function will return the impact object containing information about that impact.
There may be multiple impacts that result from some operations. In this case this function should be called multiple times, until it returns NULL. When processing of data from each successive impact is done, call set_last_impact_been_processed() to queue up the next impact object for processing.
The maximum number of unprocessed impacts is finite, and set by the function set_max_unprocessed_impacts().
Note that the returned impact pointers are owned by DI-Guy and are temporary. The information you need from them should be immediately read, and the pointers should not be stored.
function diguyScenario::set_last_impact_been_processed |
Prototype:
Description:void set_last_impact_been_processed();
Reading of data from the last impact information will be considered complete when this function is called.
function diguyScenario::set_last_env_impact_info |
Prototype:
Description:void set_last_env_impact_info(const diguyImpact& impact);
This function will add the passed impact object to the list of impact objects to be processed by calls to get_last_env_impact_info(). An internal copy of the impact object is made.
function diguyScenario::set_max_unprocessed_impacts |
Prototype:
Description:void set_max_unprocessed_impacts(int max_unprocessed_impacts);
Sets the maximum number of unprocessed impacts there can be.
The unprocessed impact array is a first-in-first-out queue. If an impact occurs that pushes the number of unprocessed impacts past this maximum number, earlier impacts will be dropped from the array.
The initial value is 10.
| AI Line of Sight, Intersection Callback Functions |
diguyScenario has a number of number of replaceable functions that govern intersecting and detecting the world. See the following functions to identify the full set of functionality that's necessary to make DI-Guy characters interact with the environment.
function diguyScenario::set_default_point_los_function |
Prototype:
Description:int set_default_point_los_function(diguyPointLOSFunction* point_los_function);
This function sets a default point line of sight function that will be added to all new characters. It can be overridden by an explicit call to diguyCharacter::set_point_los_function(). See that function for details.Callable From:
- C++
function diguyScenario::set_default_character_los_function |
Prototype:
Description:int set_default_character_los_function(diguyCharacterLOSFunction* character_los_function);
This function sets a default character line of sight function that will be added to all new characters. It can be overridden by an explicit call to diguyCharacter::set_character_los_function(). See that function for details.Callable From:
- C++
function diguyScenario::set_default_agent_feeler_function |
Prototype:
Description:int set_default_agent_feeler_function(diguyFeelerFunction* feeler_function);
This function sets a default feeler function that will be added to all new DI-Guy AI agents. It can be overridden by an explicit call to diguyCharacter::agent_set_feeler_function().
See the "User-Defined Feelers" section in diguyCharacter.h for more information.Arguments:
Returns:
feeler_function pointer to user-defined feeler function
0 on success, -1 on failureCallable From:
- C++
function diguyScenario::exp_intersect_geometry |
Prototype:
Description:diguyIntersectionResult exp_intersect_geometry( float origin_x, float origin_y, float origin_z, float dir_x, float dir_y, float dir_z, float max_distance_to_test, int use_callback = 1);
Experimental intersection-detection function.Arguments:
Returns:
origin_x,origin_y,origin_z starting point dir_x,dir_y,dir_z direction vector max_distance_to_test distance to test to use_callback 1 to use
diguyIntersectionResult structure
| Path Planning and Regions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::find_or_create_region |
Prototype:
Description:diguyRegion* find_or_create_region(const char* name);
This function returns a pointer to the region with the given name. A new region with the given name will be created if it doesn't already exist.Arguments:
Returns:
name name of the region to find or create
pointer of type diguyRegion; should never be NULL
function diguyScenario::find_region |
Prototype:
Description:diguyRegion* find_region(const char* name);
This function returns a pointer to the specified region.Arguments:
Returns:
name name of region to be found
pointer of type diguyRegion; NULL if not found
function diguyScenario::create_region |
Prototype:
Description:diguyRegion* create_region(const char* name);
This function creates a new diguyRegion and returns a pointer to it.Arguments:
Returns:
name name of the new region object
pointer of type diguyRegion
function diguyScenario::destroy_region |
Prototype:
Description:void destroy_region(diguyRegion* region);
This function destroys the passed region.Arguments:
region region to destroy
function diguyScenario::get_num_regions |
Prototype:
Returns:int get_num_regions();
number of regions in the scenario
function diguyScenario::get_region_at_index |
Prototype:
Returns:diguyRegion* get_region_at_index(int index);
pointer of type diguyRegion; NULL if no region at the specified indexArguments:
index index of the region; indices start at 0
function diguyScenario::find_navigation_path |
Prototype:
Description:int find_navigation_path(float x1, float y1, float z1, float x2, float y2, float z2, const char* via_region, diguyPathShape* path_shape, float cost_bias_for_preferred_regions = 0.25f, int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE, float cost_bias_for_neutral_regions = 1.1f, int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE, float cost_bias_for_repulsive_regions = 100.0f);
The scenario will attempt to create a navigation path on the via_region. An A* path planning algorithm is used to find the path. See also diguyCharacter::agent_move_to_point() and diguyCharacter::agent_move_to_point_via_subregions().Arguments:
x1, y1, z1 start location x2, y2, z2 end location via_region name of the region to run A* on path_shape path shape that stores the created path preferred_subregions_mask diguySubregionMask value of regions preferred for travel cost_bias_for_preferred_regions how much cheaper it will be to cross spaces that are part of desired subregion; should be < 1.0 cost_bias_for_neutral_regions how much more expensive it will be to cross spaces that are not part of desired subregion; see below for more information repulsed_regions_mask diguySubregionMask value of regions not preferred for travel cost_bias_for_repulsed_regions how much more expensive it will be to cross regions that are marked as repulsive; pass DIGUY_DEFAULT_FLOAT to avoid completely Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and cost_bias_for_repulsed_regions to specify that they should be avoided completely.
The preferred_subregions_mask and repulsed_regions_mask use DI-Guy subregion mask values combined together. For example, DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
For cost_bias_for_neutral_regions, specifying a non-zero value for this lowers the likelihood that searches fail on disjointed subregions. A value < 1 will cause the planner to run faster but explore fewer points, possibly missing preferred regions. Values greater then 1 will explore more points but will be slower.Returns:
0 on success, -1 on failure
function diguyScenario::set_max_distance_planning_multiplier |
Prototype:
Description:void set_max_distance_planning_multiplier(float mul);
Sets an upper limit on how far a character is willing to travel as a multiple of the straight line distance between point A and point B before declaring that it can't get to a location.
Note that internally the straight line distance is forced to have a lower bound of 10 meters, so a character is always willing to travel a minimum of 10 * max_distance_planning_multiplier meters.
Defaults to -1, which means off.
function diguyScenario::get_max_distance_planning_multiplier |
Prototype:
Returns:float get_max_distance_planning_multiplier();
float constant that's used to decide if planner should give up; -1 means off
function diguyScenario::get_time_spent_path_planning_this_frame |
Prototype:
Description:float get_time_spent_path_planning_this_frame();
This function returns in seconds how much time has been spent path planning during the current frame. It can be used to avoid 100 characters simultaneously hitting the path planner.Returns:
time in seconds
function diguyScenario::set_multithreaded_path_planning_enabled |
Prototype:
Description:void set_multithreaded_path_planning_enabled(int value);
This function enables the path planner to run in a background thread. Note this only occurs if the diguyCharacter::agent_move_to_point_bg() or diguyCharacter::agent_move_to_point_via_subregions_bg() api functions are used.
By default the multi-threaded path planner is on.
function diguyScenario::get_multithreaded_path_planning_enabled |
Prototype:
Returns:int get_multithreaded_path_planning_enabled();
Returns 1 if the path planner is enabled to run in a background thread. By default the multi-threaded path planner is on.
| Formation Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_num_formations |
Prototype:
Returns:int get_num_formations();
number of formations in the scenario
function diguyScenario::get_formation_at_index |
Prototype:
Returns:diguyFormation* get_formation_at_index(int index);
pointer of type diguyFormation; NULL if no formation at the specified indexArguments:
index index of the formation; indices start at 0
function diguyScenario::find_formation |
Prototype:
Description:diguyFormation* find_formation(const char* name);
This function returns a pointer to the specified formation.Arguments:
Returns:
name name of formation to be found
pointer of type diguyFormation; NULL if not found
function diguyScenario::find_formation_of_size |
Prototype:
Description:diguyFormation* find_formation_of_size(int size);
This function returns a pointer to the first formation it finds of a given size.Arguments:
Returns:
size size of formation to be found
pointer of type diguyFormation; NULL if not found
function diguyScenario::create_formation |
Prototype:
Description:diguyFormation* create_formation(const char* name);
This function creates a new formation and returns a pointer to it.Arguments:
Returns:
name name of the new formation
pointer of type diguyFormation
function diguyScenario::find_or_create_formation |
Prototype:
Description:diguyFormation* find_or_create_formation(const char* name);
This function finds the formation with the given name or creates it if it doesn't exist.Arguments:
Returns:
name name of the formation to find or create
pointer of type diguyFormation; should never be NULL
function diguyScenario::destroy_formation |
Prototype:
Description:int destroy_formation(diguyFormation* formation);
This function destroys a formation.Arguments:
Returns:
formation pointer to a diguyFormation
0 on success, -1 on failure
| DI-Guy Scenario User Interface Functions |
These functions show or hide various supplemental visuals in the DI-Guy Scenario 3D window. They will have no effect outside of DI-Guy Scenario.
They correspond to the UI in the DI-Guy Scenario page Scenario Objects | Scenario Objects | Visibility.
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::set_action_bead_labels_visible |
Prototype:
void set_action_bead_labels_visible(diguyVisibleFlag vflag);
function diguyScenario::set_aim_trajectories_visible |
Prototype:
void set_aim_trajectories_visible(diguyVisibleFlag vflag);
function diguyScenario::set_author_selection_handles_visible |
Prototype:
void set_author_selection_handles_visible(diguyVisibleFlag vflag);
function diguyScenario::set_bead_array_visible |
Prototype:
void set_bead_array_visible(diguyVisibleFlag vflag);
function diguyScenario::set_character_labels_visible |
Prototype:
void set_character_labels_visible(diguyVisibleFlag vflag);
function diguyScenario::set_character_visible |
Prototype:
void set_character_visible(diguyVisibleFlag vflag);
function diguyScenario::set_crowd_behavior_visible |
Prototype:
void set_crowd_behavior_visible(diguyVisibleFlag flag);
function diguyScenario::set_crowd_feelers_visible |
Prototype:
void set_crowd_feelers_visible(diguyVisibleFlag flag);
function diguyScenario::set_crowd_influence_visible |
Prototype:
void set_crowd_influence_visible(diguyVisibleFlag flag);
function diguyScenario::set_crowd_regions_visible |
Prototype:
void set_crowd_regions_visible(diguyVisibleFlag flag);
function diguyScenario::set_light_array_visible |
Prototype:
void set_light_array_visible(diguyVisibleFlag vflag);
function diguyScenario::set_lua_objects_visible |
Prototype:
void set_lua_objects_visible(diguyVisibleFlag flag);
function diguyScenario::set_mesh_region_array_visible |
Prototype:
void set_mesh_region_array_visible(diguyVisibleFlag vflag);
function diguyScenario::set_sensor_region_array_visible |
Prototype:
void set_sensor_region_array_visible(diguyVisibleFlag vflag);
function diguyScenario::set_spath_visible |
Prototype:
void set_spath_visible(diguyVisibleFlag vflag);
function diguyScenario::set_waypoint_array_visible |
Prototype:
void set_waypoint_array_visible(diguyVisibleFlag vflag);
function diguyScenario::get_action_bead_labels_visible |
Prototype:
diguyVisibleFlag get_action_bead_labels_visible();
function diguyScenario::get_aim_trajectories_visible |
Prototype:
diguyVisibleFlag get_aim_trajectories_visible();
function diguyScenario::get_author_selection_handles_visible |
Prototype:
diguyVisibleFlag get_author_selection_handles_visible();
function diguyScenario::get_bead_array_visible |
Prototype:
diguyVisibleFlag get_bead_array_visible();
function diguyScenario::get_character_labels_visible |
Prototype:
diguyVisibleFlag get_character_labels_visible();
function diguyScenario::get_character_visible |
Prototype:
diguyVisibleFlag get_character_visible();
function diguyScenario::get_crowd_behavior_visible |
Prototype:
diguyVisibleFlag get_crowd_behavior_visible();
function diguyScenario::get_crowd_feelers_visible |
Prototype:
diguyVisibleFlag get_crowd_feelers_visible();
function diguyScenario::get_crowd_influence_visible |
Prototype:
diguyVisibleFlag get_crowd_influence_visible();
function diguyScenario::get_crowd_regions_visible |
Prototype:
diguyVisibleFlag get_crowd_regions_visible();
function diguyScenario::get_light_array_visible |
Prototype:
diguyVisibleFlag get_light_array_visible();
function diguyScenario::get_lua_objects_visible |
Prototype:
diguyVisibleFlag get_lua_objects_visible();
function diguyScenario::get_mesh_region_array_visible |
Prototype:
diguyVisibleFlag get_mesh_region_array_visible();
function diguyScenario::get_sensor_region_array_visible |
Prototype:
diguyVisibleFlag get_sensor_region_array_visible();
function diguyScenario::get_spath_visible |
Prototype:
diguyVisibleFlag get_spath_visible();
function diguyScenario::get_waypoint_array_visible |
Prototype:
diguyVisibleFlag get_waypoint_array_visible();
function diguyScenario::set_hide_author_selection_handles_during_play |
Prototype:
void set_hide_author_selection_handles_during_play(int visible);
function diguyScenario::get_hide_author_selection_handles_during_play |
Prototype:
int get_hide_author_selection_handles_during_play();
| DI-Guy Weapon Fire Effects Functions |
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::get_weapon_fire_effects_enabled |
Prototype:
Returns:int get_weapon_fire_effects_enabled();
If weapon fire will create light flashes.
function diguyScenario::set_weapon_fire_effects_enabled |
Prototype:
Description:int set_weapon_fire_effects_enabled(int enabled);
Sets if weapon fire will create light flashes.
function diguyScenario::get_num_active_fire_effects |
Prototype:
Returns:int get_num_active_fire_effects();
The number of light flashes that are currently active
function diguyScenario::get_weapon_fire_effect_data |
Prototype:
Description:int get_weapon_fire_effect_data(int index, float * radius, float * position_x, float * position_y, float * position_z, float * color_r, float * color_g, float * color_b, float * falloff_r, float * falloff_rsq);
This function gets the data needed for producing a weapon flash light source in the world. See diguyOglGraphicsShaderProgram::update_light_uniforms() for an example of its use. In the default OpenGL renderer the convenience function diguy_ogl_apply_active_lights() does this work for you.
| DI-Guy Scenario selection functions |
These functions allow you to get and set the currently active item in the DI-Guy Scenario UI.
They correspond to the UI in the DI-Guy Scenario Scenario Objects page.
Unless otherwise specified, callable from:
- C++
- Script
function diguyScenario::set_current_character |
Prototype:
Description:int set_current_character(diguyCharacter* current_character);
Sets the current selected character in scenarioReturns:
0 on success, -1 on failure
function diguyScenario::get_current_character |
Prototype:
Returns:diguyCharacter* get_current_character();
The current selected character in scenario
function diguyScenario::set_current_crowd |
Prototype:
Description:int set_current_crowd(diguyCrowd* current_crowd);
Sets the current selected crowd in scenarioReturns:
0 on success, -1 on failure
function diguyScenario::get_current_crowd |
Prototype:
Returns:diguyCrowd* get_current_crowd();
The current selected crowd in scenario
function diguyScenario::set_current_crowd_profile |
Prototype:
Description:int set_current_crowd_profile(diguyCrowdProfile* current_profile);
Sets the active crowd profile, which determines the attributes of subsequently-created crowds. See diguyCrowdProfile.Returns:
0 on success, -1 on failure
function diguyScenario::set_current_crowd_profile_by_name |
Prototype:
Description:int set_current_crowd_profile_by_name(const char* crowd_profile_name);
Sets the active crowd profile by name.Returns:
0 on success, -1 on failure
function diguyScenario::get_current_crowd_profile |
Prototype:
Returns:diguyCrowdProfile* get_current_crowd_profile();
Active crowd profile
function diguyScenario::set_current_region |
Prototype:
Description:int set_current_region(diguyRegion* current_region);
Sets the current region. See diguyRegion.Returns:
0 on success, -1 on failure
function diguyScenario::get_current_region |
Prototype:
Returns:diguyRegion* get_current_region();
Current region.
| Particle System Functions |
function diguyScenario::set_particle_module_disabled |
Prototype:
Description:void set_particle_module_disabled(int disable_particle_module);
This function enables or disables the particle module. By default the particle module is enabled.
function diguyScenario::create_particle_system |
Prototype:
Description:int create_particle_system(const char* description_name, float x, float y, float z, int record_transient_event = 1, float duration = -1.0f);
This function creates a particle system with type description_name at x, y, z. If duration is specified the system will automatically stop emitting after that amount of time.Arguments:
description_name name of particle description to create x, y, z the world space position of the system record_transient_event pass 1 to have this particle system play in history playback duration how long the emitter should emit; if -1 is specified then the description must have a lifetime specified
function diguyScenario::create_particle_system_with_orientation |
Prototype:
Description:int create_particle_system_with_orientation(const char* description_name, float x, float y, float z, float rz, float rx, float ry, int record_transient_event = 1, float duration = -1.0f);
Similar to create_particle_system(), but allows orientation to be set.Arguments:
rz, rx, ry orientation axes (See create_particle_system() for other parameters)
function diguyScenario::has_particle_description |
Prototype:
Returns:int has_particle_description(const char* description_name);
1 if the particle description named description_name exists, else 0
function diguyScenario::set_global_wind |
Prototype:
Description:void set_global_wind(float x, float y, float z);
Set wind velocity vector for particle system
| Lua Scripting Module Functions |
function diguyScenario::lua_get_object_field_as_string |
Prototype:
Returns:const char* lua_get_object_field_as_string(const char* lua_object, const char* field_name);
string representation of lua_object.field_name
Note that the returned string pointer will not remain valid, so the returned string should be copied.Arguments:
Callable From:
lua_object a global lua object field_name name of the field; field_name can include ".", allowing retrieval of fields in complex data structures
- C++
function diguyScenario::lua_evaluate_object_function |
Prototype:
Description:const char* lua_evaluate_object_function(const char* lua_object, const char* function_name, const char* argument = NULL, int has_return_string = 0);
Runs a member function of a lua object.Arguments:
Returns:
lua_object a global lua object function_name name of the function to call argument optional string argument has_return_string if set to 1 function will pop the top value of the lua stack and return it as a string
NULL or string representation of lua_object:function_name(argument).
The returned string should be copied if it needs to be used later.Callable From:
- C++
function diguyScenario::lua_evaluate_object_function_2a |
Prototype:
Description:const char* lua_evaluate_object_function_2a(const char* lua_object, const char* function_name, const char* argument, const char* argument2, int has_return_string = 0);
A two argument version of lua_evaluate_object_function().Callable From:
- C++
function diguyScenario::lua_evaluate_object_function_3a |
Prototype:
Description:const char* lua_evaluate_object_function_3a(const char* lua_object, const char* function_name, const char* argument, const char* argument2, const char* argument3, int has_return_string = 0);
A three argument version of lua_evaluate_object_function().Callable From:
- C++
function diguyScenario::lua_evaluate_object_function_4a |
Prototype:
Description:const char* lua_evaluate_object_function_4a(const char* lua_object, const char* function_name, const char* argument, const char* argument2, const char* argument3, const char* argument4, int has_return_string = 0);
A four argument version of lua_evaluate_object_function().Callable From:
- C++
function diguyScenario::lua_send_message_to_object |
Prototype:
Description:int lua_send_message_to_object(const char* lua_object, const char* sender, const char* message_type, const char* message, const char* message_params = NULL);
Executes a lua_object:state_manager() function call. Useful for creating sleep-able coroutine based objects that aren't characters.Callable From:
- C++
function diguyScenario::get_lua_state |
Prototype:
Description:void* get_lua_state();
This function allows low level access to the lua_State pointer. This pointer can be used by a programmer to query and run functions on the Lua virtual machine. This object can also be used to register new C functions to lua, which allows you to instrument and create callbacks from script to your code. See luaL_register on-line.
For more information on how the Lua C api works see: http://www.lua.orgpil24.htmlNOTE:
Currently all scenarios share the same underlying Lua state object. This may cause issues in applications with multiple scenarios.Callable From:
- C++
function diguyScenario::push_qt_pointer_to_lua |
Prototype:
Description:int push_qt_pointer_to_lua(void* lua_state, const char* class_name, void* ptr);
Mainly used to pass a qt pointer to lua so lqt can be used to modify/read from the widget. This requires the that the lqt package is loaded; see the lqt.lua utility package for more info.Arguments:
Callable From:
lua_state a Lua_State pointer, might be the same as get_lua_state(); depends if the calling function is inside a coroutine class_name class name should be a core class of qt with a star after it; i.e. "QWidget*" or "QLineEdit*" ptr pointer to that is returned to the calling function in lua
C++ Example:
- C++
int push_graphics_view_to_lua(lua_State *L) { bdiQGraphicsView* graphics_view = get_primary_3d_window_graphics_view(); if (m_scenario->push_qt_pointer_to_lua(L, "QGraphicsView*", graphics_view) == -1) { return 0; } return 1; }Plug-in init code:
lua_State* L = (lua_State*)scenario->get_lua_state(); if (L) { lua_register(L, "get_graphics_view", push_graphics_view_to_lua); }In lua:
local graphics_view = get_graphics_view();
function diguyScenario::lua_evaluate_object_function_4a_flex |
Prototype:
Description:const char* lua_evaluate_object_function_4a_flex(const char* lua_object, const char* function_name, const char* arg1_type, void* argument1, const char* arg2_type, void* argument2, const char* arg3_type, void* argument3, const char* arg4_type, void* argument4, int has_return_string = 0);
The most open function calling function available, if this doesn't manage to accomplish what you need you probably want to start using the lua interpreter directly.
The type arguments are string versions of the type being sent to lua, options include:
Arguments:
- '' - empty argument
- 'b' boolean - void* argument1 is assumed to be an int
- 'f' field - void* argument1 assumed to be character string of a field of a global lua object; supports nested fields like foo.bar.a
- 's' string - void* argument1 assumed to be character string
- 'd' double - void* argument is assumed to be a double
- diguy... - void* argument assumed to be a diguy class pointer ie "diguyCharacter", "diguyCrowd" (no star used for diguy classes)
- Q...* - void* argument is assumed to be a pointer to a child of QObject; the class name should be a core class of qt with a star after it, e.g. "QWidget*" or "QLineEdit*"
Returns:
lua_object a global lua object function_name name of the function to call arg(1/2/3/4)_type is the data type argument(1/2/3/4) void* pointers to data has_return_string if set to 1 function will pop the top value of the lua stack and return it as a string
NULL or string representation of lua_object:function_name(argument)
The returned string should be copied if it needs to be used later.Callable From:
- C++
function diguyScenario::lua_evaluate_global_function_4a_flex |
Prototype:
Description:const char* lua_evaluate_global_function_4a_flex(const char* function_name, const char* arg_type, void* argument, const char* arg_type2, void* argument2, const char* arg_type3, void* argument3, const char* arg_type4, void* argument4, int has_return_string = 0);
Effectively the same as diguyScenario::lua_evaluate_object_function_4a_flex() but works on global functions.Callable From:
- C++
function diguyScenario::lua_log_printf |
Prototype:
Description:int lua_log_printf(int notify_level, const char* string);
Prints a message to lua interpreter log object. In DI-Guy Scenario this is sent to the AI Mind Editor and used to fill out the error log. The Mind editor log parses debug.traceback() calls.
function diguyScenario::dump_package_info |
Prototype:
Returns:const char* dump_package_info(const char* package_name);
package meta data as a formatted string; useful for debugging, only valid inside DI-Guy Scenario
| Experimental Functions |
The following functions are experimental and may change or disappear with no warning.
function diguyScenario::get_eval_decisions_as_scripts |
Prototype:
Returns:int get_eval_decisions_as_scripts();
value set by last call to set_eval_decisions_as_scripts()
function diguyScenario::set_eval_decisions_as_scripts |
Prototype:
Description:void set_eval_decisions_as_scripts(int eval_decisions_as_scripts);
If called with an argument of 1, all decision beads and decision beads will be converted to scripts before being run.
function diguyScenario::get_impact_on_line |
Prototype:
Description:diguyImpact* get_impact_on_line(float from_x, float from_y, float from_z, float to_x, float to_y, float to_z);
Gets the point of impact with the world along specified line segmentReturns:
pointer to diguyImpact object or NULL
function diguyScenario::wait_cursor_push |
Prototype:
Description:void wait_cursor_push();
Increments wait cursor counter. If non-zero, then wait cursor is displayed in DI-GUY scenario.
function diguyScenario::wait_cursor_pop |
Prototype:
Description:void wait_cursor_pop();
Decrements wait cursor counter.
function diguyScenario::set_graphics_api_node_ptr |
Prototype:
Description:void set_graphics_api_node_ptr(void* node_ptr);
This function sets a generic node pointer that can later be retrieved by the get_graphics_api_node_ptr() call. The pointer is otherwise not used.Arguments:
Callable From:
node_ptr generic void* pointer
- C++
function diguyScenario::get_graphics_api_node_ptr |
Prototype:
Returns:void* get_graphics_api_node_ptr();
pointer set by most recent call to set_graphics_api_node_ptrCallable From:
- C++
function diguyScenario::set_draw_character_shadow_disks |
Prototype:
Description:void set_draw_character_shadow_disks(int draw_character_shadow_disks);
Sets whether shadow disks are drawn for characters. Call with 1 to turn on, 0 to turn off.
function diguyScenario::get_draw_character_shadow_disks |
Prototype:
Returns:int get_draw_character_shadow_disks();
1 if shadow disks are drawn, 0 if not
function diguyScenario::get_shadow_map_size |
Prototype:
Returns:int get_shadow_map_size();
size of texture map for shadows
function diguyScenario::set_shadow_map_size |
Prototype:
Description:int set_shadow_map_size(int shadow_size);
Sets size of texture map for shadows. Defaults to 1024. Allowed values are powers of two up to 4096.
function diguyScenario::set_default_character_scene_graph_mask |
Prototype:
Description:void set_default_character_scene_graph_mask(unsigned long mask);
Used for DI-Guy OSG Author Programming Example. Sets the default value used for characters. See also diguyCharacter::set_scene_graph_mask()
function diguyScenario::set_default_scene_object_scene_graph_mask |
Prototype:
Description:void set_default_scene_object_scene_graph_mask(unsigned long mask);
Used for DI-Guy OSG Author Programming Example. Sets the default value used for characters. See also diguySceneObject::set_scene_graph_mask()
function diguyScenario::set_internal_int |
Prototype:
Description:void set_internal_int(int var, int val);
For internal use.
function diguyScenario::set_internal_float |
Prototype:
void set_internal_float(int var, float val);
function diguyScenario::set_num_active_point_lights |
Prototype:
Description:int set_num_active_point_lights(int active_lights);
This sets the number of point lights that get handed down to diguyGraphicsShaderTechnique::pick_shader_program().
function diguyScenario::get_num_active_point_lights |
Prototype:
Description:int get_num_active_point_lights();
This gets the number of point lights that get handed down to diguyGraphicsShaderTechnique::pick_shader_program() the default is 0. diguy_ogl_apply_active_lights() automatically updates this value in the OpenGL renderer.
| Experimental Performance Functions |
function diguyScenario::optimized_update |
Prototype:
Description:int optimized_update(float t);
Experimental. For internal use.
function diguyScenario::set_world_bounds |
Prototype:
Description:int set_world_bounds(float x_min, float y_min, float z_min, float x_max, float y_max, float z_max);
Sets bounding box of worldArguments:
Returns:
x_min,y_min,z_min,x_max,y_max,z_max bounds
0 on success, -1 on failure (float * arguments converted to return values in Lua)
function diguyScenario::get_world_bounds |
Prototype:
Description:int get_world_bounds(float* x_min, float* y_min, float* z_min, float* x_max, float* y_max, float* z_max);
Gets bounding box of worldArguments:
Returns:
x_min,y_min,z_min,x_max,y_max,z_max output parameters
0 on success, -1 on failure (float * arguments converted to return values in Lua)
| Experimental Checkpoint Functions |
function diguyScenario::set_checkpoint_frequency |
Prototype:
Description:void set_checkpoint_frequency(float freq);
Internal use
function diguyScenario::get_checkpoint_frequency |
Prototype:
Description:float get_checkpoint_frequency();
Internal use
function diguyScenario::set_checkpointing_enabled |
Prototype:
Description:void set_checkpointing_enabled(int enable_checkpointing);
Internal use
function diguyScenario::get_checkpointing_enabled |
Prototype:
Description:int get_checkpointing_enabled();
Internal use
| Experimental Shader Functions |
function diguyScenario::set_initial_render_mode |
Prototype:
Description:void set_initial_render_mode(const char* render_mode);
Sets initial render modeArguments:
render_mode string containing render mode setting name Built-in render modes:
function diguyScenario::get_initial_render_mode |
Prototype:
Returns:const char* get_initial_render_mode();
initial render mode, as string
function diguyScenario::set_current_render_mode |
Prototype:
Description:void set_current_render_mode(const char* render_mode);
Sets current render mode. See set_initial_render_mode()
function diguyScenario::derive_render_mode_from_light_settings |
Prototype:
Returns:const char* derive_render_mode_from_light_settings(int set_current_to_derived = 1);
render mode, as string, derived from current light settingsArguments:
set_current_to_derived if 1, current render mode becomes derived
function diguyScenario::get_current_render_mode |
Prototype:
Returns:const char* get_current_render_mode();
current render mode, as string
function diguyScenario::set_default_character_shader |
Prototype:
Description:void set_default_character_shader(const char* render_mode, const char* shader_name, int update_existing_characters = 1);
Sets default shader for charactersArguments:
render_mode string containing render mode name shader_name string containing name of shader technique update_existing_characters if 1, all existing characters will now
function diguyScenario::get_default_character_shader |
Prototype:
Description:const char* get_default_character_shader(const char* render_mode);
Returns name of shader technique used for specified render mode
function diguyScenario::set_default_scene_object_shader |
Prototype:
Description:void set_default_scene_object_shader(const char* render_mode, const char* shader_name, int update_existing_scene_objects = 1);
Sets default shader for scene objectsArguments:
render_mode string containing render mode name shader_name string containing name of shader technique update_existing_scene_objects if 1, all existing scene objects will now
function diguyScenario::get_default_scene_object_shader |
Prototype:
Description:const char* get_default_scene_object_shader(const char* render_mode);
Returns name of shader technique used for specified render mode
function diguyScenario::set_default_particle_system_shader |
Prototype:
Description:void set_default_particle_system_shader(const char* render_mode, const char* shader_name, int update_existing_particle_systems = 1);
Sets default shader for particle systemsArguments:
render_mode string containing render mode name shader_name string containing name of shader technique update_existing_particle_systems if 1, all existing particle systems will now
function diguyScenario::get_default_particle_system_shader |
Prototype:
Description:const char* get_default_particle_system_shader(const char* render_mode);
Returns name of shader technique used for specified render mode
function diguyScenario::facefx_mount_animset |
Prototype:
Description:int facefx_mount_animset(const char* actor_name, const char* file_name);
Sets FaceFX animation set for a given actor.Arguments:
actor_name actor's name file_name fully qualified file name ending in ".animset_ingame"
function diguyScenario::set_vehicle_smoothing_enabled |
Prototype:
Description:int set_vehicle_smoothing_enabled(int enable_smoothing);
Sets vehicle smoothing on or off. If 1, vehicle will be updated at a higher rate than frame dt
Default is on.
function diguyScenario::get_vehicle_smoothing_enabled |
Prototype:
int get_vehicle_smoothing_enabled();
function diguyScenario::set_character_culling_distance |
Prototype:
Description:int set_character_culling_distance(float dist);
Culling distance (from camera) for drawing
function diguyScenario::get_character_culling_distance |
Prototype:
float get_character_culling_distance();
function diguyScenario::set_vehicle_culling_distance |
Prototype:
Description:int set_vehicle_culling_distance(float dist);
Culling distance (from camera)
function diguyScenario::get_vehicle_culling_distance |
Prototype:
float get_vehicle_culling_distance();
function diguyScenario::set_prop_culling_distance |
Prototype:
Description:int set_prop_culling_distance(float dist);
Culling distance of props (from camera)
function diguyScenario::get_prop_culling_distance |
Prototype:
float get_prop_culling_distance();
| Deprecated Functions |
The following functions are deprecated.
As these functions may disappear in a future version of DI-Guy, it is recommended that you remove calls to these functions from your application.
function diguyScenario::add_default_callback |
Prototype:
Description:static int add_default_callback(int callback_id, diguyScenarioCallback* callback, void* callback_params = 0, void* callback_user_data = 0);
Deprecated; use diguyApp::add_default_scenario_callback() instead.
function diguyScenario::remove_default_callback |
Prototype:
Description:static int remove_default_callback(int callback_id, diguyScenarioCallback* callback);
Deprecated; use diguyApp::remove_default_scenario_callback() instead.
function diguyScenario::remove_default_callback_with_user_data |
Prototype:
Description:static int remove_default_callback_with_user_data(int callback_id, void* callback_user_data);
Deprecated; use diguyApp::remove_default_scenario_callback_with_User_data() instead.
function diguyScenario::add_default_callback_script |
Prototype:
Description:static int add_default_callback_script(int callback_id, const char* callback_script, const char* callback_script_type);
Deprecated; use diguyApp::add_default_scenario_callback_script() instead.
function diguyScenario::remove_default_callback_script |
Prototype:
Description:static int remove_default_callback_script(int callback_id, const char* callback_script, const char* callback_script_type);
Deprecated; use diguyApp::remove_default_scenario_callback_script() instead.
function diguyScenario::get_character_type_class |
Prototype:
Description:const char* get_character_type_class(const char* character_type);
Deprecated as of 10.0.0; use get_character_type_map() intead, and then call diguyCharacterTypeMap::get_field_value(DIGUY_CHARACTER_TYPE_MAP_FIELD_CHARACTER_CLASS)
function diguyScenario::merge_asset |
Prototype:
Description:int merge_asset(const char* string);
Deprecated as of 10.5.1; use merge_object() intead.
function diguyScenario::print_to_log |
Prototype:
Description:void print_to_log(int notify_level, const char* string);
Deprecated as of 12.0.0; use bdi_log_print() from libbdilog.h instead.
| VegaPrime Helper Functions |
function diguyScenario::create_pending_reflected_character |
Prototype:
diguyCharacter* create_pending_reflected_character(const char* name, const char* character_type, const char* appearance = NULL);
function diguyScenario::set_network_translation |
Prototype:
int set_network_translation(float x, float y, float z);
function diguyScenario::get_network_translation |
Prototype:
int get_network_translation(float* x, float* y, float* z);
function diguyScenario::set_project_filename |
Prototype:
Description:void set_project_filename(const char* project_filename);
Deprecated as of 12.0.0; use save_as() instead.
function diguyScenario::get_project_filename |
Prototype:
Description:const char* get_project_filename();
Deprecated as of 12.0.0; use get_filename() or get_filename_without_directory() intead.
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.