ClearToEngage
Check if clear to engage (no friendlies in area)
Usage: Used in 17 task(s)
Lua Implementation
-- Clear To Engage
function evaluate(params)
local target = params.target
local safetyRadius = params.safety_radius or 100
if not target then
return false
end
-- Check for friendlies near target
local contacts = this:getContactList()
for _, contact in ipairs(contacts) do
if contact:isValid() and contact:getForceType() == this:getForceType() then
local distance = spatialUtil.distance(
contact:getLocation3D(),
target:getLocation3D()
)
if distance < safetyRadius then
return false
end
end
end
return true
end
Tasks Using This Predicate (17)
Offensive Counter-Air (OCA) Missions
Air Superiority (AIR DOMAIN)
Surface-to-Air Missile (SAM) Positioning
Air Denial Operations (AIR DOMAIN)
Forward Air Controller (FAC) Coordination
Close Air Support (CAS) (AIR DOMAIN)
Gun Runs and Strafing
Close Air Support (CAS) (AIR DOMAIN)
Rocket/Missile Strikes on Tactical Targets
Close Air Support (CAS) (AIR DOMAIN)
Danger-Close Engagement
Close Air Support (CAS) (AIR DOMAIN)
Troops-in-Contact (TIC) Response
Close Air Support (CAS) (AIR DOMAIN)
SAM Battery Destruction
Suppression/Destruction of Enemy Air Defense (SEAD/DEAD) (AIR DOMAIN)
Aircraft Destruction on Ground
Airfield Attack (AIR DOMAIN)
Medical Evacuation (MEDEVAC)
Combat Search and Rescue (CSAR) (AIR DOMAIN)
Casualty Evacuation (CASEVAC)
Logistics and Sustainment (LAND DOMAIN)
Underground Network Mapping
Subterranean/Tunnel Operations (LAND DOMAIN)
Entry and Clearance Operations
Subterranean/Tunnel Operations (LAND DOMAIN)
Booby Trap Detection and Neutralization
Subterranean/Tunnel Operations (LAND DOMAIN)
Hostage Rescue Operations
Subterranean/Tunnel Operations (LAND DOMAIN)
Underground Command Post Targeting
Subterranean/Tunnel Operations (LAND DOMAIN)
Surface Target Detection and Tracking
Anti-Ship Warfare (SURFACE DOMAIN)