DesignateTar

Designate target with laser or other means

Usage: Used in 17 task(s)

Lua Implementation

-- Designate Target
function execute(params)
    local target = params.target
    local targetLoc = params.target_location or (target and target:getLocation3D())

    if targetLoc then
        local designator = this:getSystem("LaserDesignator")
        if designator then
            designator:setAttribute("TargetLocation", targetLoc)
            designator:setAttribute("Designating", true)
            designator:setAttribute("LaserCode", params.laser_code or 1688)
        end

        this:setStateProperty("DesignatedTarget", targetLoc)
        return true
    end
    return false
end