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)
action_play_custom_do true
    1
    action_play_directional_stumble_do true
      1
      action_play_do true
        1
        • game_lib.lua, line 727: while not action_play_do(name, anim_name, morph_name, force_play, stand_still, zero_movement, navpoint, dest_nav, layered, hold_last_frame, no_script_control, navpoint_orient_only) do
        action_play_is_finished true
          11
          action_play_synced_do true
            2
            • game_lib.lua, line 743: while not action_play_synced_do(attacker, victim, anim_name, start_nav, warp_to_nav, sync_type) do
            • game_lib.lua, line 763: while not action_play_synced_do(attacker, victim, anim_name, start_nav, nil, sync_type) do
            action_play_synced_is_finished true
              1
              action_play_synced_state true
                2
                action_stop_synced_state true
                  1
                  add_object_indicator_to_closest_npc true
                    1
                    • game_lib.lua, line 2242: return add_object_indicator_to_closest_npc( target_name, group_name, object_indicator_id, object_indicator_flags, sync_type )
                    airplane_fly_to_do true
                      1
                      airplane_land_do true
                        1
                        airplane_takeoff_do true
                          1
                          ai_add_enemy_target true
                            33
                            ai_attack_region true
                              9
                              ai_clear_scripted_action true
                                2
                                ai_do_scripted_move true
                                  4
                                  ai_scripted_action_is_complete true
                                    1
                                    and true
                                      1
                                      • mintrobb.lua, line 1582: if damage ~= nil and( attacker == nil or (not character_is_dead(attacker) and not character_is_player(attacker) ))then
                                      argument_unwrapper true 1 1
                                      assert_msg true
                                        6
                                        attack true
                                          1
                                          audio_conversation_end true
                                            5
                                            audio_conversation_load_direct true
                                              2
                                              • game_lib.lua, line 4311: convo_table.handle_remote = audio_conversation_load_direct(convo_table.name, convo_table.player_talks, convo_table.sync)
                                              • game_lib.lua, line 4314: convo_table.handle = audio_conversation_load_direct(convo_table.name, convo_table.player_talks, convo_table.sync)
                                              audio_conversation_play true
                                                2
                                                audio_conversation_playing true
                                                  2
                                                  audio_is_playing true
                                                    7
                                                    audio_object_post_event true
                                                      97
                                                      audio_persona_line_playing true
                                                        5
                                                        audio_persona_load_2d true
                                                          1
                                                          audio_persona_remove_2d true
                                                            1
                                                            audio_play_delayed true 1
                                                              audio_play_delayed_thread true 1
                                                                audio_play_do true
                                                                  1
                                                                  audio_play_for_character_do true
                                                                    1
                                                                    • game_lib.lua, line 1078: local handle, play_time = audio_play_for_character_do(new_audio_name, human_name, type_name, blocking, variant, voice_distance, cellphone_line, ignore_fade)
                                                                    audio_play_for_character_weapon_do true
                                                                      1
                                                                      audio_play_for_mission_cellphone true
                                                                        1
                                                                        • game_lib.lua, line 4302: audio_play_for_mission_cellphone(convo_table.name, convo_table.receiving_call, auto_answer, "", "call_ended_cb")
                                                                        audio_play_for_mover_do true
                                                                          1
                                                                          audio_play_id_do true
                                                                            1
                                                                            audio_play_id_for_character_do true
                                                                              1
                                                                              • game_lib.lua, line 1199: local handle = audio_play_id_for_character_do(human_name, audio_id, type, blocking, variant, voice_distance)
                                                                              audio_play_id_for_navpoint_do true
                                                                                1
                                                                                audio_play_persona_line true
                                                                                  6
                                                                                  audio_play_persona_line_2d true
                                                                                    1
                                                                                    • game_lib.lua, line 4287: convo_table.play_id = audio_play_persona_line_2d(convo_table.speaker_persona_table.persona_id, convo_table.name)
                                                                                    audio_remove_mission_cellphone true
                                                                                      2
                                                                                      audio_stop true
                                                                                        19
                                                                                        audio_suppress_ambient_player_lines true
                                                                                          2
                                                                                          autil_hud_mayhem_init true
                                                                                            1
                                                                                            autil_mashing_minigame_faded_out true
                                                                                              1
                                                                                              auto_pickup_weapons true
                                                                                                2