Saints Row 2 Function Reference

Global functions

These functions are assumed to be globally available to all scripts since they aren't defined in the patch lua files.

This list is incomplete; additional functions could exist in the exe but not be used in the game lua, and some lua files may always be loaded (system_lib.lua?) making their functions essentially global.

Function name Global Defined in Examples from patch (click blue number to expand)
screenshot_do true
    2
    screen_fx_fadeout true
      4
      scripted_cutscene_playing true
        2
        script_assert true
          6
          • bh09.lua, line 910: script_assert( false, "Boat with name "..boat_name.." not found." )
          • em01.lua, line 1945: script_assert( trigger_index ~= -1, "failed to find trigger's index" )
          • pause_menu.lua, line 528: --script_assert(idx < OBJECTIVES_MAX_ITEMS, "Too many objetive messages, might have to bump the number.")
          • ss03.lua, line 1167: script_assert( false, vehicle_name.." failed path. Car followed = "..car_followed..". Please get Mark Gabby if you hit this. Thanks!" )
          • ss03.lua, line 1246: script_assert( false, "Called 'add_car_to_convoy' index "..car_index..", vehicle: "..ESCAPEE_VEHICLES[car_index].." when there were no living cars in front of said car." )
          • ug_lib.lua, line 608: 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." )
          script_profiler_do_printout true
            4
            script_profiler_end_section true
              28
              script_profiler_reset true
                3
                script_profiler_start_section true
                  27
                  send_mp_lobby_player_invite true
                    1
                    send_pause_menu_player_invite true
                      2
                      set_always_sees_player_flag true
                        21
                        set_animation_state true
                          17
                          set_attack_enemies_flag true
                            10
                            set_attack_peds_flag true
                              4
                              set_attack_player_flag true
                                33
                                set_blitz_flag true
                                  17
                                  set_cant_flee_flag true
                                    24
                                    set_coop_friendly_fire true
                                      1
                                      set_coop_join_type true
                                        5
                                        set_cops_shooting_from_vehicles true
                                          4
                                          set_cower_flee_mode true
                                            4
                                            set_current_hit_points true
                                              66
                                              set_dont_attack_me_on_sight_flag true
                                                3
                                                set_dont_drop_havok_weapons_on_idle true
                                                  4
                                                  set_force_combat_ready_team true
                                                    3
                                                    set_ignore_ai_flag true
                                                      102
                                                      set_ignore_burst_accuracy_flag true
                                                        1
                                                        set_max_hit_points true
                                                          108
                                                          set_mission_author true
                                                            80
                                                            set_name_to_use true
                                                              10
                                                              set_never_crouch_flag true
                                                                2
                                                                set_ped_density true
                                                                  3
                                                                  set_perfect_aim true
                                                                    26
                                                                    set_player_can_be_busted true
                                                                      4
                                                                      set_player_can_enter_exit_vehicles true
                                                                        41
                                                                        set_police_never_fire_at_civilian_human_shields true
                                                                          2
                                                                          set_seatbelt_flag true
                                                                            20
                                                                            set_single_player true
                                                                              5
                                                                              set_team true
                                                                                2
                                                                                set_time_of_day true
                                                                                  8
                                                                                  set_time_of_day_scale true
                                                                                    3
                                                                                    set_traffic_density true
                                                                                      7
                                                                                      set_trailing_aim_flag true
                                                                                        1
                                                                                        set_unjackable_flag true
                                                                                          75
                                                                                          set_unrecruitable_flag true
                                                                                            17
                                                                                            set_weather true
                                                                                              6
                                                                                              set_width true
                                                                                                1
                                                                                                shop_enable true
                                                                                                  4
                                                                                                  shop_purchase_purchase_shop true
                                                                                                    1
                                                                                                    show true
                                                                                                      1
                                                                                                      show_login_window_pc true
                                                                                                        1
                                                                                                        show_main_menu_friend_gamercard true
                                                                                                          1
                                                                                                          show_mp_lobby_friend_gamercard true
                                                                                                            1
                                                                                                            show_password_window_pc true
                                                                                                              1
                                                                                                              show_pause_menu_friend_gamercard true
                                                                                                                1
                                                                                                                spawning_allow_cop_ambient_spawns true
                                                                                                                  12
                                                                                                                  spawning_allow_gang_ambient_spawns true
                                                                                                                    2
                                                                                                                    spawning_allow_gang_team_ambient_spawns true
                                                                                                                      6
                                                                                                                      spawning_boats true
                                                                                                                        8
                                                                                                                        spawning_pedestrians true
                                                                                                                          64
                                                                                                                          spawning_vehicles true
                                                                                                                            47
                                                                                                                            spawn_override_set_category true
                                                                                                                              2
                                                                                                                              sprint_reset_local_overrides true
                                                                                                                                2
                                                                                                                                sprint_set_local_recharge_override true
                                                                                                                                  1
                                                                                                                                  • rn07.lua, line 777: sprint_set_local_recharge_override(GURNEY_SPRINT_RECHARGE_OVERRIDE_MS)
                                                                                                                                  sprint_set_local_use_override true
                                                                                                                                    1
                                                                                                                                    start_coop_matchmaking true
                                                                                                                                      4
                                                                                                                                      start_find_online_servers true
                                                                                                                                        6
                                                                                                                                        start_intro_cutscene true
                                                                                                                                          1
                                                                                                                                          start_mp_tutorial true
                                                                                                                                            1
                                                                                                                                            start_multiplayer_game true
                                                                                                                                              1
                                                                                                                                              start_online_game true
                                                                                                                                                1
                                                                                                                                                stop_find_online_servers true
                                                                                                                                                  5
                                                                                                                                                  stop_mp_tutorial true
                                                                                                                                                    1
                                                                                                                                                    store_set_camera_pos true
                                                                                                                                                      5
                                                                                                                                                      subgroup_create_do true
                                                                                                                                                        1