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)
game_difficulty_select true
    4
    gang_customization_change_tag true
      1
      gang_customization_confirm_gang_sign true
        1
        gang_customization_confirm_vehicle true
          1
          gang_customization_revert_gang_sign true
            1
            gang_customization_revert_gang_tag true
              1
              gang_customization_revert_to_old_gang true
                1
                gang_customization_revert_vehicle true
                  1
                  gang_customization_select_gang_sign true
                    1
                    gang_customization_select_gang_style true
                      1
                      gang_customization_select_gang_tag true
                        1
                        gang_customization_select_vehicle true
                          1
                          • gang_cust.lua, line 282: gang_customization_select_vehicle(Gang_cust_vehicle_submenu.highlighted_item, Vehicle_slot)
                          gang_customization_show_gang true
                            1
                            gang_customization_show_tag true
                              1
                              gang_customization_show_vehicle true
                                2
                                gang_force_spawn true
                                  3
                                  garage_get_repair_cost true
                                    2
                                    garage_preview_vehicle true
                                      2
                                      garage_remove_vehicle true
                                        1
                                        garage_repair_vehicle true
                                          1
                                          garage_retrieve_vehicle true
                                            2
                                            get_char_in_vehicle true
                                              9
                                              get_char_vehicle_is_in_air true
                                                2
                                                • tss04.lua, line 727: if ( get_char_vehicle_is_in_air( human ) == false and cur_speed <= LIEUTENANT_LEAVE_VEHICLE_MAX_SPEED_MPH ) then
                                                • tss04.lua, line 730: if ( get_char_vehicle_is_in_air( human ) == false and cur_speed <= LIEUTENANT_LEAVE_VEHICLE_MAX_SPEED_MPH ) then
                                                get_char_vehicle_name true
                                                  8
                                                  get_char_vehicle_special_type true
                                                    1
                                                    get_char_vehicle_towed_vehicle true
                                                      1
                                                      get_char_vehicle_type true
                                                        28
                                                        get_coop_friendly_fire true
                                                          3
                                                          get_coop_join_type true
                                                            4
                                                            get_current_difficulty true
                                                              1
                                                              get_current_hit_points true
                                                                51
                                                                • bh03.lua, line 977: local before_damage_percent = get_current_hit_points( ESCAPE_HELICOPTER ) / get_max_hit_points( ESCAPE_HELICOPTER )
                                                                • bh04.lua, line 270: Bh04_donnie_initial_hp = get_current_hit_points(CHAR_DONNIE)
                                                                • bh04.lua, line 368: local health_ratio = get_current_hit_points(CHAR_DONNIE) / Bh04_donnie_initial_hp
                                                                • bh04.lua, line 583: local Bergen_hp = get_current_hit_points(BERGEN)
                                                                • bh06.lua, line 317: PARCEL_TRUCK_INITIAL_HP = get_current_hit_points(VEH_PARCEL_TRUCK)
                                                                • bh07.lua, line 971: local shop_owner_initial_health = get_current_hit_points(CHAR_CLERK_STORE)
                                                                • bh07.lua, line 993: hit_points[j] = get_current_hit_points(lnpc)
                                                                • bh07.lua, line 1003: if not character_is_dead(npc) and (get_current_hit_points(npc) - hit_points[i]) < -50 then
                                                                • bh07.lua, line 1007: hit_points[j] = get_current_hit_points(lnpc)
                                                                • bh07.lua, line 1017: if (get_current_hit_points(npc) - hit_points[i]) < -50 then
                                                                • bh07.lua, line 1021: hit_points[j] = get_current_hit_points(lnpc)
                                                                • bh07.lua, line 1035: hit_points[j] = get_current_hit_points(lnpc)
                                                                • bh10.lua, line 868: local old_hit_points = get_current_hit_points(player)
                                                                • bh10.lua, line 1502: local old_hit_points = get_current_hit_points(CHAR_MAERO)
                                                                • bh11.lua, line 152: local pre_attack_hit_points = get_current_hit_points( attacked_object_name )
                                                                • bh11.lua, line 280: local cur_hp = get_current_hit_points(MONSTER_TRUCK)
                                                                • bh11.lua, line 562: local new_truck_hp = get_current_hit_points( MONSTER_TRUCK ) - hit_points_damage_done
                                                                • em01.lua, line 1888: local last_percentage = get_current_hit_points(JULIUS_VEHICLE) / get_max_hit_points(JULIUS_VEHICLE)
                                                                • em01.lua, line 1895: percentage = get_current_hit_points(JULIUS_VEHICLE) / get_max_hit_points(JULIUS_VEHICLE)
                                                                • ep01.lua, line 1803: local new_health = get_current_hit_points(CHARACTER_PIERCE) - rand_int(min_damage, max_damage)
                                                                • ep03.lua, line 350: local Current_hit_points = get_current_hit_points(ULTOR_GETAWAY_BOAT)
                                                                • ep03.lua, line 433: ( get_current_hit_points(boat) > BOAT_HEALTH_THRESHOLD or get_dist_char_to_vehicle(LOCAL_PLAYER, boat) > BOAT_DISTANCE_THRESHOLD ) ) do
                                                                • ep04.lua, line 662: local cur_damage_percent = get_current_hit_points( VOGEL_NAME ) / get_max_hit_points( VOGEL_NAME )
                                                                • ep04.lua, line 692: local vogel_hp = get_current_hit_points( VOGEL_NAME )
                                                                • ep04.lua, line 887: local cur_hp = get_current_hit_points( VOGELS_LIMO_NAME )
                                                                • ep04.lua, line 902: local cur_limo_hp_percent = ( get_current_hit_points( VOGELS_LIMO_NAME ) / get_max_hit_points( VOGELS_LIMO_NAME ) )
                                                                • rn02.lua, line 608: if (get_current_hit_points(VEHICLE_PLAYER_CAR)/get_max_hit_points(VEHICLE_PLAYER_CAR) < .8) then
                                                                • rn04.lua, line 761: local gat_hit_points = get_current_hit_points(CHARACTER_GAT)
                                                                • rn04.lua, line 1599: local gat_current_health = get_current_hit_points(CHARACTER_GAT)
                                                                • rn04.lua, line 1600: local gat_health_ratio = get_current_hit_points(CHARACTER_GAT)/get_max_hit_points(CHARACTER_GAT)
                                                                • rn04.lua, line 1630: local health_ratio = get_current_hit_points(Rn04_vehicle_homie)/get_max_hit_points(Rn04_vehicle_homie)
                                                                • rn07.lua, line 545: Rn07_gat_health = get_current_hit_points(CHARACTER_GAT)
                                                                • rn07.lua, line 1607: local old_hit_points = get_current_hit_points(gat)
                                                                • rn07.lua, line 1662: local old_hit_points = get_current_hit_points(gat)
                                                                • rn07.lua, line 1734: local gat_current_hit_points = get_current_hit_points(CHARACTER_GAT_NORMAL)
                                                                • rn08.lua, line 1218: local hit_points = get_current_hit_points(target)
                                                                • sh_bh_chinatown.lua, line 427: merch_damage = get_current_hit_points(npc_name)
                                                                • sh_bh_chinatown.lua, line 442: if (get_current_hit_points(merchants[i]) < get_max_hit_points(merchants[i])) then
                                                                • sh_bh_chinatown.lua, line 506: while (get_current_hit_points(merchant_name) > 0) do
                                                                • ss01.lua, line 934: local new_car_hp = MR_GABBY_CAR_HIT_POINTS_PERCENT * get_current_hit_points( FINAL_DEALER_GROUP_VEHICLE_NAME )
                                                                • ss03.lua, line 501: local CURRENT_HELI_HITPOINTS = get_current_hit_points(HELICOPTER_NAME)
                                                                • ss03.lua, line 1263: local helicopter_hit_points = get_current_hit_points( HELICOPTER_NAME )
                                                                • ss04.lua, line 867: VC_pre_hit_damage_percent = get_current_hit_points( VETERAN_CHILD_NAME ) / get_max_hit_points( VETERAN_CHILD_NAME )
                                                                • ss04.lua, line 885: local percent_damage_before_hit = get_current_hit_points( VETERAN_CHILD_NAME ) / vc_max_hp
                                                                • ss08.lua, line 1522: local cur_truck_hp = get_current_hit_points( DRUG_TRUCK )
                                                                • ss09.lua, line 356: local cur_health_percent = get_current_hit_points( attacked_object_name ) / get_max_hit_points( attacked_object_name )
                                                                • ss09.lua, line 816: local percent_damage_before_hit = get_current_hit_points( MR_SUNSHINE_NAME ) / sunshine_max_hp
                                                                • ss09.lua, line 970: local sunshine_current_hit_points = get_current_hit_points( MR_SUNSHINE_NAME )
                                                                • ss09.lua, line 997: local player_cur_hit_points = get_current_hit_points( player_name )
                                                                • ss10.lua, line 1911: Initial_van_hp = get_current_hit_points( REPAIR_VAN_NAME ) * VAN_HP_MULTIPLIER
                                                                • ss10.lua, line 2245: local cur_van_hp = get_current_hit_points( REPAIR_VAN_NAME )
                                                                get_current_hood_by_position true
                                                                  1
                                                                  get_disconnected_reason true
                                                                    1
                                                                    get_dist true
                                                                      127
                                                                      get_frame_time true
                                                                        29
                                                                        get_frame_time_real true
                                                                          1
                                                                          get_game_play_mode true
                                                                            5
                                                                            get_game_time true
                                                                              1
                                                                              get_height true
                                                                                2
                                                                                get_is_coop_client true
                                                                                  1
                                                                                  get_is_custom_game true
                                                                                    2
                                                                                    get_is_host true
                                                                                      41
                                                                                      get_is_matchmaking true
                                                                                        8
                                                                                        get_is_strongarm true
                                                                                          4
                                                                                          get_is_team_game true
                                                                                            1
                                                                                            get_is_tutorial true
                                                                                              1
                                                                                              get_language true
                                                                                                17
                                                                                                get_max_hit_points true
                                                                                                  57
                                                                                                  get_min_width true
                                                                                                    2
                                                                                                    get_mp_is_ranked true
                                                                                                      7
                                                                                                      get_mp_map_index true
                                                                                                        2
                                                                                                        get_mp_mode_index true
                                                                                                          2
                                                                                                          get_num_mp_variants true
                                                                                                            1
                                                                                                            get_pending_game_play_mode true
                                                                                                              1
                                                                                                              get_platform true
                                                                                                                118
                                                                                                                get_player_respect true
                                                                                                                  1
                                                                                                                  get_ps3_button_swap true
                                                                                                                    2
                                                                                                                    get_vehicle_speed true
                                                                                                                      8
                                                                                                                      get_width true
                                                                                                                        6
                                                                                                                        group_create_do true
                                                                                                                          1
                                                                                                                          group_create_hidden_do true
                                                                                                                            1
                                                                                                                            group_destroy true
                                                                                                                              136
                                                                                                                              group_exists true
                                                                                                                                1
                                                                                                                                group_give_to_client true
                                                                                                                                  1
                                                                                                                                  group_hide true
                                                                                                                                    23
                                                                                                                                    group_is_loaded true
                                                                                                                                      113
                                                                                                                                      group_show true
                                                                                                                                        257