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)
satan_clear_resources true
    1
    satan_disable_combat true
      4
      satan_maybe_restore_control true
        1
        • msatan.lua, line 261: satan_maybe_restore_control() --HVS_RCK - same just in case as above: Restore player control
        satan_set_flight_mode true
          1
          satan_set_proxy_push_navpoint true
            1
            satan_wing_pcswap_sam true
              2
              save_game_wrap_up true
                1
                save_system_cancel_coop_load true
                  2
                  save_system_delete_game true
                    1
                    save_system_has_accepted_game_invite true
                      2
                      save_system_load_game true
                        2
                        save_system_save_game true
                          2
                          save_system_set_operation true
                            1
                            sb_select_chop_shop_vehicle true
                              1
                              sb_select_hitman_target 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 983: 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." )
                                        seamless_animated_moment_cleanup true
                                          10
                                          seamless_animated_moment_prep true
                                            11
                                            seamless_animated_moment_start true
                                              11
                                              selected_cb true
                                                1
                                                set_animation_set true
                                                  1
                                                  set_animation_state true
                                                    25
                                                    set_attack_enemies_flag true
                                                      1
                                                      set_bg true
                                                        1
                                                        set_char_in_string true
                                                          3
                                                          set_element true
                                                            17
                                                            set_gibbable true
                                                              2
                                                              set_human_pos true
                                                                3
                                                                set_ignore_ai_flag true
                                                                  24
                                                                  set_ped_override_density true
                                                                    16
                                                                    set_player_can_enter_exit_vehicles true
                                                                      2
                                                                      set_player_can_exit_vehicles true
                                                                        4
                                                                        set_player_can_take_human_shields true
                                                                          16
                                                                          set_script_animation_state true
                                                                            5
                                                                            set_seatbelt_flag true
                                                                              3
                                                                              set_suppress_synced_attacks_flag true
                                                                                2
                                                                                set_text_tag true 1
                                                                                  set_traffic_density true
                                                                                    16
                                                                                    set_unjackable_flag true
                                                                                      2
                                                                                      sfx_faded_in true
                                                                                        1
                                                                                        sfx_use_load_images true
                                                                                          1
                                                                                          shop_purchase_purchase_shop true
                                                                                            1
                                                                                            skip_func true
                                                                                              1
                                                                                              spawning_allow_cop_ambient_spawns true
                                                                                                9
                                                                                                spawning_vehicles true
                                                                                                  7
                                                                                                  spawn_region_enable true
                                                                                                    1
                                                                                                    start true
                                                                                                      1
                                                                                                      • hud_msg.lua, line 1600: Hud_msg_back_things[ Hud_msg_back_current.q_type ].start( unpack( Hud_msg_back_current.params ) )
                                                                                                      start_func true
                                                                                                        2
                                                                                                        state_change_func true
                                                                                                          1
                                                                                                          stat_increment true
                                                                                                            8
                                                                                                            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
                                                                                                                      2
                                                                                                                      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_is_offer_free true
                                                                                                                                2
                                                                                                                                store_dlc_make_purchase true
                                                                                                                                  3
                                                                                                                                  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_set_camera_pos true
                                                                                                                                              16
                                                                                                                                              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_vendor_purchase true
                                                                                                                                                                      1
                                                                                                                                                                      store_weapon_change_weapon true
                                                                                                                                                                        2
                                                                                                                                                                        • store_weapon.lua, line 652: --store_weapon_change_weapon(Weapon_grid_data.category, weapon_info.id, weapon_info.dual_wield, Store_weapon_is_cache, nil, weapon_info.costume_id, weapon_info.skin_id, true)
                                                                                                                                                                        • store_weapon.lua, line 3260: local loading = store_weapon_change_weapon(category, id, dual_wield, is_cache, upgrade_level, costume, skin, immediate)
                                                                                                                                                                        store_weapon_enable_lights true
                                                                                                                                                                          2
                                                                                                                                                                          store_weapon_hide_weapon true
                                                                                                                                                                            5
                                                                                                                                                                            store_weapon_is_tutorial_mode true
                                                                                                                                                                              3
                                                                                                                                                                              store_weapon_process_post_bg_covered true
                                                                                                                                                                                1
                                                                                                                                                                                store_weapon_purchase_ammo true
                                                                                                                                                                                  1
                                                                                                                                                                                  store_weapon_purchase_weapon true
                                                                                                                                                                                    4
                                                                                                                                                                                    • store_weapon.lua, line 1955: store_weapon_purchase_weapon(Weapon_grid_data.category, weapon_info.id, Store_weapon_is_cache, 0)
                                                                                                                                                                                    • store_weapon.lua, line 2126: store_weapon_purchase_weapon(Weapon_grid_data.category, Store_weapon_current_info.id, Store_weapon_is_cache, 0)
                                                                                                                                                                                    • store_weapon.lua, line 2692: store_weapon_purchase_weapon(Weapon_grid_data.category, Store_weapon_current_info.id, Store_weapon_is_cache, 0)
                                                                                                                                                                                    • store_weapon.lua, line 2752: store_weapon_purchase_weapon(Weapon_grid_data.category, Store_weapon_current_info.id, Store_weapon_is_cache, Store_weapon_current_info.price)
                                                                                                                                                                                    store_weapon_purchase_weapon_upgrade true
                                                                                                                                                                                      1
                                                                                                                                                                                      • store_weapon.lua, line 2123: store_weapon_purchase_weapon_upgrade(Weapon_grid_data.category, Weapon_grid_data[Weapon_grid_idx].id, Store_weapon_building_menu[upgrade_idx].attribute_id)
                                                                                                                                                                                      store_weapon_set_costume true
                                                                                                                                                                                        2
                                                                                                                                                                                        store_weapon_tutorial_mode true
                                                                                                                                                                                          7
                                                                                                                                                                                          super_jump_set_flap_max true
                                                                                                                                                                                            8