diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 3c967a15e..00fb6ddbd 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -114,6 +114,9 @@ -- @field #number NcarriersMax Max number of required carrier assets. -- @field Core.Zone#ZONE transportDeployZone Deploy zone of an OPSTRANSPORT. -- @field Core.Zone#ZONE transportDisembarkZone Disembark zone of an OPSTRANSPORT. +-- @param #table carrierCategories Transport group categories. +-- @field #table carrierAttributes Generalized attribute(s) of transport assets. +-- @field #table carrierProperties DCS attribute(s) of transport assets. -- -- @field #number artyRadius Radius in meters. -- @field #number artyShots Number of shots fired. @@ -3056,15 +3059,18 @@ end -- @param #number NcarriersMin Number of carriers *at least* required. Default 1. -- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. -- @param Core.Zone#ZONE DisembarkZone Zone where assets are disembarked to. +-- @param #table Categories Group categories. +-- @param #table Attributes Generalizes group attributes. +-- @param #table Properties DCS attributes. -- @return #AUFTRAG self -function AUFTRAG:SetRequiredTransport(DeployZone, NcarriersMin, NcarriersMax, DisembarkZone) +function AUFTRAG:SetRequiredTransport(DeployZone, NcarriersMin, NcarriersMax, DisembarkZone, Categories, Attributes, Properties) -- OPS transport from pickup to deploy zone. self.transportDeployZone=DeployZone self.transportDisembarkZone=DisembarkZone -- Set required carriers. - self:SetRequiredCarriers(NcarriersMin, NcarriersMax) + self:SetRequiredCarriers(NcarriersMin, NcarriersMax, Categories, Attributes, Properties) return self end @@ -3115,8 +3121,11 @@ end -- @param #AUFTRAG self -- @param #number NcarriersMin Number of carriers *at least* required. Default 1. -- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. +-- @param #table Categories Group categories. +-- @param #table Attributes Group attributes. See `GROUP.Attribute.` +-- @param #table Properties DCS attributes. -- @return #AUFTRAG self -function AUFTRAG:SetRequiredCarriers(NcarriersMin, NcarriersMax) +function AUFTRAG:SetRequiredCarriers(NcarriersMin, NcarriersMax, Categories, Attributes, Properties) self.NcarriersMin=NcarriersMin or 1 @@ -3127,6 +3136,10 @@ function AUFTRAG:SetRequiredCarriers(NcarriersMin, NcarriersMax) self.NcarriersMax=self.NcarriersMin end + self.carrierCategories = UTILS.EnsureTable(Categories, true) + self.carrierAttributes = UTILS.EnsureTable(Attributes, true) + self.carrierProperties = UTILS.EnsureTable(Properties, true) + return self end diff --git a/Moose Development/Moose/Ops/Commander.lua b/Moose Development/Moose/Ops/Commander.lua index 16b9d43e1..0af40ed2d 100644 --- a/Moose Development/Moose/Ops/Commander.lua +++ b/Moose Development/Moose/Ops/Commander.lua @@ -1508,7 +1508,7 @@ function COMMANDER:CheckMissionQueue() local Transport=nil local Legions=mission.transportLegions or self.legions - TransportAvail, Transport=LEGION.AssignAssetsForTransport(self, Legions, assets, mission.NcarriersMin, mission.NcarriersMax, mission.transportDeployZone, mission.transportDisembarkZone) + TransportAvail, Transport=LEGION.AssignAssetsForTransport(self, Legions, assets, mission.NcarriersMin, mission.NcarriersMax, mission.transportDeployZone, mission.transportDisembarkZone, mission.carrierCategories, mission.carrierAttributes, mission.carrierProperties) -- Add opstransport to mission. if TransportAvail and Transport then @@ -1702,8 +1702,7 @@ function COMMANDER:RecruitAssetsForMission(Mission) local cohort=_cohort --Ops.Cohort#COHORT -- Check if cohort can perform transport to target. - --TODO: Option to filter transport carrier asset categories, attributes and/or properties. - local can=LEGION._CohortCan(cohort, AUFTRAG.Type.OPSTRANSPORT, Categories, Attributes, Properties, nil, TargetVec2) + local can=LEGION._CohortCan(cohort, AUFTRAG.Type.OPSTRANSPORT, Mission.carrierCategories, Mission.carrierAttributes, Mission.carrierProperties, nil, TargetVec2) -- MaxWeight of cargo assets is limited by the largets available cargo bay. We don't want to select, e.g., tanks that cannot be transported by APCs or helos. if can and (MaxWeight==nil or cohort.cargobayLimit>MaxWeight) then diff --git a/Moose Development/Moose/Ops/Legion.lua b/Moose Development/Moose/Ops/Legion.lua index d05f456f2..15cad88be 100644 --- a/Moose Development/Moose/Ops/Legion.lua +++ b/Moose Development/Moose/Ops/Legion.lua @@ -714,7 +714,7 @@ function LEGION:CheckMissionQueue() local Legions=mission.transportLegions or {self} -- Assign carrier assets for transport. - TransportAvail, Transport=self:AssignAssetsForTransport(Legions, assets, mission.NcarriersMin, mission.NcarriersMax, mission.transportDeployZone, mission.transportDisembarkZone) + TransportAvail, Transport=self:AssignAssetsForTransport(Legions, assets, mission.NcarriersMin, mission.NcarriersMax, mission.transportDeployZone, mission.transportDisembarkZone, mission.carrierCategories, mission.carrierAttributes, mission.carrierProperties) end -- Add opstransport to mission. @@ -2252,8 +2252,7 @@ function LEGION:RecruitAssetsForMission(Mission) local cohort=_cohort --Ops.Cohort#COHORT -- Check if cohort can perform transport to target. - --TODO: Option to filter transport carrier asset categories, attributes and/or properties. - local can=LEGION._CohortCan(cohort, AUFTRAG.Type.OPSTRANSPORT, Categories, Attributes, Properties, nil, TargetVec2) + local can=LEGION._CohortCan(cohort, AUFTRAG.Type.OPSTRANSPORT, Mission.carrierCategories, Mission.carrierAttributes, Mission.carrierProperties, nil, TargetVec2) -- MaxWeight of cargo assets is limited by the largets available cargo bay. We don't want to select, e.g., tanks that cannot be transported by APCs or helos. if can and (MaxWeight==nil or cohort.cargobayLimit>MaxWeight) then