**AUFTRAG v0.9.1**
- Added new mission type `CARGOTRANSPORT`
This commit is contained in:
Frank 2022-04-04 22:30:30 +02:00
parent e3d987bbdf
commit f01d7ecd96
3 changed files with 74 additions and 3 deletions

View File

@ -339,6 +339,9 @@ do -- Zones
-- Store color of zone.
Zone.Color=color
-- Store zone ID.
Zone.ZoneID=ZoneData.zoneId
-- Store in DB.
self.ZONENAMES[ZoneName] = ZoneName

View File

@ -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,
}

View File

@ -269,6 +269,10 @@
--
-- 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
--
-- A mission for a helicoptre or VSTOL plane to Hover at a point for a certain amount of time can be created with the @{#AUFTRAG.NewHOVER}() function.
@ -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.
@ -3453,6 +3491,19 @@ function AUFTRAG:Evaluate()
failed=true
end
elseif self.type==AUFTRAG.Type.CARGOTRANSPORT then
-- Get zone and cargo.
local zone=self.DCStask.params.zone --Core.Zone#ZONE
local cargo=self.DCStask.params.cargo --Wrapper.Static#STATIC
--Check that cargo is in drop zone.
if cargo and zone then
failed=not cargo:IsInZone(zone)
else
failed=true
end
elseif self.type==AUFTRAG.Type.RESCUEHELO then
-- Rescue helo has to survive.
@ -5002,6 +5053,19 @@ function AUFTRAG:GetDCSMissionTask(TaskControllable)
table.insert(DCStasks, DCStask)
elseif self.type==AUFTRAG.Type.CARGOTRANSPORT then
----------------------------
-- CARGOTRANSPORT Mission --
----------------------------
-- Task to transport cargo.
local TaskCargoTransportation={
id = "CargoTransportation",
params = {}
}
table.insert(DCStasks, TaskCargoTransportation)
elseif self.type==AUFTRAG.Type.RESCUEHELO then
@ -5340,6 +5404,8 @@ function AUFTRAG:GetMissionTaskforMissionType(MissionType)
mtask=ENUMS.MissionTask.REFUELING
elseif MissionType==AUFTRAG.Type.TROOPTRANSPORT then
mtask=ENUMS.MissionTask.TRANSPORT
elseif MissionType==AUFTRAG.Type.CARGOTRANSPORT then
mtask=ENUMS.MissionTask.TRANSPORT
elseif MissionType==AUFTRAG.Type.ARMORATTACK then
mtask=ENUMS.MissionTask.NOTHING
elseif MissionType==AUFTRAG.Type.HOVER then