Jump to content

FindNearestAirbase: Difference between revisions

From CMM Wiki
FindNearestAirbase – created via PowerShell script (2025-11-11T21:05:54Z)
Tag: Recreated
 
m FindNearestAirbase – created via PowerShell script (2026-02-11T01:15:37Z)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Template:FunctionInfo|fName=          FindNearestAirbase|fDescription=  |parentFile=    cmm.AirBaseFunctions.lua|syntax=        CMM.FindNearestAirbase(<vec3>, <coal>)|return=        table or nil|returnDesc=    Returns a table with keys airbase (Airbase object), distance (meters), name, and id; or nil if the input is invalid.|example=        CMM.FindNearestAirbase({x=0, y=0, z=1000}, 1)|exampleDesc=    Finds the closest airbase to the given point within the specified coalition (or any if omitted) and logs the result.|related=        |note=          |envType= CMM|par1=        table vec3|reqType1=    table|reqName1=    vec3|desc1=      A 3‑D position vector ({x, y, z}) used as the reference point.|par2=        number or nil coal|optType2=    number or nil|optName2=    coal|desc2=      Optional coalition number (1 = Red, 2 = Blue). Defaults to –1 meaning “any”.}}
{{Template:FunctionInfo|fName=          FindNearestAirbase|fDescription=  |parentFile=    cmm.AirBaseFunctions.lua|syntax=        CMM.FindNearestAirbase(<vec3>, <coal>)|return=        table or nil, table or nil|returnDesc=    Returns two tables, first one is the Airbase object, second is a table with keys distance (meters), name, and id; or nil if the input is invalid.|example=        CMM.FindNearestAirbase({x=0, y=0, z=1000}, 1)|exampleDesc=    Finds the closest airbase to the given point within the specified coalition (or any if omitted) and logs the result.|related=        |note=          |envType= CMM|par1=        table vec3|reqType1=    table|reqName1=    vec3|desc1=      A 3‑D position vector ({x, y, z}) used as the reference point.|par2=        number or nil coal|optType2=    number or nil|optName2=    coal|desc2=      Optional coalition number (1 = Red, 2 = Blue). Defaults to –1 meaning “any”.}}

Latest revision as of 14:15, 10 February 2026

Return to CMM Command Reference
Environment: Mission Scripting
Function: FindNearestAirbase
Function Description:
File Location: cmm.AirBaseFunctions.lua
Syntax: CMM.FindNearestAirbase( table vec3 , number or nil coal )
Return Value: table or nil, table or nil
Parameters: Name Description
vec3A 3‑D position vector ({x, y, z}) used as the reference point.
coalOptional coalition number (1 = Red, 2 = Blue). Defaults to –1 meaning “any”.
Example: CMM.FindNearestAirbase({x=0, y=0, z=1000}, 1)
Example Description: Finds the closest airbase to the given point within the specified coalition (or any if omitted) and logs the result.
Related Functions:
Notes: