mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
#GROUP/CONTROLLABLE
* Added RecoveryTanker Task
This commit is contained in:
parent
5a7a23552d
commit
239e2ef86d
@ -62,6 +62,7 @@
|
|||||||
-- * @{#CONTROLLABLE.TaskOrbitCircle}: (AIR) Orbit at the current position of the first unit of the controllable at a specified altitude.
|
-- * @{#CONTROLLABLE.TaskOrbitCircle}: (AIR) Orbit at the current position of the first unit of the controllable at a specified altitude.
|
||||||
-- * @{#CONTROLLABLE.TaskOrbitCircleAtVec2}: (AIR) Orbit at a specified position at a specified altitude during a specified duration with a specified speed.
|
-- * @{#CONTROLLABLE.TaskOrbitCircleAtVec2}: (AIR) Orbit at a specified position at a specified altitude during a specified duration with a specified speed.
|
||||||
-- * @{#CONTROLLABLE.TaskRefueling}: (AIR) Refueling from the nearest tanker. No parameters.
|
-- * @{#CONTROLLABLE.TaskRefueling}: (AIR) Refueling from the nearest tanker. No parameters.
|
||||||
|
-- * @{#CONTROLLABLE.TaskRecoveryTanker}: (AIR) Set group to act as recovery tanker for a naval group.
|
||||||
-- * @{#CONTROLLABLE.TaskRoute}: (AIR + GROUND) Return a Mission task to follow a given route defined by Points.
|
-- * @{#CONTROLLABLE.TaskRoute}: (AIR + GROUND) Return a Mission task to follow a given route defined by Points.
|
||||||
-- * @{#CONTROLLABLE.TaskRouteToVec2}: (AIR + GROUND) Make the Controllable move to a given point.
|
-- * @{#CONTROLLABLE.TaskRouteToVec2}: (AIR + GROUND) Make the Controllable move to a given point.
|
||||||
-- * @{#CONTROLLABLE.TaskRouteToVec3}: (AIR + GROUND) Make the Controllable move to a given point.
|
-- * @{#CONTROLLABLE.TaskRouteToVec3}: (AIR + GROUND) Make the Controllable move to a given point.
|
||||||
@ -1367,6 +1368,31 @@ function CONTROLLABLE:TaskRefueling()
|
|||||||
return DCSTask
|
return DCSTask
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- (AIR) Act as Recovery Tanker for a naval/carrier group.
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @param Wrapper.Group#GROUP CarrierGroup
|
||||||
|
-- @param #number Speed Speed in meters per second
|
||||||
|
-- @param #number Altitude Altitude the tanker orbits at in meters
|
||||||
|
-- @param #number LastWptNumber (optional) Waypoint of carrier group that when reached, ends the recovery tanker task
|
||||||
|
-- @return DCS#Task The DCS task structure.
|
||||||
|
function CONTROLLABLE:TaskRecoveryTanker(CarrierGroup, Speed, Altitude, LastWptNumber)
|
||||||
|
|
||||||
|
local LastWptFlag = LastWptNumber and true or false
|
||||||
|
|
||||||
|
local DCSTask = {
|
||||||
|
id = "RecoveryTanker",
|
||||||
|
params = {
|
||||||
|
groupId = CarrierGroup:GetID(),
|
||||||
|
speed = Speed,
|
||||||
|
altitude = Altitude,
|
||||||
|
lastWptIndexFlag = LastWptFlag,
|
||||||
|
lastWptIndex = LastWptNumber
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return DCSTask
|
||||||
|
end
|
||||||
|
|
||||||
--- (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
--- (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param DCS#Vec2 Vec2 The point where to land.
|
-- @param DCS#Vec2 Vec2 The point where to land.
|
||||||
|
|||||||
@ -2855,3 +2855,27 @@ function GROUP:GetCustomCallSign(ShortCallsign,Keepnumber,CallsignTranslations)
|
|||||||
|
|
||||||
return callsign
|
return callsign
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @param #GROUP self
|
||||||
|
-- @param Wrapper.Group#GROUP CarrierGroup.
|
||||||
|
-- @param #number Speed Speed in knots.
|
||||||
|
-- @param #boolean ToKIAS If true, adjust speed to altitude (KIAS).
|
||||||
|
-- @param #number Altitude Altitude the tanker orbits at in feet.
|
||||||
|
-- @param #number Delay (optional) Set the task after this many seconds. Defaults to one.
|
||||||
|
-- @param #number LastWaypoint (optional) Waypoint number of carrier group that when reached, ends the recovery tanker task.
|
||||||
|
-- @return #GROUP self
|
||||||
|
function GROUP:SetAsRecoveryTanker(CarrierGroup,Speed,ToKIAS,Altitude,Delay,LastWaypoint)
|
||||||
|
|
||||||
|
local speed = ToKIAS == true and UTILS.KnotsToAltKIAS(Speed,Altitude) or Speed
|
||||||
|
speed = UTILS.KnotsToMps(speed)
|
||||||
|
|
||||||
|
local alt = UTILS.FeetToMeters(Altitude)
|
||||||
|
local delay = Delay or 1
|
||||||
|
|
||||||
|
local task = self:TaskRecoveryTanker(CarrierGroup,speed,alt,LastWaypoint)
|
||||||
|
|
||||||
|
self:SetTask(task,delay)
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user