LockTarget

Achieve radar/missile lock on target

Usage: Used in 9 task(s)

Lua Implementation

-- Lock Target
function execute(params)
    local target = params.target
    local radarSystem = this:getSystem("Radar")
    local weaponSystem = this:getSystem(params.weapon_system)

    if radarSystem and target and target:isValid() then
        radarSystem:setAttribute("TrackingMode", "STT")
        radarSystem:setAttribute("TrackedTarget", target)

        if weaponSystem then
            weaponSystem:setAttribute("Target", target)
            weaponSystem:setAttribute("Tracking", true)
        end
        return true
    end
    return false
end