Merge branch 'FF/Ops' into FF/OpsDev

This commit is contained in:
Frank
2023-10-31 20:17:10 +01:00
147 changed files with 4277 additions and 2418 deletions

View File

@@ -62,7 +62,7 @@
--
-- The DCS Airbase APIs are used extensively within MOOSE. The AIRBASE class has for each DCS Airbase API a corresponding method.
-- To be able to distinguish easily in your code the difference between a AIRBASE API call and a DCS Airbase API call,
-- the first letter of the method is also capitalized. So, by example, the DCS Airbase method @{DCSWrapper.Airbase#Airbase.getName}()
-- the first letter of the method is also capitalized. So, by example, the DCS Airbase method DCSWrapper.Airbase#Airbase.getName()
-- is implemented in the AIRBASE class as @{#AIRBASE.GetName}().
--
-- @field #AIRBASE AIRBASE

View File

@@ -62,6 +62,7 @@
-- * @{#CONTROLLABLE.TaskLandAtZone}: (AIR) Land the controllable at a @{Core.Zone#ZONE_RADIUS).
-- * @{#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.TaskStrafing}: (AIR) Strafe a point Vec2 with onboard weapons.
-- * @{#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.
@@ -98,7 +99,7 @@
-- This method can also be used to **embed a function call when a certain waypoint has been reached**.
-- See below the **Tasks at Waypoints** section.
--
-- Demonstration Mission: [GRP-502 - Route at waypoint to random point](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/release-2-2-pre/GRP - Group Commands/GRP-502 - Route at waypoint to random point)
-- Demonstration Mission: [GRP-502 - Route at waypoint to random point](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/GRP%20-%20Group%20Commands/GRP-502%20-%20Route%20at%20waypoint%20to%20random%20point)
--
-- ## 2.5) Tasks at Waypoints
--
@@ -488,7 +489,7 @@ end
--- Return a Combo Task taking an array of Tasks.
-- @param #CONTROLLABLE self
-- @param DCS#TaskArray DCSTasks Array of @{DCSTasking.Task#Task}
-- @param DCS#TaskArray DCSTasks Array of DCSTasking.Task#Task
-- @return DCS#Task
function CONTROLLABLE:TaskCombo( DCSTasks )
@@ -909,6 +910,30 @@ function CONTROLLABLE:CommandEPLRS( SwitchOnOff, Delay )
return self
end
--- Set unlimited fuel. See [DCS command Unlimited Fuel](https://wiki.hoggitworld.com/view/DCS_command_setUnlimitedFuel).
-- @param #CONTROLLABLE self
-- @param #boolean OnOff Set unlimited fuel on = true or off = false.
-- @param #number Delay (Optional) Set the option only after x seconds.
-- @return #CONTROLLABLE self
function CONTROLLABLE:CommandSetUnlimitedFuel(OnOff, Delay)
local CommandSetFuel = {
id = 'SetUnlimitedFuel',
params = {
value = OnOff
}
}
if Delay and Delay > 0 then
SCHEDULER:New( nil, self.CommandSetUnlimitedFuel, { self, OnOff }, Delay )
else
self:SetCommand( CommandSetFuel )
end
return self
end
--- Set radio frequency. See [DCS command EPLRS](https://wiki.hoggitworld.com/view/DCS_command_setFrequency)
-- @param #CONTROLLABLE self
-- @param #number Frequency Radio frequency in MHz.
@@ -1073,6 +1098,42 @@ function CONTROLLABLE:TaskBombing( Vec2, GroupAttack, WeaponExpend, AttackQty, D
return DCSTask
end
--- (AIR) Strafe the point on the ground.
-- @param #CONTROLLABLE self
-- @param DCS#Vec2 Vec2 2D-coordinates of the point to deliver strafing at.
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aircraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aircraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
-- @param #number Length (optional) Length of the strafing area.
-- @param #number WeaponType (optional) The WeaponType. WeaponType is a number associated with a [corresponding weapons flags](https://wiki.hoggitworld.com/view/DCS_enum_weapon_flag)
-- @param DCS#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much ammunition will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion, e.g. AI.Task.WeaponExpend.ALL.
-- @param DCS#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
-- @param #boolean GroupAttack (optional) If true, all units in the group will attack the Unit when found.
-- @return DCS#Task The DCS task structure.
-- @usage
-- local attacker = GROUP:FindByName("Aerial-1")
-- local attackVec2 = ZONE:New("Strafe Attack"):GetVec2()
-- -- Attack with any cannons = 805306368, 4 runs, strafe a field of 200 meters
-- local task = attacker:TaskStrafing(attackVec2,4,200,805306368,AI.Task.WeaponExpend.ALL)
-- attacker:SetTask(task,2)
function CONTROLLABLE:TaskStrafing( Vec2, AttackQty, Length, WeaponType, WeaponExpend, Direction, GroupAttack )
local DCSTask = {
id = 'Strafing',
params = {
point = Vec2, -- req
weaponType = WeaponType or 1073741822,
expend = WeaponExpend or "Auto",
attackQty = AttackQty or 1, -- req
attackQtyLimit = AttackQty >1 and true or false,
direction = Direction and math.rad(Direction) or 0,
directionEnabled = Direction and true or false,
groupAttack = GroupAttack or false,
length = Length,
}
}
return DCSTask
end
--- (AIR) Attacking the map object (building, structure, etc).
-- @param #CONTROLLABLE self
-- @param DCS#Vec2 Vec2 2D-coordinates of the point to deliver weapon at.
@@ -1094,7 +1155,6 @@ function CONTROLLABLE:TaskAttackMapObject( Vec2, GroupAttack, WeaponExpend, Atta
groupAttack = GroupAttack or false,
expend = WeaponExpend or "Auto",
attackQtyLimit = AttackQty and true or false,
attackQty = AttackQty,
directionEnabled = Direction and true or false,
direction = Direction and math.rad(Direction) or 0,
altitudeEnabled = Altitude and true or false,
@@ -2167,7 +2227,7 @@ do -- Patrol methods
-- @return #CONTROLLABLE
function CONTROLLABLE:PatrolZones( ZoneList, Speed, Formation, DelayMin, DelayMax )
if not type( ZoneList ) == "table" then
if type( ZoneList ) ~= "table" then
ZoneList = { ZoneList }
end
@@ -2679,7 +2739,7 @@ do -- Route methods
-- @param Core.Zone#ZONE Zone The zone where to route to.
-- @param #boolean Randomize Defines whether to target point gets randomized within the Zone.
-- @param #number Speed The speed in m/s. Default is 5.555 m/s = 20 km/h.
-- @param Base#FORMATION Formation The formation string.
-- @param Core.Base#FORMATION Formation The formation string.
function CONTROLLABLE:TaskRouteToZone( Zone, Randomize, Speed, Formation )
self:F2( Zone )
@@ -2739,7 +2799,7 @@ do -- Route methods
-- @param #CONTROLLABLE self
-- @param DCS#Vec2 Vec2 The Vec2 where to route to.
-- @param #number Speed The speed in m/s. Default is 5.555 m/s = 20 km/h.
-- @param Base#FORMATION Formation The formation string.
-- @param Core.Base#FORMATION Formation The formation string.
function CONTROLLABLE:TaskRouteToVec2( Vec2, Speed, Formation )
local DCSControllable = self:GetDCSObject()
@@ -5269,3 +5329,54 @@ function CONTROLLABLE:TaskAerobaticsBarrelRoll(TaskAerobatics,Repeats,InitAltitu
return TaskAerobatics
end
--- [Air] Make an airplane or helicopter patrol between two points in a racetrack - resulting in a much tighter track around the start and end points.
-- @param #CONTROLLABLE self
-- @param Core.Point#COORDINATE Point1 Start point.
-- @param Core.Point#COORDINATE Point2 End point.
-- @param #number Altitude (Optional) Altitude in meters. Defaults to the altitude of the coordinate.
-- @param #number Speed (Optional) Speed in kph. Defaults to 500 kph.
-- @param #number Formation (Optional) Formation to take, e.g. ENUMS.Formation.FixedWing.Trail.Close, also see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_option_formation).
-- @param #boolean AGL (Optional) If true, set altitude to above ground level (AGL), not above sea level (ASL).
-- @param #number Delay (Optional) Set the task after delay seconds only.
-- @return #CONTROLLABLE self
function CONTROLLABLE:PatrolRaceTrack(Point1, Point2, Altitude, Speed, Formation, AGL, Delay)
local PatrolGroup = self -- Wrapper.Group#GROUP
if not self:IsInstanceOf( "GROUP" ) then
PatrolGroup = self:GetGroup() -- Wrapper.Group#GROUP
end
local delay = Delay or 1
self:F( { PatrolGroup = PatrolGroup:GetName() } )
if PatrolGroup:IsAir() then
if Formation then
PatrolGroup:SetOption(AI.Option.Air.id.FORMATION,Formation) -- https://wiki.hoggitworld.com/view/DCS_option_formation
end
local FromCoord = PatrolGroup:GetCoordinate()
local ToCoord = Point1:GetCoordinate()
-- Calculate the new Route
if Altitude then
local asl = true
if AGL then asl = false end
FromCoord:SetAltitude(Altitude, asl)
ToCoord:SetAltitude(Altitude, asl)
end
-- Create a "air waypoint", which is a "point" structure that can be given as a parameter to a Task
local Route = {}
Route[#Route + 1] = FromCoord:WaypointAir( AltType, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, Speed, true, nil, DCSTasks, description, timeReFuAr )
Route[#Route + 1] = ToCoord:WaypointAir( AltType, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, Speed, true, nil, DCSTasks, description, timeReFuAr )
local TaskRouteToZone = PatrolGroup:TaskFunction( "CONTROLLABLE.PatrolRaceTrack", Point2, Point1, Altitude, Speed, Formation, Delay )
PatrolGroup:SetTaskWaypoint( Route[#Route], TaskRouteToZone ) -- Set for the given Route at Waypoint 2 the TaskRouteToZone.
PatrolGroup:Route( Route, Delay ) -- Move after delay seconds to the Route. See the Route method for details.
end
return self
end

View File

@@ -30,7 +30,7 @@
--
-- ### Contributions:
--
-- * [**Entropy**](https://forums.eagle.ru/member.php?u=111471), **Afinegan**: Came up with the requirement for AIOnOff().
-- * **Entropy**, **Afinegan**: Came up with the requirement for AIOnOff().
--
-- ===
--
@@ -305,6 +305,8 @@ function GROUP:GetDCSObject()
if DCSGroup then
return DCSGroup
else
env.error("ERROR: Could not get DCS group object!")
end
return nil
@@ -1870,7 +1872,7 @@ function GROUP:InitModex(modex)
return self
end
--- Respawn the @{Wrapper.Group} at a @{Point}.
--- Respawn the @{Wrapper.Group} at a @{Core.Point}.
-- The method will setup the new group template according the Init(Respawn) settings provided for the group.
-- These settings can be provided by calling the relevant Init...() methods of the Group.
--

View File

@@ -32,8 +32,6 @@
--
-- ===
--
-- ![Banner Image](..\Presentations\MARKER\Marker_Main.jpg)
--
-- # The MARKER Class Idea
--
-- The MARKER class simplifies creating, updating and removing of markers on the F10 map.

View File

@@ -1684,7 +1684,7 @@ do -- Cargo
--- Add cargo.
-- @param #POSITIONABLE self
-- @param Core.Cargo#CARGO Cargo
-- @param Cargo.Cargo#CARGO Cargo
-- @return #POSITIONABLE
function POSITIONABLE:AddCargo( Cargo )
self.__.Cargo[Cargo] = Cargo
@@ -1700,7 +1700,7 @@ do -- Cargo
--- Remove cargo.
-- @param #POSITIONABLE self
-- @param Core.Cargo#CARGO Cargo
-- @param Cargo.Cargo#CARGO Cargo
-- @return #POSITIONABLE
function POSITIONABLE:RemoveCargo( Cargo )
self.__.Cargo[Cargo] = nil
@@ -1709,7 +1709,7 @@ do -- Cargo
--- Returns if carrier has given cargo.
-- @param #POSITIONABLE self
-- @return Core.Cargo#CARGO Cargo
-- @return Cargo.Cargo#CARGO Cargo
function POSITIONABLE:HasCargo( Cargo )
return self.__.Cargo[Cargo]
end
@@ -1733,7 +1733,7 @@ do -- Cargo
--- Get cargo item count.
-- @param #POSITIONABLE self
-- @return Core.Cargo#CARGO Cargo
-- @return Cargo.Cargo#CARGO Cargo
function POSITIONABLE:CargoItemCount()
local ItemCount = 0
for CargoName, Cargo in pairs( self.__.Cargo ) do

View File

@@ -8,7 +8,7 @@
--
-- ## Example Missions:
--
-- Demo missions can be found on [github](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop/Wrapper%20-%20Storage).
-- Demo missions can be found on [github](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop/Wrapper/Storage).
--
-- ===
--

View File

@@ -20,8 +20,8 @@
-- @module Wrapper.Unit
-- @image Wrapper_Unit.JPG
--- @type UNIT
---
-- @type UNIT
-- @field #string ClassName Name of the class.
-- @field #string UnitName Name of the unit.
-- @field #string GroupName Name of the group the unit belongs to.
@@ -561,7 +561,7 @@ end
--- Check if the unit is a tanker. Also retrieves the refuelling system (boom or probe) if applicable.
-- @param #UNIT self
-- @return #boolean If true, unit is refuelable (checks for the attribute "Refuelable").
-- @return #boolean If true, unit is a tanker (checks for the attribute "Tankers").
-- @return #number Refueling system (if any): 0=boom, 1=probe.
function UNIT:IsTanker()
self:F2( self.UnitName )
@@ -582,7 +582,7 @@ function UNIT:IsTanker()
-- Some hard coded data as this is not in the descriptors...
if typename=="IL-78M" then
system=1 --probe
elseif typename=="KC130" then
elseif typename=="KC130" or typename=="KC130J" then
system=1 --probe
elseif typename=="KC135BDA" then
system=1 --probe
@@ -590,6 +590,10 @@ function UNIT:IsTanker()
system=1 --probe
elseif typename=="S-3B Tanker" then
system=1 --probe
elseif typename=="KC_10_Extender" then
system=1 --probe
elseif typename=="KC_10_Extender_D" then
system=0 --boom
end
end

View File

@@ -14,7 +14,7 @@
--
-- ## Example Missions:
--
-- Demo missions can be found on [github](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop/Wrapper%20-%20Weapon).
-- Demo missions can be found on [github](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop/WRAPPER%20-%20Weapon).
--
-- ===
--