This commit is contained in:
Applevangelist 2024-12-18 12:34:00 +01:00
parent 3efe02fe37
commit 925754f290
3 changed files with 45 additions and 9 deletions

View File

@ -5723,7 +5723,7 @@ function AUFTRAG:GetMissionTypesText(MissionTypes)
return text return text
end end
--- [NON-AIR] Set the mission waypoint coordinate where the mission is executed. Note that altitude is set via `:SetMissionAltitude`. --- [NON-AIR] Set the mission waypoint coordinate from where the mission is executed. Note that altitude is set via `:SetMissionAltitude`.
-- @param #AUFTRAG self -- @param #AUFTRAG self
-- @param Core.Point#COORDINATE Coordinate Coordinate where the mission is executed. -- @param Core.Point#COORDINATE Coordinate Coordinate where the mission is executed.
-- @return #AUFTRAG self -- @return #AUFTRAG self
@ -5751,8 +5751,9 @@ end
-- @param #AUFTRAG self -- @param #AUFTRAG self
-- @param Core.Point#COORDINATE Coordinate Egrees coordinate. -- @param Core.Point#COORDINATE Coordinate Egrees coordinate.
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate. -- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
-- @param #number Speed (Optional) Speed in knots to reach this waypoint. Defaults to mission speed.
-- @return #AUFTRAG self -- @return #AUFTRAG self
function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude) function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude, Speed)
-- Obviously a zone was passed. We get the coordinate. -- Obviously a zone was passed. We get the coordinate.
if Coordinate:IsInstanceOf("ZONE_BASE") then if Coordinate:IsInstanceOf("ZONE_BASE") then
@ -5765,14 +5766,19 @@ function AUFTRAG:SetMissionEgressCoord(Coordinate, Altitude)
self.missionEgressCoord.y=UTILS.FeetToMeters(Altitude) self.missionEgressCoord.y=UTILS.FeetToMeters(Altitude)
self.missionEgressCoordAlt = UTILS.FeetToMeters(Altitude) self.missionEgressCoordAlt = UTILS.FeetToMeters(Altitude)
end end
self.missionEgressCoordSpeed=Speed and Speed or nil
return self
end end
--- [Air] Set the mission ingress coordinate. This is the coordinate where the assigned group will fly before the actual mission coordinate. --- [Air] Set the mission ingress coordinate. This is the coordinate where the assigned group will fly before the actual mission coordinate.
-- @param #AUFTRAG self -- @param #AUFTRAG self
-- @param Core.Point#COORDINATE Coordinate Ingrees coordinate. -- @param Core.Point#COORDINATE Coordinate Ingrees coordinate.
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate. -- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
-- @param #number Speed (Optional) Speed in knots to reach this waypoint. Defaults to mission speed.
-- @return #AUFTRAG self -- @return #AUFTRAG self
function AUFTRAG:SetMissionIngressCoord(Coordinate, Altitude) function AUFTRAG:SetMissionIngressCoord(Coordinate, Altitude, Speed)
-- Obviously a zone was passed. We get the coordinate. -- Obviously a zone was passed. We get the coordinate.
if Coordinate:IsInstanceOf("ZONE_BASE") then if Coordinate:IsInstanceOf("ZONE_BASE") then
@ -5785,15 +5791,20 @@ function AUFTRAG:SetMissionIngressCoord(Coordinate, Altitude)
self.missionIngressCoord.y=UTILS.FeetToMeters(Altitude) self.missionIngressCoord.y=UTILS.FeetToMeters(Altitude)
self.missionIngressCoordAlt = UTILS.FeetToMeters(Altitude or 10000) self.missionIngressCoordAlt = UTILS.FeetToMeters(Altitude or 10000)
end end
self.missionIngressCoordSpeed=Speed and Speed or nil
return self
end end
--- [Air] Set the mission holding coordinate. This is the coordinate where the assigned group will fly before the actual mission execution starts. Do not forget to add a push condition, too! --- [Air] Set the mission holding coordinate. This is the coordinate where the assigned group will fly before the actual mission execution starts. Do not forget to add a push condition, too!
-- @param #AUFTRAG self -- @param #AUFTRAG self
-- @param Core.Point#COORDINATE Coordinate Holding coordinate. -- @param Core.Point#COORDINATE Coordinate Holding coordinate.
-- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate. -- @param #number Altitude (Optional) Altitude in feet. Default is y component of coordinate.
-- @param #number Speed (Optional) Speed in knots to reach this waypoint and hold there. Defaults to mission speed.
-- @param #number Duration (Optional) Duration in seconds on how long to hold, defaults to 15 minutes. Mission continues if either a push condition is met or the time is up. -- @param #number Duration (Optional) Duration in seconds on how long to hold, defaults to 15 minutes. Mission continues if either a push condition is met or the time is up.
-- @return #AUFTRAG self -- @return #AUFTRAG self
function AUFTRAG:SetMissionHoldingCoord(Coordinate, Altitude, Duration) function AUFTRAG:SetMissionHoldingCoord(Coordinate, Altitude, Speed, Duration)
-- Obviously a zone was passed. We get the coordinate. -- Obviously a zone was passed. We get the coordinate.
if Coordinate:IsInstanceOf("ZONE_BASE") then if Coordinate:IsInstanceOf("ZONE_BASE") then
@ -5807,6 +5818,10 @@ function AUFTRAG:SetMissionHoldingCoord(Coordinate, Altitude, Duration)
self.missionHoldingCoord.y=UTILS.FeetToMeters(Altitude) self.missionHoldingCoord.y=UTILS.FeetToMeters(Altitude)
self.missionHoldingCoordAlt = UTILS.FeetToMeters(Altitude or 10000) self.missionHoldingCoordAlt = UTILS.FeetToMeters(Altitude or 10000)
end end
self.missionHoldingCoordSpeed=Speed and Speed or nil
return self
end end
--- Get the mission egress coordinate if this was defined. --- Get the mission egress coordinate if this was defined.

View File

@ -1351,7 +1351,7 @@ CTLD.UnitTypeCapabilities = {
--- CTLD class version. --- CTLD class version.
-- @field #string version -- @field #string version
CTLD.version="1.1.19" CTLD.version="1.1.20"
--- Instantiate a new CTLD. --- Instantiate a new CTLD.
-- @param #CTLD self -- @param #CTLD self
@ -5389,6 +5389,27 @@ end
return Stock return Stock
end end
--- User - Query the cargo loaded from a specific unit
-- @param #CTLD self
-- @param Wrapper.Unit#UNIT Unit The (client) unit to query.
-- @return #number Troopsloaded
-- @return #number Cratesloaded
-- @return #table Cargo Table of #CTLD_CARGO objects
function CTLD:GetLoadedCargo(Unit)
local Troops = 0
local Crates = 0
local Cargo = {}
if Unit and Unit:IsAlive() then
local name = Unit:GetName()
if self.Loaded_Cargo[name] then
Troops = self.Loaded_Cargo[name].Troopsloaded or 0
Crates = self.Loaded_Cargo[name].Cratesloaded or 0
Cargo = self.Loaded_Cargo[name].Cargo or {}
end
end
return Troops, Crates, Cargo
end
--- User - function to get a table of statics cargo in stock --- User - function to get a table of statics cargo in stock
-- @param #CTLD self -- @param #CTLD self
-- @return #table Table Table of Stock, indexed by cargo type name -- @return #table Table Table of Stock, indexed by cargo type name

View File

@ -6124,11 +6124,11 @@ function OPSGROUP:RouteToMission(mission, delay)
local holdingcoord = mission:GetMissionHoldingCoord() local holdingcoord = mission:GetMissionHoldingCoord()
if holdingcoord then if holdingcoord then
waypoint=FLIGHTGROUP.AddWaypoint(self, holdingcoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionHoldingCoordAlt or self.altitudeCruise), false) waypoint=FLIGHTGROUP.AddWaypoint(self, holdingcoord, mission.missionHoldingCoordSpeed or SpeedToMission, uid, UTILS.MetersToFeet(mission.missionHoldingCoordAlt or self.altitudeCruise), false)
uid=waypoint.uid uid=waypoint.uid
-- Orbit until flaghold=1 (true) but max 5 min -- Orbit until flaghold=1 (true) but max 5 min
self.flaghold:Set(0) self.flaghold:Set(0)
local TaskOrbit = self.group:TaskOrbit(holdingcoord, mission.missionHoldingCoordAlt) local TaskOrbit = self.group:TaskOrbit(holdingcoord, mission.missionHoldingCoordAlt, UTILS.KnotsToMps(mission.missionHoldingCoordSpeed or SpeedToMission))
local TaskStop = self.group:TaskCondition(nil, self.flaghold.UserFlagName, 1, nil, mission.missionHoldingDuration or 900) local TaskStop = self.group:TaskCondition(nil, self.flaghold.UserFlagName, 1, nil, mission.missionHoldingDuration or 900)
local TaskCntr = self.group:TaskControlled(TaskOrbit, TaskStop) local TaskCntr = self.group:TaskControlled(TaskOrbit, TaskStop)
local TaskOver = self.group:TaskFunction("FLIGHTGROUP._FinishedWaiting", self) local TaskOver = self.group:TaskFunction("FLIGHTGROUP._FinishedWaiting", self)
@ -6140,7 +6140,7 @@ function OPSGROUP:RouteToMission(mission, delay)
end end
if ingresscoord then if ingresscoord then
waypoint=FLIGHTGROUP.AddWaypoint(self, ingresscoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionIngressCoordAlt or self.altitudeCruise), false) waypoint=FLIGHTGROUP.AddWaypoint(self, ingresscoord, mission.missionIngressCoordSpeed or SpeedToMission, uid, UTILS.MetersToFeet(mission.missionIngressCoordAlt or self.altitudeCruise), false)
uid=waypoint.uid uid=waypoint.uid
end end
@ -6182,7 +6182,7 @@ function OPSGROUP:RouteToMission(mission, delay)
if egresscoord then if egresscoord then
local Ewaypoint=nil --#OPSGROUP.Waypoint local Ewaypoint=nil --#OPSGROUP.Waypoint
if self:IsFlightgroup() then if self:IsFlightgroup() then
Ewaypoint=FLIGHTGROUP.AddWaypoint(self, egresscoord, SpeedToMission, waypoint.uid, UTILS.MetersToFeet(mission.missionEgressCoordAlt or self.altitudeCruise), false) Ewaypoint=FLIGHTGROUP.AddWaypoint(self, egresscoord, mission.missionEgressCoordSpeed or SpeedToMission, waypoint.uid, UTILS.MetersToFeet(mission.missionEgressCoordAlt or self.altitudeCruise), false)
elseif self:IsArmygroup() then elseif self:IsArmygroup() then
Ewaypoint=ARMYGROUP.AddWaypoint(self, egresscoord, SpeedToMission, waypoint.uid, mission.optionFormation, false) Ewaypoint=ARMYGROUP.AddWaypoint(self, egresscoord, SpeedToMission, waypoint.uid, mission.optionFormation, false)
elseif self:IsNavygroup() then elseif self:IsNavygroup() then