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)
table_clear true 1 33
table_clone true 1 28
teleport true
    28
    teleport_check_done true
      3
      teleport_player_vehicles true
        2
        teleport_to_object true
          2
          teleport_vehicle true
            1
            temp_restore_flight_power true
              1
              temp_save_flight_power true
                1
                test_error_me true 1
                  test_interp_linear true 1
                    thread_check_done true
                      8
                      thread_get_handle true
                        4
                        thread_kill true
                          107
                          thread_new true
                            151
                            thread_yield true
                              251
                              trigger_copy_pos_from true
                                2
                                • sr4_5_city.lua, line 1550: trigger_copy_pos_from( sex_trig, talk_trig ) -- move sex trigger to same position as talk trigger
                                • sr4_5_city.lua, line 1558: trigger_copy_pos_from( contact_trig, talk_trig ) -- move contact trigger to same position as talk trigger
                                trigger_enable true
                                  24
                                  trigger_get_radius true
                                    2
                                    trigger_is_enabled true
                                      3
                                      trigger_set_delay_between_activations true
                                        1
                                        trigger_set_hold_to_repeat true
                                          1
                                          turn_invulnerable true
                                            62
                                            turn_to_do true
                                              1
                                              turn_vulnerable true
                                                41
                                                tutorial_lock true
                                                  3
                                                  tutorial_set_hud_help_closing true
                                                    4
                                                    tutorial_start true
                                                      22
                                                      tutorial_stop true
                                                        4
                                                        tutorial_stop_current true
                                                          14
                                                          tutorial_ultra_shield_only_vulnerable_to_superpowers true
                                                            7
                                                            tutorial_unlock true
                                                              3
                                                              tweak_table_override_value true
                                                                7
                                                                tweak_table_restore_value true
                                                                  2