User Tools

Site Tools


luafunctionref

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
luafunctionref [2025/05/05 07:05] – [update] bredrollluafunctionref [2026/03/03 18:17] (current) – [Loading] bredroll
Line 26: Line 26:
   * library_custom_X.lua   * library_custom_X.lua
   * screen/hud   * screen/hud
 +
  
 ==== Execution ==== ==== Execution ====
Line 1407: Line 1408:
  
 ---- ----
-===update_get_map_vehicle_by_id===+=== update_get_map_vehicle_by_id ===
  
 Native/C function Native/C function
  
-Get an object representing a player or AI controlled unit in game, the unit may be docked or active. +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.+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 see unit waypoints since update 1.5.16. 
 + 
 +Bridge screens can fully get/set waypoint data for all units on all teams.
  
 vehicle objects have many methods, the most commonly used are: vehicle objects have many methods, the most commonly used are:
Line 1431: Line 1436:
   * ''vehicle:get_position()'' (HUD only)   * ''vehicle:get_position()'' (HUD only)
     * get the vehicle 3D position as a ''vec3'' where ''pos:y()'' is the altitude in meters.     * get the vehicle 3D position as a ''vec3'' where ''pos:y()'' is the altitude in meters.
- 
  
 Usable in: Usable in:
Line 1441: Line 1445:
   * screen_weapons_support.lua   * screen_weapons_support.lua
   * vehicle_hud.lua   * vehicle_hud.lua
 +
 Example call: Example call:
  
 ''library_ui.lua''\\ ''library_ui.lua''\\
-<code>local attached_vehicle = update_get_map_vehicle_by_id(attached_vehicle_id)</code>+ 
 +<code -> 
 +local attached_vehicle = update_get_map_vehicle_by_id(attached_vehicle_id) 
 +</code>
  
 ---- ----
 +
 +
 ===update_get_map_vehicle_by_index=== ===update_get_map_vehicle_by_index===
  
luafunctionref.1746428751.txt.gz · Last modified: 2025/05/05 07:05 by bredroll

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki