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)
mesh_mover_being_wielded true
    2
    • bh04.lua, line 524: if ( (get_dist(CHAR_DONNIE, weapon) < MAX_WIELD_DIST) and (not mesh_mover_being_wielded(weapon))) then
    • bh04.lua, line 565: if (not mesh_mover_being_wielded(weapon) ) then
    mesh_mover_destroyed true
      3
      mesh_mover_hide true
        38
        mesh_mover_play_action true
          10
          mesh_mover_reset true
            27
            mesh_mover_reset_to_action_end true
              4
              mesh_mover_show true
                10
                mesh_mover_wielding true
                  4
                  mesh_mover_wield_stop true
                    2
                    message true
                      23
                      minimap_icon_add_group_do true
                        2
                        minimap_icon_add_item_do true
                          2
                          minimap_icon_add_mover_do true
                            2
                            minimap_icon_add_navpoint_do true
                              2
                              • ug_lib.lua, line 1630: minimap_icon_add_navpoint_do(name, bitmap_name, bitmap_glow_name, nil, sync_type)
                              • ug_lib.lua, line 1714: minimap_icon_add_navpoint_do(name, bitmap_name, bitmap_glow_name, radius, sync_type)
                              minimap_icon_add_npc_do true
                                2
                                minimap_icon_add_player_do true
                                  2
                                  • ug_lib.lua, line 1652: minimap_icon_add_player_do( name, bitmap_name, bitmap_glow_name, nil, sync_type )
                                  • ug_lib.lua, line 1738: minimap_icon_add_player_do( name, bitmap_name, bitmap_glow_name, radius, sync_type )
                                  minimap_icon_add_radius true
                                    2
                                    • em01.lua, line 652: minimap_icon_add_radius(CHURCH_LEASH_INSIDE, CHURCH_ABANDON_DIST_WARN, SYNC_ALL)
                                    • em01.lua, line 943: minimap_icon_add_radius(CHURCH_LEASH_INSIDE, CHURCH_ABANDON_DIST_WARN, SYNC_ALL)
                                    minimap_icon_add_trigger_do true
                                      2
                                      • ug_lib.lua, line 1663: minimap_icon_add_trigger_do(name, bitmap_name, bitmap_glow_name, nil, sync_type)
                                      • ug_lib.lua, line 1750: minimap_icon_add_trigger_do(name, bitmap_name, bitmap_glow_name, radius, sync_type)
                                      minimap_icon_add_vehicle_do true
                                        2
                                        • ug_lib.lua, line 1674: minimap_icon_add_vehicle_do(name, bitmap_name, bitmap_glow_name, nil, sync_type)
                                        • ug_lib.lua, line 1762: minimap_icon_add_vehicle_do(name, bitmap_name, bitmap_glow_name, radius, sync_type)
                                        minimap_icon_remove_group true
                                          3
                                          minimap_icon_remove_item true
                                            1
                                            minimap_icon_remove_mover true
                                              1
                                              minimap_icon_remove_navpoint true
                                                19
                                                minimap_icon_remove_npc true
                                                  2
                                                  minimap_icon_remove_player true
                                                    1
                                                    minimap_icon_remove_radius true
                                                      4
                                                      minimap_icon_remove_trigger true
                                                        7
                                                        minimap_icon_remove_vehicle true
                                                          7
                                                          mission_end_failure true
                                                            167
                                                            mission_help_clear true
                                                              30
                                                              mission_help_table_do true
                                                                3
                                                                mission_is_active true
                                                                  2
                                                                  mission_is_complete true
                                                                    13
                                                                    mission_is_unlocked true
                                                                      1
                                                                      mission_set_checkpoint true
                                                                        80
                                                                        mission_unlock true
                                                                          52
                                                                          move_to_check_done true
                                                                            2
                                                                            • bh10.lua, line 1358: if not (move_to_check_done(Maero_throw_path_idx, CHAR_MAERO, "bh10_$n027", 2, true, true, false, 0)) then
                                                                            • bh10.lua, line 1381: if not (move_to_check_done(Maero_hide_path_idx, CHAR_MAERO, "bh10_$n027", 2, true, true, false, 0)) then
                                                                            move_to_do true
                                                                              8
                                                                              • bh10.lua, line 1308: Maero_throw_path_idx = move_to_do(CHAR_MAERO, "bh10_$n027", 2, true, true, false, 0)
                                                                              • bh10.lua, line 1320: Maero_hide_path_idx = move_to_do(CHAR_MAERO, "bh10_$n027", 2, true, true, false, 0)
                                                                              • ug_lib.lua, line 1916: path_index = move_to_do(name, arg_val[j], speed, retry_on_failure, move_and_fire, false, 0)
                                                                              • ug_lib.lua, line 1936: path_index = move_to_do(name, arg_val, speed, retry_on_failure, move_and_fire, true, idx)
                                                                              • ug_lib.lua, line 1950: path_index = move_to_do(name, arg_val, speed, retry_on_failure, move_and_fire, false, 0)
                                                                              • ug_lib.lua, line 2038: path_index = move_to_do(name, arg_val[j], speed, retry_on_failure, move_and_fire, false, 0)
                                                                              • ug_lib.lua, line 2061: path_index = move_to_do(name, arg_val, speed, retry_on_failure, move_and_fire, true, idx)
                                                                              • ug_lib.lua, line 2078: path_index = move_to_do(name, arg_val, speed, retry_on_failure, move_and_fire, false, 0)
                                                                              move_to_vehicle_entry_point_check_done true
                                                                                1
                                                                                • ug_lib.lua, line 2118: until move_to_vehicle_entry_point_check_done(name, vehicle, entry_point, speed, retry_on_failure, move_and_fire)
                                                                                move_to_vehicle_entry_point_do true
                                                                                  1
                                                                                  • ug_lib.lua, line 2115: if move_to_vehicle_entry_point_do(name, vehicle, entry_point, speed, retry_on_failure, move_and_fire) then
                                                                                  mp_change_ranked_game_type true
                                                                                    3
                                                                                    mp_completion_host_left true
                                                                                      1
                                                                                      mp_completion_is_party_client true
                                                                                        3
                                                                                        mp_completion_is_party_host true
                                                                                          1
                                                                                          mp_completion_quit_game true
                                                                                            1
                                                                                            mp_completion_return_to_lobby true
                                                                                              1
                                                                                              mp_load_custom_match_settings_from_favorite true
                                                                                                3
                                                                                                mp_lobby_stop_countdown true
                                                                                                  1
                                                                                                  mp_online_logout true
                                                                                                    1
                                                                                                    mp_player_has_favorite_match_settings true
                                                                                                      4
                                                                                                      mp_popup_add_friend true
                                                                                                        1
                                                                                                        mp_popup_is_matchmaking true
                                                                                                          1
                                                                                                          mp_popup_kick_player true
                                                                                                            1
                                                                                                            mp_popup_open true
                                                                                                              5
                                                                                                              mp_popup_show_gamercard true
                                                                                                                1
                                                                                                                mp_popup_submit_player_review true
                                                                                                                  1
                                                                                                                  mp_save_custom_match_settings_as_favorite true
                                                                                                                    2
                                                                                                                    mp_start_lobby true
                                                                                                                      1
                                                                                                                      mp_start_quickmatch true
                                                                                                                        2
                                                                                                                        mp_swap_matchmaking true
                                                                                                                          1
                                                                                                                          mp_switch_maps true
                                                                                                                            1
                                                                                                                            mp_switch_modes true
                                                                                                                              7
                                                                                                                              multi_change_game_type_filter true
                                                                                                                                3
                                                                                                                                multi_change_sort_method true
                                                                                                                                  1
                                                                                                                                  multi_custom_set_activity_status true
                                                                                                                                    1
                                                                                                                                    multi_custom_set_ammo true
                                                                                                                                      1
                                                                                                                                      multi_custom_set_friendly_fire true
                                                                                                                                        1
                                                                                                                                        multi_custom_set_peds true
                                                                                                                                          1
                                                                                                                                          multi_custom_set_preset true
                                                                                                                                            2
                                                                                                                                            multi_custom_set_score_limit true
                                                                                                                                              1
                                                                                                                                              multi_custom_set_sprint true
                                                                                                                                                1
                                                                                                                                                multi_custom_set_tag_status true
                                                                                                                                                  1
                                                                                                                                                  multi_custom_set_time_limit true
                                                                                                                                                    1
                                                                                                                                                    multi_custom_set_tod true
                                                                                                                                                      1
                                                                                                                                                      multi_custom_set_vehicle_set true
                                                                                                                                                        1
                                                                                                                                                        multi_enable_special_weapon true
                                                                                                                                                          1
                                                                                                                                                          multi_get_sort_method true
                                                                                                                                                            1
                                                                                                                                                            multi_load_saved_character true
                                                                                                                                                              1
                                                                                                                                                              multi_menu_switch_teams true
                                                                                                                                                                1
                                                                                                                                                                multi_set_weapon_category_choice true
                                                                                                                                                                  1
                                                                                                                                                                  multi_set_weather_stage true
                                                                                                                                                                    1
                                                                                                                                                                    music_store_make_purchase true
                                                                                                                                                                      1
                                                                                                                                                                      music_store_preview_track true
                                                                                                                                                                        3