Configuring High Value Air Asset Attack Missions (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


SeaQueen -> Configuring High Value Air Asset Attack Missions (9/2/2021 12:43:08 AM)

Sometimes you want to create a mission to attack high value aircraft might not be airborne at the scenario start. For example, you might want to set a 4 ship of fighters on strip alert (or maybe airborn) to strike AWACS, tanker, and electronic warfare aircraft. There's not an obvious way to get aircraft of a particular type on the target list of a mission, so I created this LUA script, which is intended to be run in the console, to help you configure your missions.

-- to run in LUA console

-- select enemy bases to look for aircraft on the ground
enemyBaseId= {name='Al Asad Airbase', guid='GWKW9V-0HM9314L9UDIG'}
enemyBase = ScenEdit_GetUnit(enemyBaseId)

-- determine targeted aircraft types
enemyBaseAircraft = enemyBase["embarkedUnits"].Aircraft
targetAircraftTypes = {[214] = true, [343] = true, [617] = true, [1984] = true,[2045] = true}  -- KC-10, EA-18G, KC-135, E-3B, RC-135W

-- build target list
targetAircraft = {}
k=1
for i, j in ipairs(enemyBaseAircraft) do
    acft = ScenEdit_GetUnit({guid=j})
    if ( targetAircraftTypes[acft.dbid] ) then
        targetAircraft[k] = j
        k=k+1
    end
end

print(targetAircraft)

msnName = "OCA - HVAA-A"
msnTgts = {targetlist = targetAircraft}
ScenEdit_AssignUnitAsTarget(targetAircraft, msnName)





hrfepo1 -> RE: Configuring High Value Air Asset Attack Missions (9/2/2021 6:52:35 PM)

Thanks!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.953125