Jump to content

FindNearestGroup: Difference between revisions

From CMM Wiki
FindNearestGroup – created via PowerShell script (2025-11-11T21:12:10Z)
Tag: Recreated
 
m FindNearestGroup – created via PowerShell script (2026-06-24T22:26:40Z)
 
Line 1: Line 1:
{{Template:FunctionInfo|fName=          FindNearestGroup|fDescription=  Returns the nearest group to a given position, optionally filtered by coalition or group category.-- TODO Function incomplete|parentFile=    cmm.DCSFunctions.lua|syntax=        CMM.FindNearestGroup(Position <TBL>, CoalitionID <number|nil>, CategoryID <number|nil>)|return=        table or nil|returnDesc=    The nearest group table, or nil if none found|example=        CMM.FindNearestGroup({x=0,y=0,z=0}, 1, 2)|exampleDesc=    Returns the nearest group to the specified position, filtered by coalition and group type. Returns nil if no group is found within the search radius.|related=        |note=          |envType= CMM|par1=        table position|reqType1=    table|reqName1=    position|desc1=      vec3 position to search from|par2=        number or nil coalitionID|optType2=    number or nil|optName2=    coalitionID|desc2=      Optional coalition ID to limit search (0=NEUTRAL, 1=RED, 2=BLUE)|par3=        number or nil categoryID|optType3=    number or nil|optName3=    categoryID|desc3=      Optional group category (0=AIRPLANE, 1=HELICOPTER, 2=GROUND, 3=SHIP, 4=TRAIN)}}
{{Template:FunctionInfo|fName=          FindNearestGroup|fDescription=  Returns the nearest group to a given position, optionally filtered by coalition or group category.-- TODO Function incomplete|parentFile=    cmm.DCSFunctions.lua|syntax=        CMM.FindNearestGroup(Position <TBL>, CoalitionID <number|nil>, CategoryID <number|nil>)|return=        table or nil|returnDesc=    The nearest group table, or nil if none found|example=        CMM.FindNearestGroup({x=0,y=0,z=0}, 1, 2)|exampleDesc=    Returns the nearest group to the specified position, filtered by coalition and group type. Returns nil if no group is found within the search radius.|related=        |note=          |envType= CMM|par1=        table position|reqType1=    table|reqName1=    position|desc1=      vec3 position to search from|par2=        number or nil radius|optType2=    number or nil|optName2=    radius|desc2=      radius in meters to limit the search (default is 2500m)}}

Latest revision as of 12:26, 24 June 2026

Return to CMM Command Reference
Environment: Mission Scripting
Function: FindNearestGroup
Function Description: Returns the nearest group to a given position, optionally filtered by coalition or group category.-- TODO Function incomplete
File Location: cmm.DCSFunctions.lua
Syntax: CMM.FindNearestGroup( table position , number or nil radius )
Return Value: table or nil
Parameters: Name Description
positionvec3 position to search from
radiusradius in meters to limit the search (default is 2500m)
Example: CMM.FindNearestGroup({x=0,y=0,z=0}, 1, 2)
Example Description: Returns the nearest group to the specified position, filtered by coalition and group type. Returns nil if no group is found within the search radius.
Related Functions:
Notes: