This is a (not exhaustive) reference for functions available to be called in the lua scripts used for screen rendering/interaction.
CC2 has various lua scripts that directly drive what information you see on screens, in the control seat and ship cameras. They are the way players choose to refit units, set waypoints, see and identify threats. There are broadly 3 kinds of files:
Each screen on the carrier gets its own Lua interpreter instance. Setting globals at runtime in the script will not have any effect on other screens running the same script. The same is true of the HUD except there is only ever one instance if vehicle_hud.lua running on your PC.
Scripts have the following load order:
The whole of each file is evaluated in the same lua interpreter. If you set a global outside of a function in library_enum.lua then you will be able to see the value in library_util.lua and later.
Once this is complete, the game will call the begin() function (if it is defined). For screen scripts, during the begin() call you will be able to call begin_get_ui_region_index() and begin_get_screen_name(). You will not generally be able to call any of the other update_ native functions.
Now that the script is loaded and begin has been called, the input and update functions will be called. These are called once per “refresh_interval” (see <screen> tags in game object XML files). For the HUD the update() function is called every game tick (30 times per second).
When a player is using the HUD, the update rate of other scripts is reduced to once every 30 ticks (1 time per second), and the input functions are not called. The HUD update function is only called when a player is in the HUD view.
During the input cycle, the core game makes calls to the input functions, these are used to send in text, mouse and controller inputs into the script.
Next is the update cycle, most of the heavy lifting goes on in here, these are where you can introspect the current vehicle, carrier details, weapons, map, nearby units, other players, missiles, etc. graphical/text drawing calls are made from here to draw the various icons and UI elements.
I have recently discovered there is another factor that influences how often a script update() function is called. The further away from the screen your character is, the larger the update interval. If you leave the bridge and walk down to the flight deck, by the time you get there the bridge screens will update at most only once every two seconds.
Native/C function
Can be called only during the begin() call cycle.
Returns the name value of the currently executing screen. This is the value set in <screen> in the game object XML file for the carrier (or any other unit you attach a screen to). eg:
<screen name="screen_veh_r"
display_name_loc="680"
script_file_name="scripts/screen_vehicle_control.lua"
body_index="0"
seat_index="0"
type="3"
refresh_interval="1.00000000e+00"
help_tag="veh_con_screen_vehicle_control">
If called within a begin() function in screen_vehicle_control.lua, begin_get_screen_name() would return “screen_veh_r” for this instance of the screen.
Usable in:
Example call:
screen_inventory.lua
local screen_name = begin_get_screen_name()
Native/C function
Can be called only during the begin() call cycle.
Return the index number for a specific UI icon image. This is only really used as a shortcut to memoize icon indices in library_util.lua to create the atlas_icons table (which is easier and probably faster to work with than calling this function).
Usable in:
Example call:
library_util.lua
atlas_icons[k] = begin_get_ui_region_index(k)
Lua defined function in library_util.lua
Usable in:
Example call:
interactions.lua
begin_load()
Lua defined function in library_vehicle.lua
Called early in begin() to memoize inventory item index values and cargo statistics like weight, abbreviations and costs.
Usable in:
Example call:
library_vehicle.lua
function begin_load_inventory_data()
Lua defined function in interactions.lua
Call to display the on-screen control hints in the bottom left of the screen.
Usable in:
Example call:
interactions.lua
update_add_ui_interaction(update_get_loc(e_loc.input_text_shift), e_game_input.text_shift)
Lua defined function in interactions.lua
Usable in:
Example call:
interactions.lua
update_add_ui_interaction_special(update_get_loc(e_loc.interaction_confirm), e_ui_interaction_special.chat)
Lua defined function in vehicle_hud.lua
Usable in:
Example call:
vehicle_hud.lua
update_animations(delta_time, vehicle)
Lua defined function in library_util.lua
Usable in:
Example call:
library_util.lua
if update_boot_override(screen_w, screen_h, ticks) then
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local arrow_p0 = project(update_camera_local_rotate_inv(vehicle, vec3(0, 0, length)))
Lua defined function in interactions.lua
Usable in:
Example call:
interactions.lua
update_chat(delta_time)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_create_workshop_mod(selected_mod.id, g_mod_upload_visibility)
Lua defined function in screen_vehicle_control.lua
Usable in:
Example call:
screen_vehicle_control.lua
update_cursor_state(screen_w, screen_h)
Lua defined function in screen_damage.lua
Usable in:
Example call:
screen_damage.lua
update_damage_zones(vehicle)
Native/C function
Usable in:
Example call:
pause_menu.lua
update_exit_pause_menu()
Native/C function
Usable in:
Example call:
interactions.lua
if update_get_active_input_type() == e_active_input.gamepad then
Native/C function
Usable in:
Example call:
screen_landing.lua
local angle = update_get_angle_2d(relative_position:x() + 1000, relative_position:z() - pattern_length) - (math.pi * 0.5)
Native/C function
Usable in:
Example call:
interactions.lua
local app_state = update_get_application_state()
Native/C function
Usable in:
Example call:
screen_vehicle_loadout.lua
local ammo_type = update_get_attachment_ammo_item_type(item.type)
Native/C function
Usable in:
Example call:
screen_vehicle_loadout.lua
local attachment_definition = update_get_attachment_option(attachment_type, i)
Native/C function
Usable in:
Example call:
screen_vehicle_loadout.lua
local option_count = update_get_attachment_option_count(attachment_type)
Native/C function
Usable in:
Example call:
screen_vehicle_loadout.lua
if attachment_definition > -1 and update_get_attachment_option_hidden(attachment_definition) == false then
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local projectile_velocity = update_get_camera_forward()
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local fov = update_get_camera_fov()
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local heading = update_get_camera_heading()
Native/C function
Usable in:
Example call:
vehicle_hud.lua
camera_x = update_get_camera_position():x()
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local cam_side = update_get_camera_side()
Native/C function
Usable in:
Example call:
interactions.lua
local messages = update_get_chat_messages()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
g_connect_address, g_connect_type = update_get_connect_address()
Native/C function
Usable in:
Example call:
screen_currency.lua
local log = update_get_currency_log(i)
Native/C function
Usable in:
Example call:
screen_currency.lua
local log_count = update_get_currency_log_count()
Native/C function
Usable in:
Example call:
library_vehicle.lua
local hitpoints, armour, mass = update_get_definition_vehicle_stats(index)
Native/C function
Usable in:
Example call:
screen_delivery_log.lua
local log_time, modified_tick, log = update_get_delivery_log(i)
Native/C function
Usable in:
Example call:
screen_delivery_log.lua
for i = 0, update_get_delivery_log_count() - 1 do
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local friend_games = update_get_friend_games()
Native/C function
Usable in:
Example call:
library_ui.lua
local category = update_get_game_input_category(i)
Native/C function
Usable in:
Example call:
library_ui.lua
local input_count = update_get_game_input_count()
Native/C function
Usable in:
Example call:
library_ui.lua
ui:text(update_get_loc(e_loc.rebind).." "..update_get_game_input_name(rebinding_keyboard))
Native/C function
Usable in:
Example call:
library_ui.lua
local settings = update_get_game_settings()
Native/C function
Usable in:
Example call:
library_ui.lua
local resolution_options = update_get_gfx_resolution_modes()
Native/C function
Usable in:
Example call:
library_ui.lua
local hair_color_options = update_get_hair_color_options()
Native/C function
Usable in:
Example call:
pause_menu.lua
local connect_token = update_get_host_connect_token()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local max_players = update_get_host_max_players()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
g_text["host_password"] = update_get_host_password()
Native/C function
Usable in:
Example call:
interactions.lua
return update_get_input_binding_gamepad_button(game_input), update_get_input_binding_gamepad_axis(game_input), update_get_input_binding_joystick_button(game_input), update_get_input_binding_joystick_axis(game_input)
Native/C function
Usable in:
Example call:
interactions.lua
return update_get_input_binding_gamepad_button(game_input), update_get_input_binding_gamepad_axis(game_input), update_get_input_binding_joystick_button(game_input), update_get_input_binding_joystick_axis(game_input)
Native/C function
Usable in:
Example call:
library_ui.lua
if update_get_input_binding_is_axis_inverted(input) then
Native/C function
Usable in:
Example call:
interactions.lua
return update_get_input_binding_gamepad_button(game_input), update_get_input_binding_gamepad_axis(game_input), update_get_input_binding_joystick_button(game_input), update_get_input_binding_joystick_axis(game_input)
Native/C function
Usable in:
Example call:
interactions.lua
return update_get_input_binding_gamepad_button(game_input), update_get_input_binding_gamepad_axis(game_input), update_get_input_binding_joystick_button(game_input), update_get_input_binding_joystick_axis(game_input)
Native/C function
Usable in:
Example call:
library_ui.lua
if ui:keybinding(update_get_game_input_name(input), -1, -1, update_get_input_binding_gamepad_button(input), update_get_input_binding_gamepad_axis(input), update_get_input_binding_joystick_button(input), update_get_input_binding_joystick_axis(input), update_get_input_binding_joystick_name(input), update_get_input_binding_joystick_connected(input)) then
Native/C function
Usable in:
Example call:
library_ui.lua
local joy_guid = update_get_input_binding_joystick_guid(input)
Native/C function
Usable in:
Example call:
library_ui.lua
if ui:keybinding(update_get_game_input_name(input), -1, -1, update_get_input_binding_gamepad_button(input), update_get_input_binding_gamepad_axis(input), update_get_input_binding_joystick_button(input), update_get_input_binding_joystick_axis(input), update_get_input_binding_joystick_name(input), update_get_input_binding_joystick_connected(input)) then
Native/C function
Usable in:
Example call:
interactions.lua
return update_get_input_binding_keyboard_key(game_input), update_get_input_binding_keyboard_pointer(game_input)
Native/C function
Usable in:
Example call:
interactions.lua
return update_get_input_binding_keyboard_key(game_input), update_get_input_binding_keyboard_pointer(game_input)
Native/C function
Usable in:
Example call:
library_ui.lua
ui:header(update_get_input_category_name(v))
Native/C function
Usable in:
Example call:
library_ui.lua
axis_value = clamp(update_get_input_gamepad_axis_value(item.axis), -1, 1)
Native/C function
Usable in:
Example call:
library_ui.lua
for j = 0, update_get_input_joystick_axis_count(i) - 1 do
Native/C function
Usable in:
Example call:
library_ui.lua
axis_value = clamp(update_get_input_joystick_axis_value(item.joystick, item.axis), -1, 1)
Native/C function
Usable in:
Example call:
library_ui.lua
if update_get_input_joystick_connected(i) then
Native/C function
Usable in:
Example call:
library_ui.lua
guid=update_get_input_joystick_guid(i),
Native/C function
Usable in:
Example call:
library_ui.lua
name=update_get_input_joystick_name(i)
Native/C function
Usable in:
Example call:
interactions.lua
if update_get_is_chat_box_available() then
Native/C function
Usable in:
Example call:
library_ui.lua
is_selected = is_selected and update_get_is_focus_local()
Native/C function
Usable in:
Example call:
pause_menu.lua
if update_get_is_hosting_game() then
Native/C function
Usable in:
Example call:
library_ui.lua
if update_get_is_input_rebindable_gamepad(i) or update_get_is_input_rebindable_gamepad_as_axis(i) then
Native/C function
Usable in:
Example call:
library_ui.lua
if update_get_is_input_rebindable_gamepad(i) or update_get_is_input_rebindable_gamepad_as_axis(i) then
Native/C function
Usable in:
Example call:
library_ui.lua
if update_get_is_input_rebindable_keyboard(i) then
Native/C function
Usable in:
Example call:
interactions.lua
if is_multiplayer and is_host == false and app_state == e_game_state.main_simulation and update_get_is_loading() == false then
Native/C function
Usable in:
Example call:
interactions.lua
local is_multiplayer, is_host = update_get_is_multiplayer()
Native/C function
Usable in:
Example call:
screen_holomap.lua
if update_get_is_notification_holomap_set() == false then
Native/C function
Usable in:
Example call:
pause_menu.lua
if ui:list_item(update_get_loc(e_loc.upp_return_to_bridge), true, update_get_is_respawn_menu_option_available()) then
Native/C function
Usable in:
Example call:
pause_menu.lua
if ui:list_item(update_get_loc(e_loc.upp_save), true, update_get_is_save_game_available()) then
Native/C function
Usable in:
Example call:
interactions.lua
if update_get_is_show_controls() then
Native/C function
Usable in:
Example call:
interactions.lua
if update_get_is_show_subtitles() then
Native/C function
Usable in:
Example call:
interactions.lua
if update_get_is_show_tooltips() then
Native/C function
Usable in:
Example call:
interactions.lua
if update_get_is_show_voice_chat_others() then
Native/C function
Usable in:
Example call:
interactions.lua
if update_get_is_show_voice_chat_self() then
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if update_get_is_show_vr_multiplayer_warning() then
Native/C function
Return true if the game is running in VR mode.
Usable in:
Example call:
library_ui.lua
if update_get_is_vr() == false then
Native/C function
Usable in:
Example call:
screen_menu_main.lua
g_text["join_password"] = update_get_join_password()
Native/C function
Usable in:
Example call:
interactions.lua
[e_ui_interaction_special.cancel_rebind] = { text = update_get_key_name(259) },
Native/C function
Usable in:
Example call:
interactions.lua
return iff(update_get_keyboard_back_opens_pause(), { { input = e_game_input.pause}, { input = e_game_input.back } }, { { input = e_game_input.pause } })
Native/C function
Return the localized string for the given index word/phrase from the e_loc enum table. Eg, in English, the following:
update_get_loc(e_loc.upp_paste)
Will return “paste”.
Usable in:
Example call:
interactions.lua
self.title = update_get_loc(e_loc.tut_complete_title)
Native/C function
Get the ID of the current player.
Usable in:
Example call:
pause_menu.lua
local is_self = g_tab_multiplayer.selected_peer_id == update_get_local_peer_id()
Native/C function
Get the team ID of the current player.
Usable in:
Example call:
pause_menu.lua
return def == e_game_object_type.chassis_carrier and v:get_team_id() == update_get_local_team_id()
Native/C function
Get the logic tick. This is the game simulation counter starting at zero the moment the map is crated. It increments by one every simulation frame. The game is tuned such that a second of real time covers 30 game ticks.
During the span of an update function call, the value of the current tick will remain the same.
It can be thought of as a primitive low-res clock.
Usable in:
Example call:
library_ui.lua
return iff(update_get_logic_tick() % rate < rate / 2, col0, col1)
Native/C function
Get an object representing a recently destroyed vehicle. Used along with update_get_map_destroyed_vehicle_count().
Destroyed vehicles have several methods.
destroyed:get_position_xz() vec3 where vec3:x() is the x coordinate of the destroyed vehicle and vec3:y() is the z map coordinate of the vehicle (yes, y/z flip don't worry about it)destroyed:get_team() destroyed:get_factor() Usable in:
Example call:
screen_vehicle_control.lua
local destroyed_vehicle = update_get_map_destroyed_vehicle(i)
Native/C function
Get the number of destroyed vehicles visible on the game map.
Usable in:
Example call:
screen_vehicle_control.lua
local destroyed_vehicle_count = update_get_map_destroyed_vehicle_count()
Native/C function
Get an object representing a player or AI controlled unit in game, the unit may be docked or active.
The HUD can obtain 3D position (lat-lon-alt) information about a unit where the screen scripts can only obtain 2D (lat-lon). The HUD can also not see unit waypoints where as screens can fully get/set waypoint data.
vehicle objects have many methods, the most commonly used are:
vehicle:get()true if this object can be used and is valid.vehicle:get_id()vehicle:get_definition_index()e_game_object_type table)vehicle:get_team() (screen only)vehicle:get_team_id() (HUD only)vehicle:get_position_xz() (screen only)vec2vehicle:get_position() (HUD only)vec3 where pos:y() is the altitude in meters.Usable in:
Example call:
library_ui.lua
local attached_vehicle = update_get_map_vehicle_by_id(attached_vehicle_id)
Native/C function
Usable in:
Example call:
pause_menu.lua
vehicle = update_get_map_vehicle_by_index(index)
Native/C function
Usable in:
Example call:
pause_menu.lua
local vehicle_count = update_get_map_vehicle_count()
Native/C function
Usable in:
Example call:
screen_landing.lua
local relative_position = update_get_map_vehicle_position_relate_to_parent_vehicle(vehicle_parent:get_id(), vehicle:get_id())
Native/C function
Usable in:
Example call:
interactions.lua
local type = update_get_message_box_type()
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local consuming_missile = update_get_missile_by_id(id)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
local missile = update_get_missile_by_index(i)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
local missile_count = update_get_missile_count()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local mods = update_get_mod_details()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local incompatible_mods = update_get_mod_incompatible_active_mods(selected_mod.id)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local workshop_upload_status = update_get_mod_workshop_upload_status()
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local flight_axis = update_get_mouse_flight_axis()
Native/C function
Usable in:
Example call:
interactions.lua
local mouse_flight_mode = update_get_mouse_flight_mode()
Native/C function
Usable in:
Example call:
interactions.lua
local network_time_since_recv = update_get_network_time_since_recv() / 1000
Native/C function
Usable in:
Example call:
interactions.lua
local timeout = update_get_network_timeout() / 1000
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local base_difficulty = update_get_new_game_base_difficulty()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local blueprints_type = update_get_new_game_blueprints()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local carrier_count_per_team = update_get_new_game_carrier_count_per_team()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local is_tutorial = update_get_new_game_is_tutorial()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local island_count = update_get_new_game_island_count()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local island_count_per_team = update_get_new_game_island_count_per_team()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local loadout_type = update_get_new_game_loadout_type()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local team_count_ai = update_get_new_game_team_count_ai()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local team_count_human = update_get_new_game_team_count_human()
Native/C function
Usable in:
Example call:
screen_holomap.lua
local notification = update_get_notification_holomap()
Native/C function
Usable in:
Example call:
screen_ship_log.lua
local log = update_get_notification_log(i)
Native/C function
Usable in:
Example call:
screen_ship_log.lua
local log_count = update_get_notification_log_count()
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
update_ui_text(1, 1, string.format(update_get_loc(e_loc.upp_ocean_current)..": %.2f", update_get_ocean_current_velocity(sample_x, sample_y)), label_w, 0, color_white, 0)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
update_ui_text(1, 1, string.format(update_get_loc(e_loc.upp_ocean_depth)..": %.2f", update_get_ocean_depth_factor(sample_x, sample_y)), label_w, 0, color_white, 0)
Native/C function
Usable in:
Example call:
pause_menu.lua
local peer_count = update_get_peer_count()
Native/C function
Usable in:
Example call:
pause_menu.lua
local id = update_get_peer_id(i)
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local peer_index = update_get_peer_index_by_id(controlling_peer_id)
Native/C function
Usable in:
Example call:
pause_menu.lua
local is_admin = update_get_peer_is_admin(i)
Native/C function
Usable in:
Example call:
pause_menu.lua
if update_get_peer_is_voice_muted(i) then
Native/C function
Usable in:
Example call:
pause_menu.lua
if update_get_peer_is_voice_transmit(i) then
Native/C function
Usable in:
Example call:
pause_menu.lua
local name = update_get_peer_name(i)
Native/C function
Usable in:
Example call:
pause_menu.lua
local team = update_get_peer_team(i)
Native/C function
Usable in:
Example call:
library_ui.lua
local rebinding_gamepad = update_get_rebinding_gamepad()
Native/C function
Usable in:
Example call:
library_ui.lua
local rebinding_keyboard = update_get_rebinding_keyboard()
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_text(10, cy, "render buffer age: " .. update_get_render_buffer_age() .. "ms", screen_w, 0, color_white, 0)
Native/C function
Usable in:
Example call:
library_vehicle.lua
for i = 0, update_get_resource_inventory_category_count() - 1 do
Native/C function
Usable in:
Example call:
library_vehicle.lua
local category_index, category_name, icon_name = update_get_resource_inventory_category_data(i)
Native/C function
Usable in:
Example call:
library_vehicle.lua
for i = 0, update_get_resource_inventory_item_count() - 1 do
Native/C function
Usable in:
Example call:
library_vehicle.lua
local item_type, item_category, item_mass, item_production_cost, item_production_time, item_name, item_desc, icon_name, transfer_duration = update_get_resource_inventory_item_data(i)
Native/C function
Usable in:
Example call:
screen_vehicle_loadout.lua
if update_get_resource_item_for_definition(item.type) ~= -1 then
Native/C function
Usable in:
Example call:
library_ui.lua
if update_get_resource_item_hidden(item.index) == false then
Native/C function
Usable in:
Example call:
screen_inventory.lua
if update_get_resource_item_hidden_facility_production(item.index) == false then
Native/C function
Usable in:
Example call:
pause_menu.lua
local respawn_carrier_id = update_get_respawn_carrier_id()
Native/C function
Usable in:
Example call:
pause_menu.lua
local save_slots = update_get_save_slots()
Native/C function
Usable in:
Example call:
library_ui.lua
return is_held and update_get_screen_input(input)
Native/C function
Usable in:
Example call:
screen_carrier_camera.lua
elseif update_get_is_focus_local() and update_get_screen_state_active() then
Native/C function
Usable in:
Example call:
screen_inventory.lua
if tile:get() and tile:get_team_control() == update_get_screen_team_id() then
Native/C function
Usable in:
Example call:
library_util.lua
local this_vehicle = update_get_screen_vehicle()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local server_list = update_get_server_list()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local is_meta_set, meta = update_get_server_meta()
Native/C function
Usable in:
Example call:
screen_menu_main.lua
g_server_name = update_get_server_name()
Native/C function
Usable in:
Example call:
library_ui.lua
local skin_color_options = update_get_skin_color_options()
Native/C function
Usable in:
Example call:
library_ui.lua
local team = update_get_team(vehicle:get_team())
Native/C function
Usable in:
Example call:
pause_menu.lua
local team_color = update_get_team_color(vehicle:get_team_id())
Native/C function
Usable in:
Example call:
screen_transmissions.lua
for i = 0, update_get_team_transmission_count() - 1 do
Native/C function
Usable in:
Example call:
screen_transmissions.lua
if imgui_transmission_button(ui, update_get_team_transmission_name(i), is_unread, is_playing) then
Native/C function
Usable in:
Example call:
screen_currency.lua
local tile = update_get_tile_by_id(id)
Native/C function
Usable in:
Example call:
pause_menu.lua
local tile = update_get_tile_by_index(i)
Native/C function
Usable in:
Example call:
pause_menu.lua
local tile_count = update_get_tile_count()
Native/C function
Usable in:
Example call:
interactions.lua
self.open_time = update_get_time_ms()
Native/C function
Usable in:
Example call:
screen_transmissions.lua
local playback_progress = update_get_transmission_playback_progress()
Native/C function
Usable in:
Example call:
screen_transmissions.lua
local transmission_playing_index = update_get_transmission_playing_index()
Native/C function
Usable in:
Example call:
interactions.lua
g_ui_scale = update_get_ui_scale()
Native/C function
Usable in:
Example call:
library_util.lua
local this_vehicle_object = update_get_vehicle_by_id(this_vehicle:get_id())
Native/C function
Usable in:
Example call:
library_ui.lua
local version_col = iff(version == update_get_version(), detail_col, color_status_bad)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
local vehicle_id, direction_xz, tick = update_get_weapon_line_by_index(i)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
local weapon_line_count = update_get_weapon_line_count()
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
update_ui_text(1, 1, string.format(update_get_loc(e_loc.upp_visibility)..": %.0f%%", update_get_weather_fog_factor(sample_x, sample_y) * 100), label_w, 0, color_white, 0)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
update_ui_text(cx, 1, string.format(": %.0f%%", update_get_weather_lightning_factor(sample_x, sample_y) * 100), label_w, 0, color_white, 0)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
update_ui_text(1, 1, string.format(update_get_loc(e_loc.upp_precipitation)..": %.0f%%", update_get_weather_precipitation_factor(sample_x, sample_y) * 100), label_w, 0, color_white, 0)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
update_ui_text(1, 1, string.format(update_get_loc(e_loc.upp_wind)..": %.2f", update_get_weather_wind_velocity(sample_x, sample_y)), label_w, 0, color_white, 0)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
local published_mods = update_get_workshop_published_mods()
Lua defined function in vehicle_hud.lua
Usable in:
Example call:
vehicle_hud.lua
-- update_gun_funnel(tick_fraction, vehicle, gun_funnel_side_dist, gun_funnel_forward_dist)
Lua defined function in pause_menu.lua
Usable in:
Example call:
pause_menu.lua
update_interaction_ui()
Native/C function
Usable in:
Example call:
screen_navigation.lua
update_launch_carrier(this_vehicle:get_id())
Lua defined function in screen_inventory.lua
Usable in:
Example call:
screen_inventory.lua
update_map_cursor_state(x, y, w, h)
Native/C function
Usable in:
Example call:
screen_holomap.lua
update_map_dismiss_notification()
Lua defined function in screen_inventory.lua
Usable in:
Example call:
screen_inventory.lua
update_map_hovered(screen_w, screen_h)
Native/C function
Usable in:
Example call:
interactions.lua
update_play_sound(e_audio_effect_type.telemetry_2_radar)
Native/C function
Usable in:
Example call:
screen_transmissions.lua
update_play_transmission(unread_transmission)
Native/C function
Usable in:
Example call:
vehicle_hud.lua
-- function debug_update_print_metatable(obj, x, y)
Native/C function
Usable in:
Example call:
vehicle_hud.lua
-- function debug_update_print_regions(x, y)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_refresh_workshop_published_mods()
Lua defined function in library_ui.lua
Usable in:
Example call:
library_ui.lua
local function update_repeat(is_held, is_repeat, repeat_time)
Lua defined function in library_util.lua
Usable in:
Example call:
library_util.lua
function update_screen_overrides(screen_w, screen_h, ticks)
Lua defined function in library_util.lua
Usable in:
Example call:
library_util.lua
elseif update_self_destruct_override(screen_w, screen_h) then
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_set_connect_address(g_connect_address, g_connect_type)
Native/C function
Usable in:
Example call:
screen_vehicle_control.lua
update_set_go_code(0)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_host_max_players(max_players) end
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_set_host_password(g_text[g_edit_text])
Native/C function
Usable in:
Example call:
interactions.lua
update_set_is_block_input(g_message_box.is_block_input or g_server_timeout.is_block_input)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_set_is_mod_enabled(mod.id, false)
Native/C function
Usable in:
Example call:
interactions.lua
update_set_is_pause_simulation(is_pause_simulation)
Native/C function
Usable in:
Example call:
interactions.lua
update_set_is_text_input_mode(g_chat.is_chat_box or g_chat.text_input_mode_cooldown > 0)
Native/C function
Usable in:
Example call:
overlay.lua
update_set_is_visible(g_loading_alpha > 0)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_set_join_password(g_text[g_edit_text])
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_new_game_base_difficulty(base_difficulty) end
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_new_game_blueprints(blueprints_type) end
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_new_game_carrier_count_per_team(carrier_count_per_team) end
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_set_new_game_is_tutorial(tutorial == 0)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_new_game_island_count(island_count) end
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_new_game_island_count_per_team(island_count_per_team) end
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_new_game_loadout_type(loadout_type) end
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_new_game_team_count_ai(team_count_ai) end
Native/C function
Usable in:
Example call:
screen_menu_main.lua
if is_modified then update_set_new_game_team_count_human(team_count_human) end
Native/C function
Usable in:
Example call:
vehicle_hud.lua
update_set_observed_vehicle(target_hovered.id, observation_factor)
Native/C function
Usable in:
Example call:
vehicle_hud.lua
update_set_screen_background_clip(map_x, screen_h - map_y - map_h, map_w, map_h)
Native/C function
Usable in:
Example call:
vehicle_hud.lua
update_set_screen_background_color(color8(0, 0, 0, 64))
Native/C function
Usable in:
Example call:
pause_menu.lua
update_set_screen_background_is_render_islands(is_render_islands)
Native/C function
Usable in:
Example call:
vehicle_hud.lua
update_set_screen_background_tile_color_custom(color8(64, 64, 64, 255))
Native/C function
Usable in:
Example call:
library_util.lua
update_set_screen_background_type(0)
Native/C function
Usable in:
Example call:
screen_cctv.lua
update_set_screen_camera_attach_vehicle(screen_vehicle:get_id(), render_camera_index)
Native/C function
Usable in:
Example call:
screen_cctv.lua
update_set_screen_camera_cull_distance(200)
Native/C function
Usable in:
Example call:
screen_cctv.lua
update_set_screen_camera_is_render_ocean(false)
Native/C function
Usable in:
Example call:
screen_cctv.lua
update_set_screen_camera_lod_level(0)
Native/C function
Usable in:
Example call:
screen_vehicle_camera.lua
update_set_screen_camera_pos_orientation(g_cam_x, g_cam_y, g_cam_z, g_cam_rot)
Native/C function
Usable in:
Example call:
screen_cctv.lua
update_set_screen_camera_render_attached_vehicle(true)
Native/C function
Usable in:
Example call:
pause_menu.lua
update_set_screen_map_position_scale(g_tab_map.camera_pos_x, g_tab_map.camera_pos_y, g_tab_map.camera_size)
Native/C function
Usable in:
Example call:
screen_carrier_camera.lua
update_set_screen_state_exit()
Native/C function
Usable in:
Example call:
screen_carrier_camera.lua
update_set_screen_vehicle_control_id(g_vehicle_id)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_set_server_name(g_server_name)
Native/C function
Usable in:
Example call:
screen_transmissions.lua
update_stop_transmission()
Native/C function
Usable in:
Example call:
library_ui.lua
local text_time = iff(is_set, update_string_from_epoch(time, "%H:%M:%S %d/%m/%Y"), "---")
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_add_triangle(vec2(bg_width / 2, 0), vec2(bg_width / 2 - arrow_w / 2, arrow_h), vec2(bg_width / 2 + arrow_w / 2, arrow_h), arrow_col)
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_begin_triangles()
Lua defined function in library_ui.lua
Usable in:
Example call:
library_ui.lua
function update_ui_circle(x, y, rad, steps, col)
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_end_triangles()
Lua defined function in library_ui.lua
Usable in:
Example call:
interactions.lua
update_ui_event("quit_to_menu")
Native/C function
Usable in:
Example call:
screen_menu_main.lua
{ w=column_widths[4], margin=column_margins[4], value=update_ui_format_peer_display_name(player_name, player_peer_id), col=players_col },
Native/C function
Usable in:
Example call:
interactions.lua
local icon_w, icon_h = update_ui_get_image_size(atlas_icons.crosshair)
Native/C function
Usable in:
Example call:
library_ui.lua
local offset_x, offset_y = update_ui_get_offset()
Native/C function
Usable in:
Example call:
interactions.lua
local text_duration_millis = update_ui_get_text_size(self.text, 10000, 0) * 3
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_image(cx - math.floor(icon_w / 2), cy - math.floor(icon_h / 2), atlas_icons.crosshair, g_crosshair_color, 0)
Native/C function
Usable in:
Example call:
pause_menu.lua
update_ui_image_power(cx, y, icon, col, 0, power)
Native/C function
Usable in:
Example call:
screen_compass.lua
update_ui_image_rot(26 + 38, 42 + 38, atlas_icons.screen_compass_dial_pivot, color_white, -this_vehicle_bearing)
Native/C function
Usable in:
Example call:
library_ui.lua
update_ui_line(x + label_w, y + 1, x + label_w + check_w, y + 10, check_col)
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_pop_alpha()
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_pop_clip()
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_pop_offset()
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_pop_scale()
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_push_alpha(200)
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_push_clip(0, 0, bg_size, math.floor(bg_size * g_voice_anim_factor + 0.5))
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_push_offset(g_screen_border, screen_h - g_screen_border)
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_push_scale(g_ui_scale)
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_rectangle(0, -math.floor(g_back_height + 0.5), math.floor(g_back_width + 0.5), math.floor(g_back_height + 0.5), color_black)
Lua defined function in library_ui.lua
Usable in:
Example call:
interactions.lua
update_ui_rectangle_outline(2, cy, 10, 10, color_grey_mid)
Native/C function
Usable in:
Example call:
overlay.lua
update_ui_set_back_color(color8(0, 0, 0, math.floor(g_loading_alpha * 255)))
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_set_text_color(1, iff(#g_chat.text >= 128, color_status_bad, color_white))
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_text(cx + 2, cy + 1, icon.delim, 10, 0, color_shadow, 0)
Native/C function
Usable in:
Example call:
interactions.lua
update_ui_text_scale(0, 5, g_message_box.title, w, 1, g_message_box.title_col, 0, 2)
Native/C function
Usable in:
Example call:
screen_menu_main.lua
update_update_workshop_mod(g_selected_mod_id, g_selected_mod_overwrite.published_id, g_mod_upload_visibility)
Native/C function
Usable in:
Example call:
vehicle_hud.lua
local hit_pos_screen = update_world_to_screen(predicted_hit_pos)
Process finished with exit code 0