ObjectiveSecured
Check if objective is secured
Usage: Used in 9 task(s)
Lua Implementation
-- Objective Secured
function evaluate(params)
local objective = params.objective or this:getStateProperty("Objective")
if not objective then
return false
end
-- Check if at objective
local atObjective = IsAtLocation{location = objective, tolerance = 50}
-- Check for threats nearby
local threats = 0
local contacts = this:getContactList()
for _, contact in ipairs(contacts) do
if contact:isValid() and IsHostile{target = contact} then
local distance = spatialUtil.distance(objective, contact:getLocation3D())
if distance < 200 then
threats = threats + 1
end
end
end
return atObjective and threats == 0
end
Tasks Using This Predicate (9)
Assault Force Movement to Contact
Offensive Operations (LAND DOMAIN)
Breakthrough Operations
Offensive Operations (LAND DOMAIN)
Exploitation of Gaps
Offensive Operations (LAND DOMAIN)
Artillery Preparation Fires
Combined Arms Assault (LAND DOMAIN)
Engineer Breaching Support
Combined Arms Assault (LAND DOMAIN)
Assault Force Insertion
Combined Arms Assault (LAND DOMAIN)
Objective Seizure
Combined Arms Assault (LAND DOMAIN)
Exploitation Force Commitment
Combined Arms Assault (LAND DOMAIN)
Rubble Navigation and Breaching
Urban Warfare (LAND DOMAIN)