Saints Row: The Third 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)
satellite_weapon_mode_exit true
    2
    satellite_weapon_mode_set true
      2
      save_game_wrap_up true
        1
        save_system_cancel_coop_load true
          2
          save_system_change_device true
            1
            save_system_delete_game true
              1
              save_system_load_game true
                2
                save_system_save_game true
                  2
                  save_system_set_operation true
                    1
                    sb_saintsbook_is_available true
                      1
                      sb_select_chop_shop_vehicle true
                        1
                        sb_select_hitman_target true
                          1
                          screenshot true 1
                            screenshot_do true
                              2
                              screen_capture_preview_should_upload true
                                1
                                Screen_fade_transition_complete true
                                  1
                                  script_assert true
                                    1
                                    • game_lib.lua, line 824: script_assert( false, "You must specify CELLPHONE_CHARACTER as the speaking character ( or leave it at nil ) for the other side of a cellphone conversation." )
                                    selected_cb true
                                      1
                                      set_always_cower_flag true
                                        11
                                        set_always_sees_player_flag true
                                          26
                                          set_animation_set true
                                            9
                                            set_animation_state true
                                              36
                                              set_attack_enemies_flag true
                                                9
                                                set_attack_peds_flag true
                                                  1
                                                  set_attack_player_flag true
                                                    41
                                                    set_behavior_set true
                                                      13
                                                      set_cant_cower_flag true
                                                        11
                                                        set_cant_flee_flag true
                                                          15
                                                          set_char_in_string true
                                                            1
                                                            set_civilians_flee true
                                                              4
                                                              set_cops_shooting_from_vehicles true
                                                                2
                                                                set_cower_variant true
                                                                  2
                                                                  set_current_hit_points true
                                                                    27
                                                                    set_dont_attack_me_on_sight_flag true
                                                                      35
                                                                      set_element true
                                                                        25
                                                                        set_force_combat_ready_team true
                                                                          7
                                                                          set_ignore_ai_flag true
                                                                            201
                                                                            set_max_hit_points true
                                                                              13
                                                                              • dlc2_m01.lua, line 3176: set_max_hit_points(Dlc2_m01_groups.armory_get_away_car.vehicle, veh_hitpoints, true)
                                                                              • dlc2_m01.lua, line 3979: set_max_hit_points(Dlc2_m01_groups.armory_get_away_car.vehicle, vehicle_hitpoints, true)
                                                                              • dlc2_m01.lua, line 4849: set_max_hit_points(vehicle_table.vehicle, hp_multiplier * get_max_hit_points(vehicle_table.vehicle))
                                                                              • dlc2_m03.lua, line 2283: set_max_hit_points(DLC2_M03_current_vehicle_name, DLC2_M03_AIRCRAFT_HITPOINTS)
                                                                              • m02.lua, line 3023: set_max_hit_points(char.name, (get_current_hit_points(char.name) * M02_tweak_values.goon_hitpoint_modifier) )
                                                                              • m07.lua, line 2270: set_max_hit_points(M07_char.oleg, 99999, true)
                                                                              • m11.lua, line 1798: set_max_hit_points(M11_groups.oleg_battle.oleg.oleg, 50000, true)
                                                                              • m13.lua, line 2440: set_max_hit_points(pierce, 50000, true)
                                                                              • m13.lua, line 2477: set_max_hit_points(pierce, normal_hitpoints, true)
                                                                              • m16.lua, line 2866: set_max_hit_points(M16_characters.matt, single_player_hp * MATT_COOP_HEALTH_MULTIPLIER, true)
                                                                              • m20.lua, line 1645: -- set_max_hit_points( rc_tank, get_max_hit_points( rc_tank ) * 4 , true)
                                                                              • m20.lua, line 1738: set_max_hit_points( M20_vehicle.lw_truck, get_max_hit_points( M20_vehicle.lw_truck ) * 4, true )
                                                                              • m21.lua, line 912: set_max_hit_points(M21_characters.angel, get_max_hit_points(M21_characters.angel) * ANGEL_HEALTH_MULTIPLIER, true)
                                                                              set_min_hit_points true
                                                                                14
                                                                                set_mission_author true
                                                                                  62
                                                                                  set_never_turn_on_player true
                                                                                    3
                                                                                    set_ped_density true
                                                                                      34
                                                                                      set_ped_override_density true
                                                                                        4
                                                                                        set_perfect_aim true
                                                                                          13
                                                                                          set_players_can_be_downed true
                                                                                            18
                                                                                            set_player_can_enter_exit_rc_vehicles true
                                                                                              19
                                                                                              set_player_can_enter_exit_vehicles true
                                                                                                93
                                                                                                set_player_can_take_human_shields true
                                                                                                  14
                                                                                                  set_player_undercover_team true
                                                                                                    10
                                                                                                    set_saints_hated true
                                                                                                      2
                                                                                                      set_script_animation_group true
                                                                                                        7
                                                                                                        set_script_animation_state true
                                                                                                          31
                                                                                                          set_seatbelt_flag true
                                                                                                            1
                                                                                                            set_stag_active true
                                                                                                              9
                                                                                                              set_stag_notoriety_area_active true
                                                                                                                2
                                                                                                                set_suppress_synced_attacks_flag true
                                                                                                                  8
                                                                                                                  set_suppress_synced_melee_attacks_flag true
                                                                                                                    4
                                                                                                                    set_team true
                                                                                                                      10
                                                                                                                      set_text_tag true 1
                                                                                                                        set_time_of_day true
                                                                                                                          7
                                                                                                                          set_traffic_density true
                                                                                                                            25
                                                                                                                            set_trailing_aim_flag true
                                                                                                                              3
                                                                                                                              set_unenterable_for_player true
                                                                                                                                10
                                                                                                                                set_unjackable_by_ai_flag true
                                                                                                                                  1
                                                                                                                                  set_unjackable_flag true
                                                                                                                                    43
                                                                                                                                    set_unrecruitable_flag true
                                                                                                                                      2
                                                                                                                                      sfx_faded_in true
                                                                                                                                        1
                                                                                                                                        sfx_faded_out true
                                                                                                                                          4
                                                                                                                                          sfx_use_load_images true
                                                                                                                                            1
                                                                                                                                            sh01_setup_crew true
                                                                                                                                              8
                                                                                                                                              shop_ignore_clerk true
                                                                                                                                                7
                                                                                                                                                shop_purchase_purchase_shop true
                                                                                                                                                  1
                                                                                                                                                  sidewalk_disable_nodes true
                                                                                                                                                    8
                                                                                                                                                    sin true
                                                                                                                                                      2
                                                                                                                                                      skip_func true
                                                                                                                                                        1
                                                                                                                                                        skydive_move_to_do true
                                                                                                                                                          2
                                                                                                                                                          • m02.lua, line 3048: skydive_move_to_do(char.name, char.dest_nav, false, 0, true, char.forced_dive)
                                                                                                                                                          • m18.lua, line 3189: skydive_move_to_do(diver_table.name, diver_table.nav, false, 0, false, diver_table.forced_dive)
                                                                                                                                                          skydive_setup_tank_bailout true
                                                                                                                                                            3
                                                                                                                                                            skydive_set_catching_shaundi true
                                                                                                                                                              5
                                                                                                                                                              skydive_set_elev_angles_deg true
                                                                                                                                                                4
                                                                                                                                                                skydive_set_player_dive_fall_speed true
                                                                                                                                                                  10
                                                                                                                                                                  spawning_allow_cop_ambient_spawns true
                                                                                                                                                                    5
                                                                                                                                                                    spawning_boats true
                                                                                                                                                                      1
                                                                                                                                                                      spawning_pedestrians true
                                                                                                                                                                        32
                                                                                                                                                                        spawning_vehicles true
                                                                                                                                                                          25
                                                                                                                                                                          spawn_global_override_clear_category true
                                                                                                                                                                            1
                                                                                                                                                                            spawn_global_override_set_category true
                                                                                                                                                                              1
                                                                                                                                                                              spawn_override_change_hood_alternate_spawning true
                                                                                                                                                                                8
                                                                                                                                                                                spawn_override_clear_override_for_hood true
                                                                                                                                                                                  1
                                                                                                                                                                                  spawn_override_set_override_category_for_hood true
                                                                                                                                                                                    1
                                                                                                                                                                                    • m20.lua, line 635: spawn_override_set_override_category_for_hood( "HOOD_YEARWOOD", "sp_cat_m20Yearwood" )
                                                                                                                                                                                    spawn_region_enable true
                                                                                                                                                                                      111
                                                                                                                                                                                      spawn_region_enable_los true
                                                                                                                                                                                        2
                                                                                                                                                                                        spawn_region_max_spawn_dist true
                                                                                                                                                                                          2
                                                                                                                                                                                          spawn_region_max_spawn_dist_reset true
                                                                                                                                                                                            2
                                                                                                                                                                                            spawn_region_min_spawn_dist true
                                                                                                                                                                                              1
                                                                                                                                                                                              spawn_region_min_spawn_dist_reset true
                                                                                                                                                                                                1
                                                                                                                                                                                                spawn_region_toggle_filter true
                                                                                                                                                                                                  15
                                                                                                                                                                                                  • dlc2_m02.lua, line 2256: spawn_region_toggle_filter( v.name, v.filter )
                                                                                                                                                                                                  • m07.lua, line 2349: spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_n, SRF_1) -- NOTE: This still allows SRF_DEFAULT spawns!
                                                                                                                                                                                                  • m07.lua, line 2350: spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_s, SRF_1) -- NOTE: This still allows SRF_DEFAULT spawns!
                                                                                                                                                                                                  • m07.lua, line 2351: spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_n, SRF_DEFAULT)
                                                                                                                                                                                                  • m07.lua, line 2352: spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_s, SRF_DEFAULT)
                                                                                                                                                                                                  • m07.lua, line 2391: spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_n, SRF_1) -- NOTE: This still allows SRF_DEFAULT spawns!
                                                                                                                                                                                                  • m07.lua, line 2392: spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_s, SRF_1) -- NOTE: This still allows SRF_DEFAULT spawns!
                                                                                                                                                                                                  • m07.lua, line 2393: spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_n, SRF_DEFAULT)
                                                                                                                                                                                                  • m07.lua, line 2394: spawn_region_toggle_filter(M07_spawn_region.casino_upper_front_s, SRF_DEFAULT)
                                                                                                                                                                                                  • m07.lua, line 2417: spawn_region_toggle_filter(M07_spawn_region.casino_rear_n, SRF_2) -- NOTE: This still allows SRF_DEFAULT spawns!
                                                                                                                                                                                                  • m07.lua, line 2418: spawn_region_toggle_filter(M07_spawn_region.casino_rear_s, SRF_3) -- NOTE: This still allows SRF_DEFAULT spawns!
                                                                                                                                                                                                  • m07.lua, line 2462: spawn_region_toggle_filter(M07_spawn_region.casino_rear_n, SRF_3) -- NOTE: This still allows SRF_DEFAULT spawns!
                                                                                                                                                                                                  • m07.lua, line 2463: spawn_region_toggle_filter(M07_spawn_region.casino_rear_s, SRF_3) -- NOTE: This still allows SRF_DEFAULT spawns!
                                                                                                                                                                                                  • m13.lua, line 1690: spawn_region_toggle_filter(region, spawns.filter)
                                                                                                                                                                                                  • m15.lua, line 1060: spawn_region_toggle_filter(region, spawns.filter)
                                                                                                                                                                                                  spotlight_heli_laser_enable true
                                                                                                                                                                                                    6
                                                                                                                                                                                                    spotlight_heli_laser_size true
                                                                                                                                                                                                      2
                                                                                                                                                                                                      squad_enable true
                                                                                                                                                                                                        1
                                                                                                                                                                                                        start_func true
                                                                                                                                                                                                          1
                                                                                                                                                                                                          state_change_func true
                                                                                                                                                                                                            1
                                                                                                                                                                                                            store_character_lineup_loaded true
                                                                                                                                                                                                              1
                                                                                                                                                                                                              store_clothing_get_store_id true
                                                                                                                                                                                                                1
                                                                                                                                                                                                                Store_common_allow_input_cb true
                                                                                                                                                                                                                  1
                                                                                                                                                                                                                  store_common_bg_anim_complete true
                                                                                                                                                                                                                    5
                                                                                                                                                                                                                    Store_common_exit_cb true
                                                                                                                                                                                                                      1
                                                                                                                                                                                                                      store_common_mouse_zoom true
                                                                                                                                                                                                                        11
                                                                                                                                                                                                                        Store_common_populate_list_cb true
                                                                                                                                                                                                                          3
                                                                                                                                                                                                                          store_common_rotate_mouse_drag true
                                                                                                                                                                                                                            1
                                                                                                                                                                                                                            store_crib_init_crib_garage true
                                                                                                                                                                                                                              1
                                                                                                                                                                                                                              store_dlc_make_purchase true
                                                                                                                                                                                                                                1
                                                                                                                                                                                                                                store_dlc_queue_icon true
                                                                                                                                                                                                                                  1
                                                                                                                                                                                                                                  store_gang_begin_exit true
                                                                                                                                                                                                                                    1
                                                                                                                                                                                                                                    store_gang_bg_covered true
                                                                                                                                                                                                                                      1
                                                                                                                                                                                                                                      store_gang_is_unlocked true
                                                                                                                                                                                                                                        1
                                                                                                                                                                                                                                        store_gang_show_question_marks true
                                                                                                                                                                                                                                          4
                                                                                                                                                                                                                                          store_interface_is_active true
                                                                                                                                                                                                                                            4
                                                                                                                                                                                                                                            store_set_camera_pos true
                                                                                                                                                                                                                                              15
                                                                                                                                                                                                                                              store_start_lighting_change true
                                                                                                                                                                                                                                                2
                                                                                                                                                                                                                                                store_stronghold_game_purchase_upgrade true
                                                                                                                                                                                                                                                  1
                                                                                                                                                                                                                                                  store_stronghold_upgrade_end_flyby true
                                                                                                                                                                                                                                                    1
                                                                                                                                                                                                                                                    store_vehicle_allow_garage true
                                                                                                                                                                                                                                                      1
                                                                                                                                                                                                                                                      store_vehicle_change_mode true
                                                                                                                                                                                                                                                        2
                                                                                                                                                                                                                                                        store_vehicle_do_return_to_crib true
                                                                                                                                                                                                                                                          1
                                                                                                                                                                                                                                                          store_vehicle_get_state true
                                                                                                                                                                                                                                                            3
                                                                                                                                                                                                                                                            store_vehicle_notify_screen_covered true
                                                                                                                                                                                                                                                              1
                                                                                                                                                                                                                                                              store_vehicle_no_vehicle_exit true
                                                                                                                                                                                                                                                                1
                                                                                                                                                                                                                                                                store_vehicle_retrieve_car_and_exit true
                                                                                                                                                                                                                                                                  2
                                                                                                                                                                                                                                                                  store_vehicle_selection_should_lock_controls true
                                                                                                                                                                                                                                                                    2
                                                                                                                                                                                                                                                                    store_weapon_change_weapon true
                                                                                                                                                                                                                                                                      1
                                                                                                                                                                                                                                                                      store_weapon_hide_weapon true
                                                                                                                                                                                                                                                                        5
                                                                                                                                                                                                                                                                        store_weapon_process_post_bg_covered true
                                                                                                                                                                                                                                                                          1
                                                                                                                                                                                                                                                                          store_weapon_purchase_ammo true
                                                                                                                                                                                                                                                                            1
                                                                                                                                                                                                                                                                            store_weapon_purchase_weapon true
                                                                                                                                                                                                                                                                              2
                                                                                                                                                                                                                                                                              • store_weapon.lua, line 1491: store_weapon_purchase_weapon(Weapon_grid_data.category, weapon_info.id, Store_weapon_is_cache, 0)
                                                                                                                                                                                                                                                                              • store_weapon.lua, line 1759: store_weapon_purchase_weapon(Weapon_grid_data.category, Store_weapon_current_info.id, Store_weapon_is_cache, menu_data.price)
                                                                                                                                                                                                                                                                              sync_from_player true 1