Page 1 of 1

Configuring High Value Air Asset Attack Missions

Posted: Wed Sep 01, 2021 9:43 pm
by SeaQueen
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.

Code: Select all

 -- 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)
 

Code: Select all

 -- 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
 

Code: Select all

 -- 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)
 
 

RE: Configuring High Value Air Asset Attack Missions

Posted: Thu Sep 02, 2021 3:52 pm
by hrfepo1
Thanks!