Possible to setup Runway attack payload, default to strike payload otherwise;

This commit is contained in:
Khopa 2020-12-15 23:14:36 +01:00
parent 1a1e55e16c
commit 991cd91dd4
4 changed files with 86 additions and 40 deletions

View File

@ -140,6 +140,7 @@ from dcs.task import (
SEAD,
Task,
Transport,
RunwayAttack,
)
from dcs.terrain.terrain import Airport
from dcs.unit import Ship, Unit, Vehicle
@ -978,6 +979,7 @@ COMMON_OVERRIDE = {
AntishipStrike: "ANTISHIP",
GroundAttack: "STRIKE",
Escort: "CAP",
RunwayAttack: "RUNWAY_ATTACK"
}
PLANE_PAYLOAD_OVERRIDES: Dict[Type[PlaneType], Dict[Type[Task], str]] = {

View File

@ -65,6 +65,7 @@ from dcs.task import (
Targets,
Task,
WeaponType,
PinpointStrike,
)
from dcs.terrain.terrain import Airport, NoParkingSlotError
from dcs.translation import String
@ -728,6 +729,11 @@ class AircraftConflictGenerator:
if for_task in db.PLANE_PAYLOAD_OVERRIDES[unit_type]:
payload_name = db.PLANE_PAYLOAD_OVERRIDES[unit_type][for_task]
group.load_loadout(payload_name)
if not group.units[0].pylons and for_task == RunwayAttack:
if PinpointStrike in db.PLANE_PAYLOAD_OVERRIDES[unit_type]:
logging.warning("No loadout for \"Runway Attack\" for the {}, defaulting to Strike loadout".format(str(unit_type)))
payload_name = db.PLANE_PAYLOAD_OVERRIDES[unit_type][PinpointStrike]
group.load_loadout(payload_name)
did_load_loadout = True
logging.info("Loaded overridden payload for {} - {} for task {}".format(unit_type, payload_name, for_task))

View File

@ -282,7 +282,7 @@ local unitPayloads = {
},
},
[8] = {
["name"] = "RUNWAY STRIKE",
["name"] = "RUNWAY_ATTACK",
["pylons"] = {
[1] = {
["CLSID"] = "{5335D97A-35A5-4643-9D9B-026C75961E52}",

View File

@ -2,44 +2,6 @@ local unitPayloads = {
["name"] = "JF-17",
["payloads"] = {
[1] = {
["name"] = "CAP",
["pylons"] = {
[1] = {
["CLSID"] = "DIS_TANK800",
["num"] = 5,
},
[2] = {
["CLSID"] = "DIS_TANK800",
["num"] = 3,
},
[3] = {
["CLSID"] = "DIS_WMD7",
["num"] = 4,
},
[4] = {
["CLSID"] = "DIS_PL-5EII",
["num"] = 1,
},
[5] = {
["CLSID"] = "DIS_PL-5EII",
["num"] = 7,
},
[6] = {
["CLSID"] = "DIS_SD-10_DUAL_R",
["num"] = 6,
},
[7] = {
["CLSID"] = "DIS_SD-10_DUAL_L",
["num"] = 2,
},
},
["tasks"] = {
[1] = 10,
[2] = 11,
[3] = 19,
},
},
[2] = {
["name"] = "CAS",
["pylons"] = {
[1] = {
@ -69,7 +31,7 @@ local unitPayloads = {
[3] = 19,
},
},
[3] = {
[2] = {
["name"] = "STRIKE",
["pylons"] = {
[1] = {
@ -103,6 +65,44 @@ local unitPayloads = {
[3] = 19,
},
},
[3] = {
["name"] = "CAP",
["pylons"] = {
[1] = {
["CLSID"] = "DIS_TANK800",
["num"] = 5,
},
[2] = {
["CLSID"] = "DIS_TANK800",
["num"] = 3,
},
[3] = {
["CLSID"] = "DIS_WMD7",
["num"] = 4,
},
[4] = {
["CLSID"] = "DIS_PL-5EII",
["num"] = 1,
},
[5] = {
["CLSID"] = "DIS_PL-5EII",
["num"] = 7,
},
[6] = {
["CLSID"] = "DIS_SD-10_DUAL_R",
["num"] = 6,
},
[7] = {
["CLSID"] = "DIS_SD-10_DUAL_L",
["num"] = 2,
},
},
["tasks"] = {
[1] = 10,
[2] = 11,
[3] = 19,
},
},
[4] = {
["name"] = "SEAD",
["pylons"] = {
@ -179,6 +179,44 @@ local unitPayloads = {
[3] = 19,
},
},
[6] = {
["name"] = "RUNWAY_ATTACK",
["pylons"] = {
[1] = {
["CLSID"] = "DIS_TYPE200_DUAL_R",
["num"] = 6,
},
[2] = {
["CLSID"] = "DIS_TANK800",
["num"] = 5,
},
[3] = {
["CLSID"] = "DIS_TANK800",
["num"] = 3,
},
[4] = {
["CLSID"] = "DIS_TYPE200_DUAL_L",
["num"] = 2,
},
[5] = {
["CLSID"] = "DIS_PL-5EII",
["num"] = 1,
},
[6] = {
["CLSID"] = "DIS_PL-5EII",
["num"] = 7,
},
[7] = {
["CLSID"] = "DIS_WMD7",
["num"] = 4,
},
},
["tasks"] = {
[1] = 10,
[2] = 11,
[3] = 19,
},
},
},
["unitType"] = "JF-17",
}