mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OPS
**AUFTRAG v0.9.1** - Added new mission type `CARGOTRANSPORT`
This commit is contained in:
parent
e3d987bbdf
commit
f01d7ecd96
@ -338,6 +338,9 @@ do -- Zones
|
|||||||
|
|
||||||
-- Store color of zone.
|
-- Store color of zone.
|
||||||
Zone.Color=color
|
Zone.Color=color
|
||||||
|
|
||||||
|
-- Store zone ID.
|
||||||
|
Zone.ZoneID=ZoneData.zoneId
|
||||||
|
|
||||||
-- Store in DB.
|
-- Store in DB.
|
||||||
self.ZONENAMES[ZoneName] = ZoneName
|
self.ZONENAMES[ZoneName] = ZoneName
|
||||||
|
|||||||
@ -59,6 +59,7 @@
|
|||||||
-- @field #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
|
-- @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 #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 #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
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
|
|
||||||
@ -108,7 +109,8 @@ ZONE_BASE = {
|
|||||||
ZoneName = "",
|
ZoneName = "",
|
||||||
ZoneProbability = 1,
|
ZoneProbability = 1,
|
||||||
DrawID=nil,
|
DrawID=nil,
|
||||||
Color={}
|
Color={},
|
||||||
|
ZoneID=nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -268,6 +268,10 @@
|
|||||||
-- ## TROOPTRANSPORT
|
-- ## TROOPTRANSPORT
|
||||||
--
|
--
|
||||||
-- A troop transport mission can be created with the @{#AUFTRAG.NewTROOPTRANSPORT}() function.
|
-- 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
|
-- ## HOVER
|
||||||
--
|
--
|
||||||
@ -387,6 +391,7 @@ _AUFTRAGSNR=0
|
|||||||
-- @field #string CASENHANCED Enhanced CAS.
|
-- @field #string CASENHANCED Enhanced CAS.
|
||||||
-- @field #string HOVER Hover.
|
-- @field #string HOVER Hover.
|
||||||
-- @field #string GROUNDATTACK Ground attack.
|
-- @field #string GROUNDATTACK Ground attack.
|
||||||
|
-- @field #string CARGOTRANSPORT Cargo transport.
|
||||||
AUFTRAG.Type={
|
AUFTRAG.Type={
|
||||||
ANTISHIP="Anti Ship",
|
ANTISHIP="Anti Ship",
|
||||||
AWACS="AWACS",
|
AWACS="AWACS",
|
||||||
@ -421,7 +426,8 @@ AUFTRAG.Type={
|
|||||||
ARMORATTACK="Armor Attack",
|
ARMORATTACK="Armor Attack",
|
||||||
CASENHANCED="CAS Enhanced",
|
CASENHANCED="CAS Enhanced",
|
||||||
HOVER="Hover",
|
HOVER="Hover",
|
||||||
GROUNDATTACK="Ground Attack"
|
GROUNDATTACK="Ground Attack",
|
||||||
|
CARGOTRANSPORT="Cargo Transport"
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Mission status of an assigned group.
|
--- Mission status of an assigned group.
|
||||||
@ -568,7 +574,7 @@ AUFTRAG.Category={
|
|||||||
|
|
||||||
--- AUFTRAG class version.
|
--- AUFTRAG class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
AUFTRAG.version="0.9.0"
|
AUFTRAG.version="0.9.1"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -1620,6 +1626,38 @@ function AUFTRAG:NewTROOPTRANSPORT(TransportGroupSet, DropoffCoordinate, PickupC
|
|||||||
return mission
|
return mission
|
||||||
end
|
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.
|
--- **[AIR, GROUND, NAVAL]** Create a OPS TRANSPORT mission.
|
||||||
@ -3452,6 +3490,19 @@ function AUFTRAG:Evaluate()
|
|||||||
if Ntargets<Ntargets0 then
|
if Ntargets<Ntargets0 then
|
||||||
failed=true
|
failed=true
|
||||||
end
|
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
|
elseif self.type==AUFTRAG.Type.RESCUEHELO then
|
||||||
|
|
||||||
@ -5002,6 +5053,19 @@ function AUFTRAG:GetDCSMissionTask(TaskControllable)
|
|||||||
|
|
||||||
table.insert(DCStasks, DCStask)
|
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
|
elseif self.type==AUFTRAG.Type.RESCUEHELO then
|
||||||
|
|
||||||
@ -5340,6 +5404,8 @@ function AUFTRAG:GetMissionTaskforMissionType(MissionType)
|
|||||||
mtask=ENUMS.MissionTask.REFUELING
|
mtask=ENUMS.MissionTask.REFUELING
|
||||||
elseif MissionType==AUFTRAG.Type.TROOPTRANSPORT then
|
elseif MissionType==AUFTRAG.Type.TROOPTRANSPORT then
|
||||||
mtask=ENUMS.MissionTask.TRANSPORT
|
mtask=ENUMS.MissionTask.TRANSPORT
|
||||||
|
elseif MissionType==AUFTRAG.Type.CARGOTRANSPORT then
|
||||||
|
mtask=ENUMS.MissionTask.TRANSPORT
|
||||||
elseif MissionType==AUFTRAG.Type.ARMORATTACK then
|
elseif MissionType==AUFTRAG.Type.ARMORATTACK then
|
||||||
mtask=ENUMS.MissionTask.NOTHING
|
mtask=ENUMS.MissionTask.NOTHING
|
||||||
elseif MissionType==AUFTRAG.Type.HOVER then
|
elseif MissionType==AUFTRAG.Type.HOVER then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user