Saints Row: The Third 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)
ingame_effect_add_trigger true
    8
    • game_lib.lua, line 2023: ingame_effect_add_trigger(trigger_name, ingame_effect_name, sync_type)
    • m17.lua, line 1794: ingame_effect_add_trigger(M17_triggers.brig, INGAME_EFFECT_CHECKPOINT, SYNC_ALL)
    • m17.lua, line 2451: ingame_effect_add_trigger(M17_triggers.brig_entry, INGAME_EFFECT_CHECKPOINT, SYNC_ALL)
    • m21.lua, line 2245: ingame_effect_add_trigger(M21_triggers.tag_trigger_outside, INGAME_EFFECT_LOCATION, sync_from_player(player_outside_ring))
    • m21.lua, line 2248: ingame_effect_add_trigger(M21_triggers.tag_trigger_inside, INGAME_EFFECT_LOCATION, sync_from_player(player_in_ring))
    • m21.lua, line 3398: ingame_effect_add_trigger(M21_triggers.tag_trigger_inside, INGAME_EFFECT_LOCATION, sync_from_player(player_in_ring))
    • m21.lua, line 3494: ingame_effect_add_trigger(M21_triggers.tag_trigger_inside, INGAME_EFFECT_LOCATION, sync_from_player(player_in_ring))
    • m21.lua, line 3526: ingame_effect_add_trigger(M21_triggers.tag_trigger_outside, INGAME_EFFECT_LOCATION, sync_from_player(player_outside_ring))
    ingame_effect_remove_trigger true
      6
      interior_disable_exterior true
        5
        inv_add_temp_loadout true 1 8
        inv_has_item true
          4
          • m23.lua, line 2488: if ((not inv_has_item("brute_minigun", LOCAL_PLAYER)) or (not inv_has_item("brute_minigun", REMOTE_PLAYER))) then
          • m23.lua, line 2488: if ((not inv_has_item("brute_minigun", LOCAL_PLAYER)) or (not inv_has_item("brute_minigun", REMOTE_PLAYER))) then
          • m23.lua, line 2495: if (not inv_has_item("brute_minigun")) then
          • sh04.lua, line 1536: if ( inv_has_item("Special-SonicGun", REMOTE_PLAYER) == true ) then
          inv_item_add true 1 37
          inv_item_add_ammo true
            1
            inv_item_add_do true
              2
              inv_item_dual_wield true
                1
                inv_item_equip true
                  50
                  inv_item_equip_slot true
                    5
                    inv_item_get_anim_group true
                      1
                      inv_item_get_equipped_item true
                        5
                        • m02.lua, line 1595: if (inv_item_get_equipped_item(LOCAL_PLAYER) ~= M02_tweak_values.skydiving_pistol) then
                        • m02.lua, line 1599: if (inv_item_get_equipped_item(REMOTE_PLAYER) ~= M02_tweak_values.skydiving_pistol) then
                        • m02.lua, line 3734: if (use_directional == true and inv_item_get_equipped_item(player) == M02_tweak_values.skydiving_pistol) then
                        • m18.lua, line 1642: local equipped_weapon = inv_item_get_equipped_item(player)
                        • m21.lua, line 3294: local weapon_name = inv_item_get_equipped_item(attacker_name)
                        inv_item_get_weapon_upgrades true
                          1
                          • m22.lua, line 4369: if (inv_item_get_weapon_upgrades(KIA_TEMPORARY_GRENADE, triggerer) ~= WEAPON_LEVEL4) then
                          inv_item_in_slot true
                            15
                            • m07.lua, line 1753: M07_status.temp_weapon_local = inv_item_in_slot(LOCAL_PLAYER, "rifle")
                            • m07.lua, line 1764: M07_status.temp_weapon_remote = inv_item_in_slot(REMOTE_PLAYER, "rifle")
                            • m12.lua, line 1684: local pistol_name = inv_item_in_slot(LOCAL_PLAYER, "pistol")
                            • m16.lua, line 2727: m16_local_player_special_weapon = inv_item_in_slot(LOCAL_PLAYER, "special") -- if the player has a special weapon, remove it for the mission
                            • m16.lua, line 2734: m16_remote_player_special_weapon = inv_item_in_slot(REMOTE_PLAYER, "special") -- remove the current special weapon for the mission
                            • m17.lua, line 2937: local pistol_name = inv_item_in_slot(LOCAL_PLAYER, "pistol")
                            • m18.lua, line 1532: local pistol_type = inv_item_in_slot(LOCAL_PLAYER, "pistol")
                            • m21.lua, line 920: local_melee_weapon = inv_item_in_slot(LOCAL_PLAYER, "melee") -- if the player has a melee weapon, remove it for the mission
                            • m21.lua, line 927: remote_melee_weapon = inv_item_in_slot(REMOTE_PLAYER, "melee")
                            • sh03.lua, line 1154: weapon = inv_item_in_slot(REMOTE_PLAYER, "rifle")
                            • sh03.lua, line 1159: weapon = inv_item_in_slot(LOCAL_PLAYER, "rifle")
                            • sh04.lua, line 1324: weapon = inv_item_in_slot(SH04_INTERROGATE_PLAYER, "rifle")
                            • sh04.lua, line 1408: weapon = inv_item_in_slot(attacker, "rifle")
                            • sh04.lua, line 1516: --local_weap = inv_item_in_slot(LOCAL_PLAYER, WEAPON_SLOT_SPECIAL)
                            • sh04.lua, line 1535: --remote_weap = inv_item_in_slot(REMOTE_PLAYER, WEAPON_SLOT_SPECIAL)
                            inv_item_is_equipped true
                              3
                              • dlc2_m02.lua, line 3278: elseif inv_item_is_equipped( "DLC_LaserPistol", attacker ) == true then
                              • m02.lua, line 1618: if (m02_helper_human_can_play_anim(char) == true and inv_item_is_equipped(M02_tweak_values.skydiving_pistol, char)) then
                              • m18.lua, line 3644: --local equip = inv_item_is_equipped("Special-SonicGun", REMOTE_PLAYER) -- obey whatever the equip status was after picking up the sonic gun
                              inv_item_is_firearm_equipped true
                                4
                                • m01.lua, line 3356: while not inv_item_is_firearm_equipped(npc_name) and not character_is_dead(npc_name) do
                                • m01.lua, line 4565: while not inv_item_is_firearm_equipped() or not player_action_is_pressed("CBA_OFC_SHOULDER_CAMERA") do
                                • m06.lua, line 2945: while not inv_item_is_firearm_equipped(REMOTE_PLAYER) do
                                • m06.lua, line 2952: while not inv_item_is_firearm_equipped(LOCAL_PLAYER) do
                                inv_item_remove true
                                  8
                                  inv_item_remove_all true
                                    32
                                    inv_item_remove_in_slot true
                                      8
                                      inv_remove_temp_loadout true 1 10
                                      inv_weapon_add_temporary true
                                        72
                                        • dlc2_m01.lua, line 4373: inv_weapon_add_temporary(player, weapon_table.weapon, 1, true, equip_now, false, true, weapon_table.upgrade_lvl)
                                        • dlc2_m02.lua, line 2613: inv_weapon_add_temporary( LOCAL_PLAYER, weapon, 1, true, loadout_data.equip == slot, true, true )
                                        • dlc2_m02.lua, line 2616: inv_weapon_add_temporary( REMOTE_PLAYER, weapon, 1, true, loadout_data.equip == slot, true, true )
                                        • game_lib.lua, line 3531: inv_weapon_add_temporary(LOCAL_PLAYER, weapon, 1, true)
                                        • game_lib.lua, line 3534: inv_weapon_add_temporary(REMOTE_PLAYER, weapon, 1, true)
                                        • m01.lua, line 2763: inv_weapon_add_temporary(LOCAL_PLAYER, M01_PLAYER_PISTOL, magazines, unlimited, equip_now, dual_wield, force_override, M01_PLAYER_PISTOL_UPGRADES)
                                        • m01.lua, line 2764: inv_weapon_add_temporary(LOCAL_PLAYER, M01_PLAYER_SHOTGUN, magazines, unlimited, equip_now, dual_wield, force_override, M01_PLAYER_SHOTGUN_UPGRADES)
                                        • m01.lua, line 2765: inv_weapon_add_temporary(LOCAL_PLAYER, M01_PLAYER_RIFLE, magazines, unlimited, true, dual_wield, force_override, M01_PLAYER_RIFLE_UPGRADES)
                                        • m01.lua, line 2766: inv_weapon_add_temporary(LOCAL_PLAYER, M01_PLAYER_SMG, magazines, unlimited, equip_now, dual_wield, force_override)
                                        • m01.lua, line 2767: --inv_weapon_add_temporary(LOCAL_PLAYER, M01_PLAYER_GRENADE, magazines, false, equip_now, dual_wield)
                                        • m01.lua, line 2771: inv_weapon_add_temporary(REMOTE_PLAYER, M01_PLAYER_PISTOL, magazines, unlimited, equip_now, dual_wield, force_override, M01_PLAYER_PISTOL_UPGRADES)
                                        • m01.lua, line 2772: inv_weapon_add_temporary(REMOTE_PLAYER, M01_PLAYER_SHOTGUN, magazines, unlimited, equip_now, dual_wield, force_override, M01_PLAYER_SHOTGUN_UPGRADES)
                                        • m01.lua, line 2773: inv_weapon_add_temporary(REMOTE_PLAYER, M01_PLAYER_RIFLE, magazines, unlimited, true, dual_wield, force_override, M01_PLAYER_RIFLE_UPGRADES)
                                        • m01.lua, line 2774: inv_weapon_add_temporary(REMOTE_PLAYER, M01_PLAYER_SMG, magazines, unlimited, equip_now, dual_wield, force_override)
                                        • m01.lua, line 2775: --inv_weapon_add_temporary(REMOTE_PLAYER, M01_PLAYER_GRENADE, magazines, false, equip_now, dual_wield)
                                        • m02.lua, line 1011: inv_weapon_add_temporary(LOCAL_PLAYER, M02_tweak_values.skydiving_smg, 1, true, true, true) -- SMG has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m02.lua, line 1014: inv_weapon_add_temporary(REMOTE_PLAYER, M02_tweak_values.skydiving_smg, 1, true, true, true) -- SMG has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m02.lua, line 1841: inv_weapon_add_temporary(LOCAL_PLAYER, M02_tweak_values.skydiving_smg, 0, true, true, false) -- Pistol has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m02.lua, line 1842: inv_weapon_add_temporary(REMOTE_PLAYER, M02_tweak_values.skydiving_smg, 0, true, true, false) -- Pistol has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m02.lua, line 2445: inv_weapon_add_temporary(LOCAL_PLAYER, M02_tweak_values.skydiving_smg, 1, true, true, true) -- SMG has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m02.lua, line 2447: inv_weapon_add_temporary(REMOTE_PLAYER, M02_tweak_values.skydiving_smg, 1, true, true, true) -- SMG has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m02.lua, line 3443: inv_weapon_add_temporary(LOCAL_PLAYER, M02_tweak_values.skydiving_smg, 1, true, true, true) -- SMG has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m02.lua, line 3464: inv_weapon_add_temporary(REMOTE_PLAYER, M02_tweak_values.skydiving_smg, 1, true, true, true) -- SMG has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m03.lua, line 1801: inv_weapon_add_temporary(LOCAL_PLAYER, M03_weapon.satellite_drone_weapon, 1, true)
                                        • m03.lua, line 1803: inv_weapon_add_temporary(REMOTE_PLAYER, M03_weapon.satellite_drone_weapon, 1, true)
                                        • m03.lua, line 1891: inv_weapon_add_temporary(REMOTE_PLAYER, M03_weapon.helicopter_ride, 1, unlimited_ammo, equip_now, dual_wielding, force_override, 0x7)
                                        • m03.lua, line 1893: inv_weapon_add_temporary(LOCAL_PLAYER, M03_weapon.helicopter_ride, 1, unlimited_ammo, equip_now, dual_wielding, force_override, 0x7)
                                        • m03.lua, line 2658: inv_weapon_add_temporary(LOCAL_PLAYER, M03_weapon.satellite_drone_weapon, 1, true, true)
                                        • m03.lua, line 2662: inv_weapon_add_temporary(REMOTE_PLAYER, M03_weapon.satellite_drone_weapon, 1, true, true)
                                        • m06.lua, line 2946: inv_weapon_add_temporary(REMOTE_PLAYER, M06_PLAYER_RIFLE, 1, true)
                                        • m06.lua, line 2953: inv_weapon_add_temporary(LOCAL_PLAYER, M06_PLAYER_RIFLE, 1, true)
                                        • m07.lua, line 1757: inv_weapon_add_temporary(LOCAL_PLAYER, M07_status.temp_weapon_local, 1, true, true, false, true)
                                        • m07.lua, line 1768: inv_weapon_add_temporary(REMOTE_PLAYER, M07_status.temp_weapon_remote, 1, true, true, false, true)
                                        • m08.lua, line 923: inv_weapon_add_temporary(LOCAL_PLAYER, M08_weapon.sniper_rifle, 1, true, true, true)
                                        • m08.lua, line 929: inv_weapon_add_temporary(REMOTE_PLAYER, M08_weapon.sniper_rifle, 1, true, true, true)
                                        • m08.lua, line 1172: inv_weapon_add_temporary( LOCAL_PLAYER, "Explosive-RocketLauncher", nil, true, true )
                                        • m08.lua, line 1175: inv_weapon_add_temporary( REMOTE_PLAYER, "Explosive-RocketLauncher", nil, true, true )
                                        • m08.lua, line 1585: inv_weapon_add_temporary( LOCAL_PLAYER, "Explosive-RocketLauncher", nil, true, true )
                                        • m08.lua, line 1588: inv_weapon_add_temporary( REMOTE_PLAYER, "Explosive-RocketLauncher", nil, true, true )
                                        • m09.lua, line 2537: --inv_weapon_add_temporary(LOCAL_PLAYER, M09_heli_weapon, 1, true, true)
                                        • m09.lua, line 2540: inv_weapon_add_temporary(LOCAL_PLAYER, "Explosive-RocketLauncher", 1, true, true, false, true, WEAPON_LEVEL4)
                                        • m09.lua, line 2547: inv_weapon_add_temporary(REMOTE_PLAYER, M09_heli_weapon, 1, true, true)
                                        • m09.lua, line 2550: inv_weapon_add_temporary(REMOTE_PLAYER, "Explosive-RocketLauncher", 1, true, true, false, true, WEAPON_LEVEL4)
                                        • m12.lua, line 1687: inv_weapon_add_temporary(LOCAL_PLAYER, M12_TEMP_PISTOL_NAME)
                                        • m13.lua, line 1559: inv_weapon_add_temporary(LOCAL_PLAYER, M13_config.grenade, 1, true, true, false)
                                        • m13.lua, line 1561: inv_weapon_add_temporary(REMOTE_PLAYER, M13_config.grenade, 1, true, true, false)
                                        • m13.lua, line 1661: inv_weapon_add_temporary(LOCAL_PLAYER, M13_config.airstrike, 1, true, true, false)
                                        • m13.lua, line 1663: inv_weapon_add_temporary(REMOTE_PLAYER, M13_config.airstrike, 1, true, true, false)
                                        • m13.lua, line 2482: inv_weapon_add_temporary(LOCAL_PLAYER, M13_config.airstrike, 1, true, true, false)
                                        • m13.lua, line 2484: inv_weapon_add_temporary(REMOTE_PLAYER, M13_config.airstrike, 1, true, true, false)
                                        • m17.lua, line 2942: inv_weapon_add_temporary(LOCAL_PLAYER, M17_TEMP_PISTOL_NAME, 1, false, true)
                                        • m18.lua, line 1387: inv_weapon_add_temporary(LOCAL_PLAYER, "Pistol-Gang", 1, true, true)
                                        • m18.lua, line 1389: inv_weapon_add_temporary(REMOTE_PLAYER, "Pistol-Gang", 1, true, true)
                                        • m18.lua, line 1923: inv_weapon_add_temporary(LOCAL_PLAYER, "Special-SonicGun", 1, true, true, false)
                                        • m18.lua, line 1925: inv_weapon_add_temporary(REMOTE_PLAYER, "Special-SonicGun", 1, true, true, false)
                                        • m18.lua, line 2872: inv_weapon_add_temporary(LOCAL_PLAYER, M18_tweak_values.player_smg, 1, true, true, true) -- SMG has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m18.lua, line 2898: inv_weapon_add_temporary(REMOTE_PLAYER, M18_tweak_values.player_smg, 1, true, true, true) -- SMG has unlimited ammo and is equipped immediatly, and dual weidling
                                        • m18.lua, line 3641: inv_weapon_add_temporary(LOCAL_PLAYER, "Special-SonicGun", 1, true, equip, false)
                                        • m18.lua, line 3646: inv_weapon_add_temporary(REMOTE_PLAYER, "Special-SonicGun", 1, true, equip, false)
                                        • m20.lua, line 560: inv_weapon_add_temporary(LOCAL_PLAYER, M20_weapon.rc_gun, 1, true, false, false, false, WEAPON_LEVEL4)
                                        • m20.lua, line 620: inv_weapon_add_temporary(LOCAL_PLAYER, M20_weapon.rc_gun, 1, true, false, false, false, WEAPON_LEVEL4)
                                        • m21.lua, line 1485: inv_weapon_add_temporary(LOCAL_PLAYER, "chainsaw", 1, true, true)
                                        • m21.lua, line 1487: inv_weapon_add_temporary(REMOTE_PLAYER, "chainsaw", 1, true, true)
                                        • m22.lua, line 3311: inv_weapon_add_temporary(LOCAL_PLAYER, KIA_TEMPORARY_WEAPON, 1, false, false, false, true)
                                        • m22.lua, line 3314: inv_weapon_add_temporary(LOCAL_PLAYER, KIA_TEMPORARY_GRENADE, 2, false, false, false, true, WEAPON_LEVEL4)
                                        • m22.lua, line 3316: inv_weapon_add_temporary(REMOTE_PLAYER, KIA_TEMPORARY_WEAPON, 1, false, false, false, true)
                                        • m22.lua, line 3319: inv_weapon_add_temporary(REMOTE_PLAYER, KIA_TEMPORARY_GRENADE, 2, false, false, false, true, WEAPON_LEVEL4)
                                        • m22.lua, line 4371: inv_weapon_add_temporary(triggerer, KIA_TEMPORARY_GRENADE, 0, false, false, false, true, WEAPON_LEVEL4)
                                        • m24.lua, line 1276: inv_weapon_add_temporary(LOCAL_PLAYER, M24_PLAYER_RIFLE, 1, true, true, false, true, WEAPON_LEVEL4)
                                        • m24.lua, line 1277: inv_weapon_add_temporary(REMOTE_PLAYER, M24_PLAYER_RIFLE, 1, true, true, false, true, WEAPON_LEVEL4)
                                        • mm_p_01.lua, line 112: inv_weapon_add_temporary( LOCAL_PLAYER, "Explosive-RocketLauncher" )
                                        • mm_p_01.lua, line 114: inv_weapon_add_temporary( REMOTE_PLAYER, "Explosive-RocketLauncher" )
                                        inv_weapon_disable_all_but_this_slot true
                                          22
                                          inv_weapon_disable_all_slots true
                                            33
                                            inv_weapon_disable_slot true
                                              18
                                              inv_weapon_remove_temporary true
                                                58
                                                is_a_vehicle true
                                                  1
                                                  is_player_tag true 1 3
                                                  is_rappelling true
                                                    4
                                                    is_syn_tower_destroyed true
                                                      1
                                                      item_anim_play true
                                                        3
                                                        item_hide true
                                                          3
                                                          item_show true
                                                            2