Saints Row 2 Function Reference

Global functions

These functions are assumed to be globally available to all scripts (they aren't defined in the available Lua files, or are defined in files that are known to be always loaded).

This list is assumed incomplete; additional functions could exist in the exe but not be used in the game scripts, and there's no definitive list of Lua files that are always loaded.

Function name Global Defined in Examples from patch (click blue number to expand)
callback true
    5
    camera_look_through_do true
      1
      camera_revert_target true
        2
        camera_script_disable true
          1
          camera_set_hide_ui_during_animated true
            2
            camera_set_target true
              6
              camera_shake_stop true
                2
                cash_add true
                  3
                  cat_mouse_results_select true
                    3
                    cellphone_animate_start_do true
                      3
                      cellphone_animate_stop_do true
                        2
                        cellphone_choose_vehicle true
                          3
                          cellphone_dial true
                            1
                            cellphone_enable_powers_tutorial true
                              3
                              cellphone_lock true
                                9
                                cell_allow_camera true
                                  1
                                  cell_camera_enable true
                                    2
                                    cell_camera_is_enabled true
                                      1
                                      cell_cheats_activate_cheat true
                                        1
                                        cell_cheats_cancel_cheat true
                                          1
                                          cell_cheats_confirm_cheat true
                                            1
                                            cell_cheats_unlock_cheat true
                                              1
                                              cell_is_closing true
                                                1
                                                cell_is_map_disabled true
                                                  1
                                                  cell_is_phone_disabled true
                                                    1
                                                    cell_machinima_is_recording true
                                                      1
                                                      cell_menu_disable_map true
                                                        2
                                                        cell_missions_can_start_objective true
                                                          1
                                                          cell_missions_client_objective_locked_by_host_progress true
                                                            1
                                                            cell_missions_host_should_wait_for_client true
                                                              1
                                                              cell_missions_objective_locked_by_contact true
                                                                1
                                                                cell_missions_objective_mystery_locked true
                                                                  1
                                                                  cell_music_menu_toggle_station true
                                                                    1
                                                                    cell_playlist_save_list true
                                                                      1
                                                                      cell_rewards_button_a true
                                                                        2
                                                                        Cell_transition_cb_func true
                                                                          1
                                                                          challenge_get_challenge_tut_id true
                                                                            2
                                                                            challenge_tutorial_mode_is_active true
                                                                              3
                                                                              challenge_tutorial_set_active true
                                                                                3
                                                                                character_add_prop true
                                                                                  1
                                                                                  character_allow_ragdoll true
                                                                                    9
                                                                                    character_clear_combat_move true
                                                                                      2
                                                                                      character_collision_enable true
                                                                                        44
                                                                                        character_damage true
                                                                                          1
                                                                                          character_destroy true
                                                                                            1
                                                                                            character_enable_superpower_immunity true
                                                                                              44
                                                                                              character_enable_supersprint_immunity true
                                                                                                2
                                                                                                character_evacuate_from_all_vehicles true
                                                                                                  5
                                                                                                  character_exists true
                                                                                                    1
                                                                                                    character_get_anim_set true
                                                                                                      10
                                                                                                      character_get_gender true
                                                                                                        1
                                                                                                        character_has_human_shield true
                                                                                                          2
                                                                                                          character_has_specific_human_shield true
                                                                                                            3
                                                                                                            character_has_ultra_shield_up true
                                                                                                              1
                                                                                                              character_hide true
                                                                                                                4
                                                                                                                character_is_combat_ready true
                                                                                                                  1
                                                                                                                  character_is_dead true
                                                                                                                    21
                                                                                                                    character_is_entering_vehicle true
                                                                                                                      2
                                                                                                                      character_is_exiting_vehicle true
                                                                                                                        1
                                                                                                                        character_is_in_lava true
                                                                                                                          2
                                                                                                                          character_is_in_vehicle true
                                                                                                                            17
                                                                                                                            character_is_on_fire true
                                                                                                                              2
                                                                                                                              character_is_player true
                                                                                                                                5
                                                                                                                                character_is_ragdolled true
                                                                                                                                  1
                                                                                                                                  character_kill true
                                                                                                                                    7
                                                                                                                                    character_limb_immune_to_imp true
                                                                                                                                      1
                                                                                                                                      character_prevent_bumping true
                                                                                                                                        1
                                                                                                                                        character_prevent_explosion_fling true
                                                                                                                                          3
                                                                                                                                          character_prevent_flinching true
                                                                                                                                            8
                                                                                                                                            character_ragdoll true
                                                                                                                                              1
                                                                                                                                              character_ragdoll_stop true
                                                                                                                                                1
                                                                                                                                                character_set_animation_overrides true
                                                                                                                                                  11
                                                                                                                                                  character_set_counter_on_grabbed_by_player true
                                                                                                                                                    1
                                                                                                                                                    character_set_never_catch_fire true
                                                                                                                                                      11
                                                                                                                                                      character_set_orient_from_nav true
                                                                                                                                                        1
                                                                                                                                                        character_show true
                                                                                                                                                          14
                                                                                                                                                          character_take_human_shield_check_done true
                                                                                                                                                            2
                                                                                                                                                            character_take_human_shield_do true
                                                                                                                                                              1
                                                                                                                                                              check_animation_state true
                                                                                                                                                                2
                                                                                                                                                                check_script_animation_state true
                                                                                                                                                                  1
                                                                                                                                                                  • mintrobb.lua, line 1414: if check_script_animation_state(imp, mIntroBB_imp_animation_state) and not human_is_frozen(imp) then
                                                                                                                                                                  cinema_editor_create_camera_zone true
                                                                                                                                                                    2
                                                                                                                                                                    cinema_editor_save_clip true
                                                                                                                                                                      1
                                                                                                                                                                      city_load_img_load_complete true
                                                                                                                                                                        1
                                                                                                                                                                        city_zone_swap true
                                                                                                                                                                          19
                                                                                                                                                                          clear_animation_state true
                                                                                                                                                                            9
                                                                                                                                                                            clear_callbacks_for_obj true
                                                                                                                                                                              1
                                                                                                                                                                              closest_point_on_line_segment true
                                                                                                                                                                                6
                                                                                                                                                                                collectible_hide_orbs true
                                                                                                                                                                                  4
                                                                                                                                                                                  community_login_open true
                                                                                                                                                                                    1
                                                                                                                                                                                    completion_call_callback true
                                                                                                                                                                                      1
                                                                                                                                                                                      completion_camera_shake true
                                                                                                                                                                                        1
                                                                                                                                                                                        completion_credits_were_active true
                                                                                                                                                                                          1
                                                                                                                                                                                          completion_cutscene_was_active true
                                                                                                                                                                                            3
                                                                                                                                                                                            completion_cutscene_was_skipped true
                                                                                                                                                                                              1
                                                                                                                                                                                              Completion_get_other_player_name true
                                                                                                                                                                                                2
                                                                                                                                                                                                Completion_is_client true
                                                                                                                                                                                                  2
                                                                                                                                                                                                  completion_load_lut true
                                                                                                                                                                                                    6
                                                                                                                                                                                                    completion_screen_finished true
                                                                                                                                                                                                      2
                                                                                                                                                                                                      Completion_should_wait_for_coop true
                                                                                                                                                                                                        1
                                                                                                                                                                                                        Completion_user_is_done_viewing true
                                                                                                                                                                                                          1
                                                                                                                                                                                                          continuous_explosion_stop true
                                                                                                                                                                                                            1
                                                                                                                                                                                                            continuous_spawn_stop true
                                                                                                                                                                                                              2
                                                                                                                                                                                                              coop_is_active true
                                                                                                                                                                                                                163
                                                                                                                                                                                                                credits_force_close true
                                                                                                                                                                                                                  1
                                                                                                                                                                                                                  credits_in_cutscene true
                                                                                                                                                                                                                    1
                                                                                                                                                                                                                    credits_were_skipped true
                                                                                                                                                                                                                      1
                                                                                                                                                                                                                      crib_has_garage_with_vehicles_of_type true
                                                                                                                                                                                                                        4
                                                                                                                                                                                                                        crib_is_garage_disabled true
                                                                                                                                                                                                                          1
                                                                                                                                                                                                                          crib_ship_nemo_chair_enter_check_done true
                                                                                                                                                                                                                            1
                                                                                                                                                                                                                            crib_ship_nemo_chair_enter_do true
                                                                                                                                                                                                                              1
                                                                                                                                                                                                                              crib_ship_nemo_chair_exit_check_done true
                                                                                                                                                                                                                                2
                                                                                                                                                                                                                                crib_ship_nemo_chair_exit_do true
                                                                                                                                                                                                                                  1
                                                                                                                                                                                                                                  crib_ship_nemo_chair_exit_setup_do true
                                                                                                                                                                                                                                    1
                                                                                                                                                                                                                                    Current_menu_anim_in_cb true
                                                                                                                                                                                                                                      1
                                                                                                                                                                                                                                      customization_item_wear true
                                                                                                                                                                                                                                        4
                                                                                                                                                                                                                                        • game_lib.lua, line 5494: customization_item_wear(item_name, wear_option, variant, add_to_wardrobe, sync_flags, clear_facewear)
                                                                                                                                                                                                                                        • game_lib.lua, line 5500: customization_item_wear(item_name, wear_option, variant, add_to_wardrobe, sync_flags, clear_facewear)
                                                                                                                                                                                                                                        • mintro.lua, line 564: customization_item_wear( "cm_PCGatJSuit", "PC_Gat_Jsuit.cmeshx", "default", add_to_wardrobe, SYNC_LOCAL, clear_facewear )
                                                                                                                                                                                                                                        • mintro.lua, line 566: customization_item_wear( "cf_PCKinzieJSuit", "cf_pckinziejsuit.cmeshx", "default", add_to_wardrobe, SYNC_REMOTE, not clear_facewear )
                                                                                                                                                                                                                                        cutscene_check_exiting true
                                                                                                                                                                                                                                          4
                                                                                                                                                                                                                                          cutscene_play_do true
                                                                                                                                                                                                                                            1
                                                                                                                                                                                                                                            • game_lib.lua, line 1506: cutscene_play_do(name, converted_group, converted_teleports, fade_in_after, wait_for_spawning, restore_players_vehicle)