diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index af9e56964..b61e37094 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -338,6 +338,9 @@ do -- Zones -- Store color of zone. Zone.Color=color + + -- Store zone ID. + Zone.ZoneID=ZoneData.zoneId -- Store in DB. self.ZONENAMES[ZoneName] = ZoneName diff --git a/Moose Development/Moose/Core/Zone.lua b/Moose Development/Moose/Core/Zone.lua index 6a5bde026..85214622f 100644 --- a/Moose Development/Moose/Core/Zone.lua +++ b/Moose Development/Moose/Core/Zone.lua @@ -59,6 +59,7 @@ -- @field #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability. -- @field #number DrawID Unique ID of the drawn zone on the F10 map. -- @field #table Color Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value. +-- @field #number ZoneID ID of zone. Only zones defined in the ME have an ID! -- @extends Core.Fsm#FSM @@ -108,7 +109,8 @@ ZONE_BASE = { ZoneName = "", ZoneProbability = 1, DrawID=nil, - Color={} + Color={}, + ZoneID=nil, } diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 2bdfc9720..928e3d168 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -268,6 +268,10 @@ -- ## TROOPTRANSPORT -- -- A troop transport mission can be created with the @{#AUFTRAG.NewTROOPTRANSPORT}() function. +-- +-- ## CARGOTRANSPORT +-- +-- A cargo transport mission can be created with the @{#AUFTRAG.NewCARGOTRANSPORT}() function. -- -- ## HOVER -- @@ -387,6 +391,7 @@ _AUFTRAGSNR=0 -- @field #string CASENHANCED Enhanced CAS. -- @field #string HOVER Hover. -- @field #string GROUNDATTACK Ground attack. +-- @field #string CARGOTRANSPORT Cargo transport. AUFTRAG.Type={ ANTISHIP="Anti Ship", AWACS="AWACS", @@ -421,7 +426,8 @@ AUFTRAG.Type={ ARMORATTACK="Armor Attack", CASENHANCED="CAS Enhanced", HOVER="Hover", - GROUNDATTACK="Ground Attack" + GROUNDATTACK="Ground Attack", + CARGOTRANSPORT="Cargo Transport" } --- Mission status of an assigned group. @@ -568,7 +574,7 @@ AUFTRAG.Category={ --- AUFTRAG class version. -- @field #string version -AUFTRAG.version="0.9.0" +AUFTRAG.version="0.9.1" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -1620,6 +1626,38 @@ function AUFTRAG:NewTROOPTRANSPORT(TransportGroupSet, DropoffCoordinate, PickupC return mission end +--- **[AIR ROTARY]** Create a CARGO TRANSPORT mission. +-- **Important Note:** +-- The dropoff zone has to be a zone defined in the Mission Editor. This is due to a restriction in the used DCS task, which takes the zone ID as input. +-- Only ME zones have an ID that can be referenced. +-- @param #AUFTRAG self +-- @param Wrapper.Static#STATIC StaticCargo Static cargo object. +-- @param Core.Zone#ZONE DropZone Zone where to drop off the cargo. **Has to be a zone defined in the ME!** +-- @return #AUFTRAG self +function AUFTRAG:NewCARGOTRANSPORT(StaticCargo, DropZone) + + local mission=AUFTRAG:New(AUFTRAG.Type.CARGOTRANSPORT) + + mission:_TargetFromObject(StaticCargo) + + mission.missionTask=mission:GetMissionTaskforMissionType(AUFTRAG.Type.CARGOTRANSPORT) + + -- Set ROE and ROT. + mission.optionROE=ENUMS.ROE.ReturnFire + mission.optionROT=ENUMS.ROT.PassiveDefense + + mission.categories={AUFTRAG.Category.HELICOPTER} + + mission.DCStask=mission:GetDCSMissionTask() + + mission.DCStask.params.groupId=StaticCargo:GetID() + mission.DCStask.params.zoneId=DropZone.ZoneID + mission.DCStask.params.zone=DropZone + mission.DCStask.params.cargo=StaticCargo + + return mission +end + --[[ --- **[AIR, GROUND, NAVAL]** Create a OPS TRANSPORT mission. @@ -3452,6 +3490,19 @@ function AUFTRAG:Evaluate() if Ntargets