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)
damage_indicator_off true
    18
    damage_indicator_on true
      23
      • bh07.lua, line 978: --damage_indicator_on(0, CHAR_CLERK_STORE, 0, TEXT_SHOP_OWNER_HEALTH)
      • bh10.lua, line 912: damage_indicator_on(0,CHAR_MAERO,0.0, "bh11_maeros_health")
      • bh11.lua, line 291: damage_indicator_on( 0, MONSTER_TRUCK, 0, "bh11_maeros_health" )
      • bh11.lua, line 579: damage_indicator_on( 0, MONSTER_TRUCK, 0, "bh11_maeros_health" )
      • coop_test.lua, line 18: damage_indicator_on(0,"coop_test_$c000",0.0, "rn10_hud_akuji_health")
      • em01.lua, line 2027: damage_indicator_on(0, JULIUS_VEHICLE, 0.0, "em01_bar_label", get_max_hit_points(JULIUS_VEHICLE), SYNC_ALL)
      • ep03.lua, line 358: damage_indicator_on( 0, ULTOR_GETAWAY_BOAT, 0, TEXT_HEALTH_BAR, get_current_hit_points(ULTOR_GETAWAY_BOAT) )
      • rn04.lua, line 642: damage_indicator_on(1, CHARACTER_GAT,0.0, HELPTEXT_HUD_GAT_HEALTH)
      • rn06.lua, line 445: damage_indicator_on(0, CHARACTER_JYUNICHI,0.0, HELPTEXT_HUD_HEALTH_JYUNICHI)
      • rn09.lua, line 350: damage_indicator_on(0,CHARACTER_SHOGO,0.0,HELPTEXT_HUD_SHOGO_HEALTH)
      • rn09.lua, line 583: damage_indicator_on(0,CHARACTER_SHOGO,0.0, HELPTEXT_HUD_SHOGO_HEALTH)
      • rn09.lua, line 619: damage_indicator_on(0,CHARACTER_SHOGO,0.0, HELPTEXT_HUD_SHOGO_HEALTH)
      • rn10.lua, line 1238: damage_indicator_on(0,CHARACTER_AKUJI,0.0, HELPTEXT_HUD_AKUJI_HEALTH)
      • rn11.lua, line 415: damage_indicator_on(0, CHARACTER_AKUJI,0.0, HELPTEXT_HUD_AKUJI_HEALTH)
      • rn11.lua, line 839: damage_indicator_on(0, CHARACTER_AKUJI,0.0, HELPTEXT_HUD_AKUJI_HEALTH)
      • sh_bh_chinatown.lua, line 401: damage_indicator_on(0, merchants[i], 0, "MSN_SH_BH_CHINATOWN_SHOP_OWNER_BAR")
      • sh_bh_chinatown.lua, line 566: damage_indicator_on(0,"sh_bh_chinatown_$cPagoda", 0, "MSN_SH_BH_CHINATOWN_HOTEL_OWNER_BAR")
      • ss04.lua, line 620: damage_indicator_on( VC_HEALTH_BAR_INDEX, AUSSIE_VC_NAME, 0, HT_VETERAN_CHILDS_HEALTH, hit_points_to_set )
      • ss04.lua, line 697: damage_indicator_on( VC_HEALTH_BAR_INDEX, VETERAN_CHILD_NAME, 0, HT_VETERAN_CHILDS_HEALTH, hit_points_to_set )
      • ss09.lua, line 572: damage_indicator_on( 0, MR_SUNSHINE_NAME, 0, HT_MR_SUNSHINE_HEALTH, sunshine_hit_points )
      • ss11.lua, line 1053: damage_indicator_on( 0, GENERALS_RIDE, 0, HT_GENERALS_RIDE_HP, generals_ride_hp )
      • ss11.lua, line 1364: damage_indicator_on( 0, THE_GENERAL_NAME, 0, HT_GENERALS_HP, general_max_hp )
      • tss01.lua, line 4539: damage_indicator_on(0, HIGH_SEAS_VEHICLE, 0.0, "tss01_boat_health", get_max_hit_points(HIGH_SEAS_VEHICLE), SYNC_ALL)
      debug_print true
        383
        demo_derby_cancel true
          1
          demo_derby_get_menu_type true
            1
            demo_derby_sp_tournament_select true
              1
              demo_derby_update_options true
                5
                demo_derby_validate_points true
                  1
                  • demo_derby.lua, line 218: if Demo_derby_points_spent > Demo_derby_max_points and demo_derby_validate_points() == true then
                  dialog_box_create_internal true
                    1
                    • dialog_box.lua, line 208: local handle = dialog_box_create_internal(header, body, callback, priority, is_confirmation, is_spinner, options[0], options[1], options[2], options[3], default, is_close_on_death, is_close_on_damage)
                    dialog_box_disconnect true
                      1
                      dialog_box_force_close true
                        5
                        dialog_box_force_close_all true
                          3
                          dialog_box_set_result true
                            3
                            dialog_coop_invite_start_pressed true
                              1
                              dialog_coop_invite_timeout true
                                1
                                dialog_pause_unpause true
                                  1
                                  distance_display_off true
                                    24
                                    distance_display_on true
                                      14
                                      • ep04.lua, line 838: distance_display_on( VOGELS_LIMO_NAME, 0, VOGELS_LIMO_MAX_DIST_METERS, 0, VOGELS_LIMO_MAX_DIST_METERS, SYNC_ALL )
                                      • rn05.lua, line 1143: distance_display_on(Escape_vehicle,0,failure_dist[Escape_vehicle],0.0,failure_dist[Escape_vehicle], SYNC_ALL)
                                      • rn09.lua, line 584: distance_display_on(VEHICLE_SHOGO_MOTORCYCLE,0.0,shogo_flee_dist,0.0,shogo_flee_dist, SYNC_ALL)
                                      • rn11.lua, line 902: distance_display_on(CHARACTER_AKUJI, 0, 50.0, 0, 50.0, player_sync[player])
                                      • rn11.lua, line 946: distance_display_on(Escape_vehicle,0,failure_dist[Escape_vehicle],0.0,failure_dist[Escape_vehicle], SYNC_ALL)
                                      • rn11.lua, line 1157: distance_display_on(VEHICLE_SPEEDBOAT1,0.0,failure_distance,0.0,failure_distance, SYNC_ALL)
                                      • rn11.lua, line 1210: distance_display_on(VEHICLE_SPEEDBOAT1,SPEEDBOAT_CLOSE_RANGE_M,5000.0,0.0,SPEEDBOAT_CLOSE_RANGE_M, SYNC_ALL)
                                      • rn11.lua, line 1211: distance_display_on(VEHICLE_SPEEDBOAT2,SPEEDBOAT_CLOSE_RANGE_M,5000.0,0.0,SPEEDBOAT_CLOSE_RANGE_M, SYNC_ALL)
                                      • sh_bh_airport.lua, line 118: --distance_display_on("sh_bh_airport_$tComputer", 0, 15, 0, 15, SYNC_LOCAL)
                                      • sh_bh_docks.lua, line 243: distance_display_on("sh_bh_docks_$v001", 0, 60, 0, 60, SYNC_ALL)
                                      • ss05.lua, line 1319: distance_display_on( LAB_FOUR_ESCAPE_VEHICLE, 0, LAB_TECH_CHASE_DISTANCE_METERS, 0, LAB_TECH_CHASE_DISTANCE_METERS, SYNC_ALL )
                                      • ss08.lua, line 995: distance_display_on( DRUG_TRUCK, 0, DRUG_TRUCK_MAX_DISTANCE_METERS, 0, DRUG_TRUCK_MAX_DISTANCE_METERS, SYNC_ALL )
                                      • ss10.lua, line 796: distance_display_on( REPAIR_VAN_NAME, 0, REPAIR_VAN_CHASE_DISTANCE_METERS, 0, REPAIR_VAN_CHASE_DISTANCE_METERS, SYNC_ALL )
                                      • ss10.lua, line 1138: distance_display_on( SHAUNDI_REPAIR_VARIANT_NAME, 0, SHAUNDI_ABANDONED_DISTANCE_METERS, 0, SHAUNDI_ABANDONED_DISTANCE_METERS, SYNC_LOCAL )
                                      district_set_pulsing true
                                        8
                                        door_close true
                                          22
                                          door_is_open true
                                            8
                                            • tss01.lua, line 1315: local back_door_closed = not door_is_open(Tss01_doors[BACK_DOOR])
                                            • tss01.lua, line 1316: local front_doors_closed = not door_is_open(Tss01_doors[FRONT_DOOR_1]) and not door_is_open(Tss01_doors[FRONT_DOOR_2])
                                            • tss01.lua, line 1316: local front_doors_closed = not door_is_open(Tss01_doors[FRONT_DOOR_1]) and not door_is_open(Tss01_doors[FRONT_DOOR_2])
                                            • tss01.lua, line 1402: back_door_closed = not door_is_open(Tss01_doors[BACK_DOOR])
                                            • tss01.lua, line 1403: front_doors_closed = not door_is_open(Tss01_doors[FRONT_DOOR_1]) and not door_is_open(Tss01_doors[FRONT_DOOR_2])
                                            • tss01.lua, line 1403: front_doors_closed = not door_is_open(Tss01_doors[FRONT_DOOR_1]) and not door_is_open(Tss01_doors[FRONT_DOOR_2])
                                            • tss01.lua, line 2523: -- while (not door_is_open(Tss01_doors[KEY_DOOR])) do
                                            • tss01.lua, line 2560: while (not door_is_open(Tss01_doors[KEY_DOOR])) do
                                            door_lock true
                                              186
                                              door_message_override true
                                                9
                                                door_open true
                                                  68
                                                  drug_effect_set_override_values true
                                                    8
                                                    drug_enable_disable_effect_override true
                                                      10
                                                      dump_fps_tagged true
                                                        16