====== CC2 Lua ====== 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: * screen * draw the user interface for each bridge station * hud * draw the heads-up-display when in direct control of a unit * library * shared code usable in screens or hud scripting. ===== Script Environment ===== ==== Loading ==== 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: * library_enum.lua * library_util.lua * library_vehicle.lua * library_ui.lua * library_custom_X.lua * screen/hud ==== Execution ==== 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. === begin === 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. === game === 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 '''' 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. ==== input ==== 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. ==== update ==== 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. === Refresh Rate === 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. ==== Functions ====== ---- ===begin_get_screen_name=== 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 '''' in the game object XML file for the carrier (or any other unit you attach a screen to). eg: 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: * screen_*.lua Example call: ''screen_inventory.lua''\\ local screen_name = begin_get_screen_name() ---- ===begin_get_ui_region_index=== 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: * library_util.lua * screen_damage.lua * screen_intro_main.lua * screen_menu_customisation.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_options.lua * screen_menu_quit.lua * screen_placeholder.lua * screen_vehicle_camera.lua Example call: ''library_util.lua''\\ atlas_icons[k] = begin_get_ui_region_index(k) ---- ===begin_load=== Lua defined function in library_util.lua Usable in: * interactions.lua * library_util.lua * pause_menu.lua * screen_cctv.lua * screen_compass.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_intro_main.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_options.lua * screen_menu_quit.lua * screen_navigation.lua * screen_placeholder.lua * screen_power.lua * screen_propulsion.lua * screen_radar.lua * screen_self_destruct.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_camera.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ begin_load() ---- ===begin_load_inventory_data=== 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: * library_vehicle.lua * screen_currency.lua * screen_delivery_log.lua * screen_holomap.lua * screen_inventory.lua * screen_vehicle_control.lua Example call: ''library_vehicle.lua''\\ function begin_load_inventory_data() ---- ===update_add_ui_interaction=== Lua defined function in interactions.lua Call to display the on-screen control hints in the bottom left of the screen. Usable in: * interactions.lua * library_ui.lua * pause_menu.lua * screen_currency.lua * screen_delivery_log.lua * screen_inventory.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_options.lua * screen_menu_quit.lua * screen_navigation.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_add_ui_interaction(update_get_loc(e_loc.input_text_shift), e_game_input.text_shift) ---- ===update_add_ui_interaction_special=== Lua defined function in interactions.lua Usable in: * interactions.lua * library_ui.lua * pause_menu.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_options.lua * screen_menu_quit.lua * screen_navigation.lua * screen_ship_log.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_add_ui_interaction_special(update_get_loc(e_loc.interaction_confirm), e_ui_interaction_special.chat) ---- ===update_animations=== Lua defined function in vehicle_hud.lua Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ update_animations(delta_time, vehicle) ---- ===update_boot_override=== Lua defined function in library_util.lua Usable in: * library_util.lua Example call: ''library_util.lua''\\ if update_boot_override(screen_w, screen_h, ticks) then ---- ===update_camera_local_rotate_inv=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local arrow_p0 = project(update_camera_local_rotate_inv(vehicle, vec3(0, 0, length))) ---- ===update_chat=== Lua defined function in interactions.lua Usable in: * interactions.lua Example call: ''interactions.lua''\\ update_chat(delta_time) ---- ===update_create_workshop_mod=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_create_workshop_mod(selected_mod.id, g_mod_upload_visibility) ---- ===update_cursor_state=== Lua defined function in screen_vehicle_control.lua Usable in: * screen_vehicle_control.lua Example call: ''screen_vehicle_control.lua''\\ update_cursor_state(screen_w, screen_h) ---- ===update_damage_zones=== Lua defined function in screen_damage.lua Usable in: * screen_damage.lua Example call: ''screen_damage.lua''\\ update_damage_zones(vehicle) ---- ===update_exit_pause_menu=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ update_exit_pause_menu() ---- ===update_get_active_input_type=== Native/C function Usable in: * interactions.lua * library_ui.lua * pause_menu.lua * screen_currency.lua * screen_delivery_log.lua * screen_holomap.lua * screen_inventory.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_options.lua * screen_navigation.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_control.lua * screen_vision_radar.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ if update_get_active_input_type() == e_active_input.gamepad then ---- ===update_get_angle_2d=== Native/C function Usable in: * screen_landing.lua Example call: ''screen_landing.lua''\\ local angle = update_get_angle_2d(relative_position:x() + 1000, relative_position:z() - pattern_length) - (math.pi * 0.5) ---- ===update_get_application_state=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ local app_state = update_get_application_state() ---- ===update_get_attachment_ammo_item_type=== Native/C function Usable in: * screen_vehicle_loadout.lua Example call: ''screen_vehicle_loadout.lua''\\ local ammo_type = update_get_attachment_ammo_item_type(item.type) ---- ===update_get_attachment_option=== Native/C function Usable in: * screen_vehicle_loadout.lua Example call: ''screen_vehicle_loadout.lua''\\ local attachment_definition = update_get_attachment_option(attachment_type, i) ---- ===update_get_attachment_option_count=== Native/C function Usable in: * screen_vehicle_loadout.lua Example call: ''screen_vehicle_loadout.lua''\\ local option_count = update_get_attachment_option_count(attachment_type) ---- ===update_get_attachment_option_hidden=== Native/C function Usable in: * screen_vehicle_loadout.lua Example call: ''screen_vehicle_loadout.lua''\\ if attachment_definition > -1 and update_get_attachment_option_hidden(attachment_definition) == false then ---- ===update_get_camera_forward=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local projectile_velocity = update_get_camera_forward() ---- ===update_get_camera_fov=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local fov = update_get_camera_fov() ---- ===update_get_camera_heading=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local heading = update_get_camera_heading() ---- ===update_get_camera_position=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ camera_x = update_get_camera_position():x() ---- ===update_get_camera_side=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local cam_side = update_get_camera_side() ---- ===update_get_chat_messages=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ local messages = update_get_chat_messages() ---- ===update_get_connect_address=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ g_connect_address, g_connect_type = update_get_connect_address() ---- ===update_get_currency_log=== Native/C function Usable in: * screen_currency.lua Example call: ''screen_currency.lua''\\ local log = update_get_currency_log(i) ---- ===update_get_currency_log_count=== Native/C function Usable in: * screen_currency.lua Example call: ''screen_currency.lua''\\ local log_count = update_get_currency_log_count() ---- ===update_get_definition_vehicle_stats=== Native/C function Usable in: * library_vehicle.lua * screen_vehicle_loadout.lua Example call: ''library_vehicle.lua''\\ local hitpoints, armour, mass = update_get_definition_vehicle_stats(index) ---- ===update_get_delivery_log=== Native/C function Usable in: * screen_delivery_log.lua Example call: ''screen_delivery_log.lua''\\ local log_time, modified_tick, log = update_get_delivery_log(i) ---- ===update_get_delivery_log_count=== Native/C function Usable in: * screen_delivery_log.lua Example call: ''screen_delivery_log.lua''\\ for i = 0, update_get_delivery_log_count() - 1 do ---- ===update_get_friend_games=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local friend_games = update_get_friend_games() ---- ===update_get_game_input_category=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local category = update_get_game_input_category(i) ---- ===update_get_game_input_count=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local input_count = update_get_game_input_count() ---- ===update_get_game_input_name=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ ui:text(update_get_loc(e_loc.rebind).." "..update_get_game_input_name(rebinding_keyboard)) ---- ===update_get_game_settings=== Native/C function Usable in: * library_ui.lua * screen_menu_customisation.lua * screen_menu_language.lua * vehicle_hud.lua Example call: ''library_ui.lua''\\ local settings = update_get_game_settings() ---- ===update_get_gfx_resolution_modes=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local resolution_options = update_get_gfx_resolution_modes() ---- ===update_get_hair_color_options=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local hair_color_options = update_get_hair_color_options() ---- ===update_get_host_connect_token=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ local connect_token = update_get_host_connect_token() ---- ===update_get_host_max_players=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local max_players = update_get_host_max_players() ---- ===update_get_host_password=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ g_text["host_password"] = update_get_host_password() ---- ===update_get_input_binding_gamepad_axis=== Native/C function Usable in: * interactions.lua * library_ui.lua 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) ---- ===update_get_input_binding_gamepad_button=== Native/C function Usable in: * interactions.lua * library_ui.lua 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) ---- ===update_get_input_binding_is_axis_inverted=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ if update_get_input_binding_is_axis_inverted(input) then ---- ===update_get_input_binding_joystick_axis=== Native/C function Usable in: * interactions.lua * library_ui.lua 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) ---- ===update_get_input_binding_joystick_button=== Native/C function Usable in: * interactions.lua * library_ui.lua 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) ---- ===update_get_input_binding_joystick_connected=== Native/C function Usable in: * library_ui.lua 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 ---- ===update_get_input_binding_joystick_guid=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local joy_guid = update_get_input_binding_joystick_guid(input) ---- ===update_get_input_binding_joystick_name=== Native/C function Usable in: * library_ui.lua 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 ---- ===update_get_input_binding_keyboard_key=== Native/C function Usable in: * interactions.lua * library_ui.lua Example call: ''interactions.lua''\\ return update_get_input_binding_keyboard_key(game_input), update_get_input_binding_keyboard_pointer(game_input) ---- ===update_get_input_binding_keyboard_pointer=== Native/C function Usable in: * interactions.lua * library_ui.lua Example call: ''interactions.lua''\\ return update_get_input_binding_keyboard_key(game_input), update_get_input_binding_keyboard_pointer(game_input) ---- ===update_get_input_category_name=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ ui:header(update_get_input_category_name(v)) ---- ===update_get_input_gamepad_axis_value=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ axis_value = clamp(update_get_input_gamepad_axis_value(item.axis), -1, 1) ---- ===update_get_input_joystick_axis_count=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ for j = 0, update_get_input_joystick_axis_count(i) - 1 do ---- ===update_get_input_joystick_axis_value=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ axis_value = clamp(update_get_input_joystick_axis_value(item.joystick, item.axis), -1, 1) ---- ===update_get_input_joystick_connected=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ if update_get_input_joystick_connected(i) then ---- ===update_get_input_joystick_guid=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ guid=update_get_input_joystick_guid(i), ---- ===update_get_input_joystick_name=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ name=update_get_input_joystick_name(i) ---- ===update_get_is_chat_box_available=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ if update_get_is_chat_box_available() then ---- ===update_get_is_focus_local=== Native/C function Usable in: * library_ui.lua * screen_carrier_camera.lua * screen_cctv.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_inventory.lua * screen_landing.lua * screen_menu_language.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_control.lua Example call: ''library_ui.lua''\\ is_selected = is_selected and update_get_is_focus_local() ---- ===update_get_is_hosting_game=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ if update_get_is_hosting_game() then ---- ===update_get_is_input_rebindable_gamepad=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ if update_get_is_input_rebindable_gamepad(i) or update_get_is_input_rebindable_gamepad_as_axis(i) then ---- ===update_get_is_input_rebindable_gamepad_as_axis=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ if update_get_is_input_rebindable_gamepad(i) or update_get_is_input_rebindable_gamepad_as_axis(i) then ---- ===update_get_is_input_rebindable_keyboard=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ if update_get_is_input_rebindable_keyboard(i) then ---- ===update_get_is_loading=== Native/C function Usable in: * interactions.lua 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 ---- ===update_get_is_multiplayer=== Native/C function Usable in: * interactions.lua * pause_menu.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ local is_multiplayer, is_host = update_get_is_multiplayer() ---- ===update_get_is_notification_holomap_set=== Native/C function Usable in: * screen_holomap.lua Example call: ''screen_holomap.lua''\\ if update_get_is_notification_holomap_set() == false then ---- ===update_get_is_respawn_menu_option_available=== Native/C function Usable in: * pause_menu.lua 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 ---- ===update_get_is_save_game_available=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ if ui:list_item(update_get_loc(e_loc.upp_save), true, update_get_is_save_game_available()) then ---- ===update_get_is_show_controls=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ if update_get_is_show_controls() then ---- ===update_get_is_show_subtitles=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ if update_get_is_show_subtitles() then ---- ===update_get_is_show_tooltips=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ if update_get_is_show_tooltips() then ---- ===update_get_is_show_voice_chat_others=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ if update_get_is_show_voice_chat_others() then ---- ===update_get_is_show_voice_chat_self=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ if update_get_is_show_voice_chat_self() then ---- ===update_get_is_show_vr_multiplayer_warning=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if update_get_is_show_vr_multiplayer_warning() then ---- ===update_get_is_vr=== Native/C function Return ''true'' if the game is running in VR mode. Usable in: * library_ui.lua * pause_menu.lua * screen_inventory.lua * screen_menu_options.lua * screen_vehicle_control.lua Example call: ''library_ui.lua''\\ if update_get_is_vr() == false then ---- ===update_get_join_password=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ g_text["join_password"] = update_get_join_password() ---- ===update_get_key_name=== Native/C function Usable in: * interactions.lua * library_ui.lua Example call: ''interactions.lua''\\ [e_ui_interaction_special.cancel_rebind] = { text = update_get_key_name(259) }, ---- ===update_get_keyboard_back_opens_pause=== Native/C function Usable in: * interactions.lua 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 } }) ---- ===update_get_loc=== 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: * interactions.lua * library_ui.lua * library_util.lua * library_vehicle.lua * pause_menu.lua * screen_cctv.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_main.lua * screen_menu_options.lua * screen_menu_quit.lua * screen_navigation.lua * screen_power.lua * screen_propulsion.lua * screen_radar.lua * screen_self_destruct.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ self.title = update_get_loc(e_loc.tut_complete_title) ---- ===update_get_local_peer_id=== Native/C function Get the ID of the current player. Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ local is_self = g_tab_multiplayer.selected_peer_id == update_get_local_peer_id() ---- ===update_get_local_team_id=== Native/C function Get the team ID of the current player. Usable in: * pause_menu.lua * screen_vehicle_control.lua Example call: ''pause_menu.lua''\\ return def == e_game_object_type.chassis_carrier and v:get_team_id() == update_get_local_team_id() ---- ===update_get_logic_tick=== 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: * library_ui.lua * screen_cctv.lua * screen_delivery_log.lua * screen_inventory.lua * screen_propulsion.lua * screen_ship_log.lua * vehicle_hud.lua Example call: ''library_ui.lua''\\ return iff(update_get_logic_tick() % rate < rate / 2, col0, col1) ---- ===update_get_map_destroyed_vehicle=== 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()'' * get a ''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()'' * get the team ID of the destroyed vehicle * ''destroyed:get_factor()'' * get float in range 0-1 based on the age of destruction, where 1 is most recent and 0 is oldest. Usable in: * screen_vehicle_control.lua Example call: ''screen_vehicle_control.lua''\\ local destroyed_vehicle = update_get_map_destroyed_vehicle(i) ---- ===update_get_map_destroyed_vehicle_count=== Native/C function Get the number of destroyed vehicles visible on the game map. Usable in: * screen_vehicle_control.lua Example call: ''screen_vehicle_control.lua''\\ local destroyed_vehicle_count = update_get_map_destroyed_vehicle_count() ---- ===update_get_map_vehicle_by_id=== 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()'' * locking/housekeeping, return ''true'' if this object can be used and is valid. * ''vehicle:get_id()'' * get the vehicle ID number. * ''vehicle:get_definition_index()'' * get the vehicle type (a value in the ''e_game_object_type'' table) * ''vehicle:get_team()'' (screen only) * get the vehicle team number * ''vehicle:get_team_id()'' (HUD only) * get the vehicle team number * ''vehicle:get_position_xz()'' (screen only) * get the vehicle 2D position as a ''vec2'' * ''vehicle:get_position()'' (HUD only) * get the vehicle 3D position as a ''vec3'' where ''pos:y()'' is the altitude in meters. Usable in: * library_ui.lua * screen_inventory.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_weapons_support.lua * vehicle_hud.lua Example call: ''library_ui.lua''\\ local attached_vehicle = update_get_map_vehicle_by_id(attached_vehicle_id) ---- ===update_get_map_vehicle_by_index=== Native/C function Usable in: * pause_menu.lua * screen_inventory.lua * screen_landing.lua * screen_navigation.lua * screen_propulsion.lua * screen_vehicle_control.lua * screen_vision_radar.lua * vehicle_hud.lua Example call: ''pause_menu.lua''\\ vehicle = update_get_map_vehicle_by_index(index) ---- ===update_get_map_vehicle_count=== Native/C function Usable in: * pause_menu.lua * screen_inventory.lua * screen_landing.lua * screen_navigation.lua * screen_propulsion.lua * screen_vehicle_control.lua * screen_vision_radar.lua * vehicle_hud.lua Example call: ''pause_menu.lua''\\ local vehicle_count = update_get_map_vehicle_count() ---- ===update_get_map_vehicle_position_relate_to_parent_vehicle=== Native/C function Usable in: * screen_landing.lua * screen_propulsion.lua Example call: ''screen_landing.lua''\\ local relative_position = update_get_map_vehicle_position_relate_to_parent_vehicle(vehicle_parent:get_id(), vehicle:get_id()) ---- ===update_get_message_box_type=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ local type = update_get_message_box_type() ---- ===update_get_missile_by_id=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local consuming_missile = update_get_missile_by_id(id) ---- ===update_get_missile_by_index=== Native/C function Usable in: * screen_vehicle_control.lua * screen_vision_radar.lua Example call: ''screen_vehicle_control.lua''\\ local missile = update_get_missile_by_index(i) ---- ===update_get_missile_count=== Native/C function Usable in: * screen_vehicle_control.lua * screen_vision_radar.lua Example call: ''screen_vehicle_control.lua''\\ local missile_count = update_get_missile_count() ---- ===update_get_mod_details=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local mods = update_get_mod_details() ---- ===update_get_mod_incompatible_active_mods=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local incompatible_mods = update_get_mod_incompatible_active_mods(selected_mod.id) ---- ===update_get_mod_workshop_upload_status=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local workshop_upload_status = update_get_mod_workshop_upload_status() ---- ===update_get_mouse_flight_axis=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local flight_axis = update_get_mouse_flight_axis() ---- ===update_get_mouse_flight_mode=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ local mouse_flight_mode = update_get_mouse_flight_mode() ---- ===update_get_network_time_since_recv=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ local network_time_since_recv = update_get_network_time_since_recv() / 1000 ---- ===update_get_network_timeout=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ local timeout = update_get_network_timeout() / 1000 ---- ===update_get_new_game_base_difficulty=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local base_difficulty = update_get_new_game_base_difficulty() ---- ===update_get_new_game_blueprints=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local blueprints_type = update_get_new_game_blueprints() ---- ===update_get_new_game_carrier_count_per_team=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local carrier_count_per_team = update_get_new_game_carrier_count_per_team() ---- ===update_get_new_game_is_tutorial=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local is_tutorial = update_get_new_game_is_tutorial() ---- ===update_get_new_game_island_count=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local island_count = update_get_new_game_island_count() ---- ===update_get_new_game_island_count_per_team=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local island_count_per_team = update_get_new_game_island_count_per_team() ---- ===update_get_new_game_loadout_type=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local loadout_type = update_get_new_game_loadout_type() ---- ===update_get_new_game_team_count_ai=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local team_count_ai = update_get_new_game_team_count_ai() ---- ===update_get_new_game_team_count_human=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local team_count_human = update_get_new_game_team_count_human() ---- ===update_get_notification_holomap=== Native/C function Usable in: * screen_holomap.lua Example call: ''screen_holomap.lua''\\ local notification = update_get_notification_holomap() ---- ===update_get_notification_log=== Native/C function Usable in: * screen_ship_log.lua Example call: ''screen_ship_log.lua''\\ local log = update_get_notification_log(i) ---- ===update_get_notification_log_count=== Native/C function Usable in: * screen_ship_log.lua Example call: ''screen_ship_log.lua''\\ local log_count = update_get_notification_log_count() ---- ===update_get_ocean_current_velocity=== Native/C function Usable in: * screen_vehicle_control.lua 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) ---- ===update_get_ocean_depth_factor=== Native/C function Usable in: * screen_vehicle_control.lua 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) ---- ===update_get_peer_count=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ local peer_count = update_get_peer_count() ---- ===update_get_peer_id=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ local id = update_get_peer_id(i) ---- ===update_get_peer_index_by_id=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local peer_index = update_get_peer_index_by_id(controlling_peer_id) ---- ===update_get_peer_is_admin=== Native/C function Usable in: * pause_menu.lua * screen_vehicle_control.lua Example call: ''pause_menu.lua''\\ local is_admin = update_get_peer_is_admin(i) ---- ===update_get_peer_is_voice_muted=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ if update_get_peer_is_voice_muted(i) then ---- ===update_get_peer_is_voice_transmit=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ if update_get_peer_is_voice_transmit(i) then ---- ===update_get_peer_name=== Native/C function Usable in: * pause_menu.lua * vehicle_hud.lua Example call: ''pause_menu.lua''\\ local name = update_get_peer_name(i) ---- ===update_get_peer_team=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ local team = update_get_peer_team(i) ---- ===update_get_rebinding_gamepad=== Native/C function Usable in: * library_ui.lua * pause_menu.lua * screen_menu_options.lua Example call: ''library_ui.lua''\\ local rebinding_gamepad = update_get_rebinding_gamepad() ---- ===update_get_rebinding_keyboard=== Native/C function Usable in: * library_ui.lua * pause_menu.lua * screen_menu_options.lua Example call: ''library_ui.lua''\\ local rebinding_keyboard = update_get_rebinding_keyboard() ---- ===update_get_render_buffer_age=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ update_ui_text(10, cy, "render buffer age: " .. update_get_render_buffer_age() .. "ms", screen_w, 0, color_white, 0) ---- ===update_get_resource_inventory_category_count=== Native/C function Usable in: * library_vehicle.lua Example call: ''library_vehicle.lua''\\ for i = 0, update_get_resource_inventory_category_count() - 1 do ---- ===update_get_resource_inventory_category_data=== Native/C function Usable in: * library_vehicle.lua Example call: ''library_vehicle.lua''\\ local category_index, category_name, icon_name = update_get_resource_inventory_category_data(i) ---- ===update_get_resource_inventory_item_count=== Native/C function Usable in: * library_vehicle.lua * screen_inventory.lua Example call: ''library_vehicle.lua''\\ for i = 0, update_get_resource_inventory_item_count() - 1 do ---- ===update_get_resource_inventory_item_data=== Native/C function Usable in: * library_vehicle.lua 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) ---- ===update_get_resource_item_for_definition=== Native/C function Usable in: * screen_vehicle_loadout.lua Example call: ''screen_vehicle_loadout.lua''\\ if update_get_resource_item_for_definition(item.type) ~= -1 then ---- ===update_get_resource_item_hidden=== Native/C function Usable in: * library_ui.lua * screen_inventory.lua Example call: ''library_ui.lua''\\ if update_get_resource_item_hidden(item.index) == false then ---- ===update_get_resource_item_hidden_facility_production=== Native/C function Usable in: * screen_inventory.lua Example call: ''screen_inventory.lua''\\ if update_get_resource_item_hidden_facility_production(item.index) == false then ---- ===update_get_respawn_carrier_id=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ local respawn_carrier_id = update_get_respawn_carrier_id() ---- ===update_get_save_slots=== Native/C function Usable in: * pause_menu.lua * screen_menu_main.lua Example call: ''pause_menu.lua''\\ local save_slots = update_get_save_slots() ---- ===update_get_screen_input=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ return is_held and update_get_screen_input(input) ---- ===update_get_screen_state_active=== Native/C function Usable in: * screen_carrier_camera.lua * screen_inventory.lua * screen_menu_options.lua Example call: ''screen_carrier_camera.lua''\\ elseif update_get_is_focus_local() and update_get_screen_state_active() then ---- ===update_get_screen_team_id=== Native/C function Usable in: * screen_inventory.lua * screen_navigation.lua * screen_propulsion.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''screen_inventory.lua''\\ if tile:get() and tile:get_team_control() == update_get_screen_team_id() then ---- ===update_get_screen_vehicle=== Native/C function Usable in: * library_util.lua * screen_carrier_camera.lua * screen_cctv.lua * screen_compass.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_inventory.lua * screen_landing.lua * screen_navigation.lua * screen_power.lua * screen_propulsion.lua * screen_radar.lua * screen_self_destruct.lua * screen_vehicle_camera.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua Example call: ''library_util.lua''\\ local this_vehicle = update_get_screen_vehicle() ---- ===update_get_server_list=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local server_list = update_get_server_list() ---- ===update_get_server_meta=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local is_meta_set, meta = update_get_server_meta() ---- ===update_get_server_name=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ g_server_name = update_get_server_name() ---- ===update_get_skin_color_options=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local skin_color_options = update_get_skin_color_options() ---- ===update_get_team=== Native/C function Usable in: * library_ui.lua * screen_currency.lua * screen_inventory.lua * screen_transmissions.lua * screen_vehicle_control.lua * screen_weapons_support.lua Example call: ''library_ui.lua''\\ local team = update_get_team(vehicle:get_team()) ---- ===update_get_team_color=== Native/C function Usable in: * pause_menu.lua * screen_holomap.lua * screen_inventory.lua * screen_menu_main.lua * screen_navigation.lua * screen_vehicle_control.lua Example call: ''pause_menu.lua''\\ local team_color = update_get_team_color(vehicle:get_team_id()) ---- ===update_get_team_transmission_count=== Native/C function Usable in: * screen_transmissions.lua Example call: ''screen_transmissions.lua''\\ for i = 0, update_get_team_transmission_count() - 1 do ---- ===update_get_team_transmission_name=== Native/C function Usable in: * screen_transmissions.lua Example call: ''screen_transmissions.lua''\\ if imgui_transmission_button(ui, update_get_team_transmission_name(i), is_unread, is_playing) then ---- ===update_get_tile_by_id=== Native/C function Usable in: * screen_currency.lua * screen_holomap.lua * screen_inventory.lua * screen_ship_log.lua * screen_vehicle_control.lua Example call: ''screen_currency.lua''\\ local tile = update_get_tile_by_id(id) ---- ===update_get_tile_by_index=== Native/C function Usable in: * pause_menu.lua * screen_holomap.lua * screen_inventory.lua * screen_navigation.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''pause_menu.lua''\\ local tile = update_get_tile_by_index(i) ---- ===update_get_tile_count=== Native/C function Usable in: * pause_menu.lua * screen_holomap.lua * screen_inventory.lua * screen_navigation.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''pause_menu.lua''\\ local tile_count = update_get_tile_count() ---- ===update_get_time_ms=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ self.open_time = update_get_time_ms() ---- ===update_get_transmission_playback_progress=== Native/C function Usable in: * screen_transmissions.lua Example call: ''screen_transmissions.lua''\\ local playback_progress = update_get_transmission_playback_progress() ---- ===update_get_transmission_playing_index=== Native/C function Usable in: * screen_transmissions.lua Example call: ''screen_transmissions.lua''\\ local transmission_playing_index = update_get_transmission_playing_index() ---- ===update_get_ui_scale=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ g_ui_scale = update_get_ui_scale() ---- ===update_get_vehicle_by_id=== Native/C function Usable in: * library_util.lua * screen_damage.lua * screen_power.lua * screen_propulsion.lua * screen_radar.lua * screen_self_destruct.lua * screen_vision_radar.lua Example call: ''library_util.lua''\\ local this_vehicle_object = update_get_vehicle_by_id(this_vehicle:get_id()) ---- ===update_get_version=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local version_col = iff(version == update_get_version(), detail_col, color_status_bad) ---- ===update_get_weapon_line_by_index=== Native/C function Usable in: * screen_vehicle_control.lua Example call: ''screen_vehicle_control.lua''\\ local vehicle_id, direction_xz, tick = update_get_weapon_line_by_index(i) ---- ===update_get_weapon_line_count=== Native/C function Usable in: * screen_vehicle_control.lua Example call: ''screen_vehicle_control.lua''\\ local weapon_line_count = update_get_weapon_line_count() ---- ===update_get_weather_fog_factor=== Native/C function Usable in: * screen_vehicle_control.lua 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) ---- ===update_get_weather_lightning_factor=== Native/C function Usable in: * screen_vehicle_control.lua 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) ---- ===update_get_weather_precipitation_factor=== Native/C function Usable in: * screen_vehicle_control.lua 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) ---- ===update_get_weather_wind_velocity=== Native/C function Usable in: * screen_vehicle_control.lua 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) ---- ===update_get_workshop_published_mods=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ local published_mods = update_get_workshop_published_mods() ---- ===update_gun_funnel=== Lua defined function in vehicle_hud.lua Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ -- update_gun_funnel(tick_fraction, vehicle, gun_funnel_side_dist, gun_funnel_forward_dist) ---- ===update_interaction_ui=== Lua defined function in pause_menu.lua Usable in: * pause_menu.lua * screen_inventory.lua * screen_menu_customisation.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_options.lua * screen_menu_quit.lua * screen_vehicle_control.lua Example call: ''pause_menu.lua''\\ update_interaction_ui() ---- ===update_launch_carrier=== Native/C function Usable in: * screen_navigation.lua Example call: ''screen_navigation.lua''\\ update_launch_carrier(this_vehicle:get_id()) ---- ===update_map_cursor_state=== Lua defined function in screen_inventory.lua Usable in: * screen_inventory.lua Example call: ''screen_inventory.lua''\\ update_map_cursor_state(x, y, w, h) ---- ===update_map_dismiss_notification=== Native/C function Usable in: * screen_holomap.lua Example call: ''screen_holomap.lua''\\ update_map_dismiss_notification() ---- ===update_map_hovered=== Lua defined function in screen_inventory.lua Usable in: * screen_inventory.lua Example call: ''screen_inventory.lua''\\ update_map_hovered(screen_w, screen_h) ---- ===update_play_sound=== Native/C function Usable in: * interactions.lua * screen_propulsion.lua * screen_radar.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua Example call: ''interactions.lua''\\ update_play_sound(e_audio_effect_type.telemetry_2_radar) ---- ===update_play_transmission=== Native/C function Usable in: * screen_transmissions.lua Example call: ''screen_transmissions.lua''\\ update_play_transmission(unread_transmission) ---- ===update_print_metatable=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ -- function debug_update_print_metatable(obj, x, y) ---- ===update_print_regions=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ -- function debug_update_print_regions(x, y) ---- ===update_refresh_workshop_published_mods=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_refresh_workshop_published_mods() ---- ===update_repeat=== Lua defined function in library_ui.lua Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local function update_repeat(is_held, is_repeat, repeat_time) ---- ===update_screen_overrides=== Lua defined function in library_util.lua Usable in: * library_util.lua * screen_cctv.lua * screen_compass.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_intro_main.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_options.lua * screen_menu_quit.lua * screen_navigation.lua * screen_placeholder.lua * screen_power.lua * screen_propulsion.lua * screen_radar.lua * screen_self_destruct.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_camera.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua Example call: ''library_util.lua''\\ function update_screen_overrides(screen_w, screen_h, ticks) ---- ===update_self_destruct_override=== Lua defined function in library_util.lua Usable in: * library_util.lua * screen_damage.lua Example call: ''library_util.lua''\\ elseif update_self_destruct_override(screen_w, screen_h) then ---- ===update_set_connect_address=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_set_connect_address(g_connect_address, g_connect_type) ---- ===update_set_go_code=== Native/C function Usable in: * screen_vehicle_control.lua Example call: ''screen_vehicle_control.lua''\\ update_set_go_code(0) ---- ===update_set_host_max_players=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_host_max_players(max_players) end ---- ===update_set_host_password=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_set_host_password(g_text[g_edit_text]) ---- ===update_set_is_block_input=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ update_set_is_block_input(g_message_box.is_block_input or g_server_timeout.is_block_input) ---- ===update_set_is_mod_enabled=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_set_is_mod_enabled(mod.id, false) ---- ===update_set_is_pause_simulation=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ update_set_is_pause_simulation(is_pause_simulation) ---- ===update_set_is_text_input_mode=== Native/C function Usable in: * interactions.lua * pause_menu.lua Example call: ''interactions.lua''\\ update_set_is_text_input_mode(g_chat.is_chat_box or g_chat.text_input_mode_cooldown > 0) ---- ===update_set_is_visible=== Native/C function Usable in: * overlay.lua Example call: ''overlay.lua''\\ update_set_is_visible(g_loading_alpha > 0) ---- ===update_set_join_password=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_set_join_password(g_text[g_edit_text]) ---- ===update_set_new_game_base_difficulty=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_new_game_base_difficulty(base_difficulty) end ---- ===update_set_new_game_blueprints=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_new_game_blueprints(blueprints_type) end ---- ===update_set_new_game_carrier_count_per_team=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_new_game_carrier_count_per_team(carrier_count_per_team) end ---- ===update_set_new_game_is_tutorial=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_set_new_game_is_tutorial(tutorial == 0) ---- ===update_set_new_game_island_count=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_new_game_island_count(island_count) end ---- ===update_set_new_game_island_count_per_team=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_new_game_island_count_per_team(island_count_per_team) end ---- ===update_set_new_game_loadout_type=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_new_game_loadout_type(loadout_type) end ---- ===update_set_new_game_team_count_ai=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_new_game_team_count_ai(team_count_ai) end ---- ===update_set_new_game_team_count_human=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ if is_modified then update_set_new_game_team_count_human(team_count_human) end ---- ===update_set_observed_vehicle=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ update_set_observed_vehicle(target_hovered.id, observation_factor) ---- ===update_set_screen_background_clip=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ update_set_screen_background_clip(map_x, screen_h - map_y - map_h, map_w, map_h) ---- ===update_set_screen_background_color=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ update_set_screen_background_color(color8(0, 0, 0, 64)) ---- ===update_set_screen_background_is_render_islands=== Native/C function Usable in: * pause_menu.lua * screen_holomap.lua * screen_inventory.lua * screen_navigation.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''pause_menu.lua''\\ update_set_screen_background_is_render_islands(is_render_islands) ---- ===update_set_screen_background_tile_color_custom=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ update_set_screen_background_tile_color_custom(color8(64, 64, 64, 255)) ---- ===update_set_screen_background_type=== Native/C function Usable in: * library_util.lua * pause_menu.lua * screen_cctv.lua * screen_holomap.lua * screen_inventory.lua * screen_navigation.lua * screen_vehicle_camera.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''library_util.lua''\\ update_set_screen_background_type(0) ---- ===update_set_screen_camera_attach_vehicle=== Native/C function Usable in: * screen_cctv.lua * screen_vehicle_camera.lua Example call: ''screen_cctv.lua''\\ update_set_screen_camera_attach_vehicle(screen_vehicle:get_id(), render_camera_index) ---- ===update_set_screen_camera_cull_distance=== Native/C function Usable in: * screen_cctv.lua Example call: ''screen_cctv.lua''\\ update_set_screen_camera_cull_distance(200) ---- ===update_set_screen_camera_is_render_ocean=== Native/C function Usable in: * screen_cctv.lua Example call: ''screen_cctv.lua''\\ update_set_screen_camera_is_render_ocean(false) ---- ===update_set_screen_camera_lod_level=== Native/C function Usable in: * screen_cctv.lua Example call: ''screen_cctv.lua''\\ update_set_screen_camera_lod_level(0) ---- ===update_set_screen_camera_pos_orientation=== Native/C function Usable in: * screen_vehicle_camera.lua Example call: ''screen_vehicle_camera.lua''\\ update_set_screen_camera_pos_orientation(g_cam_x, g_cam_y, g_cam_z, g_cam_rot) ---- ===update_set_screen_camera_render_attached_vehicle=== Native/C function Usable in: * screen_cctv.lua Example call: ''screen_cctv.lua''\\ update_set_screen_camera_render_attached_vehicle(true) ---- ===update_set_screen_map_position_scale=== Native/C function Usable in: * pause_menu.lua * screen_holomap.lua * screen_inventory.lua * screen_navigation.lua * screen_vehicle_control.lua * vehicle_hud.lua 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) ---- ===update_set_screen_state_exit=== Native/C function Usable in: * screen_carrier_camera.lua * screen_cctv.lua * screen_compass.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_intro_main.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_options.lua * screen_menu_quit.lua * screen_navigation.lua * screen_placeholder.lua * screen_power.lua * screen_propulsion.lua * screen_radar.lua * screen_self_destruct.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_camera.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua Example call: ''screen_carrier_camera.lua''\\ update_set_screen_state_exit() ---- ===update_set_screen_vehicle_control_id=== Native/C function Usable in: * screen_carrier_camera.lua * screen_vehicle_control.lua Example call: ''screen_carrier_camera.lua''\\ update_set_screen_vehicle_control_id(g_vehicle_id) ---- ===update_set_server_name=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_set_server_name(g_server_name) ---- ===update_stop_transmission=== Native/C function Usable in: * screen_transmissions.lua Example call: ''screen_transmissions.lua''\\ update_stop_transmission() ---- ===update_string_from_epoch=== Native/C function Usable in: * library_ui.lua * pause_menu.lua Example call: ''library_ui.lua''\\ local text_time = iff(is_set, update_string_from_epoch(time, "%H:%M:%S %d/%m/%Y"), "---") ---- ===update_ui_add_triangle=== Native/C function Usable in: * interactions.lua * library_ui.lua * screen_holomap.lua * screen_inventory.lua * screen_radar.lua * screen_vehicle_control.lua * vehicle_hud.lua 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) ---- ===update_ui_begin_triangles=== Native/C function Usable in: * interactions.lua * library_ui.lua * screen_holomap.lua * screen_inventory.lua * screen_radar.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_ui_begin_triangles() ---- ===update_ui_circle=== Lua defined function in library_ui.lua Usable in: * library_ui.lua * screen_holomap.lua * screen_intro_shuttle.lua Example call: ''library_ui.lua''\\ function update_ui_circle(x, y, rad, steps, col) ---- ===update_ui_end_triangles=== Native/C function Usable in: * interactions.lua * library_ui.lua * screen_holomap.lua * screen_inventory.lua * screen_radar.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_ui_end_triangles() ---- ===update_ui_event=== Lua defined function in library_ui.lua Usable in: * interactions.lua * library_ui.lua * pause_menu.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_quit.lua Example call: ''interactions.lua''\\ update_ui_event("quit_to_menu") ---- ===update_ui_format_peer_display_name=== Native/C function Usable in: * screen_menu_main.lua 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 }, ---- ===update_ui_get_image_size=== Native/C function Usable in: * interactions.lua * library_ui.lua * pause_menu.lua * screen_vehicle_loadout.lua Example call: ''interactions.lua''\\ local icon_w, icon_h = update_ui_get_image_size(atlas_icons.crosshair) ---- ===update_ui_get_offset=== Native/C function Usable in: * library_ui.lua Example call: ''library_ui.lua''\\ local offset_x, offset_y = update_ui_get_offset() ---- ===update_ui_get_text_size=== Native/C function Usable in: * interactions.lua * library_ui.lua * overlay.lua * pause_menu.lua * screen_holomap.lua * screen_inventory.lua * screen_menu_main.lua * screen_propulsion.lua * screen_transmissions.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ local text_duration_millis = update_ui_get_text_size(self.text, 10000, 0) * 3 ---- ===update_ui_image=== Native/C function Usable in: * interactions.lua * library_ui.lua * library_util.lua * library_vehicle.lua * pause_menu.lua * screen_compass.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_language.lua * screen_menu_main.lua * screen_menu_quit.lua * screen_navigation.lua * screen_placeholder.lua * screen_power.lua * screen_propulsion.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua 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) ---- ===update_ui_image_power=== Native/C function Usable in: * pause_menu.lua Example call: ''pause_menu.lua''\\ update_ui_image_power(cx, y, icon, col, 0, power) ---- ===update_ui_image_rot=== Native/C function Usable in: * screen_compass.lua * screen_inventory.lua * screen_propulsion.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''screen_compass.lua''\\ update_ui_image_rot(26 + 38, 42 + 38, atlas_icons.screen_compass_dial_pivot, color_white, -this_vehicle_bearing) ---- ===update_ui_line=== Native/C function Usable in: * library_ui.lua * pause_menu.lua * screen_compass.lua * screen_damage.lua * screen_holomap.lua * screen_inventory.lua * screen_landing.lua * screen_navigation.lua * screen_propulsion.lua * screen_radar.lua * screen_vehicle_control.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua Example call: ''library_ui.lua''\\ update_ui_line(x + label_w, y + 1, x + label_w + check_w, y + 10, check_col) ---- ===update_ui_pop_alpha=== Native/C function Usable in: * interactions.lua * overlay.lua Example call: ''interactions.lua''\\ update_ui_pop_alpha() ---- ===update_ui_pop_clip=== Native/C function Usable in: * interactions.lua * library_ui.lua * pause_menu.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_ui_pop_clip() ---- ===update_ui_pop_offset=== Native/C function Usable in: * interactions.lua * library_ui.lua * library_vehicle.lua * pause_menu.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_main.lua * screen_power.lua * screen_propulsion.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_camera.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_ui_pop_offset() ---- ===update_ui_pop_scale=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ update_ui_pop_scale() ---- ===update_ui_push_alpha=== Native/C function Usable in: * interactions.lua * overlay.lua Example call: ''interactions.lua''\\ update_ui_push_alpha(200) ---- ===update_ui_push_clip=== Native/C function Usable in: * interactions.lua * library_ui.lua * pause_menu.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_vehicle_control.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_ui_push_clip(0, 0, bg_size, math.floor(bg_size * g_voice_anim_factor + 0.5)) ---- ===update_ui_push_offset=== Native/C function Usable in: * interactions.lua * library_ui.lua * library_vehicle.lua * pause_menu.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_main.lua * screen_power.lua * screen_propulsion.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_camera.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_ui_push_offset(g_screen_border, screen_h - g_screen_border) ---- ===update_ui_push_scale=== Native/C function Usable in: * interactions.lua Example call: ''interactions.lua''\\ update_ui_push_scale(g_ui_scale) ---- ===update_ui_rectangle=== Native/C function Usable in: * interactions.lua * library_ui.lua * library_util.lua * overlay.lua * pause_menu.lua * screen_carrier_camera.lua * screen_cctv.lua * screen_compass.lua * screen_damage.lua * screen_holomap.lua * screen_intro_shuttle.lua * screen_inventory.lua * screen_landing.lua * screen_menu_customisation.lua * screen_menu_language.lua * screen_menu_main.lua * screen_power.lua * screen_propulsion.lua * screen_radar.lua * screen_transmissions.lua * screen_vehicle_camera.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua 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) ---- ===update_ui_rectangle_outline=== Lua defined function in library_ui.lua Usable in: * interactions.lua * library_ui.lua * overlay.lua * pause_menu.lua * screen_currency.lua * screen_damage.lua * screen_holomap.lua * screen_inventory.lua * screen_landing.lua * screen_menu_main.lua * screen_power.lua * screen_propulsion.lua * screen_self_destruct.lua * screen_transmissions.lua * screen_vehicle_control.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_ui_rectangle_outline(2, cy, 10, 10, color_grey_mid) ---- ===update_ui_set_back_color=== Native/C function Usable in: * overlay.lua * vehicle_hud.lua Example call: ''overlay.lua''\\ update_ui_set_back_color(color8(0, 0, 0, math.floor(g_loading_alpha * 255))) ---- ===update_ui_set_text_color=== Native/C function Usable in: * interactions.lua * overlay.lua * pause_menu.lua * screen_menu_main.lua Example call: ''interactions.lua''\\ update_ui_set_text_color(1, iff(#g_chat.text >= 128, color_status_bad, color_white)) ---- ===update_ui_text=== Native/C function Usable in: * interactions.lua * library_ui.lua * library_util.lua * library_vehicle.lua * overlay.lua * pause_menu.lua * screen_cctv.lua * screen_compass.lua * screen_currency.lua * screen_damage.lua * screen_delivery_log.lua * screen_holomap.lua * screen_intro_main.lua * screen_inventory.lua * screen_landing.lua * screen_menu_main.lua * screen_menu_quit.lua * screen_navigation.lua * screen_power.lua * screen_propulsion.lua * screen_radar.lua * screen_self_destruct.lua * screen_ship_log.lua * screen_transmissions.lua * screen_vehicle_control.lua * screen_vehicle_loadout.lua * screen_vision_radar.lua * screen_weapons_anti_air.lua * screen_weapons_anti_missile.lua * screen_weapons_support.lua * vehicle_hud.lua Example call: ''interactions.lua''\\ update_ui_text(cx + 2, cy + 1, icon.delim, 10, 0, color_shadow, 0) ---- ===update_ui_text_scale=== Native/C function Usable in: * interactions.lua * library_ui.lua * screen_holomap.lua Example call: ''interactions.lua''\\ update_ui_text_scale(0, 5, g_message_box.title, w, 1, g_message_box.title_col, 0, 2) ---- ===update_update_workshop_mod=== Native/C function Usable in: * screen_menu_main.lua Example call: ''screen_menu_main.lua''\\ update_update_workshop_mod(g_selected_mod_id, g_selected_mod_overwrite.published_id, g_mod_upload_visibility) ---- ===update_world_to_screen=== Native/C function Usable in: * vehicle_hud.lua Example call: ''vehicle_hud.lua''\\ local hit_pos_screen = update_world_to_screen(predicted_hit_pos) Process finished with exit code 0