diff --git a/Moose Development/Moose/Core/Astar.lua b/Moose Development/Moose/Core/Astar.lua index a7b032ad9..803cf1b72 100644 --- a/Moose Development/Moose/Core/Astar.lua +++ b/Moose Development/Moose/Core/Astar.lua @@ -320,10 +320,12 @@ end --- Set valid neighbours to be in a certain distance. -- @param #ASTAR self --- @param #number MaxDistance Max distance between nodes in meters. Default is 2000 m. +-- @param #number MaxDistance (Optional) Max distance between nodes in meters. Default is 2000 m. -- @return #ASTAR self function ASTAR:SetValidNeighbourDistance(MaxDistance) + MaxDistance = MaxDistance or 2000 + self:SetValidNeighbourFunction(ASTAR.DistMax, MaxDistance) return self @@ -331,10 +333,12 @@ end --- Set valid neighbours to be in a certain distance. -- @param #ASTAR self --- @param #number MaxDistance Max distance between nodes in meters. Default is 2000 m. +-- @param #number MaxDistance (Optional) Max distance between nodes in meters. Default is 2000 m. -- @return #ASTAR self function ASTAR:SetValidNeighbourRoad(MaxDistance) + MaxDistance = MaxDistance or 2000 + self:SetValidNeighbourFunction(ASTAR.Road, MaxDistance) return self @@ -397,10 +401,10 @@ end -- The coordinate system is oriented along the line between start and end point. -- @param #ASTAR self -- @param #table ValidSurfaceTypes Valid surface types. By default is all surfaces are allowed. --- @param #number BoxHY Box "height" in meters along the y-coordinate. Default 40000 meters (40 km). --- @param #number SpaceX Additional space in meters before start and after end coordinate. Default 10000 meters (10 km). --- @param #number deltaX Increment in the direction of start to end coordinate in meters. Default 2000 meters. --- @param #number deltaY Increment perpendicular to the direction of start to end coordinate in meters. Default is same as deltaX. +-- @param #number BoxHY (Optional) Box "height" in meters along the y-coordinate. Default 40000 meters (40 km). +-- @param #number SpaceX (Optional) Additional space in meters before start and after end coordinate. Default 10000 meters (10 km). +-- @param #number deltaX (Optional) Increment in the direction of start to end coordinate in meters. Default 2000 meters. +-- @param #number deltaY (Optional) Increment perpendicular to the direction of start to end coordinate in meters. Default is same as deltaX. -- @param #boolean MarkGrid If true, create F10 map markers at grid nodes. -- @return #ASTAR self function ASTAR:CreateGrid(ValidSurfaceTypes, BoxHY, SpaceX, deltaX, deltaY, MarkGrid) @@ -547,7 +551,7 @@ end --- Function to check if distance between two nodes is less than a threshold distance. -- @param #ASTAR.Node nodeA First node. -- @param #ASTAR.Node nodeB Other node. --- @param #number distmax Max distance in meters. Default is 2000 m. +-- @param #number distmax (Optional) Max distance in meters. Default is 2000 m. -- @return #boolean If true, distance between the two nodes is below threshold. function ASTAR.DistMax(nodeA, nodeB, distmax) diff --git a/Moose Development/Moose/Core/Condition.lua b/Moose Development/Moose/Core/Condition.lua index 9d65f43cd..171e49f5a 100644 --- a/Moose Development/Moose/Core/Condition.lua +++ b/Moose Development/Moose/Core/Condition.lua @@ -257,7 +257,7 @@ end --- Evaluate conditon functions. -- @param #CONDITION self --- @param #boolean AnyTrue If `true`, evaluation return `true` if *any* condition function returns `true`. By default, *all* condition functions must return true. +-- @param #boolean AnyTrue (Optional) If `true`, evaluation return `true` if *any* condition function returns `true`. By default, *all* condition functions must return true. -- @return #boolean Result of condition functions. function CONDITION:Evaluate(AnyTrue) @@ -401,7 +401,7 @@ end --- Condition to check if time is greater than a given threshold time. -- @param #number Time Time in seconds. --- @param #boolean Absolute If `true`, abs. mission time from `timer.getAbsTime()` is checked. Default is relative mission time from `timer.getTime()`. +-- @param #boolean Absolute (Optional) If `true`, abs. mission time from `timer.getAbsTime()` is checked. Default is relative mission time from `timer.getTime()`. -- @return #boolean Returns `true` if time is greater than give the time. function CONDITION.IsTimeGreater(Time, Absolute) @@ -424,7 +424,7 @@ end --- Function that returns `true` (success) with a certain probability. For example, if you specify `Probability=80` there is an 80% chance that `true` is returned. -- Technically, a random number between 0 and 100 is created. If the given success probability is less then this number, `true` is returned. --- @param #number Probability Success probability in percent. Default 50 %. +-- @param #number Probability (Optional) Success probability in percent. Default 50 %. -- @return #boolean Returns `true` for success and `false` otherwise. function CONDITION.IsRandomSuccess(Probability) diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index 5ad19686c..1575e7296 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -1178,10 +1178,10 @@ end --- Get a generic static cargo group template from scratch for dynamic cargo spawns register. Does not register the template! -- @param #DATABASE self -- @param #string Name Name of the static. --- @param #string Typename Typename of the static. Defaults to "container_cargo". --- @param #number Mass Mass of the static. Defaults to 0. --- @param #number Coalition Coalition of the static. Defaults to coalition.side.BLUE. --- @param #number Country Country of the static. Defaults to country.id.GERMANY. +-- @param #string Typename (Optional) Typename of the static. Defaults to "container_cargo". +-- @param #number Mass (Optional) Mass of the static. Defaults to 0. +-- @param #number Coalition (Optional) Coalition of the static. Defaults to coalition.side.BLUE. +-- @param #number Country (Optional) Country of the static. Defaults to country.id.GERMANY. -- @return #table Static template table. function DATABASE:_GetGenericStaticCargoGroupTemplate(Name,Typename,Mass,Coalition,Country) local StaticTemplate = {} diff --git a/Moose Development/Moose/Core/Message.lua b/Moose Development/Moose/Core/Message.lua index 86dfd1858..7492bb997 100644 --- a/Moose Development/Moose/Core/Message.lua +++ b/Moose Development/Moose/Core/Message.lua @@ -198,10 +198,41 @@ function MESSAGE:ToClient( Client, Settings ) return self end +--- Sends a MESSAGE to a SET_GROUP, SET_UNIT, or SET_CLIENT. +-- @param #MESSAGE self +-- @param Core.Set#SET_GROUP Set The set to send to. +-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display. +-- @return self +function MESSAGE:ToSet(Set, Settings) + for _,_obj in pairs (Set:GetSetObjects() or {}) do + if _obj and _obj:IsAlive() then + if _obj:IsInstanceOf("SET_GROUP") then + self:ToGroup(_obj, Settings) + elseif _obj:IsInstanceOf("SET_CLIENT") or _obj:IsInstanceOf("SET_UNIT") then + self:ToUnit(_obj, Settings) + end + end + end + return self +end + +--- Sends a MESSAGE to a SET_GROUP, SET_UNIT, or SET_CLIENT if a condition is true. +-- @param #MESSAGE self +-- @param Core.Set#SET_GROUP Set The set to send to. +-- @param #boolean Condition The condition which needs to be true. +-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display. +-- @return self +function MESSAGE:ToSetIf(Set, Condition, Settings) + if Set and Condition == true then + self:ToSet(Set, Settings) + end + return self +end + --- Sends a MESSAGE to a Group. -- @param #MESSAGE self -- @param Wrapper.Group#GROUP Group to which the message is displayed. --- @param Core.Settings#Settings Settings (Optional) Settings for message display. +-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display. -- @return #MESSAGE Message object. function MESSAGE:ToGroup( Group, Settings ) self:F( Group.GroupName ) @@ -226,7 +257,7 @@ end --- Sends a MESSAGE to a Unit. -- @param #MESSAGE self -- @param Wrapper.Unit#UNIT Unit to which the message is displayed. --- @param Core.Settings#Settings Settings (Optional) Settings for message display. +-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display. -- @return #MESSAGE Message object. function MESSAGE:ToUnit( Unit, Settings ) self:F( Unit.IdentifiableName ) @@ -252,7 +283,7 @@ end --- Sends a MESSAGE to a Country. -- @param #MESSAGE self -- @param #number Country to which the message is displayed, e.g. country.id.GERMANY. For all country numbers see here: [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_country) --- @param Core.Settings#Settings Settings (Optional) Settings for message display. +-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display. -- @return #MESSAGE Message object. function MESSAGE:ToCountry( Country, Settings ) self:F(Country ) @@ -274,7 +305,7 @@ end -- @param #MESSAGE self -- @param #number Country to which the message is displayed, , e.g. country.id.GERMANY. For all country numbers see here: [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_country) -- @param #boolean Condition Sends the message only if the condition is true. --- @param Core.Settings#Settings Settings (Optional) Settings for message display. +-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display. -- @return #MESSAGE Message object. function MESSAGE:ToCountryIf( Country, Condition, Settings ) self:F(Country ) @@ -379,7 +410,7 @@ end --- Sends a MESSAGE to all players. -- @param #MESSAGE self --- @param Core.Settings#Settings Settings (Optional) Settings for message display. +-- @param Core.Settings#SETTINGS Settings (Optional) Settings for message display. -- @param #number Delay (Optional) Delay in seconds before the message is send. Default instantly (`nil`). -- @return #MESSAGE self -- @usage diff --git a/Moose Development/Moose/Core/Pathline.lua b/Moose Development/Moose/Core/Pathline.lua index bc6e9305e..0efe2ddab 100644 --- a/Moose Development/Moose/Core/Pathline.lua +++ b/Moose Development/Moose/Core/Pathline.lua @@ -253,7 +253,7 @@ end --- Get the n-th point of the pathline. -- @param #PATHLINE self --- @param #number n The index of the point. Default is the first point. +-- @param #number n (optional) The index of the point. Default is the first point. -- @return #PATHLINE.Point Point. function PATHLINE:GetPointFromIndex(n) @@ -275,7 +275,7 @@ end --- Get the 3D position of the n-th point. -- @param #PATHLINE self -- @param #number n The n-th point. --- @return DCS#VEC3 Position in 3D. +-- @return DCS#Vec3 Position in 3D. function PATHLINE:GetPoint3DFromIndex(n) local point=self:GetPointFromIndex(n) @@ -290,7 +290,7 @@ end --- Get the 2D position of the n-th point. -- @param #PATHLINE self -- @param #number n The n-th point. --- @return DCS#VEC2 Position in 3D. +-- @return DCS#Vec2 Position in 3D. function PATHLINE:GetPoint2DFromIndex(n) local point=self:GetPointFromIndex(n) @@ -360,8 +360,8 @@ end --- Draw line on F10 map. -- @param #PATHLINE self -- @param #number Recipient Recipent of the line: -1=All. --- @param #table Color Color as RGB table plus alpha value. Default {1, 0, 0, 1.0}. --- @param #number LineType Line type: 1=Solid (default). +-- @param #table Color (optional) Color as RGB table plus alpha value. Default {1, 0, 0, 1.0}. +-- @param #number LineType (optional) Line type: 1=Solid (default). -- @return #PATHLINE self function PATHLINE:DrawLine(Recipient, Color, LineType) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index f67ffb59d..803744936 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -610,7 +610,7 @@ do -- COORDINATE --- Find the closest static to the COORDINATE within a certain radius. -- @param #COORDINATE self - -- @param #number radius Scan radius in meters. Default 100 m. + -- @param #number radius (Optional) Scan radius in meters. Default 100 m. -- @return Wrapper.Static#STATIC The closest static or #nil if no unit is inside the given radius. function COORDINATE:FindClosestStatic(radius) @@ -633,7 +633,7 @@ do -- COORDINATE --- Find the closest unit to the COORDINATE within a certain radius. -- @param #COORDINATE self - -- @param #number radius Scan radius in meters. Default 100 m. + -- @param #number radius (Optional) Scan radius in meters. Default 100 m. -- @return Wrapper.Unit#UNIT The closest unit or #nil if no unit is inside the given radius. function COORDINATE:FindClosestUnit(radius) @@ -678,7 +678,7 @@ do -- COORDINATE --- Find the closest scenery to the COORDINATE within a certain radius. -- @param #COORDINATE self - -- @param #number radius Scan radius in meters. Default 100 m. + -- @param #number radius (Optional) Scan radius in meters. Default 100 m. -- @return Wrapper.Scenery#SCENERY The closest scenery or #nil if no object is inside the given radius. function COORDINATE:FindClosestScenery(radius) @@ -716,8 +716,8 @@ do -- COORDINATE --- Add a Distance in meters from the COORDINATE orthonormal plane, with the given angle, and calculate the new COORDINATE. -- @param #COORDINATE self -- @param DCS#Distance Distance The Distance to be added in meters. - -- @param DCS#Angle Angle The Angle in degrees. Defaults to 0 if not specified (nil). - -- @param #boolean Keepalt If true, keep altitude of original coordinate. Default is that the new coordinate is created at the translated land height. + -- @param DCS#Angle Angle (Optional) The Angle in degrees. Defaults to 0 if not specified (nil). + -- @param #boolean Keepalt (Optional) If true, keep altitude of original coordinate. Default is that the new coordinate is created at the translated land height. -- @param #boolean Overwrite If true, overwrite the original COORDINATE with the translated one. Otherwise, create a new COORDINATE. -- @return #COORDINATE The new calculated COORDINATE. function COORDINATE:Translate( Distance, Angle, Keepalt, Overwrite ) @@ -958,7 +958,7 @@ do -- COORDINATE --- Return an intermediate COORDINATE between this an another coordinate. -- @param #COORDINATE self -- @param #COORDINATE ToCoordinate The other coordinate. - -- @param #number Fraction The fraction (0,1) where the new coordinate is created. Default 0.5, i.e. in the middle. + -- @param #number Fraction (Optional) The fraction (0,1) where the new coordinate is created. Default 0.5, i.e. in the middle. -- @return #COORDINATE Coordinate between this and the other coordinate. function COORDINATE:GetIntermediateCoordinate( ToCoordinate, Fraction ) @@ -1514,7 +1514,7 @@ do -- COORDINATE -- @param Core.Settings#SETTINGS Settings -- @param #string Language (Optional) Language "en" or "ru" -- @param #boolean MagVar If true, also state angle in magnetic - -- @param #number Precision Rounding precision, defaults to 0 + -- @param #number Precision (Optional) Rounding precision, defaults to 0 -- @return #string The BR Text function COORDINATE:GetBRText( AngleRadians, Distance, Settings, Language, MagVar, Precision ) @@ -1555,7 +1555,7 @@ do -- COORDINATE --- Set altitude. -- @param #COORDINATE self -- @param #number altitude New altitude in meters. - -- @param #boolean asl Altitude above sea level. Default is above ground level. + -- @param #boolean asl (Optional) Altitude above sea level. Default is above ground level. -- @return #COORDINATE The COORDINATE with adjusted altitude. function COORDINATE:SetAltitude(altitude, asl) local alt=altitude @@ -1581,7 +1581,7 @@ do -- COORDINATE -- @param #COORDINATE.WaypointAltType AltType The altitude type. -- @param #COORDINATE.WaypointType Type The route point type. -- @param #COORDINATE.WaypointAction Action The route point action. - -- @param DCS#Speed Speed Airspeed in km/h. Default is 500 km/h. + -- @param DCS#Speed Speed (Optional) Airspeed in km/h. Default is 500 km/h. -- @param #boolean SpeedLocked true means the speed is locked. -- @param Wrapper.Airbase#AIRBASE airbase The airbase for takeoff and landing points. -- @param #table DCSTasks A table of @{DCS#Task} items which are executed at the waypoint. @@ -1741,7 +1741,7 @@ do -- COORDINATE -- @param #COORDINATE self -- @param DCS#Speed Speed Airspeed in km/h. -- @param Wrapper.Airbase#AIRBASE airbase The airbase for takeoff and landing points. - -- @param #number timeReFuAr Time in minutes, the aircraft stays at the airbase. Default 10 min. + -- @param #number timeReFuAr (Optional) Time in minutes, the aircraft stays at the airbase. Default 10 min. -- @param #table DCSTasks A table of @{DCS#Task} items which are executed at the waypoint. -- @param #string description A text description of the waypoint, which will be shown on the F10 map. -- @return #table The route point. @@ -2148,7 +2148,7 @@ do -- COORDINATE --- Creates an explosion at the point of a certain intensity. -- @param #COORDINATE self - -- @param #number ExplosionIntensity Intensity of the explosion in kg TNT. Default 100 kg. + -- @param #number ExplosionIntensity (Optional) Intensity of the explosion in kg TNT. Default 100 kg. -- @param #number Delay (Optional) Delay before explosion is triggered in seconds. -- @return #COORDINATE self function COORDINATE:Explosion( ExplosionIntensity, Delay ) @@ -2163,7 +2163,7 @@ do -- COORDINATE --- Creates an illumination bomb at the point. -- @param #COORDINATE self - -- @param #number Power Power of illumination bomb in Candela. Default 1000 cd. + -- @param #number Power (Optional) Power of illumination bomb in Candela. Default 1000 cd. -- @param #number Delay (Optional) Delay before bomb is ignited in seconds. -- @return #COORDINATE self function COORDINATE:IlluminationBomb(Power, Delay) @@ -2622,10 +2622,10 @@ do -- COORDINATE -- Creates a line on the F10 map from one point to another. -- @param #COORDINATE self -- @param #COORDINATE Endpoint COORDINATE to where the line is drawn. - -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. - -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default). - -- @param #number Alpha Transparency [0,1]. Default 1. - -- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. + -- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. + -- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default). + -- @param #number Alpha (Optional) Transparency [0,1]. Default 1. + -- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @param #string Text (Optional) Text displayed when mark is added. Default none. -- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again. @@ -2646,13 +2646,13 @@ do -- COORDINATE --- Circle to all. -- Creates a circle on the map with a given radius, color, fill color, and outline. -- @param #COORDINATE self - -- @param #number Radius Radius in meters. Default 1000 m. - -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. - -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default). - -- @param #number Alpha Transparency [0,1]. Default 1. - -- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. - -- @param #number FillAlpha Transparency [0,1]. Default 0.15. - -- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. + -- @param #number Radius (Optional) Radius in meters. Default 1000 m. + -- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. + -- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default). + -- @param #number Alpha (Optional) Transparency [0,1]. Default 1. + -- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. + -- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. + -- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @param #string Text (Optional) Text displayed when mark is added. Default none. -- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again. @@ -2686,12 +2686,12 @@ do -- COORDINATE -- Creates a line on the F10 map from one point to another. -- @param #COORDINATE self -- @param #COORDINATE Endpoint COORDINATE in the opposite corner. - -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. - -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default). - -- @param #number Alpha Transparency [0,1]. Default 1. - -- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. - -- @param #number FillAlpha Transparency [0,1]. Default 0.15. - -- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. + -- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. + -- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default). + -- @param #number Alpha (Optional) Transparency [0,1]. Default 1. + -- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. + -- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. + -- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @param #string Text (Optional) Text displayed when mark is added. Default none. -- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again. @@ -2722,12 +2722,12 @@ do -- COORDINATE -- @param #COORDINATE Coord2 Second COORDINATE of the quad shape. -- @param #COORDINATE Coord3 Third COORDINATE of the quad shape. -- @param #COORDINATE Coord4 Fourth COORDINATE of the quad shape. - -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. - -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default). - -- @param #number Alpha Transparency [0,1]. Default 1. - -- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. - -- @param #number FillAlpha Transparency [0,1]. Default 0.15. - -- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. + -- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. + -- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default). + -- @param #number Alpha (Optional) Transparency [0,1]. Default 1. + -- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. + -- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. + -- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @param #string Text (Optional) Text displayed when mark is added. Default none. -- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again. @@ -2759,12 +2759,12 @@ do -- COORDINATE --- Creates a free form shape on the F10 map. The first point is the current COORDINATE. The remaining points need to be specified. -- @param #COORDINATE self -- @param #table Coordinates Table of coordinates of the remaining points of the shape. - -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. - -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default). - -- @param #number Alpha Transparency [0,1]. Default 1. - -- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. - -- @param #number FillAlpha Transparency [0,1]. Default 0.15. - -- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. + -- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. + -- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default). + -- @param #number Alpha (Optional) Transparency [0,1]. Default 1. + -- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. + -- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. + -- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @param #string Text (Optional) Text displayed when mark is added. Default none. -- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again. @@ -2865,12 +2865,12 @@ do -- COORDINATE --- Text to all. Creates a text imposed on the map at the COORDINATE. Text scales with the map. -- @param #COORDINATE self -- @param #string Text Text displayed on the F10 map. - -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. - -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default). - -- @param #number Alpha Transparency [0,1]. Default 1. - -- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. - -- @param #number FillAlpha Transparency [0,1]. Default 0.3. - -- @param #number FontSize Font size. Default 14. + -- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. + -- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default). + -- @param #number Alpha (Optional) Transparency [0,1]. Default 1. + -- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. + -- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.3. + -- @param #number FontSize (Optional) Font size. Default 14. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again. function COORDINATE:TextToAll(Text, Coalition, Color, Alpha, FillColor, FillAlpha, FontSize, ReadOnly) @@ -2895,12 +2895,12 @@ do -- COORDINATE --- Arrow to all. Creates an arrow from the COORDINATE to the endpoint COORDINATE on the F10 map. There is no control over other dimensions of the arrow. -- @param #COORDINATE self -- @param #COORDINATE Endpoint COORDINATE where the tip of the arrow is pointing at. - -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. - -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default). - -- @param #number Alpha Transparency [0,1]. Default 1. - -- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. - -- @param #number FillAlpha Transparency [0,1]. Default 0.15. - -- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. + -- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. + -- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red (default). + -- @param #number Alpha (Optional) Transparency [0,1]. Default 1. + -- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. + -- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. + -- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @param #string Text (Optional) Text displayed when mark is added. Default none. -- @return #number The resulting Mark ID, which is a number. Can be used to remove the object again. @@ -2930,7 +2930,7 @@ do -- COORDINATE --- Returns if a Coordinate has Line of Sight (LOS) with the ToCoordinate. -- @param #COORDINATE self -- @param #COORDINATE ToCoordinate - -- @param #number Offset Height offset in meters. Default 2 m. + -- @param #number Offset (Optional) Height offset in meters. Default 2 m. -- @return #boolean true If the ToCoordinate has LOS with the Coordinate, otherwise false. function COORDINATE:IsLOS( ToCoordinate, Offset ) @@ -3286,7 +3286,7 @@ do -- COORDINATE -- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from. -- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object. -- @param #boolean MagVar If true, also get angle in MagVar for BR/BRA - -- @param #number Precision Rounding precision, currently full km as default (=0) + -- @param #number Precision (Optional) Rounding precision, currently full km as default (=0) -- @return #string The BR text. function COORDINATE:ToStringBR( FromCoordinate, Settings, MagVar, Precision ) local DirectionVec3 = FromCoordinate:GetDirectionVec3( self ) @@ -3300,7 +3300,7 @@ do -- COORDINATE -- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from. -- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object. -- @param #boolean MagVar If true, also get angle in MagVar for BR/BRA - -- @param #number Precision Rounding precision, currently full km as default (=0) + -- @param #number Precision (Optional) Rounding precision, currently full km as default (=0) -- @return #string The BR text. function COORDINATE:ToStringBearing( FromCoordinate, Settings, MagVar, Precision ) local DirectionVec3 = FromCoordinate:GetDirectionVec3( self ) @@ -3714,8 +3714,8 @@ do -- COORDINATE -- * Uses default settings in COORDINATE. -- * Can be overridden if for a GROUP containing x clients, a menu was selected to override the default. -- @param #COORDINATE self - -- @param Wrapper.Controllable#CONTROLLABLE Controllable The controllable to retrieve the settings from, otherwise the default settings will be chosen. - -- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object. + -- @param Wrapper.Controllable#CONTROLLABLE Controllable (Optional) The controllable to retrieve the settings from, otherwise the default settings will be chosen. + -- @param Core.Settings#SETTINGS Settings (Optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object. -- @return #string The coordinate Text in the configured coordinate system. function COORDINATE:ToString( Controllable, Settings ) @@ -3750,7 +3750,7 @@ do -- COORDINATE -- * Can be overridden if for a GROUP containing x clients, a menu was selected to override the default. -- @param #COORDINATE self -- @param Wrapper.Controllable#CONTROLLABLE Controllable - -- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object. + -- @param Core.Settings#SETTINGS Settings (Optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object. -- @return #string The pressure text in the configured measurement system. function COORDINATE:ToStringPressure( Controllable, Settings ) diff --git a/Moose Development/Moose/Core/Scheduler.lua b/Moose Development/Moose/Core/Scheduler.lua index e88d4a7ec..944e820cc 100644 --- a/Moose Development/Moose/Core/Scheduler.lua +++ b/Moose Development/Moose/Core/Scheduler.lua @@ -231,7 +231,7 @@ end -- @param #number Repeat Specifies the time interval in seconds when the scheduler will call the event function. -- @param #number RandomizeFactor Specifies a randomization factor between 0 and 1 to randomize the Repeat. -- @param #number Stop Time interval in seconds after which the scheduler will be stopped. --- @param #number TraceLevel Trace level [0,3]. Default 3. +-- @param #number TraceLevel (Optional) Trace level [0,3]. Default 3. -- @param Core.Fsm#FSM Fsm Finite state model. -- @return #string The Schedule ID of the planned schedule. function SCHEDULER:Schedule( MasterObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop, TraceLevel, Fsm ) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index 172e7422d..b6e00b969 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -54,7 +54,7 @@ do -- SET_BASE - --- + --- SET_BASE class. -- @type SET_BASE -- @field #table Filter Table of filters. -- @field #table Set Table of objects. @@ -62,6 +62,7 @@ do -- SET_BASE -- @field #table List Unused table. -- @field Core.Scheduler#SCHEDULER CallScheduler -- @field #SET_BASE.Filters Filter Filters + -- @field #booleaen filterNoRegex If true, FilterPrefix ignores special characters and evaluates plain string. -- @extends Core.Base#BASE --- The @{Core.Set#SET_BASE} class defines the core functions that define a collection of objects. @@ -100,6 +101,7 @@ do -- SET_BASE ["neutral"] = coalition.side.NEUTRAL, }, }, + filterNoRegex=false, } --- Filters @@ -244,6 +246,26 @@ do -- SET_BASE return ObjectFound end + + --- Compares string for FilterPrefix function. + -- @param #SET_BASE self + -- @param #string Name The Name of the object. + -- @param #string Pattern The pattern that is contained in the Name. + -- @param #boolean NoRegex (Optional) If `true`, special characters in the Name are interpreted as plain text and not regular expressions. Default is `self.filterNoregex`. + -- @param #boolean ReplaceDash If `true`, dashes are not used as regex. + -- @return #boolean Returns `true`, if the pattern is contained in the name and false otherwise. + function SET_BASE:_SearchPattern(Name, Pattern, NoRegex, ReplaceDash) + NoRegex=NoRegex or self.filterNoRegex + if ReplaceDash==true then + -- Not sure why "-" is replaced by "%-" ?! - So we can still match group names with a dash in them + -- reason is that the string is interpreted as a pattern and "-" is a special character then. For interpreting it as a string, fourth parameter needs to be set to true. + Pattern=Pattern:gsub("-", "%%-") + end + local contain=string.find(Name, Pattern, 1, NoRegex) + return contain + end + + --- Gets the Set. -- @param #SET_BASE self -- @return #SET_BASE self @@ -551,7 +573,7 @@ do -- SET_BASE --- Define the SET iterator **"limit"**. -- @param #SET_BASE self - -- @param #number Limit Defines how many objects are evaluated of the set as part of the Some iterators. The default is 1. + -- @param #number Limit (Optional) Defines how many objects are evaluated of the set as part of the Some iterators. The default is 1. -- @return #SET_BASE self function SET_BASE:SetSomeIteratorLimit(Limit) @@ -1556,7 +1578,7 @@ do --- Set filter timer interval for FilterZones if using active filtering with FilterStart(). -- @param #SET_GROUP self - -- @param #number Seconds Seconds between check intervals, defaults to 30. **Caution** - do not be too agressive with timing! Groups are usually not moving fast enough + -- @param #number Seconds (Optional) Seconds between check intervals, defaults to 30. **Caution** - do not be too agressive with timing! Groups are usually not moving fast enough -- to warrant a check of below 10 seconds. -- @return #SET_GROUP self function SET_GROUP:FilterZoneTimer(Seconds) @@ -2094,19 +2116,16 @@ do if self.Filter.GroupPrefixes and MGroupInclude then local MGroupPrefix = false for GroupPrefixId, GroupPrefix in pairs(self.Filter.GroupPrefixes) do - --self:I({ "Prefix:", MGroup:GetName(), GroupPrefix }) - if string.find(MGroup:GetName(), string.gsub(GroupPrefix,"-","%%-"),1) then + if self:_SearchPattern(MGroup:GetName(), GroupPrefix, false, true) then MGroupPrefix = true end end MGroupInclude = MGroupInclude and MGroupPrefix - --self:I("Is Included: "..tostring(MGroupInclude)) end if self.Filter.Zones and MGroupInclude then local MGroupZone = false for ZoneName, Zone in pairs(self.Filter.Zones) do - --self:T("Zone:", ZoneName) if MGroup:IsInZone(Zone) then MGroupZone = true end @@ -2120,7 +2139,6 @@ do MGroupInclude = MGroupInclude and MGroupFunc end - --self:I(MGroupInclude) return MGroupInclude end @@ -2637,7 +2655,7 @@ do -- SET_UNIT --- Set filter timer interval for FilterZones if using active filtering with FilterStart(). -- @param #SET_UNIT self - -- @param #number Seconds Seconds between check intervals, defaults to 30. **Caution** - do not be too agressive with timing! Groups are usually not moving fast enough + -- @param #number Seconds (Optional) Seconds between check intervals, defaults to 30. **Caution** - do not be too agressive with timing! Groups are usually not moving fast enough -- to warrant a check of below 10 seconds. -- @return #SET_UNIT self function SET_UNIT:FilterZoneTimer(Seconds) @@ -3329,9 +3347,8 @@ do -- SET_UNIT if self.Filter.UnitPrefixes and MUnitInclude then local MUnitPrefix = false - for UnitPrefixId, UnitPrefix in pairs(self.Filter.UnitPrefixes) do - --self:T3({ "Prefix:", string.find(MUnit:GetName(), UnitPrefix, 1), UnitPrefix }) - if string.find(MUnit:GetName(), UnitPrefix, 1) then + for UnitPrefixId, UnitPrefix in pairs(self.Filter.UnitPrefixes) do + if self:_SearchPattern(MUnit:GetName(), UnitPrefix, false, true) then MUnitPrefix = true end end @@ -4102,8 +4119,7 @@ do -- SET_STATIC if self.Filter.StaticPrefixes then local MStaticPrefix = false for StaticPrefixId, StaticPrefix in pairs(self.Filter.StaticPrefixes) do - --self:T(3({ "Prefix:", string.find(MStatic:GetName(), StaticPrefix, 1), StaticPrefix }) - if string.find(MStatic:GetName(), StaticPrefix, 1) then + if self:_SearchPattern(MStatic:GetName(), StaticPrefix, false, true) then MStaticPrefix = true end end @@ -4560,7 +4576,7 @@ do -- SET_CLIENT --- Set filter timer interval for FilterZones if using active filtering with FilterStart(). -- @param #SET_CLIENT self - -- @param #number Seconds Seconds between check intervals, defaults to 30. **Caution** - do not be too agressive with timing! Groups are usually not moving fast enough + -- @param #number Seconds (Optional) Seconds between check intervals, defaults to 30. **Caution** - do not be too agressive with timing! Groups are usually not moving fast enough -- to warrant a check of below 10 seconds. -- @return #SET_CLIENT self function SET_CLIENT:FilterZoneTimer(Seconds) @@ -4886,12 +4902,10 @@ do -- SET_CLIENT if self.Filter.ClientPrefixes and MClientInclude then local MClientPrefix = false for ClientPrefixId, ClientPrefix in pairs(self.Filter.ClientPrefixes) do - --self:T3({ "Prefix:", string.find(MClient.UnitName, ClientPrefix, 1), ClientPrefix }) - if string.find(MClient.UnitName, ClientPrefix, 1) then + if self:_SearchPattern(MClient.UnitName, ClientPrefix) then MClientPrefix = true end end - --self:T({ "Evaluated Prefix", MClientPrefix }) MClientInclude = MClientInclude and MClientPrefix end @@ -4912,7 +4926,7 @@ do -- SET_CLIENT local playername = MClient:GetPlayerName() or "Unknown" --self:T(playername) for _,_Playername in pairs(self.Filter.Playernames) do - if playername and string.find(playername,_Playername) then + if playername and self:_SearchPattern(playername,_Playername) then MClientPlayername = true end end @@ -4925,7 +4939,7 @@ do -- SET_CLIENT local callsign = MClient:GetCallsign() --self:I(callsign) for _,_Callsign in pairs(self.Filter.Callsigns) do - if callsign and string.find(callsign,_Callsign,1,true) then + if callsign and self:_SearchPattern(callsign,_Callsign, true) then MClientCallsigns = true end end @@ -5346,12 +5360,10 @@ do -- SET_PLAYER if self.Filter.ClientPrefixes then local MClientPrefix = false for ClientPrefixId, ClientPrefix in pairs(self.Filter.ClientPrefixes) do - --self:T(3({ "Prefix:", string.find(MClient.UnitName, ClientPrefix, 1), ClientPrefix }) - if string.find(MClient.UnitName, ClientPrefix, 1) then + if self:_SearchPattern(MClient.UnitName,ClientPrefix) then MClientPrefix = true end end - --self:T(({ "Evaluated Prefix", MClientPrefix }) MClientInclude = MClientInclude and MClientPrefix end end @@ -6000,12 +6012,12 @@ do -- SET_ZONE --- Draw all zones in the set on the F10 map. -- @param #SET_ZONE self - -- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. + -- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red. - -- @param #number Alpha Transparency [0,1]. Default 1. - -- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. - -- @param #number FillAlpha Transparency [0,1]. Default 0.15. - -- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. + -- @param #number Alpha (Optional) Transparency [0,1]. Default 1. + -- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. + -- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. + -- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @return #SET_ZONE self function SET_ZONE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly) @@ -6056,12 +6068,10 @@ do -- SET_ZONE if self.Filter.Prefixes then local MZonePrefix = false for ZonePrefixId, ZonePrefix in pairs(self.Filter.Prefixes) do - --self:T(2({ "Prefix:", string.find(MZoneName, ZonePrefix, 1), ZonePrefix }) - if string.find(MZoneName, ZonePrefix, 1) then + if self:_SearchPattern(MZoneName, ZonePrefix, false, true) then MZonePrefix = true end end - --self:T(({ "Evaluated Prefix", MZonePrefix }) MZoneInclude = MZoneInclude and MZonePrefix end end @@ -6147,7 +6157,7 @@ do -- SET_ZONE --- Set the check time for SET_ZONE:Trigger() -- @param #SET_ZONE self - -- @param #number seconds Check every seconds for objects entering or leaving the zone. Defaults to 5 secs. + -- @param #number seconds (Optional) Check every seconds for objects entering or leaving the zone. Defaults to 5 secs. -- @return #SET_ZONE self function SET_ZONE:SetCheckTime(seconds) self.Checktime = seconds or 5 @@ -6567,12 +6577,10 @@ do -- SET_ZONE_GOAL if self.Filter.Prefixes then local MZonePrefix = false for ZonePrefixId, ZonePrefix in pairs(self.Filter.Prefixes) do - --self:T(3({ "Prefix:", string.find(MZoneName, ZonePrefix, 1), ZonePrefix }) - if string.find(MZoneName, ZonePrefix, 1) then + if self:_SearchPattern(MZoneName, ZonePrefix, false, true) then MZonePrefix = true end end - --self:T(({ "Evaluated Prefix", MZonePrefix }) MZoneInclude = MZoneInclude and MZonePrefix end end @@ -6929,18 +6937,14 @@ do -- SET_OPSZONE -- Loop over prefixes. for ZonePrefixId, ZonePrefix in pairs(self.Filter.Prefixes) do - -- Prifix - --self:T(3({ "Prefix:", string.find(MZoneName, ZonePrefix, 1), ZonePrefix }) - - if string.find(MZoneName, ZonePrefix, 1) then + -- Prefix + if self:_SearchPattern(MZoneName, ZonePrefix, false, true) then MZonePrefix = true break --Break the loop as we found the prefix. end end - --self:T(({ "Evaluated Prefix", MZonePrefix }) - MZoneInclude = MZoneInclude and MZonePrefix end @@ -7728,7 +7732,7 @@ function SET_OPSGROUP:_EventOnBirth(Event) local MGroupPrefix = false for GroupPrefixId, GroupPrefix in pairs(self.Filter.GroupPrefixes) do - if string.find(MGroup:GetName(), GroupPrefix:gsub ("-", "%%-"), 1) then --Not sure why "-" is replaced by "%-" ?! - So we can still match group names with a dash in them + if self:_SearchPattern(MGroup:GetName(), GroupPrefix, false, true) then MGroupPrefix = true end end @@ -8062,12 +8066,10 @@ do -- SET_SCENERY if self.Filter.Prefixes then local MSceneryPrefix = false for ZonePrefixId, ZonePrefix in pairs(self.Filter.Prefixes) do - --self:T(({ "Prefix:", string.find(MSceneryName, ZonePrefix, 1), ZonePrefix }) - if string.find(MSceneryName, ZonePrefix, 1) then + if self:_SearchPattern(MSceneryName, ZonePrefix, false, true) then MSceneryPrefix = true end end - --self:T(({ "Evaluated Prefix", MSceneryPrefix }) MSceneryInclude = MSceneryInclude and MSceneryPrefix end @@ -8335,8 +8337,7 @@ do -- SET_DYNAMICCARGO if self.Filter.StaticPrefixes then local DCargoPrefix = false for StaticPrefixId, StaticPrefix in pairs(self.Filter.StaticPrefixes) do - --self:T2({ "Prefix:", string.find(DCargo:GetName(), StaticPrefix, 1), StaticPrefix }) - if string.find(DCargo:GetName(), StaticPrefix, 1) then + if self:_SearchPattern(DCargo:GetName(), StaticPrefix, false, true) then DCargoPrefix = true end end @@ -8504,7 +8505,7 @@ do -- SET_DYNAMICCARGO function SET_DYNAMICCARGO:FilterCurrentOwner(PlayerName) self:FilterFunction( function(cargo) - if cargo and cargo.Owner and string.find(cargo.Owner,PlayerName,1,true) then + if cargo and cargo.Owner and self:_SearchPattern(cargo.Owner, PlayerName, true) then return true else return false @@ -8630,7 +8631,7 @@ do -- SET_DYNAMICCARGO --- Set filter timer interval for FilterZones if using active filtering with FilterStart(). -- @param #SET_DYNAMICCARGO self - -- @param #number Seconds Seconds between check intervals, defaults to 30. **Caution** - do not be too agressive with timing! Objects are usually not moving fast enough + -- @param #number Seconds (Optional) Seconds between check intervals, defaults to 30. **Caution** - do not be too agressive with timing! Objects are usually not moving fast enough -- to warrant a check of below 10 seconds. -- @return #SET_DYNAMICCARGO self function SET_DYNAMICCARGO:FilterZoneTimer(Seconds) diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index 7fedb5d50..45af7269a 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -1295,7 +1295,7 @@ end --- Respawn group after landing. -- @param #SPAWN self --- @param #number WaitingTime Wait this many seconds before despawning the alive group after landing. Defaults to 3 . +-- @param #number WaitingTime (Optional) Wait this many seconds before despawning the alive group after landing. Defaults to 3 . -- @return #SPAWN self -- @usage -- @@ -1601,7 +1601,7 @@ end -- This method can be used to "reset" the spawn counter to a specific index number. -- This will actually enable a respawn of groups from the specific index. -- @param #SPAWN self --- @param #string SpawnIndex The index of the group from where the spawning will start again. The default value would be 0, which means a complete reset of the spawnindex. +-- @param #string SpawnIndex (Optional) The index of the group from where the spawning will start again. The default value would be 0, which means a complete reset of the spawnindex. -- @return #SPAWN self function SPAWN:SetSpawnIndex( SpawnIndex ) self.SpawnIndex = SpawnIndex or 0 diff --git a/Moose Development/Moose/Core/SpawnStatic.lua b/Moose Development/Moose/Core/SpawnStatic.lua index 9bbe9efc5..42871bca9 100644 --- a/Moose Development/Moose/Core/SpawnStatic.lua +++ b/Moose Development/Moose/Core/SpawnStatic.lua @@ -162,7 +162,7 @@ end --- Creates the main object to spawn a @{Wrapper.Static} given a template table. -- @param #SPAWNSTATIC self -- @param #table SpawnTemplate Template used for spawning. --- @param DCS#country.id CountryID The ID of the country. Default `country.id.USA`. +-- @param DCS#country.id CountryID (Optional) The ID of the country. Default `country.id.USA`. -- @return #SPAWNSTATIC self function SPAWNSTATIC:NewFromTemplate(SpawnTemplate, CountryID) @@ -180,7 +180,7 @@ end -- @param #SPAWNSTATIC self -- @param #string StaticType Type of the static. -- @param #string StaticCategory Category of the static, e.g. "Planes". --- @param DCS#country.id CountryID The ID of the country. Default `country.id.USA`. +-- @param DCS#country.id CountryID (Optional) The ID of the country. Default `country.id.USA`. -- @return #SPAWNSTATIC self function SPAWNSTATIC:NewFromType(StaticType, StaticCategory, CountryID) @@ -201,7 +201,7 @@ end --- (Internal/Cargo) Init the resource table for STATIC object that should be spawned containing storage objects. -- NOTE that you have to init many other parameters as the resources. -- @param #SPAWNSTATIC self --- @param #number CombinedWeight The weight this cargo object should have (some have fixed weights!), defaults to 1kg. +-- @param #number CombinedWeight (Optional) The weight this cargo object should have (some have fixed weights!), defaults to 1kg. -- @return #SPAWNSTATIC self function SPAWNSTATIC:_InitResourceTable(CombinedWeight) if not self.TemplateStaticUnit.resourcePayload then @@ -300,9 +300,9 @@ end --- Initialize parameters for spawning FARPs. -- @param #SPAWNSTATIC self --- @param #number CallsignID Callsign ID. Default 1 (="London"). --- @param #number Frequency Frequency in MHz. Default 127.5 MHz. --- @param #number Modulation Modulation 0=AM, 1=FM. +-- @param #number CallsignID (Optional) Callsign ID. Default 1 (="London"). +-- @param #number Frequency (Optional) Frequency in MHz. Default 127.5 MHz. +-- @param #number Modulation (Optional) Modulation 0=AM, 1=FM. Defaults to 0 -- @param #boolean DynamicSpawns If true, allow Dynamic Spawns -- @param #boolean DynamicHotStarts If true, and DynamicSpawns is true, then allow Dynamic Spawns with hot starts. -- @return #SPAWNSTATIC self diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua index f92f8093c..14a9d285d 100644 --- a/Moose Development/Moose/Core/Spot.lua +++ b/Moose Development/Moose/Core/Spot.lua @@ -388,7 +388,7 @@ do --- Set laser start position relative to the lasing unit. -- @param #SPOT self - -- @param #table position Start position of the laser relative to the lasing unit. Default is { x = 0, y = 2, z = 0 } + -- @param #table position (Optional) Start position of the laser relative to the lasing unit. Default is { x = 0, y = 2, z = 0 } -- @return #SPOT self -- @usage -- -- Set lasing position to be the position of the optics of the Gazelle M: diff --git a/Moose Development/Moose/Core/Vector.lua b/Moose Development/Moose/Core/Vector.lua index ce8ab3631..db13984d9 100644 --- a/Moose Development/Moose/Core/Vector.lua +++ b/Moose Development/Moose/Core/Vector.lua @@ -583,7 +583,7 @@ end --- Return an intermediate VECTOR between this and another given vector. -- @param #VECTOR self -- @param #VECTOR Vector The destination vector. --- @param #number Fraction The fraction (0,1) where the new vector is created. Default 0.5, *i.e.* in the middle. +-- @param #number Fraction (Optional) The fraction (0,1) where the new vector is created. Default 0.5, *i.e.* in the middle. -- @return #VECTOR Vector between this and the other vector. function VECTOR:GetIntermediateVector(Vector, Fraction) @@ -625,7 +625,7 @@ end --- Set x-component of vector. The x-axis points to the North. -- @param #VECTOR self --- @param #number x Value of x. Default 0. +-- @param #number x (Optional) Value of x. Default 0. -- @return #VECTOR self function VECTOR:SetX(x) self.x=x or 0 @@ -634,7 +634,7 @@ end --- Set y-component of vector. The y-axis points to the upwards and describes the altitude above mean sea level. -- @param #VECTOR self --- @param #number y Value of y. Default land/surface height at this point. +-- @param #number y (Optional) Value of y. Default land/surface height at this point. -- @return #VECTOR self function VECTOR:SetY(y) @@ -647,7 +647,7 @@ end --- Set z-component of vector. The z-axis points to the East. -- @param #VECTOR self --- @param #number z Value of z. Default 0. +-- @param #number z (Optional) Value of z. Default 0. -- @return #VECTOR self function VECTOR:SetZ(z) self.z=z or 0 @@ -783,8 +783,8 @@ end --- Translate the vector by a given distance and angle. -- @param #VECTOR self --- @param #number Distance Distance in meters. Default 1000 meters. --- @param #number Heading Heading angle in degrees. Default 0° = North. +-- @param #number Distance (Optional) Distance in meters. Default 1000 meters. +-- @param #number Heading (Optional) Heading angle in degrees. Default 0° = North. -- @param #boolean Copy Create a copy of the VECTOR so the original stays unchanged. -- @return #VECTOR The translated vector or a copy of it. function VECTOR:Translate(Distance, Heading, Copy) @@ -807,7 +807,7 @@ end --- Rotate the VECTOR clockwise in the 2D (x,z) plane. -- @param #VECTOR self --- @param #number Angle Rotation angle in degrees). Default 0. +-- @param #number Angle (Optional) Rotation angle in degrees). Default 0. -- @param #boolean Copy Create a copy of the VECTOR so the original stays unchanged. -- @return #VECTOR The translated vector or a copy of it. function VECTOR:Rotate2D(Angle, Copy) @@ -1001,7 +1001,7 @@ end --- Returns an intercept point at which a ray drawn from the this vector in the passed normalized direction for a specified distance. -- @param #VECTOR self -- @param DCS#Vec3 DirectionVector Directional vector. --- @param #number Distance Distance in meters. Default 1000 m. +-- @param #number Distance (Optional) Distance in meters. Default 1000 m. -- @return #VECTOR Intercept vector. Can be `nil` if no intercept point is found. function VECTOR:GetInterceptPoint(DirectionVector, Distance) @@ -1080,7 +1080,7 @@ end --- Creates a smoke at this vector. -- @param #VECTOR self --- @param #number Color Color of the smoke: 0=Green, 1=Red, 2=White, 3=Orange, 4=Blue. Default 0. +-- @param #number Color (Optional) Color of the smoke: 0=Green, 1=Red, 2=White, 3=Orange, 4=Blue. Default 0. -- @param #number Duration (Optional) Duration of the smoke in seconds. Default nil. -- @return #string Name of the smoke object. Can be used to stop it. function VECTOR:Smoke(Color, Duration) @@ -1115,8 +1115,8 @@ end -- * 8 = huge smoke -- -- @param #VECTOR self --- @param #number Preset Preset of smoke. Default `BIGSMOKEPRESET.LargeSmokeAndFire`. --- @param #number Density Density between [0,1]. Default 0.5. +-- @param #number Preset (Optional) Preset of smoke. Default `BIGSMOKEPRESET.LargeSmokeAndFire`. +-- @param #number Density (Optional) Density between [0,1]. Default 0.5. -- @param #number Duration (Optional) Duration of the smoke and fire in seconds. -- @return #string Name of the smoke. Can be used to stop it. function VECTOR:SmokeAndFire(Preset, Density, Duration) @@ -1161,7 +1161,7 @@ end --- Creates an illumination bomb at the specified point. -- @param #VECTOR self --- @param #number Power The power in Candela (cd). Should be between 1 and 1000000. Default 1000 cd. +-- @param #number Power (Optional) The power in Candela (cd). Should be between 1 and 1000000. Default 1000 cd. -- @param #number Altitude (Optional) Altitude [m] at which the illumination bomb is created. -- @return #VECTOR self function VECTOR:IlluminationBomb(Power, Altitude) @@ -1180,7 +1180,7 @@ end --- Creates an explosion at a given point at the specified power. -- @param #VECTOR self --- @param #number Power The power in kg TNT. Default 100 kg. +-- @param #number Power (Optional) The power in kg TNT. Default 100 kg. -- @return #VECTOR self function VECTOR:Explosion(Power) @@ -1193,8 +1193,8 @@ end --- Creates a signal flare at the given point in the specified color. The flare will be launched in the direction of the azimuth angle. -- @param #VECTOR self --- @param #number Color Color of flare. Default Green. --- @param #number Azimuth Azimuth angle in degrees. Default 0. +-- @param #number Color (Optional) Color of flare. Default Green. +-- @param #number Azimuth (Optional) Azimuth angle in degrees. Default 0. -- @return #VECTOR self function VECTOR:Flare(Color, Azimuth) @@ -1209,10 +1209,10 @@ end --- Creates a arrow from this VECTOR to another vector on the F10 map. -- @param #VECTOR self -- @param #VECTOR Vector The vector defining the endpoint. --- @param #number Coalition Coalition Id: -1=All, 0=Neutral, 1=Red, 2=Blue. Default -1. --- @param #table Color RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.7}. --- @param #table FillColor RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.5}. --- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot Dash, 5=Long Dash, 6=Two Dash. Default 1. +-- @param #number Coalition (Optional) Coalition Id: -1=All, 0=Neutral, 1=Red, 2=Blue. Default -1. +-- @param #table Color (Optional) RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.7}. +-- @param #table FillColor (Optional) RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.5}. +-- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot Dash, 5=Long Dash, 6=Two Dash. Default 1. -- @return #number Marker ID. Can be used to remove the drawing. function VECTOR:ArrowTo(Vector, Coalition, Color, FillColor, LineType) @@ -1237,7 +1237,7 @@ end --- Create mark on F10 map. -- @param #VECTOR self -- @param #string MarkText Free format text that shows the marking clarification. --- @param #number Recipient Recipient of the mark: -1=All (default), 0=Neutral, 1=Red, 2=Blue. Can also be a `GROUP` object. +-- @param #number Recipient (Optional) Recipient of the mark: -1=All (default), 0=Neutral, 1=Red, 2=Blue. Can also be a `GROUP` object. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @return #number Mark ID. function VECTOR:Mark(MarkText, Recipient, ReadOnly) diff --git a/Moose Development/Moose/Core/Zone.lua b/Moose Development/Moose/Core/Zone.lua index a6b507182..255da83f9 100644 --- a/Moose Development/Moose/Core/Zone.lua +++ b/Moose Development/Moose/Core/Zone.lua @@ -369,7 +369,7 @@ end --- Set draw coalition of zone. -- @param #ZONE_BASE self --- @param #number Coalition Coalition. Default -1. +-- @param #number Coalition (Optional) Coalition. Default -1. -- @return #ZONE_BASE self function ZONE_BASE:SetDrawCoalition(Coalition) self.drawCoalition=Coalition or -1 @@ -385,8 +385,8 @@ end --- Set color of zone. -- @param #ZONE_BASE self --- @param #table RGBcolor RGB color table. Default `{1, 0, 0}`. --- @param #number Alpha Transparency between 0 and 1. Default 0.15. +-- @param #table RGBcolor (Optional) RGB color table. Default `{1, 0, 0}`. +-- @param #number Alpha (Optional) Transparency between 0 and 1. Default 0.15. -- @return #ZONE_BASE self function ZONE_BASE:SetColor(RGBcolor, Alpha) @@ -432,8 +432,8 @@ end --- Set fill color of zone. -- @param #ZONE_BASE self --- @param #table RGBcolor RGB color table. Default `{1, 0, 0}`. --- @param #number Alpha Transparacy between 0 and 1. Default 0.15. +-- @param #table RGBcolor (Optional) RGB color table. Default `{1, 0, 0}`. +-- @param #number Alpha (Optional) Transparacy between 0 and 1. Default 0.15. -- @return #ZONE_BASE self function ZONE_BASE:SetFillColor(RGBcolor, Alpha) @@ -586,7 +586,7 @@ end --- Set the check time for ZONE:Trigger() -- @param #ZONE_BASE self --- @param #number seconds Check every seconds for objects entering or leaving the zone. Defaults to 5 secs. +-- @param #number seconds (Optional) Check every seconds for objects entering or leaving the zone. Defaults to 5 secs. -- @return #ZONE_BASE self function ZONE_BASE:SetCheckTime(seconds) self.Checktime = seconds or 5 @@ -862,7 +862,7 @@ ZONE_RADIUS = { -- @param #string ZoneName Name of the zone. -- @param DCS#Vec2 Vec2 The location of the zone. -- @param DCS#Distance Radius The radius of the zone. --- @param DCS#Boolean DoNotRegisterZone Determines if the Zone should not be registered in the _Database Table. Default=false +-- @param DCS#Boolean DoNotRegisterZone (Optional) Determines if the Zone should not be registered in the _Database Table. Default=false -- @return #ZONE_RADIUS self function ZONE_RADIUS:New( ZoneName, Vec2, Radius, DoNotRegisterZone ) @@ -946,12 +946,12 @@ end --- Draw the zone circle on the F10 map. -- @param #ZONE_RADIUS self --- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. --- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red. --- @param #number Alpha Transparency [0,1]. Default 1. --- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. --- @param #number FillAlpha Transparency [0,1]. Default 0.15. --- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. +-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. +-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. +-- @param #number Alpha (Optional) Transparency [0,1]. Default 1. +-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. +-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. +-- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @return #ZONE_RADIUS self function ZONE_RADIUS:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly) @@ -2506,7 +2506,7 @@ end --- Get a vertex of the polygon. -- @param #ZONE_POLYGON_BASE self --- @param #number Index Index of the vertex. Default 1. +-- @param #number Index (Optional) Index of the vertex. Default 1. -- @return DCS#Vec2 Vertex of the polygon. function ZONE_POLYGON_BASE:GetVertexVec2(Index) return self._.Polygon[Index or 1] @@ -2514,7 +2514,7 @@ end --- Get a vertex of the polygon. -- @param #ZONE_POLYGON_BASE self --- @param #number Index Index of the vertex. Default 1. +-- @param #number Index (Optional) Index of the vertex. Default 1. -- @return DCS#Vec3 Vertex of the polygon. function ZONE_POLYGON_BASE:GetVertexVec3(Index) local vec2=self:GetVertexVec2(Index) @@ -2527,7 +2527,7 @@ end --- Get a vertex of the polygon. -- @param #ZONE_POLYGON_BASE self --- @param #number Index Index of the vertex. Default 1. +-- @param #number Index (Optional) Index of the vertex. Default 1. -- @return Core.Point#COORDINATE Vertex of the polygon. function ZONE_POLYGON_BASE:GetVertexCoordinate(Index) local vec2=self:GetVertexVec2(Index) @@ -2657,12 +2657,12 @@ end --- Draw the zone on the F10 map. Infinite number of points supported --- ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Polygon.lua -- @param #ZONE_POLYGON_BASE self --- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. --- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red. --- @param #number Alpha Transparency [0,1]. Default 1. --- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. -- doesn't seem to work --- @param #number FillAlpha Transparency [0,1]. Default 0.15. -- doesn't seem to work --- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. +-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. +-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. +-- @param #number Alpha (Optional) Transparency [0,1]. Default 1. +-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. -- doesn't seem to work +-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. -- doesn't seem to work +-- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false.s -- @return #ZONE_POLYGON_BASE self function ZONE_POLYGON_BASE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly, IncludeTriangles) @@ -2710,7 +2710,7 @@ end --- Change/Re-fill a Polygon Zone -- @param #ZONE_POLYGON_BASE self -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red. --- @param #number Alpha Transparency [0,1]. Default 1. +-- @param #number Alpha (Optional) Transparency [0,1]. Default 1. -- @return #ZONE_POLYGON_BASE self function ZONE_POLYGON_BASE:ReFill(Color,Alpha) local color = Color or self:GetFillColorRGB() or {1,0,0} @@ -2740,8 +2740,8 @@ end --- Change/Re-draw the border of a Polygon Zone -- @param #ZONE_POLYGON_BASE self -- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red. --- @param #number Alpha Transparency [0,1]. Default 1. --- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. +-- @param #number Alpha (Optional) Transparency [0,1]. Default 1. +-- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @return #ZONE_POLYGON_BASE function ZONE_POLYGON_BASE:ReDrawBorderline(Color, Alpha, LineType) local color = Color or self:GetFillColorRGB() or {1,0,0} @@ -2840,7 +2840,7 @@ end --- Remove junk inside the zone. Due to DCS limitations, this works only for rectangular zones. So we get the smallest rectangular zone encompassing all points points of the polygon zone. -- @param #ZONE_POLYGON_BASE self --- @param #number Height Height of the box in meters. Default 1000. +-- @param #number Height (Optional) Height of the box in meters. Default 1000. -- @return #number Number of removed objects. function ZONE_POLYGON_BASE:RemoveJunk(Height) @@ -3761,8 +3761,8 @@ do -- ZONE_ELASTIC --- Update the convex hull of the polygon. -- This uses the [Graham scan](https://en.wikipedia.org/wiki/Graham_scan). -- @param #ZONE_ELASTIC self - -- @param #number Delay Delay in seconds before the zone is updated. Default 0. - -- @param #boolean Draw Draw the zone. Default `nil`. + -- @param #number Delay (Optional) Delay in seconds before the zone is updated. Default 0. + -- @param #boolean Draw (Optional) Draw the zone. Default `nil`. -- @return #ZONE_ELASTIC self function ZONE_ELASTIC:Update(Delay, Draw) @@ -3803,9 +3803,9 @@ do -- ZONE_ELASTIC --- Start the updating scheduler. -- @param #ZONE_ELASTIC self -- @param #number Tstart Time in seconds before the updating starts. - -- @param #number dT Time interval in seconds between updates. Default 60 sec. - -- @param #number Tstop Time in seconds after which the updating stops. Default `nil`. - -- @param #boolean Draw Draw the zone. Default `nil`. + -- @param #number dT (Optional) Time interval in seconds between updates. Default 60 sec. + -- @param #number Tstop (Optional) Time in seconds after which the updating stops. Default `nil`. + -- @param #boolean Draw (Optional) Draw the zone. Default `nil`. -- @return #ZONE_ELASTIC self function ZONE_ELASTIC:StartUpdate(Tstart, dT, Tstop, Draw) @@ -3816,7 +3816,7 @@ do -- ZONE_ELASTIC --- Stop the updating scheduler. -- @param #ZONE_ELASTIC self - -- @param #number Delay Delay in seconds before the scheduler will be stopped. Default 0. + -- @param #number Delay (Optional) Delay in seconds before the scheduler will be stopped. Default 0. -- @return #ZONE_ELASTIC self function ZONE_ELASTIC:StopUpdate(Delay) @@ -4066,12 +4066,12 @@ end --- Draw the zone on the F10 map. --- ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Oval.lua -- @param #ZONE_OVAL self --- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. --- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red. --- @param #number Alpha Transparency [0,1]. Default 1. --- @param #table FillColor RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. -- doesn't seem to work --- @param #number FillAlpha Transparency [0,1]. Default 0.15. -- doesn't seem to work --- @param #number LineType Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. +-- @param #number Coalition (Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All. +-- @param #table Color (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. +-- @param #number Alpha (Optional) Transparency [0,1]. Default 1. +-- @param #table FillColor (Optional) RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as `Color` value. -- doesn't seem to work +-- @param #number FillAlpha (Optional) Transparency [0,1]. Default 0.15. -- doesn't seem to work +-- @param #number LineType (Optional) Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly (Optional) Mark is readonly and cannot be removed by users. Default false. -- @return #ZONE_OVAL self function ZONE_OVAL:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType) diff --git a/Moose Development/Moose/DCS.lua b/Moose Development/Moose/DCS.lua index cebedcfd6..f726caf31 100644 --- a/Moose Development/Moose/DCS.lua +++ b/Moose Development/Moose/DCS.lua @@ -131,7 +131,7 @@ do -- world --- Returns a table of DCS airbase objects. -- @function [parent=#world] getAirbases - -- @param #number coalitionId The coalition side number ID. Default is all airbases are returned. + -- @param #number coalitionId (Optional) The coalition side number ID. Default is all airbases are returned. -- @return #table Table of DCS airbase objects. @@ -1033,7 +1033,7 @@ do -- Spot --- Sets the number that is used to define the laser code for which laser designation can track. -- @function [parent=#Spot] setCode -- @param #Spot self - -- @param #number Code The laser code. Default value is 1688. + -- @param #number Code (Optional) The laser code. Default value is 1688. --- Destroys the spot. -- @function [parent=#Spot] destroy diff --git a/Moose Development/Moose/Functional/AICSAR.lua b/Moose Development/Moose/Functional/AICSAR.lua index 7ec2f73dc..262366042 100644 --- a/Moose Development/Moose/Functional/AICSAR.lua +++ b/Moose Development/Moose/Functional/AICSAR.lua @@ -308,7 +308,7 @@ AICSAR.RadioLength = { -- @param #string Helotemplate Helicopter template name. -- @param Wrapper.Airbase#AIRBASE FARP FARP object or Airbase from where to start. -- @param Core.Zone#ZONE MASHZone Zone where to drop pilots after rescue. --- @param #number Helonumber Max number of alive Ai Helos at the same time. Defaults to three. +-- @param #number Helonumber (Optional) Max number of alive Ai Helos at the same time. Defaults to 3. -- @return #AICSAR self function AICSAR:New(Alias,Coalition,Pilottemplate,Helotemplate,FARP,MASHZone,Helonumber) -- Inherit everything from FSM class. @@ -543,10 +543,10 @@ end -- @param #AICSAR self -- @param #boolean OnOff Switch on (true) or off (false). -- @param #string Path Path to your SRS Server External Audio Component, e.g. "C:\\\\Program Files\\\\DCS-SimpleRadio-Standalone\\\\ExternalAudio" --- @param #number Frequency Defaults to 243 (guard) --- @param #number Modulation Radio modulation. Defaults to radio.modulation.AM --- @param #string SoundPath Where to find the audio files. Defaults to nil, i.e. add messages via "Sound to..." in the Mission Editor. --- @param #number Port Port of the SRS, defaults to 5002. +-- @param #number Frequency (Optional) Defaults to 243 (guard) +-- @param #number Modulation (Optional) Radio modulation. Defaults to radio.modulation.AM +-- @param #string SoundPath (Optional) Where to find the audio files. Defaults to nil, i.e. add messages via "Sound to..." in the Mission Editor. +-- @param #number Port (Optional) Port of the SRS, defaults to 5002. -- @return #AICSAR self function AICSAR:SetSRSRadio(OnOff,Path,Frequency,Modulation,SoundPath,Port) self:T(self.lid .. "SetSRSRadio") @@ -657,8 +657,8 @@ end --- [User] Switch sound output on and use normale (DCS) radio -- @param #AICSAR self -- @param #boolean OnOff Switch on (true) or off (false). --- @param #number Frequency Defaults to 243 (guard). --- @param #number Modulation Radio modulation. Defaults to radio.modulation.AM. +-- @param #number Frequency(Optional) Defaults to 243 (guard). +-- @param #number Modulation (Optional) Radio modulation. Defaults to radio.modulation.AM. -- @param Wrapper.Group#GROUP Group The group to use as sending station. -- @return #AICSAR self function AICSAR:SetDCSRadio(OnOff,Frequency,Modulation,Group) diff --git a/Moose Development/Moose/Functional/Artillery.lua b/Moose Development/Moose/Functional/Artillery.lua index 04f2202b1..74ba69e3a 100644 --- a/Moose Development/Moose/Functional/Artillery.lua +++ b/Moose Development/Moose/Functional/Artillery.lua @@ -1391,7 +1391,7 @@ end -- @param #ARTY self -- @param Core.Point#COORDINATE coord Coordinates of the new position. -- @param #string time (Optional) Day time at which the group should start moving. Passed as a string in format "08:13:45". Default is now. --- @param #number speed (Optinal) Speed in km/h the group should move at. Default 70% of max posible speed of group. +-- @param #number speed (Optional) Speed in km/h the group should move at. Default 70% of max posible speed of group. -- @param #boolean onroad (Optional) If true, group will mainly use roads. Default off, i.e. go directly towards the specified coordinate. -- @param #boolean cancel (Optional) If true, cancel any running attack when move should begin. Default is false. -- @param #string name (Optional) Name of the coordinate. Default is LL DMS string of the coordinate. If the name was already given, the numbering "#01", "#02",... is appended automatically. @@ -1502,7 +1502,7 @@ end --- Set minimum firing range. Targets closer than this distance are not engaged. -- @param #ARTY self --- @param #number range Min range in kilometers. Default is 0.1 km. +-- @param #number range (Optional) Min range in kilometers. Default is 0.1 km. -- @return self function ARTY:SetMinFiringRange(range) self:F({range=range}) @@ -1512,7 +1512,7 @@ end --- Set maximum firing range. Targets further away than this distance are not engaged. -- @param #ARTY self --- @param #number range Max range in kilometers. Default is 1000 km. +-- @param #number range (Optional) Max range in kilometers. Default is 1000 km. -- @return self function ARTY:SetMaxFiringRange(range) self:F({range=range}) @@ -1522,7 +1522,7 @@ end --- Set time interval between status updates. During the status check, new events are triggered. -- @param #ARTY self --- @param #number interval Time interval in seconds. Default 10 seconds. +-- @param #number interval (Optional) Time interval in seconds. Default 10 seconds. -- @return self function ARTY:SetStatusInterval(interval) self:F({interval=interval}) @@ -1532,7 +1532,7 @@ end --- Set time interval for weapon tracking. -- @param #ARTY self --- @param #number interval Time interval in seconds. Default 0.2 seconds. +-- @param #number interval (Optional) Time interval in seconds. Default 0.2 seconds. -- @return self function ARTY:SetTrackInterval(interval) self.dtTrack=interval or 0.2 @@ -1541,7 +1541,7 @@ end --- Set time how it is waited a unit the first shot event happens. If no shot is fired after this time, the task to fire is aborted and the target removed. -- @param #ARTY self --- @param #number waittime Time in seconds. Default 300 seconds. +-- @param #number waittime (Optional) Time in seconds. Default 300 seconds. -- @return self function ARTY:SetWaitForShotTime(waittime) self:F({waittime=waittime}) @@ -1551,7 +1551,7 @@ end --- Define the safe distance between ARTY group and rearming unit or rearming place at which rearming process is possible. -- @param #ARTY self --- @param #number distance Safe distance in meters. Default is 100 m. +-- @param #number distance (Optional) Safe distance in meters. Default is 100 m. -- @return self function ARTY:SetRearmingDistance(distance) self:F({distance=distance}) @@ -1813,7 +1813,7 @@ end --- Set nuclear warhead explosion strength. -- @param #ARTY self --- @param #number strength Explosion strength in kilo tons TNT. Default is 0.075 kt. +-- @param #number strength (Optional) Explosion strength in kilo tons TNT. Default is 0.075 kt. -- @return self function ARTY:SetTacNukeWarhead(strength) self.nukewarhead=strength or 0.075 @@ -3903,7 +3903,7 @@ end --- Get the number of shells a unit or group currently has. For a group the ammo count of all units is summed up. -- @param #ARTY self --- @param #boolean display Display ammo table as message to all. Default false. +-- @param #boolean display (Optional) Display ammo table as message to all. Default false. -- @return #number Total amount of ammo the whole group has left. -- @return #number Number of shells the group has left. -- @return #number Number of rockets the group has left. diff --git a/Moose Development/Moose/Functional/Autolase.lua b/Moose Development/Moose/Functional/Autolase.lua index f33d635dc..8b909ef39 100644 --- a/Moose Development/Moose/Functional/Autolase.lua +++ b/Moose Development/Moose/Functional/Autolase.lua @@ -427,7 +427,7 @@ end --- (User) Set minimum threat level for target selection, can be 0 (lowest) to 10 (highest). -- @param #AUTOLASE self --- @param #number Level Level used for filtering, defaults to 0. SAM systems and manpads have level 7 to 10, AAA level 6, MTBs and armoured vehicles level 3 to 5, APC, Artillery, Infantry and EWR level 1 to 2. +-- @param #number Level (Optional) Level used for filtering, defaults to 0. SAM systems and manpads have level 7 to 10, AAA level 6, MTBs and armoured vehicles level 3 to 5, APC, Artillery, Infantry and EWR level 1 to 2. -- @return #AUTOLASE self -- @usage Filter for level 3 and above: -- `myautolase:SetMinThreatLevel(3)` @@ -593,8 +593,8 @@ end --- (User) Function to force laser cooldown and cool down time -- @param #AUTOLASE self --- @param #boolean OnOff Switch cool down on (true) or off (false) - defaults to true --- @param #number Seconds Number of seconds for cooldown - dafaults to 60 seconds +-- @param #boolean OnOff (Optional) Switch cool down on (true) or off (false) - defaults to true +-- @param #number Seconds (Optional) Number of seconds for cooldown - dafaults to 60 seconds -- @return #AUTOLASE self function AUTOLASE:SetLaserCoolDown(OnOff, Seconds) self.forcecooldown = OnOff and true @@ -615,8 +615,8 @@ end --- (User) Function to set lasing distance in meters and duration in seconds -- @param #AUTOLASE self --- @param #number Distance (Max) distance for lasing in meters - default 5000 meters --- @param #number Duration (Max) duration for lasing in seconds - default 300 secs +-- @param #number Distance (Optional) Max distance for lasing in meters - default 5000 meters +-- @param #number Duration (Optional) Max duration for lasing in seconds - default 300 secs -- @return #AUTOLASE self function AUTOLASE:SetLasingParameters(Distance, Duration) self.LaseDistance = Distance or 5000 @@ -640,7 +640,7 @@ end --- (User) Function to set rounding precision for BR distance output. -- @param #AUTOLASE self --- @param #number IDP Rounding precision before/after the decimal sign. Defaults to zero. Positive values round right of the decimal sign, negative ones left of the decimal sign. +-- @param #number IDP (Optional) Rounding precision before/after the decimal sign. Defaults to zero. Positive values round right of the decimal sign, negative ones left of the decimal sign. -- @return #AUTOLASE self function AUTOLASE:SetRoundingPrecsion(IDP) self.RoundingPrecision = IDP or 0 diff --git a/Moose Development/Moose/Functional/CleanUp.lua b/Moose Development/Moose/Functional/CleanUp.lua index 7975b3163..52d818d94 100644 --- a/Moose Development/Moose/Functional/CleanUp.lua +++ b/Moose Development/Moose/Functional/CleanUp.lua @@ -178,7 +178,7 @@ end -- Note, one can also use the method @{#CLEANUP_AIRBASE.RemoveAirbase}() to remove the airbase from the control process as a whole, -- when an enemy unit is near. That is also an option... -- @param #CLEANUP_AIRBASE self --- @param #string CleanMissiles (Default=true) If true, missiles fired are immediately destroyed. If false missiles are not controlled. +-- @param #boolean CleanMissiles (Optional) (Default=true) If true, missiles fired are immediately destroyed. If false missiles are not controlled. -- @return #CLEANUP_AIRBASE function CLEANUP_AIRBASE:SetCleanMissiles( CleanMissiles ) diff --git a/Moose Development/Moose/Functional/Designate.lua b/Moose Development/Moose/Functional/Designate.lua index b6156d256..a8035d8cf 100644 --- a/Moose Development/Moose/Functional/Designate.lua +++ b/Moose Development/Moose/Functional/Designate.lua @@ -301,12 +301,11 @@ do -- DESIGNATE --- DESIGNATE Constructor. This class is an abstract class and should not be instantiated. -- @param #DESIGNATE self - -- @param Tasking.CommandCenter#COMMANDCENTER CC + -- @param Wrapper.Group#GROUP CC Group as Commandcenter standin. Currently unused (03/2026) -- @param Functional.Detection#DETECTION_BASE Detection -- @param Core.Set#SET_GROUP AttackSet The Attack collection of GROUP objects to designate and report for. - -- @param Tasking.Mission#MISSION Mission (Optional) The Mission where the menu needs to be attached. -- @return #DESIGNATE - function DESIGNATE:New( CC, Detection, AttackSet, Mission ) + function DESIGNATE:New( CC, Detection, AttackSet ) local self = BASE:Inherit( self, FSM:New() ) -- #DESIGNATE self:F( { Detection } ) @@ -468,7 +467,7 @@ do -- DESIGNATE -- @param #DESIGNATE self -- @param #number Delay - self.CC = CC + --self.CC = CC self.Detection = Detection self.AttackSet = AttackSet self.RecceSet = Detection:GetDetectionSet() @@ -480,7 +479,7 @@ do -- DESIGNATE self:SetFlashStatusMenu( false ) self:SetFlashDetectionMessages( true ) - self:SetMission( Mission ) + --self:SetMission( Mission ) self:SetLaserCodes( { 1688, 1130, 4785, 6547, 1465, 4578 } ) -- set self.LaserCodes self:SetAutoLase( false, false ) -- set self.Autolase and don't send message. @@ -682,7 +681,7 @@ do -- DESIGNATE --- Set the lase duration for designations. -- @param #DESIGNATE self - -- @param #number LaseDuration The time in seconds a lase will continue to hold on target. The default is 120 seconds. + -- @param #number LaseDuration (Optional) The time in seconds a lase will continue to hold on target. The default is 120 seconds. -- @return #DESIGNATE function DESIGNATE:SetLaseDuration( LaseDuration ) self.LaseDuration = LaseDuration or 120 @@ -754,10 +753,12 @@ do -- DESIGNATE if Message then local AutoLaseOnOff = ( self.AutoLase == true ) and "On" or "Off" - local CC = self.CC:GetPositionable() - if CC then - CC:MessageToSetGroup( self.DesignateName .. ": Auto Lase " .. AutoLaseOnOff .. ".", 15, self.AttackSet ) - end + + MESSAGE:New(self.DesignateName .. ": Auto Lase " .. AutoLaseOnOff .. ".",15):ToSet(self.AttackSet) + --local CC = self.CC:GetPositionable() + --if CC then + --CC:MessageToSetGroup( self.DesignateName .. ": Auto Lase " .. AutoLaseOnOff .. ".", 15, self.AttackSet ) + --end end self:CoordinateLase() @@ -777,14 +778,14 @@ do -- DESIGNATE return self end - --- Set the MISSION object for which designate will function. + --- [DEPRECATED DO NOT USE] Set the MISSION object for which designate will function. -- When a MISSION object is assigned, the menu for the designation will be located at the Mission Menu. -- @param #DESIGNATE self -- @param Tasking.Mission#MISSION Mission The MISSION object. -- @return #DESIGNATE function DESIGNATE:SetMission( Mission ) --R2.2 - self.Mission = Mission + --self.Mission = Mission return self end @@ -830,7 +831,8 @@ do -- DESIGNATE function( AttackGroup ) if AttackGroup:IsAlive() == true then local DetectionText = self.Detection:DetectedItemReportSummary( DetectedItem, AttackGroup ):Text( ", " ) - self.CC:GetPositionable():MessageToGroup( "Targets out of LOS\n" .. DetectionText, 10, AttackGroup, self.DesignateName ) + --self.CC:GetPositionable():MessageToGroup( "Targets out of LOS\n" .. DetectionText, 10, AttackGroup, self.DesignateName ) + MESSAGE:New("Targets out of LOS\n" .. DetectionText,10,self.DesignateName):ToGroup(AttackGroup) end end ) @@ -855,7 +857,8 @@ do -- DESIGNATE function( AttackGroup ) if self.FlashDetectionMessage[AttackGroup] == true then local DetectionText = self.Detection:DetectedItemReportSummary( DetectedItem, AttackGroup ):Text( ", " ) - self.CC:GetPositionable():MessageToGroup( "Targets detected at \n" .. DetectionText, 10, AttackGroup, self.DesignateName ) + --self.CC:GetPositionable():MessageToGroup( "Targets detected at \n" .. DetectionText, 10, AttackGroup, self.DesignateName ) + MESSAGE:New( "Targets detected at \n" .. DetectionText,10,self.DesignateName):ToGroup(AttackGroup) end end ) @@ -929,9 +932,10 @@ do -- DESIGNATE end end - local CC = self.CC:GetPositionable() + -- local CC = self.CC:GetPositionable() - CC:MessageTypeToGroup( DetectedReport:Text( "\n" ), MESSAGE.Type.Information, AttackGroup, self.DesignateName ) + --CC:MessageTypeToGroup( DetectedReport:Text( "\n" ), MESSAGE.Type.Information, AttackGroup, self.DesignateName ) + MESSAGE:New( DetectedReport:Text( "\n" ),15,self.DesignateName):ToGroup(AttackGroup) local DesignationReport = REPORT:New( "Marking Targets:" ) @@ -965,10 +969,10 @@ do -- DESIGNATE local MissionMenu = nil - if self.Mission then + --if self.Mission then --MissionMenu = self.Mission:GetRootMenu( AttackGroup ) - MissionMenu = self.Mission:GetMenu( AttackGroup ) - end + --MissionMenu = self.Mission:GetMenu( AttackGroup ) + --end local MenuTime = timer.getTime() @@ -1356,12 +1360,13 @@ do -- DESIGNATE -- @param #DESIGNATE self -- @return #DESIGNATE function DESIGNATE:onafterLaseOff( From, Event, To, Index ) - - local CC = self.CC:GetPositionable() + + MESSAGE:New("Stopped lasing.",5,self.DesignateName):ToSet(self.AttackSet) + --local CC = self.CC:GetPositionable() - if CC then - CC:MessageToSetGroup( "Stopped lasing.", 5, self.AttackSet, self.DesignateName ) - end + --if CC then + --CC:MessageToSetGroup( "Stopped lasing.", 5, self.AttackSet, self.DesignateName ) + --end local DetectedItem = self.Detection:GetDetectedItemByIndex( Index ) local TargetSetUnit = self.Detection:GetDetectedItemSet( DetectedItem ) diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua index 76e768ef3..0e12a0892 100644 --- a/Moose Development/Moose/Functional/Detection.lua +++ b/Moose Development/Moose/Functional/Detection.lua @@ -1052,9 +1052,9 @@ do -- DETECTION_BASE --- Method to make the radar detection less accurate, e.g. for WWII scenarios. -- @param #DETECTION_BASE self -- @param #number minheight Minimum flight height to be detected, in meters AGL (above ground) - -- @param #number thresheight Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance) - -- @param #number thresblur Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found) - -- @param #number closing Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20. + -- @param #number thresheight (Optional) Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance) + -- @param #number thresblur (Optional) Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found) + -- @param #number closing (Optional) Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20. -- @return #DETECTION_BASE self function DETECTION_BASE:SetRadarBlur(minheight,thresheight,thresblur,closing) self.RadarBlur = true @@ -1104,12 +1104,14 @@ do -- DETECTION_BASE --- Set the parameters to calculate to optimal intercept point. -- @param #DETECTION_BASE self - -- @param #boolean Intercept Intercept is true if an intercept point is calculated. Intercept is false if it is disabled. The default Intercept is false. + -- @param #boolean Intercept (Optional) Intercept is true if an intercept point is calculated. Intercept is false if it is disabled. The default Intercept is false. -- @param #number InterceptDelay If Intercept is true, then InterceptDelay is the average time it takes to get airplanes airborne. -- @return #DETECTION_BASE self function DETECTION_BASE:SetIntercept( Intercept, InterceptDelay ) self:F2() + Intercept = Intercept or false + self.Intercept = Intercept self.InterceptDelay = InterceptDelay @@ -1611,8 +1613,8 @@ do -- DETECTION_BASE -- The DetectedItem is a table and contains a SET_UNIT in the field Set. -- @param #DETECTION_BASE self -- @param #string ItemPrefix Prefix of detected item. - -- @param #number DetectedItemKey The key of the DetectedItem. Default self.DetectedItemMax. Could also be a string in principle. - -- @param Core.Set#SET_UNIT Set (optional) The Set of Units to be added. + -- @param #number DetectedItemKey (Optional) The key of the DetectedItem. Default self.DetectedItemMax. Could also be a string in principle. + -- @param Core.Set#SET_UNIT Set (Optional) The Set of Units to be added. -- @return #DETECTION_BASE.DetectedItem function DETECTION_BASE:AddDetectedItem( ItemPrefix, DetectedItemKey, Set ) @@ -2536,7 +2538,7 @@ do -- DETECTION_AREAS --- DETECTION_AREAS constructor. -- @param #DETECTION_AREAS self -- @param Core.Set#SET_GROUP DetectionSetGroup The @{Core.Set} of GROUPs in the Forward Air Controller role. - -- @param #number DetectionZoneRange The range in meters within which targets are grouped upon the first detected target. Default 5000m. + -- @param #number DetectionZoneRange (Optional) The range in meters within which targets are grouped upon the first detected target. Default 5000m. -- @return #DETECTION_AREAS function DETECTION_AREAS:New( DetectionSetGroup, DetectionZoneRange ) diff --git a/Moose Development/Moose/Functional/Escort.lua b/Moose Development/Moose/Functional/Escort.lua index d7fe6a2f7..1d49ac2da 100644 --- a/Moose Development/Moose/Functional/Escort.lua +++ b/Moose Development/Moose/Functional/Escort.lua @@ -179,7 +179,7 @@ ESCORT = { -- @param Wrapper.Client#CLIENT EscortClient The client escorted by the EscortGroup. -- @param Wrapper.Group#GROUP EscortGroup The group AI escorting the EscortClient. -- @param #string EscortName Name of the escort. --- @param #string EscortBriefing A text showing the ESCORT briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown. +-- @param #string EscortBriefing (Optional) A text showing the ESCORT briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown. -- @return #ESCORT self -- @usage -- -- Declare a new EscortPlanes object as follows: @@ -193,7 +193,7 @@ ESCORT = { function ESCORT:New( EscortClient, EscortGroup, EscortName, EscortBriefing ) local self = BASE:Inherit( self, BASE:New() ) -- #ESCORT - --self:F( { EscortClient, EscortGroup, EscortName } ) + self:F( { EscortClient, EscortGroup, EscortName } ) self.EscortClient = EscortClient -- Wrapper.Client#CLIENT self.EscortGroup = EscortGroup -- Wrapper.Group#GROUP @@ -202,7 +202,7 @@ function ESCORT:New( EscortClient, EscortGroup, EscortName, EscortBriefing ) self.EscortSetGroup = SET_GROUP:New() self.EscortSetGroup:AddObject( self.EscortGroup ) - --self.EscortSetGroup:Flush() + self.EscortSetGroup:Flush() self.Detection = DETECTION_UNITS:New( self.EscortSetGroup, 15000 ) self.EscortGroup.Detection = self.Detection @@ -242,11 +242,12 @@ function ESCORT:New( EscortClient, EscortGroup, EscortName, EscortBriefing ) self.CT1 = 0 self.GT1 = 0 - self.FollowScheduler, self.FollowSchedule = SCHEDULER:New( self, self._FollowScheduler, {}, 1, 2, .01 ) + self.FollowScheduler, self.FollowSchedule = SCHEDULER:New( self, self._FollowScheduler, {}, 1, .5, .01 ) self.FollowScheduler:Stop( self.FollowSchedule ) self.EscortMode = ESCORT.MODE.MISSION - + + return self end @@ -272,11 +273,12 @@ function ESCORT:TestSmokeDirectionVector( SmokeDirection ) self.SmokeDirectionVector = ( SmokeDirection == true ) and true or false end + --- Defines the default menus -- @param #ESCORT self --- @return #ESCORT self +-- @return #ESCORT function ESCORT:Menus() - --self:F() + self:F() self:MenuFollowAt( 100 ) self:MenuFollowAt( 200 ) @@ -297,16 +299,19 @@ function ESCORT:Menus() self:MenuEvasion() self:MenuResumeMission() + return self end + + --- Defines a menu slot to let the escort Join and Follow you at a certain distance. -- This menu will appear under **Navigation**. -- @param #ESCORT self -- @param DCS#Distance Distance The distance in meters that the escort needs to follow the client. --- @return #ESCORT self +-- @return #ESCORT function ESCORT:MenuFollowAt( Distance ) - --self:F(Distance) + self:F(Distance) if self.EscortGroup:IsAir() then if not self.EscortMenuReportNavigation then @@ -328,13 +333,13 @@ end --- Defines a menu slot to let the escort hold at their current position and stay low with a specified height during a specified time in seconds. -- This menu will appear under **Hold position**. -- @param #ESCORT self --- @param DCS#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters. --- @param DCS#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given. --- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed. --- @return #ESCORT self +-- @param DCS#Distance Height (Optional) parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters. +-- @param DCS#Time Seconds (Optional) parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given. +-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. The text string is formatted, and should contain two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed. +-- @return #ESCORT -- TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function. function ESCORT:MenuHoldAtEscortPosition( Height, Seconds, MenuTextFormat ) - --self:F( { Height, Seconds, MenuTextFormat } ) + self:F( { Height, Seconds, MenuTextFormat } ) if self.EscortGroup:IsAir() then @@ -385,16 +390,17 @@ function ESCORT:MenuHoldAtEscortPosition( Height, Seconds, MenuTextFormat ) return self end + --- Defines a menu slot to let the escort hold at the client position and stay low with a specified height during a specified time in seconds. -- This menu will appear under **Navigation**. -- @param #ESCORT self --- @param DCS#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters. --- @param DCS#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given. --- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed. --- @return #ESCORT self +-- @param DCS#Distance Height (Optional) parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters. +-- @param DCS#Time Seconds (Optional) parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given. +-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed. +-- @return #ESCORT -- TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function. function ESCORT:MenuHoldAtLeaderPosition( Height, Seconds, MenuTextFormat ) - --self:F( { Height, Seconds, MenuTextFormat } ) + self:F( { Height, Seconds, MenuTextFormat } ) if self.EscortGroup:IsAir() then @@ -449,12 +455,12 @@ end --- Defines a menu slot to let the escort scan for targets at a certain height for a certain time in seconds. -- This menu will appear under **Scan targets**. -- @param #ESCORT self --- @param DCS#Distance Height Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters. --- @param DCS#Time Seconds Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given. --- @param #string MenuTextFormat Optional parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed. --- @return #ESCORT self +-- @param DCS#Distance Height (Optional) parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters. +-- @param DCS#Time Seconds (Optional) parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given. +-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed. +-- @return #ESCORT function ESCORT:MenuScanForTargets( Height, Seconds, MenuTextFormat ) - --self:F( { Height, Seconds, MenuTextFormat } ) + self:F( { Height, Seconds, MenuTextFormat } ) if self.EscortGroup:IsAir() then if not self.EscortMenuScan then @@ -502,14 +508,16 @@ function ESCORT:MenuScanForTargets( Height, Seconds, MenuTextFormat ) return self end + + --- Defines a menu slot to let the escort disperse a flare in a certain color. -- This menu will appear under **Navigation**. -- The flare will be fired from the first unit in the group. -- @param #ESCORT self --- @param #string MenuTextFormat Optional parameter that shows the menu option text. If no text is given, the default text will be displayed. --- @return #ESCORT self +-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. If no text is given, the default text will be displayed. +-- @return #ESCORT function ESCORT:MenuFlare( MenuTextFormat ) - ----self:F() + self:F() if not self.EscortMenuReportNavigation then self.EscortMenuReportNavigation = MENU_GROUP:New( self.EscortClient:GetGroup(), "Navigation", self.EscortMenu ) @@ -538,10 +546,10 @@ end -- Note that smoke menu options will only be displayed for ships and ground units. Not for air units. -- The smoke will be fired from the first unit in the group. -- @param #ESCORT self --- @param #string MenuTextFormat Optional parameter that shows the menu option text. If no text is given, the default text will be displayed. --- @return #ESCORT self +-- @param #string MenuTextFormat (Optional) parameter that shows the menu option text. If no text is given, the default text will be displayed. +-- @return #ESCORT function ESCORT:MenuSmoke( MenuTextFormat ) - ----self:F() + self:F() if not self.EscortGroup:IsAir() then if not self.EscortMenuReportNavigation then @@ -572,10 +580,10 @@ end -- This menu will appear under **Report targets**. -- Note that if a report targets menu is not specified, no targets will be detected by the escort, and the attack and assisted attack menus will not be displayed. -- @param #ESCORT self --- @param DCS#Time Seconds Optional parameter that lets the escort report their current detected targets after specified time interval in seconds. The default time is 30 seconds. --- @return #ESCORT self +-- @param DCS#Time Seconds (Optional) parameter that lets the escort report their current detected targets after specified time interval in seconds. The default time is 30 seconds. +-- @return #ESCORT function ESCORT:MenuReportTargets( Seconds ) - --self:F( { Seconds } ) + self:F( { Seconds } ) if not self.EscortMenuReportNearbyTargets then self.EscortMenuReportNearbyTargets = MENU_GROUP:New( self.EscortClient:GetGroup(), "Report targets", self.EscortMenu ) @@ -593,6 +601,7 @@ function ESCORT:MenuReportTargets( Seconds ) -- Attack Targets self.EscortMenuAttackNearbyTargets = MENU_GROUP:New( self.EscortClient:GetGroup(), "Attack targets", self.EscortMenu ) + self.ReportTargetsScheduler, self.ReportTargetsSchedulerID = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, Seconds ) return self @@ -602,9 +611,9 @@ end -- This menu will appear under **Request assistance from**. -- Note that this method needs to be preceded with the method MenuReportTargets. -- @param #ESCORT self --- @return #ESCORT self +-- @return #ESCORT function ESCORT:MenuAssistedAttack() - --self:F() + self:F() -- Request assistance from other escorts. -- This is very useful to let f.e. an escorting ship attack a target detected by an escorting plane... @@ -616,9 +625,9 @@ end --- Defines a menu to let the escort set its rules of engagement. -- All rules of engagement will appear under the menu **ROE**. -- @param #ESCORT self --- @return #ESCORT self +-- @return #ESCORT function ESCORT:MenuROE( MenuTextFormat ) - --self:F( MenuTextFormat ) + self:F( MenuTextFormat ) if not self.EscortMenuROE then -- Rules of Engagement @@ -640,12 +649,13 @@ function ESCORT:MenuROE( MenuTextFormat ) return self end + --- Defines a menu to let the escort set its evasion when under threat. -- All rules of engagement will appear under the menu **Evasion**. -- @param #ESCORT self --- @return #ESCORT self +-- @return #ESCORT function ESCORT:MenuEvasion( MenuTextFormat ) - --self:F( MenuTextFormat ) + self:F( MenuTextFormat ) if self.EscortGroup:IsAir() then if not self.EscortMenuEvasion then @@ -672,9 +682,9 @@ end --- Defines a menu to let the escort resume its mission from a waypoint on its route. -- All rules of engagement will appear under the menu **Resume mission from**. -- @param #ESCORT self --- @return #ESCORT self +-- @return #ESCORT function ESCORT:MenuResumeMission() - --self:F() + self:F() if not self.EscortMenuResumeMission then -- Mission Resume Menu Root @@ -684,8 +694,7 @@ function ESCORT:MenuResumeMission() return self end ---- --- @param #ESCORT self + -- @param #MENUPARAM MenuParam function ESCORT:_HoldPosition( OrbitGroup, OrbitHeight, OrbitSeconds ) @@ -726,8 +735,6 @@ function ESCORT:_HoldPosition( OrbitGroup, OrbitHeight, OrbitSeconds ) end ---- --- @param #ESCORT self -- @param #MENUPARAM MenuParam function ESCORT:_JoinUpAndFollow( Distance ) @@ -745,7 +752,7 @@ end -- @param Wrapper.Client#CLIENT EscortClient -- @param DCS#Distance Distance function ESCORT:JoinUpAndFollow( EscortGroup, EscortClient, Distance ) - --self:F( { EscortGroup, EscortClient, Distance } ) + self:F( { EscortGroup, EscortClient, Distance } ) self.FollowScheduler:Stop( self.FollowSchedule ) @@ -761,8 +768,6 @@ function ESCORT:JoinUpAndFollow( EscortGroup, EscortClient, Distance ) EscortGroup:MessageToClient( "Rejoining and Following at " .. Distance .. "!", 30, EscortClient ) end ---- --- @param #ESCORT self -- @param #MENUPARAM MenuParam function ESCORT:_Flare( Color, Message ) @@ -773,8 +778,6 @@ function ESCORT:_Flare( Color, Message ) EscortGroup:MessageToClient( Message, 10, EscortClient ) end ---- --- @param #ESCORT self -- @param #MENUPARAM MenuParam function ESCORT:_Smoke( Color, Message ) @@ -785,8 +788,7 @@ function ESCORT:_Smoke( Color, Message ) EscortGroup:MessageToClient( Message, 10, EscortClient ) end ---- --- @param #ESCORT self + -- @param #MENUPARAM MenuParam function ESCORT:_ReportNearbyTargetsNow() @@ -797,8 +799,6 @@ function ESCORT:_ReportNearbyTargetsNow() end ---- --- @param #ESCORT self function ESCORT:_SwitchReportNearbyTargets( ReportTargets ) local EscortGroup = self.EscortGroup @@ -816,8 +816,6 @@ function ESCORT:_SwitchReportNearbyTargets( ReportTargets ) end end ---- --- @param #ESCORT self -- @param #MENUPARAM MenuParam function ESCORT:_ScanTargets( ScanDuration ) @@ -848,27 +846,24 @@ function ESCORT:_ScanTargets( ScanDuration ) end ---- --- @param #ESCORT self -- @param Wrapper.Group#GROUP EscortGroup function _Resume( EscortGroup ) - --env.info( '_Resume' ) + env.info( '_Resume' ) local Escort = EscortGroup:GetState( EscortGroup, "Escort" ) - --env.info( "EscortMode = " .. Escort.EscortMode ) + env.info( "EscortMode = " .. Escort.EscortMode ) if Escort.EscortMode == ESCORT.MODE.FOLLOW then Escort:JoinUpAndFollow( EscortGroup, Escort.EscortClient, Escort.Distance ) end end ---- -- @param #ESCORT self -- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem function ESCORT:_AttackTarget( DetectedItem ) local EscortGroup = self.EscortGroup -- Wrapper.Group#GROUP - --self:F( EscortGroup ) + self:F( EscortGroup ) local EscortClient = self.EscortClient @@ -988,8 +983,6 @@ function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItem ) end ---- --- @param #ESCORT self -- @param #MENUPARAM MenuParam function ESCORT:_ROE( EscortROEFunction, EscortROEMessage ) @@ -1000,8 +993,6 @@ function ESCORT:_ROE( EscortROEFunction, EscortROEMessage ) EscortGroup:MessageToClient( EscortROEMessage, 10, EscortClient ) end ---- --- @param #ESCORT self -- @param #MENUPARAM MenuParam function ESCORT:_ROT( EscortROTFunction, EscortROTMessage ) @@ -1012,8 +1003,6 @@ function ESCORT:_ROT( EscortROTFunction, EscortROTMessage ) EscortGroup:MessageToClient( EscortROTMessage, 10, EscortClient ) end ---- --- @param #ESCORT self -- @param #MENUPARAM MenuParam function ESCORT:_ResumeMission( WayPoint ) @@ -1038,7 +1027,7 @@ end -- @param #ESCORT self -- @return #table function ESCORT:RegisterRoute() - --self:F() + self:F() local EscortGroup = self.EscortGroup -- Wrapper.Group#GROUP @@ -1049,11 +1038,9 @@ function ESCORT:RegisterRoute() return TaskPoints end ---- --- @param #ESCORT self -- @param Functional.Escort#ESCORT self function ESCORT:_FollowScheduler() - --self:F( { self.FollowDistance } ) + self:F( { self.FollowDistance } ) self:T( {self.EscortClient.UnitName, self.EscortGroup.GroupName } ) if self.EscortGroup:IsAlive() and self.EscortClient:IsAlive() then @@ -1159,10 +1146,11 @@ function ESCORT:_FollowScheduler() return false end + --- Report Targets Scheduler. -- @param #ESCORT self function ESCORT:_ReportTargetsScheduler() - --self:F( self.EscortGroup:GetName() ) + self:F( self.EscortGroup:GetName() ) if self.EscortGroup:IsAlive() and self.EscortClient:IsAlive() then @@ -1175,7 +1163,7 @@ function ESCORT:_ReportTargetsScheduler() end local DetectedItems = self.Detection:GetDetectedItems() - --self:F( DetectedItems ) + self:F( DetectedItems ) local DetectedTargets = false @@ -1187,7 +1175,7 @@ function ESCORT:_ReportTargetsScheduler() --local EscortUnit = EscortGroupData:GetUnit( 1 ) for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do - --self:F( { DetectedItemIndex, DetectedItem } ) + self:F( { DetectedItemIndex, DetectedItem } ) -- Remove the sub menus of the Attack menu of the Escort for the EscortGroup. local DetectedItemReportSummary = self.Detection:DetectedItemReportSummary( DetectedItem, EscortGroupData.EscortGroup, _DATABASE:GetPlayerSettings( self.EscortClient:GetPlayerName() ) ) @@ -1228,7 +1216,7 @@ function ESCORT:_ReportTargetsScheduler() end end - --self:F( DetectedMsgs ) + self:F( DetectedMsgs ) if DetectedTargets then self.EscortGroup:MessageToClient( "Reporting detected targets:\n" .. table.concat( DetectedMsgs, "\n" ), 20, self.EscortClient ) else diff --git a/Moose Development/Moose/Functional/Formation.lua b/Moose Development/Moose/Functional/Formation.lua index 5eac066db..f15f0d631 100644 --- a/Moose Development/Moose/Functional/Formation.lua +++ b/Moose Development/Moose/Functional/Formation.lua @@ -515,7 +515,7 @@ end --- Set time interval between updates of the formation. -- @param #FORMATION self --- @param #number dt Time step in seconds between formation updates. Default is every 0.5 seconds. +-- @param #number dt (Optional) Time step in seconds between formation updates. Default is every 0.5 seconds. -- @return #FORMATION function FORMATION:SetFollowTimeInterval(dt) self.dtFollow=dt or 0.5 diff --git a/Moose Development/Moose/Functional/Fox.lua b/Moose Development/Moose/Functional/Fox.lua index 66a790c41..f605e6ff3 100644 --- a/Moose Development/Moose/Functional/Fox.lua +++ b/Moose Development/Moose/Functional/Fox.lua @@ -459,7 +459,7 @@ end --- Set explosion power. This is an "artificial" explosion generated when the missile is destroyed. Just for the visual effect. -- Don't set the explosion power too big or it will harm the aircraft in the vicinity. -- @param #FOX self --- @param #number power Explosion power in kg TNT. Default 0.1 kg. +-- @param #number power (Optional) Explosion power in kg TNT. Default 0.1 kg. -- @return #FOX self function FOX:SetExplosionPower(power) @@ -470,7 +470,7 @@ end --- Set missile-player distance when missile is destroyed. -- @param #FOX self --- @param #number distance Distance in meters. Default 200 m. +-- @param #number distance (Optional) Distance in meters. Default 200 m. -- @return #FOX self function FOX:SetExplosionDistance(distance) @@ -481,8 +481,8 @@ end --- Set missile-player distance when BIG missiles are destroyed. -- @param #FOX self --- @param #number distance Distance in meters. Default 500 m. --- @param #number explosivemass Explosive mass of missile threshold in kg TNT. Default 50 kg. +-- @param #number distance (Optional) Distance in meters. Default 500 m. +-- @param #number explosivemass (Optional) Explosive mass of missile threshold in kg TNT. Default 50 kg. -- @return #FOX self function FOX:SetExplosionDistanceBigMissiles(distance, explosivemass) @@ -516,7 +516,7 @@ end --- Set verbosity level. -- @param #FOX self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #FOX self function FOX:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index 05b8aca46..90ea8d843 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -872,8 +872,8 @@ do --- Set to accept accoustic detection. Set this *before* MANTIS starts! -- @param #MANTIS self - -- @param #number Radius Radius in which we can "hear" units. Defaults to 2000 meters. - -- @param #table UnitCategories Set what Unit Categories we can "hear". Defaults to `{Unit.Category.HELICOPTER}` + -- @param #number Radius (Optional) Radius in which we can "hear" units. Defaults to 2000 meters. + -- @param #table UnitCategories (Optional) Set what Unit Categories we can "hear". Defaults to `{Unit.Category.HELICOPTER}` -- @return #MANTIS self function MANTIS:SetAccousticDetectionOn(Radius,UnitCategories) self.DetectAccoustic = true @@ -1032,9 +1032,9 @@ do --- Add a SET_ZONE of zones for Shoot&Scoot - SHORAD units will move around -- @param #MANTIS self -- @param Core.Set#SET_ZONE ZoneSet Set of zones to be used. Units will move around to the next (random) zone between 100m and 3000m away. - -- @param #number Number Number of closest zones to be considered, defaults to 3. + -- @param #number Number (Optional) Number of closest zones to be considered, defaults to 3. -- @param #boolean Random If true, use a random coordinate inside the next zone to scoot to. - -- @param #string Formation Formation to use, defaults to "Cone". See mission editor dropdown for options. + -- @param #string Formation (Optional) Formation to use, defaults to "Cone". See mission editor dropdown for options. -- @return #MANTIS self function MANTIS:AddScootZones(ZoneSet, Number, Random, Formation) self:T(self.lid .. " AddScootZones") @@ -1215,11 +1215,11 @@ do --- Function to set number of SAMs going active on a valid, detected thread -- @param #MANTIS self - -- @param #number Short Number of short-range systems activated, defaults to 1. - -- @param #number Mid Number of mid-range systems activated, defaults to 2. - -- @param #number Long Number of long-range systems activated, defaults to 2. - -- @param #number Classic (non-automode) Number of overall systems activated, defaults to 6. - -- @param #number Point Number of point defense and AAA systems activated, defaults to 6. + -- @param #number Short (Optional) Number of short-range systems activated, defaults to 2. + -- @param #number Mid (Optional) Number of mid-range systems activated, defaults to 2. + -- @param #number Long (Optional) Number of long-range systems activated, defaults to 1. + -- @param #number Classic (Optional) (non-automode) Number of overall systems activated, defaults to 6. + -- @param #number Point (Optional) Number of point defense and AAA systems activated, defaults to 6. -- @return #MANTIS self function MANTIS:SetMaxActiveSAMs(Short,Mid,Long,Classic,Point) self:T(self.lid .. "SetMaxActiveSAMs") @@ -1341,7 +1341,7 @@ do --- Function to set Advanded Mode -- @param #MANTIS self -- @param #boolean onoff If true, will activate Advanced Mode - -- @param #number ratio [optional] Percentage to use for advanced mode, defaults to 100% + -- @param #number ratio (Optional) Percentage to use for advanced mode, defaults to 100% -- @usage Advanced mode will *decrease* reactivity of MANTIS, if HQ and/or EWR network dies. Set SAMs to RED state if both are dead. Requires usage of an **HQ** object and the **dynamic** option. -- E.g. `mymantis:SetAdvancedMode(true, 90)` function MANTIS:SetAdvancedMode(onoff, ratio) diff --git a/Moose Development/Moose/Functional/PseudoATC.lua b/Moose Development/Moose/Functional/PseudoATC.lua index defeb0064..ef90d3d88 100644 --- a/Moose Development/Moose/Functional/PseudoATC.lua +++ b/Moose Development/Moose/Functional/PseudoATC.lua @@ -172,7 +172,7 @@ end --- Set duration how long messages are displayed. -- @param #PSEUDOATC self --- @param #number duration Time in seconds. Default is 30 sec. +-- @param #number duration (Optional) Time in seconds. Default is 30 sec. function PSEUDOATC:SetMessageDuration(duration) self.mdur=duration or 30 end @@ -186,21 +186,21 @@ end --- Set time interval after which the F10 radio menu is refreshed. -- @param #PSEUDOATC self --- @param #number interval Interval in seconds. Default is every 120 sec. +-- @param #number interval (Optional) Interval in seconds. Default is every 120 sec. function PSEUDOATC:SetMenuRefresh(interval) self.mrefresh=interval or 120 end --- [Deprecated] Enable/disable event handling by MOOSE or DCS. -- @param #PSEUDOATC self --- @param #boolean switch If true, events are handled by MOOSE (default). If false, events are handled directly by DCS. +-- @param #boolean switch (Optional) If true, events are handled by MOOSE (default). If false, events are handled directly by DCS. function PSEUDOATC:SetEventsMoose(switch) self.eventsmoose=switch end --- Set time interval for reporting altitude until touchdown. -- @param #PSEUDOATC self --- @param #number interval Interval in seconds. Default is every 3 sec. +-- @param #number interval (Optional) Interval in seconds. Default is every 3 sec. function PSEUDOATC:SetReportAltInterval(interval) self.talt=interval or 3 end diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index 46d391c26..eb7ac35f7 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -1055,7 +1055,7 @@ end --- Set the friendly coalitions from which the airports can be used as departure and destination. -- @param #RAT self --- @param #string friendly "same"=own coalition+neutral (default), "sameonly"=own coalition only, "neutral"=all neutral airports. +-- @param #string friendly (Optional) "same"=own coalition+neutral (default), "sameonly"=own coalition only, "neutral"=all neutral airports. -- Default is "same", so aircraft will use airports of the coalition their spawn template has plus all neutral airports. -- @return #RAT RAT self object. -- @usage yak:SetCoalition("neutral") will spawn aircraft randomly on all neutral airports. @@ -1137,7 +1137,7 @@ end --- Set the scan radius around parking spots. Parking spot is considered to be occupied if any obstacle is found with the radius. -- @param #RAT self --- @param #number radius Radius in meters. Default 50 m. +-- @param #number radius (Optional) Radius in meters. Default 50 m. -- @return #RAT RAT self object. function RAT:SetParkingScanRadius(radius) self:F2(radius) @@ -1503,7 +1503,7 @@ end --- Set the delay before first group is spawned. -- @param #RAT self --- @param #number delay Delay in seconds. Default is 5 seconds. Minimum delay is 0.5 seconds. +-- @param #number delay (Optional) Delay in seconds. Default is 5 seconds. Minimum delay is 0.5 seconds. -- @return #RAT RAT self object. function RAT:SetSpawnDelay(delay) self:F2(delay) @@ -1514,7 +1514,7 @@ end --- Set the interval between spawnings of the template group. -- @param #RAT self --- @param #number interval Interval in seconds. Default is 5 seconds. Minimum is 0.5 seconds. +-- @param #number interval (Optional) Interval in seconds. Default is 5 seconds. Minimum is 0.5 seconds. -- @return #RAT RAT self object. function RAT:SetSpawnInterval(interval) self:F2(interval) @@ -1525,7 +1525,7 @@ end --- Set max number of groups that will be spawned. When this limit is reached, no more RAT groups are spawned. -- @param #RAT self --- @param #number Nmax Max number of groups. Default `nil`=unlimited. +-- @param #number Nmax (Optional) Max number of groups. Default `nil`=unlimited. -- @return #RAT RAT self object. function RAT:SetSpawnLimit(Nmax) self.NspawnMax=Nmax @@ -1545,7 +1545,7 @@ end --- Sets the delay between despawning and respawning aircraft. -- @param #RAT self --- @param #number delay Delay in seconds until respawn happens. Default is 1 second. Minimum is 1 second. +-- @param #number delay (Optional) Delay in seconds until respawn happens. Default is 1 second. Minimum is 1 second. -- @return #RAT RAT self object. function RAT:SetRespawnDelay(delay) self:F2(delay) @@ -1566,7 +1566,7 @@ end --- Number of tries to respawn an aircraft in case it has accidentally been spawned on runway. -- @param #RAT self --- @param #number n Number of retries. Default is 3. +-- @param #number n (Optional) Number of retries. Default is 3. -- @return #RAT RAT self object. function RAT:SetMaxRespawnTriedWhenSpawnedOnRunway(n) self:F2(n) @@ -1624,7 +1624,7 @@ end --- Check if aircraft have accidentally been spawned on the runway. If so they will be removed immediately. -- @param #RAT self -- @param #boolean switch If true, check is performed. If false, this check is omitted. --- @param #number radius Distance in meters until a unit is considered to have spawned accidentally on the runway. Default is 75 m. +-- @param #number radius (Optional) Distance in meters until a unit is considered to have spawned accidentally on the runway. Default is 75 m. -- @return #RAT RAT self object. function RAT:CheckOnRunway(switch, distance) self:F2(switch) @@ -1639,7 +1639,7 @@ end --- Check if aircraft have accidentally been spawned on top of each other. If yes, they will be removed immediately. -- @param #RAT self -- @param #boolean switch If true, check is performed. If false, this check is omitted. --- @param #number radius Radius in meters until which a unit is considered to be on top of each other. Default is 2 m. +-- @param #number radius (Optional) Radius in meters until which a unit is considered to be on top of each other. Default is 2 m. -- @return #RAT RAT self object. function RAT:CheckOnTop(switch, radius) self:F2(switch) @@ -1755,10 +1755,10 @@ end --- Define how aircraft that are spawned in uncontrolled state are activate. -- @param #RAT self --- @param #number maxactivated Maximal numnber of activated aircraft. Absolute maximum will be the number of spawned groups. Default is 1. --- @param #number delay Time delay in seconds before (first) aircraft is activated. Default is 1 second. --- @param #number delta Time difference in seconds before next aircraft is activated. Default is 1 second. --- @param #number frand Factor [0,...,1] for randomization of time difference between aircraft activations. Default is 0, i.e. no randomization. +-- @param #number maxactivated (Optional) Maximal numnber of activated aircraft. Absolute maximum will be the number of spawned groups. Default is 1. +-- @param #number delay (Optional) Time delay in seconds before (first) aircraft is activated. Default is 1 second. +-- @param #number delta (Optional) Time difference in seconds before next aircraft is activated. Default is 1 second. +-- @param #number frand (Optional) Factor [0,...,1] for randomization of time difference between aircraft activations. Default is 0, i.e. no randomization. -- @return #RAT RAT self object. function RAT:ActivateUncontrolled(maxactivated, delay, delta, frand) self:F2({max=maxactivated, delay=delay, delta=delta, rand=frand}) @@ -1784,7 +1784,7 @@ end --- Set the time after which inactive groups will be destroyed. -- @param #RAT self --- @param #number time Time in seconds. Default is 600 seconds = 10 minutes. Minimum is 60 seconds. +-- @param #number time (Optional) Time in seconds. Default is 600 seconds = 10 minutes. Minimum is 60 seconds. -- @return #RAT RAT self object. function RAT:TimeDestroyInactive(time) self:F2(time) @@ -1818,7 +1818,7 @@ end --- Set the climb rate. This automatically sets the climb angle. -- @param #RAT self --- @param #number rate Climb rate in ft/min. Default is 1500 ft/min. Minimum is 100 ft/min. Maximum is 15,000 ft/min. +-- @param #number rate (Optional) Climb rate in ft/min. Default is 1500 ft/min. Minimum is 100 ft/min. Maximum is 15,000 ft/min. -- @return #RAT RAT self object. function RAT:SetClimbRate(rate) self:F2(rate) @@ -1912,7 +1912,7 @@ end --- Max number of planes that get landing clearance of the RAT ATC. This setting effects all RAT objects and groups! -- @param #RAT self --- @param #number n Number of aircraft that are allowed to land simultaniously. Default is 2. +-- @param #number n (Optional) Number of aircraft that are allowed to land simultaniously. Default is 2. -- @return #RAT RAT self object. function RAT:ATC_Clearance(n) self:F2(n) @@ -1922,7 +1922,7 @@ end --- Delay between granting landing clearance for simultanious landings. This setting effects all RAT objects and groups! -- @param #RAT self --- @param #number time Delay time when the next aircraft will get landing clearance event if the previous one did not land yet. Default is 240 sec. +-- @param #number time (Optional) Delay time when the next aircraft will get landing clearance event if the previous one did not land yet. Default is 240 sec. -- @return #RAT RAT self object. function RAT:ATC_Delay(time) self:F2(time) @@ -2767,7 +2767,7 @@ end --- Despawn group. The `FLIGHTGROUP` is despawned and stopped. The ratcraft is removed from the self.ratcraft table. Menues are removed. -- @param #RAT self -- @param Wrapper.Group#GROUP group Group to be despawned. --- @param #number delay Delay in seconds before the despawn happens. Default is immidiately. +-- @param #number delay (Optional) Delay in seconds before the despawn happens. Default is immidiately. function RAT:_Despawn(group, delay) if delay and delay>0 then @@ -4705,7 +4705,7 @@ end --- Anticipated group name from alias and spawn index. -- @param #RAT self --- @param #number index Spawnindex of group if given or self.SpawnIndex+1 by default. +-- @param #number index (Optional) Spawnindex of group if given or self.SpawnIndex+1 by default. -- @return #string Name the group will get after it is spawned. function RAT:_AnticipatedGroupName(index) local index=index or self.SpawnIndex+1 @@ -6013,7 +6013,7 @@ end --- Adds a RAT object to the RAT manager. Parameter min specifies the limit how many RAT groups are at least alive. -- @param #RATMANAGER self -- @param #RAT ratobject RAT object to be managed. --- @param #number min Minimum number of groups for this RAT object. Default is 1. +-- @param #number min (Optional) Minimum number of groups for this RAT object. Default is 1. -- @return #RATMANAGER RATMANAGER self object. function RATMANAGER:Add(ratobject,min) @@ -6041,7 +6041,7 @@ end --- Starts the RAT manager and spawns the initial random number RAT groups for each RAT object. -- @param #RATMANAGER self --- @param #number delay Time delay in seconds after which the RAT manager is started. Default is 5 seconds. +-- @param #number delay (Optional) Time delay in seconds after which the RAT manager is started. Default is 5 seconds. -- @return #RATMANAGER RATMANAGER self object. function RATMANAGER:Start(delay) @@ -6114,7 +6114,7 @@ end --- Stops the RAT manager. -- @param #RATMANAGER self --- @param #number delay Delay in seconds before the manager is stopped. Default is 1 second. +-- @param #number delay (Optional) Delay in seconds before the manager is stopped. Default is 1 second. -- @return #RATMANAGER RATMANAGER self object. function RATMANAGER:Stop(delay) delay=delay or 1 @@ -6150,7 +6150,7 @@ end --- Sets the time interval between spawning of groups. -- @param #RATMANAGER self --- @param #number dt Time interval in seconds. Default is 1 second. +-- @param #number dt (Optional) Time interval in seconds. Default is 1 second. -- @return #RATMANAGER RATMANAGER self object. function RATMANAGER:SetTspawn(dt) self.dTspawn=dt or 1.0 diff --git a/Moose Development/Moose/Functional/Range.lua b/Moose Development/Moose/Functional/Range.lua index 0ec94102b..0ab0122c5 100644 --- a/Moose Development/Moose/Functional/Range.lua +++ b/Moose Development/Moose/Functional/Range.lua @@ -949,7 +949,7 @@ end --- Set maximal strafing altitude. Player entering a strafe pit above that altitude are not registered for a valid pass. -- @param #RANGE self --- @param #number maxalt Maximum altitude in meters AGL. Default is 914 m = 3000 ft. +-- @param #number maxalt (Optional) Maximum altitude in meters AGL. Default is 914 m = 3000 ft. -- @return #RANGE self function RANGE:SetMaxStrafeAlt( maxalt ) self.strafemaxalt = maxalt or RANGE.Defaults.strafemaxalt @@ -958,7 +958,7 @@ end --- Set time interval for tracking bombs. A smaller time step increases accuracy but needs more CPU time. -- @param #RANGE self --- @param #number dt Time interval in seconds. Default is 0.005 s. +-- @param #number dt (Optional) Time interval in seconds. Default is 0.005 s. -- @return #RANGE self function RANGE:SetBombtrackTimestep( dt ) self.dtBombtrack = dt or RANGE.Defaults.dtBombtrack @@ -967,7 +967,7 @@ end --- Set time how long (most) messages are displayed. -- @param #RANGE self --- @param #number time Time in seconds. Default is 30 s. +-- @param #number time (Optional) Time in seconds. Default is 30 s. -- @return #RANGE self function RANGE:SetMessageTimeDuration( time ) self.Tmsg = time or RANGE.Defaults.Tmsg @@ -1009,8 +1009,8 @@ end --- Set FunkMan socket. Bombing and strafing results will be send to your Discord bot. -- **Requires running FunkMan program**. -- @param #RANGE self --- @param #number Port Port. Default `10042`. --- @param #string Host Host. Default "127.0.0.1". +-- @param #number Port (Optional) Port. Default `10042`. +-- @param #string Host (Optional) Host. Default "127.0.0.1". -- @return #RANGE self function RANGE:SetFunkManOn(Port, Host) @@ -1032,7 +1032,7 @@ end --- Set max number of player results that are displayed. -- @param #RANGE self --- @param #number nmax Number of results. Default is 10. +-- @param #number nmax (Optional) Number of results. Default is 10. -- @return #RANGE self function RANGE:SetDisplayedMaxPlayerResults( nmax ) self.ndisplayresult = nmax or RANGE.Defaults.ndisplayresult @@ -1041,7 +1041,7 @@ end --- Set range radius. Defines the area in which e.g. bomb impacts are smoked. -- @param #RANGE self --- @param #number radius Radius in km. Default 5 km. +-- @param #number radius (Optional) Radius in km. Default 5 km. -- @return #RANGE self function RANGE:SetRangeRadius( radius ) self.rangeradius = radius * 1000 or RANGE.Defaults.rangeradius @@ -1050,7 +1050,7 @@ end --- Set player setting whether bomb impact points are smoked or not. -- @param #RANGE self --- @param #boolean switch If true nor nil default is to smoke impact points of bombs. +-- @param #boolean switch (Optional) If true nor nil default is to smoke impact points of bombs. -- @return #RANGE self function RANGE:SetDefaultPlayerSmokeBomb( switch ) if switch == true or switch == nil then @@ -1063,7 +1063,7 @@ end --- Set bomb track threshold distance. Bombs/rockets/missiles are only tracked if player-range distance is less than this distance. Default 25 km. -- @param #RANGE self --- @param #number distance Threshold distance in km. Default 25 km. +-- @param #number distance (Optional) Threshold distance in km. Default 25 km. -- @return #RANGE self function RANGE:SetBombtrackThreshold( distance ) self.BombtrackThreshold = (distance or 25) * 1000 @@ -1110,7 +1110,7 @@ end --- Enable range ceiling. Aircraft must be below the ceiling altitude to be considered in the range zone. -- @param #RANGE self --- @param #boolean enabled True if you would like to enable the ceiling check. If no value give, will Default to false. +-- @param #boolean enabled (Optional) True if you would like to enable the ceiling check. If no value give, will Default to false. -- @return #RANGE self function RANGE:EnableRangeCeiling( enabled ) self:T(self.lid.."EnableRangeCeiling") @@ -1126,7 +1126,7 @@ end --- Set smoke color for marking bomb targets. By default bomb targets are marked by red smoke. -- @param #RANGE self --- @param Utilities.Utils#SMOKECOLOR colorid Color id. Default `SMOKECOLOR.Red`. +-- @param Utilities.Utils#SMOKECOLOR colorid (Optional) Color id. Default `SMOKECOLOR.Red`. -- @return #RANGE self function RANGE:SetBombTargetSmokeColor( colorid ) self.BombSmokeColor = colorid or SMOKECOLOR.Red @@ -1135,7 +1135,7 @@ end --- Set score bomb distance. -- @param #RANGE self --- @param #number distance Distance in meters. Default 1000 m. +-- @param #number distance (Optional) Distance in meters. Default 1000 m. -- @return #RANGE self function RANGE:SetScoreBombDistance( distance ) self.scorebombdistance = distance or 1000 @@ -1144,7 +1144,7 @@ end --- Set smoke color for marking strafe targets. By default strafe targets are marked by green smoke. -- @param #RANGE self --- @param Utilities.Utils#SMOKECOLOR colorid Color id. Default `SMOKECOLOR.Green`. +-- @param Utilities.Utils#SMOKECOLOR colorid (Optional) Color id. Default `SMOKECOLOR.Green`. -- @return #RANGE self function RANGE:SetStrafeTargetSmokeColor( colorid ) self.StrafeSmokeColor = colorid or SMOKECOLOR.Green @@ -1153,7 +1153,7 @@ end --- Set smoke color for marking strafe pit approach boxes. By default strafe pit boxes are marked by white smoke. -- @param #RANGE self --- @param Utilities.Utils#SMOKECOLOR colorid Color id. Default `SMOKECOLOR.White`. +-- @param Utilities.Utils#SMOKECOLOR colorid (Optional) Color id. Default `SMOKECOLOR.White`. -- @return #RANGE self function RANGE:SetStrafePitSmokeColor( colorid ) self.StrafePitSmokeColor = colorid or SMOKECOLOR.White @@ -1162,7 +1162,7 @@ end --- Set time delay between bomb impact and starting to smoke the impact point. -- @param #RANGE self --- @param #number delay Time delay in seconds. Default is 3 seconds. +-- @param #number delay (Optional) Time delay in seconds. Default is 3 seconds. -- @return #RANGE self function RANGE:SetSmokeTimeDelay( delay ) self.TdelaySmoke = delay or RANGE.Defaults.TdelaySmoke @@ -1252,11 +1252,11 @@ end --- Use SRS Simple-Text-To-Speech for transmissions. No sound files necessary. -- @param #RANGE self -- @param #string PathToSRS Path to SRS directory. --- @param #number Port SRS port. Default 5002. --- @param #number Coalition Coalition side, e.g. `coalition.side.BLUE` or `coalition.side.RED`. Default `coalition.side.BLUE`. --- @param #number Frequency Frequency to use. Default is 256 MHz for range control and 305 MHz for instructor. If given, both control and instructor get this frequency. --- @param #number Modulation Modulation to use, defaults to radio.modulation.AM --- @param #number Volume Volume, between 0.0 and 1.0. Defaults to 1.0 +-- @param #number Port (Optional) SRS port. Default 5002. +-- @param #number Coalition (Optional) Coalition side, e.g. `coalition.side.BLUE` or `coalition.side.RED`. Default `coalition.side.BLUE`. +-- @param #number Frequency (Optional) Frequency to use. Default is 256 MHz for range control and 305 MHz for instructor. If given, both control and instructor get this frequency. +-- @param #number Modulation (Optional) Modulation to use, defaults to radio.modulation.AM +-- @param #number Volume (Optional) Volume, between 0.0 and 1.0. Defaults to 1.0 -- @param #string PathToGoogleKey Path to Google TTS credentials. -- @return #RANGE self function RANGE:SetSRS(PathToSRS, Port, Coalition, Frequency, Modulation, Volume, PathToGoogleKey) @@ -1300,11 +1300,11 @@ end --- (SRS) Set range control frequency and voice. Use `RANGE:SetSRS()` once first before using this function. -- @param #RANGE self --- @param #number frequency Frequency in MHz. Default 256 MHz. --- @param #number modulation Modulation, defaults to radio.modulation.AM. +-- @param #number frequency (Optional) Frequency in MHz. Default 256 MHz. +-- @param #number modulation (Optional) Modulation, defaults to radio.modulation.AM. -- @param #string voice Voice. --- @param #string culture Culture, defaults to "en-US". --- @param #string gender Gender, defaults to "female". +-- @param #string culture (Optional) Culture, defaults to "en-US". +-- @param #string gender (Optional) Gender, defaults to "female". -- @param #string relayunitname Name of the unit used for transmission location. -- @return #RANGE self function RANGE:SetSRSRangeControl( frequency, modulation, voice, culture, gender, relayunitname ) @@ -1334,11 +1334,11 @@ end --- (SRS) Set range instructor frequency and voice. Use `RANGE:SetSRS()` once first before using this function. -- @param #RANGE self --- @param #number frequency Frequency in MHz. Default 305 MHz. --- @param #number modulation Modulation, defaults to radio.modulation.AM. +-- @param #number frequency (Optional) Frequency in MHz. Default 305 MHz. +-- @param #number modulation (Optional) Modulation, defaults to radio.modulation.AM. -- @param #string voice Voice. --- @param #string culture Culture, defaults to "en-US". --- @param #string gender Gender, defaults to "male". +-- @param #string culture (Optional) Culture, defaults to "en-US". +-- @param #string gender (Optional) Gender, defaults to "male". -- @param #string relayunitname Name of the unit used for transmission location. -- @return #RANGE self function RANGE:SetSRSRangeInstructor( frequency, modulation, voice, culture, gender, relayunitname ) @@ -1368,7 +1368,7 @@ end --- Enable range control and set frequency (non-SRS). -- @param #RANGE self --- @param #number frequency Frequency in MHz. Default 256 MHz. +-- @param #number frequency (Optional) Frequency in MHz. Default 256 MHz. -- @param #string relayunitname Name of the unit used for transmission. -- @return #RANGE self function RANGE:SetRangeControl( frequency, relayunitname ) @@ -1379,7 +1379,7 @@ end --- Enable instructor radio and set frequency (non-SRS). -- @param #RANGE self --- @param #number frequency Frequency in MHz. Default 305 MHz. +-- @param #number frequency (Optional) Frequency in MHz. Default 305 MHz. -- @param #string relayunitname Name of the unit used for transmission. -- @return #RANGE self function RANGE:SetInstructorRadio( frequency, relayunitname ) @@ -1390,7 +1390,7 @@ end --- Set sound files folder within miz file. -- @param #RANGE self --- @param #string path Path for sound files. Default "Range Soundfiles/". Mind the slash "/" at the end! +-- @param #string path (Optional) Path for sound files. Default "Range Soundfiles/". Mind the slash "/" at the end! -- @return #RANGE self function RANGE:SetSoundfilesPath( path ) self.soundpath = tostring( path or "Range Soundfiles/" ) @@ -1630,11 +1630,13 @@ end -- @param #RANGE self -- @param #table targetnames Single or multiple (Table) names of unit or static objects serving as bomb targets. -- @param #number goodhitrange (Optional) Max distance from target unit (in meters) which is considered as a good hit. Default is 25 m. --- @param #boolean randommove If true, unit will move randomly within the range. Default is false. +-- @param #boolean randommove (Optional) If true, unit will move randomly within the range. Default is false. -- @return #RANGE self function RANGE:AddBombingTargets( targetnames, goodhitrange, randommove ) self:F( { targetnames = targetnames, goodhitrange = goodhitrange, randommove = randommove } ) + randommove = randommove or false + -- Create a table if necessary. if type( targetnames ) ~= "table" then targetnames = { targetnames } @@ -1669,7 +1671,7 @@ end -- @param #RANGE self -- @param Wrapper.Positionable#POSITIONABLE unit Positionable (unit or static) of the bombing target. -- @param #number goodhitrange Max distance from unit which is considered as a good hit. --- @param #boolean randommove If true, unit will move randomly within the range. Default is false. +-- @param #boolean randommove (Optional) If true, unit will move randomly within the range. Default is false. -- @return #RANGE self function RANGE:AddBombingTargetUnit( unit, goodhitrange, randommove ) self:F( { unit = unit, goodhitrange = goodhitrange, randommove = randommove } ) @@ -1785,7 +1787,7 @@ end -- @param #RANGE self -- @param Wrapper.Group#GROUP group Group of bombing targets. Can also be given as group name. -- @param #number goodhitrange Max distance from unit which is considered as a good hit. --- @param #boolean randommove If true, unit will move randomly within the range. Default is false. +-- @param #boolean randommove (Optional) If true, unit will move randomly within the range. Default is false. -- @return #RANGE self function RANGE:AddBombingTargetGroup( group, goodhitrange, randommove ) self:F( { group = group, goodhitrange = goodhitrange, randommove = randommove } ) diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index 5d67f389e..c2fd4ecfe 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -394,7 +394,7 @@ end --- Set a prefix string that will be displayed at each scoring message sent. -- @param #SCORING self --- @param #string DisplayMessagePrefix (Default="Scoring: ") The scoring prefix string. +-- @param #string DisplayMessagePrefix (Optional) (Default="Scoring: ") The scoring prefix string. -- @return #SCORING function SCORING:SetDisplayMessagePrefix( DisplayMessagePrefix ) self.DisplayMessagePrefix = DisplayMessagePrefix or "" diff --git a/Moose Development/Moose/Functional/Sead.lua b/Moose Development/Moose/Functional/Sead.lua index f7227bf2e..be091f9c8 100644 --- a/Moose Development/Moose/Functional/Sead.lua +++ b/Moose Development/Moose/Functional/Sead.lua @@ -182,7 +182,7 @@ end --- Sets the engagement range of the SAMs. Defaults to 75% to make it more deadly. Feature Request #1355 -- @param #SEAD self --- @param #number range Set the engagement range in percent, e.g. 55 (default 75) +-- @param #number range (Optional) Set the engagement range in percent, e.g. 55 (default 75) -- @return #SEAD self function SEAD:SetEngagementRange(range) self:T( { range } ) @@ -197,7 +197,7 @@ end --- Set the padding in seconds, which extends the radar off time calculated by SEAD -- @param #SEAD self --- @param #number Padding Extra number of seconds to add for the switch-on (default 10 seconds) +-- @param #number Padding (Optional) Extra number of seconds to add for the switch-on (default 10 seconds) -- @return #SEAD self function SEAD:SetPadding(Padding) self:T( { Padding } ) diff --git a/Moose Development/Moose/Functional/Shorad.lua b/Moose Development/Moose/Functional/Shorad.lua index 1b7475baa..99d104d92 100644 --- a/Moose Development/Moose/Functional/Shorad.lua +++ b/Moose Development/Moose/Functional/Shorad.lua @@ -158,15 +158,15 @@ do --- Instantiates a new SHORAD object -- @param #SHORAD self - -- @param #string Name Name of this SHORAD - -- @param #string ShoradPrefix Filter for the Shorad #SET_GROUP - -- @param Core.Set#SET_GROUP Samset The #SET_GROUP of SAM sites to defend - -- @param #number Radius Defense radius in meters, used to switch on SHORAD groups **within** this radius - -- @param #number ActiveTimer Determines how many seconds the systems stay on red alert after wake-up call + -- @param #string Name (Optional) Name of this SHORAD. Default "MyShorad" + -- @param #string ShoradPrefix (Optional) Filter for the Shorad #SET_GROUP. Default "SAM SHORAD" + -- @param Core.Set#SET_GROUP Samset (Optional) The #SET_GROUP of SAM sites to defend. Default is based on default ShoradPrefix and default Coalition. + -- @param #number Radius (Optional) Defense radius in meters, used to switch on SHORAD groups **within** this radius. Default is 20000m. + -- @param #number ActiveTimer (Optional) Determines how many seconds the systems stay on red alert after wake-up call. Default 600s -- @param #string Coalition Coalition, i.e. "blue", "red", or "neutral" -- @param #boolean UseEmOnOff Use Emissions On/Off rather than Alarm State Red/Green (default: use Emissions switch) - -- @param #boolean SmokeDecoy Throw smoke decoy when getting activated. Defaults to false. - -- @param #number SmokeDecoyColor SMOLECOLOR to use. Defaults to SMOLECOLOR.White + -- @param #boolean SmokeDecoy (Optional) Throw smoke decoy when getting activated. Defaults to false. + -- @param #number SmokeDecoyColor (Optional) SMOLECOLOR to use. Defaults to SMOLECOLOR.White -- @return #SHORAD self function SHORAD:New(Name, ShoradPrefix, Samset, Radius, ActiveTimer, Coalition, UseEmOnOff, SmokeDecoy, SmokeDecoyColor) local self = BASE:Inherit( self, FSM:New() ) @@ -240,9 +240,9 @@ do --- Add a SET_ZONE of zones for Shoot&Scoot -- @param #SHORAD self -- @param Core.Set#SET_ZONE ZoneSet Set of zones to be used. Units will move around to the next (random) zone between 100m and 3000m away. - -- @param #number Number Number of closest zones to be considered, defaults to 3. + -- @param #number Number (Optional) Number of closest zones to be considered, defaults to 3. -- @param #boolean Random If true, use a random coordinate inside the next zone to scoot to. - -- @param #string Formation Formation to use, defaults to "Cone". See mission editor dropdown for options. + -- @param #string Formation (Optional) Formation to use, defaults to "Cone". See mission editor dropdown for options. -- @return #SHORAD self function SHORAD:AddScootZones(ZoneSet, Number, Random, Formation) self:T(self.lid .. " AddScootZones") diff --git a/Moose Development/Moose/Functional/Stratego.lua b/Moose Development/Moose/Functional/Stratego.lua index adb440470..02ca8918c 100644 --- a/Moose Development/Moose/Functional/Stratego.lua +++ b/Moose Development/Moose/Functional/Stratego.lua @@ -251,7 +251,7 @@ STRATEGO.Type = { -- @param #STRATEGO self -- @param #string Name Name of the Adviser. -- @param #number Coalition Coalition, e.g. coalition.side.BLUE. --- @param #number MaxDist Maximum distance of a single route in kilometers, defaults to 150. +-- @param #number MaxDist (Optional) Maximum distance of a single route in kilometers, defaults to 150. -- @return #STRATEGO self function STRATEGO:New(Name,Coalition,MaxDist) -- Inherit everything from FSM class. @@ -362,7 +362,7 @@ end --- [USER] Set up usage of budget and set an initial budget in points. -- @param #STRATEGO self -- @param #boolean Usebudget If true, use budget for advisory calculations. --- @param #number StartBudget Initial budget to be used, defaults to 500. +-- @param #number StartBudget (Optional) Initial budget to be used, defaults to 500. function STRATEGO:SetUsingBudget(Usebudget,StartBudget) self:T(self.lid.."SetUsingBudget") self.usebudget = Usebudget @@ -394,10 +394,10 @@ end --- [USER] Set weights for nodes and routes to determine their importance. -- @param #STRATEGO self --- @param #number MaxRunways Set the maximum number of runways the big (equals strategic) airbases on the map have. Defaults to 3. The weight of an airbase node hence equals the number of runways. --- @param #number PortWeight Set what weight a port node has. Defaults to 3. --- @param #number POIWeight Set what weight a POI node has. Defaults to 1. --- @param #number RouteFactor Defines which weight each route between two defined nodes gets: Weight * RouteFactor. +-- @param #number MaxRunways (Optional) Set the maximum number of runways the big (equals strategic) airbases on the map have. Defaults to 3. The weight of an airbase node hence equals the number of runways. +-- @param #number PortWeight (Optional) Set what weight a port node has. Defaults to 3. +-- @param #number POIWeight (Optional) Set what weight a POI node has. Defaults to 1. +-- @param #number RouteFactor (Optional) Defines which weight each route between two defined nodes gets: Weight * RouteFactor. Defaults to 5. -- @return #STRATEGO self function STRATEGO:SetWeights(MaxRunways,PortWeight,POIWeight,RouteFactor) self:T(self.lid.."SetWeights") @@ -410,7 +410,7 @@ end --- [USER] Set neutral benefit, i.e. how many points it is cheaper to decide for a neutral vs an enemy node when taking decisions. -- @param #STRATEGO self --- @param #number NeutralBenefit Pointsm defaults to 100. +-- @param #number NeutralBenefit (Optional) Pointsm defaults to 100. -- @return #STRATEGO self function STRATEGO:SetNeutralBenefit(NeutralBenefit) self:T(self.lid.."SetNeutralBenefit") @@ -420,9 +420,9 @@ end --- [USER] Set how many units of which minimum threat level are needed to capture one node (i.e. the underlying OpsZone). -- @param #STRATEGO self --- @param #number CaptureUnits Number of units needed, defaults to three. --- @param #number CaptureThreatlevel Threat level needed, can be 0..10, defaults to one. --- @param #table CaptureCategories Table of object categories which can capture a node, defaults to `{Object.Category.UNIT}`. +-- @param #number CaptureUnits (Optional) Number of units needed, defaults to 3. +-- @param #number CaptureThreatlevel (Optional) Threat level needed, can be 0..10, defaults to 1. +-- @param #table CaptureCategories (Optional) Table of object categories which can capture a node, defaults to `{Object.Category.UNIT}`. -- @return #STRATEGO self function STRATEGO:SetCaptureOptions(CaptureUnits,CaptureThreatlevel,CaptureCategories) self:T(self.lid.."SetCaptureOptions") diff --git a/Moose Development/Moose/Functional/Suppression.lua b/Moose Development/Moose/Functional/Suppression.lua index 08ff6966c..4a094b9ae 100644 --- a/Moose Development/Moose/Functional/Suppression.lua +++ b/Moose Development/Moose/Functional/Suppression.lua @@ -642,7 +642,7 @@ end --- Set average, minimum and maximum time a unit is suppressed each time it gets hit. -- @param #SUPPRESSION self --- @param #number Tave Average time [seconds] a group will be suppressed. Default is 15 seconds. +-- @param #number Tave (Optional) Average time [seconds] a group will be suppressed. Default is 15 seconds. -- @param #number Tmin (Optional) Minimum time [seconds] a group will be suppressed. Default is 5 seconds. -- @param #number Tmax (Optional) Maximum time a group will be suppressed. Default is 25 seconds. function SUPPRESSION:SetSuppressionTime(Tave, Tmin, Tmax) @@ -697,7 +697,7 @@ end --- Set the formation a group uses for fall back, hide or retreat. -- @param #SUPPRESSION self --- @param #string formation Formation of the group. Default "Vee". +-- @param #string formation (Optional) Formation of the group. Default "Vee". function SUPPRESSION:SetFormation(formation) self:F(formation) self.Formation=formation or "Vee" @@ -705,7 +705,7 @@ end --- Set speed a group moves at for fall back, hide or retreat. -- @param #SUPPRESSION self --- @param #number speed Speed in km/h of group. Default max speed the group can do. +-- @param #number speed (Optional) Speed in km/h of group. Default max speed the group can do. function SUPPRESSION:SetSpeed(speed) self:F(speed) self.Speed=speed or self.SpeedMax @@ -793,7 +793,7 @@ end -- If the group consists of only a singe unit, this referrs to the life of the unit. -- If the group consists of more than one unit, this referrs to the group strength relative to its initial strength. -- @param #SUPPRESSION self --- @param #number damage Damage in percent. If group gets damaged above this value, the group will retreat. Default 50 %. +-- @param #number damage (Optional) Damage in percent. If group gets damaged above this value, the group will retreat. Default 50 %. function SUPPRESSION:SetRetreatDamage(damage) self:F(damage) self.RetreatDamage=damage or 50 @@ -801,7 +801,7 @@ end --- Set time a group waits in the retreat zone before it resumes its mission. Default is two hours. -- @param #SUPPRESSION self --- @param #number time Time in seconds. Default 7200 seconds = 2 hours. +-- @param #number time (Optional) Time in seconds. Default 7200 seconds = 2 hours. function SUPPRESSION:SetRetreatWait(time) self:F(time) self.RetreatWait=time or 7200 @@ -809,7 +809,7 @@ end --- Set alarm state a group will get after it returns from a fall back or take cover. -- @param #SUPPRESSION self --- @param #string alarmstate Alarm state. Possible "Auto", "Green", "Red". Default is "Auto". +-- @param #string alarmstate (Optional) Alarm state. Possible "Auto", "Green", "Red". Default is "Auto". function SUPPRESSION:SetDefaultAlarmState(alarmstate) self:F(alarmstate) if alarmstate:lower()=="auto" then @@ -825,7 +825,7 @@ end --- Set Rules of Engagement (ROE) a group will get when it recovers from suppression. -- @param #SUPPRESSION self --- @param #string roe ROE after suppression. Possible "Free", "Hold" or "Return". Default "Free". +-- @param #string roe (Optional) ROE after suppression. Possible "Free", "Hold" or "Return". Default "Free". function SUPPRESSION:SetDefaultROE(roe) self:F(roe) if roe:lower()=="free" then @@ -841,7 +841,7 @@ end --- Create an F10 menu entry for the suppressed group. The menu is mainly for Debugging purposes. -- @param #SUPPRESSION self --- @param #boolean switch Enable=true or disable=false menu group. Default is true. +-- @param #boolean switch (Optional) Enable=true or disable=false menu group. Default is true. function SUPPRESSION:MenuOn(switch) self:F(switch) if switch==nil then @@ -1682,9 +1682,9 @@ end --- Make group run/drive to a certain point. We put in several intermediate waypoints because sometimes the group stops before it arrived at the desired point. --@param #SUPPRESSION self --@param Core.Point#COORDINATE fin Coordinate where we want to go. ---@param #number speed Speed of group. Default is 20. ---@param #string formation Formation of group. Default is "Vee". ---@param #number wait Time the group will wait/hold at final waypoint. Default is 30 seconds. +--@param #number speed (Optional) Speed of group. Default is 20. +--@param #string formation (Optional) Formation of group. Default is "Vee". +--@param #number wait (Optional) Time the group will wait/hold at final waypoint. Default is 30 seconds. function SUPPRESSION:_Run(fin, speed, formation, wait) speed=speed or 20 @@ -1946,7 +1946,7 @@ end --- Sets the ROE for the group and updates the current ROE variable. -- @param #SUPPRESSION self --- @param #string roe ROE the group will get. Possible "Free", "Hold", "Return". Default is self.DefaultROE. +-- @param #string roe (Optional) ROE the group will get. Possible "Free", "Hold", "Return". Default is self.DefaultROE. function SUPPRESSION:_SetROE(roe) local group=self.Controllable --Wrapper.Controllable#CONTROLLABLE @@ -1975,7 +1975,7 @@ end --- Sets the alarm state of the group and updates the current alarm state variable. -- @param #SUPPRESSION self --- @param #string state Alarm state the group will get. Possible "Auto", "Green", "Red". Default is self.DefaultAlarmState. +-- @param #string state (Optional) Alarm state the group will get. Possible "Auto", "Green", "Red". Default is self.DefaultAlarmState. function SUPPRESSION:_SetAlarmState(state) local group=self.Controllable --Wrapper.Controllable#CONTROLLABLE diff --git a/Moose Development/Moose/Functional/Tiresias.lua b/Moose Development/Moose/Functional/Tiresias.lua index 9d5168748..c4457e31c 100644 --- a/Moose Development/Moose/Functional/Tiresias.lua +++ b/Moose Development/Moose/Functional/Tiresias.lua @@ -181,8 +181,8 @@ end --- [USER] Set activation radius for Helos and Planes in Nautical Miles. -- @param #TIRESIAS self --- @param #number HeloMiles Radius around a Helicopter in which AI ground units will be activated. Defaults to 10NM. --- @param #number PlaneMiles Radius around an Airplane in which AI ground units will be activated. Defaults to 25NM. +-- @param #number HeloMiles (Optional) Radius around a Helicopter in which AI ground units will be activated. Defaults to 10NM. +-- @param #number PlaneMiles (Optional) Radius around an Airplane in which AI ground units will be activated. Defaults to 25NM. -- @return #TIRESIAS self function TIRESIAS:SetActivationRanges(HeloMiles, PlaneMiles) self.HeloSwitchRange = HeloMiles or 10 @@ -194,8 +194,8 @@ end ---[USER] Set AAA Ranges - AAA equals non-SAM systems which qualify as AAA in DCS world. -- @param #TIRESIAS self --- @param #number FiringRange The engagement range that AAA units will be set to. Can be 0 to 100 (percent). Defaults to 60. --- @param #boolean SwitchAAA Decide if these system will have their AI switched off, too. Defaults to true. +-- @param #number FiringRange (Optional) The engagement range that AAA units will be set to. Can be 0 to 100 (percent). Defaults to 60. +-- @param #boolean SwitchAAA (Optional) Decide if these system will have their AI switched off, too. Defaults to true. -- @return #TIRESIAS self function TIRESIAS:SetAAARanges(FiringRange, SwitchAAA) self.AAARange = FiringRange or 60 diff --git a/Moose Development/Moose/Functional/Warehouse.lua b/Moose Development/Moose/Functional/Warehouse.lua index 597c81fe1..12d5d31a0 100644 --- a/Moose Development/Moose/Functional/Warehouse.lua +++ b/Moose Development/Moose/Functional/Warehouse.lua @@ -2467,14 +2467,14 @@ function WAREHOUSE:New(warehouse, alias) --- Triggers the FSM event "Save" when the warehouse assets are saved to file on disk. -- @function [parent=#WAREHOUSE] Save -- @param #WAREHOUSE self - -- @param #string path Path where the file is saved. Default is the DCS installation root directory. + -- @param #string path (Optional) Path where the file is saved. Default is the DCS installation root directory. -- @param #string filename (Optional) File name. Default is WAREHOUSE-_.txt. --- Triggers the FSM event "Save" with a delay when the warehouse assets are saved to a file. -- @function [parent=#WAREHOUSE] __Save -- @param #WAREHOUSE self -- @param #number delay Delay in seconds. - -- @param #string path Path where the file is saved. Default is the DCS installation root directory. + -- @param #string path (Optional) Path where the file is saved. Default is the DCS installation root directory. -- @param #string filename (Optional) File name. Default is WAREHOUSE-_.txt. --- On after "Save" event user function. Called when the warehouse assets are saved to disk. @@ -2483,21 +2483,21 @@ function WAREHOUSE:New(warehouse, alias) -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. - -- @param #string path Path where the file is saved. Default is the DCS installation root directory. + -- @param #string path (Optional) Path where the file is saved. Default is the DCS installation root directory. -- @param #string filename (Optional) File name. Default is WAREHOUSE-_.txt. --- Triggers the FSM event "Load" when the warehouse is loaded from a file on disk. -- @function [parent=#WAREHOUSE] Load -- @param #WAREHOUSE self - -- @param #string path Path where the file is located. Default is the DCS installation root directory. + -- @param #string path (Optional) Path where the file is located. Default is the DCS installation root directory. -- @param #string filename (Optional) File name. Default is WAREHOUSE-_.txt. --- Triggers the FSM event "Load" with a delay when the warehouse assets are loaded from disk. -- @function [parent=#WAREHOUSE] __Load -- @param #WAREHOUSE self -- @param #number delay Delay in seconds. - -- @param #string path Path where the file is located. Default is the DCS installation root directory. + -- @param #string path (Optional) Path where the file is located. Default is the DCS installation root directory. -- @param #string filename (Optional) File name. Default is WAREHOUSE-_.txt. --- On after "Load" event user function. Called when the warehouse assets are loaded from disk. @@ -2506,7 +2506,7 @@ function WAREHOUSE:New(warehouse, alias) -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. - -- @param #string path Path where the file is located. Default is the DCS installation root directory. + -- @param #string path (Optional) Path where the file is located. Default is the DCS installation root directory. -- @param #string filename (Optional) File name. Default is WAREHOUSE-_.txt. @@ -2576,7 +2576,7 @@ end --- Set low fuel threshold. If one unit of an asset has less fuel than this number, the event AssetLowFuel will be fired. -- @param #WAREHOUSE self --- @param #number threshold Relative low fuel threshold, i.e. a number in [0,1]. Default 0.15 (15%). +-- @param #number threshold (Optional) Relative low fuel threshold, i.e. a number in [0,1]. Default 0.15 (15%). -- @return #WAREHOUSE self function WAREHOUSE:SetLowFuelThreshold(threshold) self.lowfuelthresh=threshold or 0.15 @@ -2594,7 +2594,7 @@ end --- Set verbosity level. -- @param #WAREHOUSE self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #WAREHOUSE self function WAREHOUSE:SetVerbosityLevel(VerbosityLevel) self.verbosity=VerbosityLevel or 0 @@ -2705,7 +2705,7 @@ end --- Enable auto save of warehouse assets at mission end event. -- @param #WAREHOUSE self -- @param #string path Path where to save the asset data file. --- @param #string filename File name. Default is generated automatically from warehouse id. +-- @param #string filename (Optional) File name. Default is generated automatically from warehouse id. -- @return #WAREHOUSE self function WAREHOUSE:SetSaveOnMissionEnd(path, filename) self.autosave=true @@ -3349,7 +3349,7 @@ end -- Note that this is the time, the DCS engine uses not something we can control on a user level or we could get via scripting. -- You need to input the value. On the DCS forum it was stated that this is currently one hour. Hence this is the default value. -- @param #WAREHOUSE self --- @param #number RepairTime Time in seconds until the runway is repaired. Default 3600 sec (one hour). +-- @param #number RepairTime (Optional) Time in seconds until the runway is repaired. Default 3600 sec (one hour). -- @return #WAREHOUSE self function WAREHOUSE:SetRunwayRepairtime(RepairTime) self.runwayrepairtime=RepairTime or 3600 @@ -3891,7 +3891,7 @@ end -- @param #string Event Event. -- @param #string To To state. -- @param Wrapper.Group#GROUP group Group or template group to be added to the warehouse stock. --- @param #number ngroups Number of groups to add to the warehouse stock. Default is 1. +-- @param #number ngroups (Optional) Number of groups to add to the warehouse stock. Default is 1. -- @param #WAREHOUSE.Attribute forceattribute (Optional) Explicitly force a generalized attribute for the asset. This has to be an @{#WAREHOUSE.Attribute}. -- @param #number forcecargobay (Optional) Explicitly force cargobay weight limit in kg for cargo carriers. This is for each *unit* of the group. -- @param #number forceweight (Optional) Explicitly force weight in kg of each unit in the group. @@ -6226,7 +6226,7 @@ end -- @param #WAREHOUSE self -- @param Wrapper.Group#GROUP Group The train group. -- @param Core.Point#COORDINATE Coordinate of the destination. Tail will be routed to the closest point --- @param #number Speed Speed in km/h to drive to the destination coordinate. Default is 60% of max possible speed the unit can go. +-- @param #number Speed (Optional) Speed in km/h to drive to the destination coordinate. Default is 60% of max possible speed the unit can go. function WAREHOUSE:_RouteTrain(Group, Coordinate, Speed) if Group and Group:IsAlive() then @@ -8783,7 +8783,7 @@ end --- Info Message. Message send to coalition if reports or debug mode activated (and duration > 0). Text self:I(text) added to DCS.log file. -- @param #WAREHOUSE self -- @param #string text The text of the error message. --- @param #number duration Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed. +-- @param #number duration (Optional) Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed. function WAREHOUSE:_InfoMessage(text, duration) duration=duration or 20 if duration>0 and self.Debug or self.Report then @@ -8796,7 +8796,7 @@ end --- Debug message. Message send to all if debug mode is activated (and duration > 0). Text self:T(text) added to DCS.log file. -- @param #WAREHOUSE self -- @param #string text The text of the error message. --- @param #number duration Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed. +-- @param #number duration (Optional) Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed. function WAREHOUSE:_DebugMessage(text, duration) duration=duration or 20 if self.Debug and duration>0 then @@ -8808,7 +8808,7 @@ end --- Error message. Message send to all (if duration > 0). Text self:E(text) added to DCS.log file. -- @param #WAREHOUSE self -- @param #string text The text of the error message. --- @param #number duration Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed. +-- @param #number duration (Optional) Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed. function WAREHOUSE:_ErrorMessage(text, duration) duration=duration or 20 if duration>0 then diff --git a/Moose Development/Moose/Functional/ZoneCaptureCoalition.lua b/Moose Development/Moose/Functional/ZoneCaptureCoalition.lua index b6f392426..256e36d00 100644 --- a/Moose Development/Moose/Functional/ZoneCaptureCoalition.lua +++ b/Moose Development/Moose/Functional/ZoneCaptureCoalition.lua @@ -365,8 +365,8 @@ do -- ZONE_CAPTURE_COALITION -- @param #ZONE_CAPTURE_COALITION self -- @param Core.Zone#ZONE Zone A @{Core.Zone} object with the goal to be achieved. Alternatively, can be handed as the name of late activated group describing a @{Core.Zone#ZONE_POLYGON} with its waypoints. -- @param #number Coalition The initial coalition owning the zone. - -- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}. - -- @param #table ObjectCategories Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS. + -- @param #table UnitCategories (Optional) Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}. + -- @param #table ObjectCategories (Optional) Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS. -- @return #ZONE_CAPTURE_COALITION -- @usage -- diff --git a/Moose Development/Moose/Functional/ZoneGoalCoalition.lua b/Moose Development/Moose/Functional/ZoneGoalCoalition.lua index 82da20706..6555629bd 100644 --- a/Moose Development/Moose/Functional/ZoneGoalCoalition.lua +++ b/Moose Development/Moose/Functional/ZoneGoalCoalition.lua @@ -54,8 +54,8 @@ do -- ZoneGoal --- ZONE_GOAL_COALITION Constructor. -- @param #ZONE_GOAL_COALITION self -- @param Core.Zone#ZONE Zone A @{Core.Zone} object with the goal to be achieved. - -- @param #number Coalition The initial coalition owning the zone. Default coalition.side.NEUTRAL. - -- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}. + -- @param #number Coalition (Optional) The initial coalition owning the zone. Default coalition.side.NEUTRAL. + -- @param #table UnitCategories (Optional) Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}. -- @return #ZONE_GOAL_COALITION function ZONE_GOAL_COALITION:New( Zone, Coalition, UnitCategories ) @@ -90,7 +90,7 @@ do -- ZoneGoal --- Set the owning coalition of the zone. -- @param #ZONE_GOAL_COALITION self - -- @param #table UnitCategories Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}. + -- @param #table UnitCategories (Optional) Table of unit categories. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). Default {Unit.Category.GROUND_UNIT}. -- @return #ZONE_GOAL_COALITION function ZONE_GOAL_COALITION:SetUnitCategories( UnitCategories ) @@ -105,7 +105,7 @@ do -- ZoneGoal --- Set the owning coalition of the zone. -- @param #ZONE_GOAL_COALITION self - -- @param #table ObjectCategories Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS. + -- @param #table ObjectCategories (Optional) Table of unit categories. See [DCS Class Object](https://wiki.hoggitworld.com/view/DCS_Class_Object). Default {Object.Category.UNIT, Object.Category.STATIC}, i.e. all UNITS and STATICS. -- @return #ZONE_GOAL_COALITION function ZONE_GOAL_COALITION:SetObjectCategories( ObjectCategories ) diff --git a/Moose Development/Moose/Modules.lua b/Moose Development/Moose/Modules.lua index 489d0421a..528c86bac 100644 --- a/Moose Development/Moose/Modules.lua +++ b/Moose Development/Moose/Modules.lua @@ -85,6 +85,9 @@ __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/RecoveryTanker.lua' ) __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/RescueHelo.lua' ) __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/ATIS.lua' ) __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CTLD.lua' ) +__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CTLD_CARGO.lua' ) +__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CTLD_Localization.lua' ) +__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CTLD_Hercules.lua' ) __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/CSAR.lua' ) __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/AirWing.lua' ) __Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Ops/ArmyGroup.lua' ) diff --git a/Moose Development/Moose/Navigation/Beacons.lua b/Moose Development/Moose/Navigation/Beacons.lua index 84ecf218d..69b14f184 100644 --- a/Moose Development/Moose/Navigation/Beacons.lua +++ b/Moose Development/Moose/Navigation/Beacons.lua @@ -242,7 +242,7 @@ end --- Find closest beacons to a given coordinate. -- @param #BEACONS self -- @param Core.Point#COORDINATE Coordinate The reference coordinate. --- @param #number Nmax Max number of beacons. Default 5. +-- @param #number Nmax (Optional) Max number of beacons. Default 5. -- @param #number TypeID (Optional) Only search for specific beacon types, *e.g.* `BEACON.Type.TACAN`. -- @param #number DistMax (Optional) Max search distance in meters. -- @return #table Table of #BEACONS.Beacon closest beacons. diff --git a/Moose Development/Moose/Navigation/Point.lua b/Moose Development/Moose/Navigation/Point.lua index e02fb9945..bc1f4148f 100644 --- a/Moose Development/Moose/Navigation/Point.lua +++ b/Moose Development/Moose/Navigation/Point.lua @@ -115,7 +115,7 @@ NAVFIX.version="0.1.0" --- Create a new NAVFIX class instance from a given VECTOR. -- @param #NAVFIX self -- @param #string Name Name/ident of the point. Should be unique! --- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`. +-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`. -- @param Core.Vector#VECTOR Vector Position vector of the navpoint. -- @return #NAVFIX self function NAVFIX:NewFromVector(Name, Type, Vector) @@ -150,7 +150,7 @@ end --- Create a new NAVFIX class instance from a given COORDINATE. -- @param #NAVFIX self -- @param #string Name Name of the fix. Should be unique! --- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`. +-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`. -- @param Core.Point#COORDINATE Coordinate Coordinate of the point. -- @return #NAVFIX self function NAVFIX:NewFromCoordinate(Name, Type, Coordinate) @@ -168,7 +168,7 @@ end --- Create a new NAVFIX instance from given latitude and longitude in degrees, minutes and seconds (DMS). -- @param #NAVFIX self -- @param #string Name Name of the fix. Should be unique! --- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`. +-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`. -- @param #string Latitude Latitude in DMS as string. -- @param #string Longitude Longitude in DMS as string. -- @return #NAVFIX self @@ -186,7 +186,7 @@ end --- Create a new NAVFIX instance from given latitude and longitude in decimal degrees (DD). -- @param #NAVFIX self -- @param #string Name Name of the fix. Should be unique! --- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`. +-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`. -- @param #number Latitude Latitude in DD. -- @param #number Longitude Longitude in DD. -- @return #NAVFIX self @@ -523,7 +523,7 @@ NAVAID.version="0.1.0" --- Create a new NAVAID class instance. -- @param #NAVAID self -- @param #string Name Name/ident of this navaid. --- @param #string Type Type of the point. Default `NAVFIX.Type.POINT`. +-- @param #string Type (Optional) Type of the point. Default `NAVFIX.Type.POINT`. -- @param #string ZoneName Name of the zone to scan the scenery. -- @param #string SceneryName Name of the scenery object. -- @return #NAVAID self @@ -579,7 +579,7 @@ end --- Set channel of, *e.g.*, TACAN beacons. -- @param #NAVAID self -- @param #number Channel The channel. --- @param #string Band The band either `"X"` (default) or `"Y"`. +-- @param #string Band (Optional) The band either `"X"` (default) or `"Y"`. -- @return #NAVAID self function NAVAID:SetChannel(Channel, Band) diff --git a/Moose Development/Moose/Navigation/Radios.lua b/Moose Development/Moose/Navigation/Radios.lua index fb78e56f4..fa85d5fc3 100644 --- a/Moose Development/Moose/Navigation/Radios.lua +++ b/Moose Development/Moose/Navigation/Radios.lua @@ -249,7 +249,7 @@ end --- Find closest radios to a given coordinate. -- @param #RADIOS self -- @param Core.Point#COORDINATE Coordinate The reference coordinate. --- @param #number Nmax Max number of radios. Default 5. +-- @param #number Nmax (Optional) Max number of radios. Default 5. -- @param #number DistMax (Optional) Max search distance in meters. -- @return #table Table of #RADIOS.Radio closest radios. function RADIOS:GetClosestRadios(Coordinate, Nmax, DistMax) diff --git a/Moose Development/Moose/Navigation/Towns.lua b/Moose Development/Moose/Navigation/Towns.lua index 3825854f9..064f27846 100644 --- a/Moose Development/Moose/Navigation/Towns.lua +++ b/Moose Development/Moose/Navigation/Towns.lua @@ -240,7 +240,7 @@ end --- Find closest towns to a given coordinate. -- @param #TOWNS self -- @param Core.Point#COORDINATE Coordinate The reference coordinate. --- @param #number Nmax Max number of towns. Default 5. +-- @param #number Nmax (Optional) Max number of towns. Default 5. -- @param #number DistMax (Optional) Max search distance in meters. -- @return #table Table of #TOWNS.Town closest towns. function TOWNS:GetClosestTowns(Coordinate, Nmax, DistMax) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 107808898..b42699971 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -1003,8 +1003,8 @@ ATIS.version = "1.0.1" --- Create a new ATIS class object for a specific airbase. -- @param #ATIS self -- @param #string AirbaseName Name of the airbase. --- @param #number Frequency Radio frequency in MHz. Default 143.00 MHz. When using **SRS** this can be passed as a table of multiple frequencies. --- @param #number Modulation Radio modulation: 0=AM, 1=FM. Default 0=AM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. When using **SRS** this can be passed as a table of multiple modulations. +-- @param #number Frequency (Optional) Radio frequency in MHz. Default 143.00 MHz. When using **SRS** this can be passed as a table of multiple frequencies. +-- @param #number Modulation (Optional) Radio modulation: 0=AM, 1=FM. Default 0=AM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. When using **SRS** this can be passed as a table of multiple modulations. -- @return #ATIS self function ATIS:New(AirbaseName, Frequency, Modulation) @@ -1161,9 +1161,9 @@ end --- Set sound files folder within miz file (not your local hard drive!). -- @param #ATIS self --- @param #string pathMain Path to folder containing main sound files. Default "ATIS Soundfiles/". Mind the slash "/" at the end! --- @param #string pathAirports Path folder containing the airport names sound files. Default is `"ATIS Soundfiles/"`, *e.g.* `"ATIS Soundfiles/Caucasus/"`. --- @param #string pathNato Path folder containing the NATO alphabet sound files. Default is "ATIS Soundfiles/NATO Alphabet/". +-- @param #string pathMain (Optional) Path to folder containing main sound files. Default "ATIS Soundfiles/". Mind the slash "/" at the end! +-- @param #string pathAirports (Optional) Path folder containing the airport names sound files. Default is `"ATIS Soundfiles/"`, *e.g.* `"ATIS Soundfiles/Caucasus/"`. +-- @param #string pathNato (Optional) Path folder containing the NATO alphabet sound files. Default is "ATIS Soundfiles/NATO Alphabet/". -- @return #ATIS self function ATIS:SetSoundfilesPath( pathMain, pathAirports, pathNato ) self.soundpath = tostring( pathMain or "ATIS Soundfiles/" ) @@ -1283,8 +1283,8 @@ end --- Set the active runway for landing. -- @param #ATIS self --- @param #string runway : Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction. --- @param #boolean preferleft : If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right. +-- @param #string runway (Optional) Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction. +-- @param #boolean preferleft (Optional) If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right. -- @return #ATIS self function ATIS:SetActiveRunwayLanding(runway, preferleft) self.airbase:SetActiveRunwayLanding(runway,preferleft) @@ -1294,7 +1294,7 @@ end --- Set the active runway for take-off. -- @param #ATIS self -- @param #string runway : Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction. --- @param #boolean preferleft : If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right. +-- @param #boolean preferleft (Optional) If true, perfer the left runway. If false, prefer the right runway. If nil (default), do not care about left or right. -- @return #ATIS self function ATIS:SetActiveRunwayTakeoff(runway,preferleft) self.airbase:SetActiveRunwayTakeoff(runway,preferleft) @@ -1328,7 +1328,7 @@ end --- Set radio power. Note that this only applies if no relay unit is used. -- @param #ATIS self --- @param #number power Radio power in Watts. Default 100 W. +-- @param #number power (Optional) Radio power in Watts. Default 100 W. -- @return #ATIS self function ATIS:SetRadioPower( power ) self.power = power or 100 @@ -1337,7 +1337,7 @@ end --- Use F10 map mark points. -- @param #ATIS self --- @param #boolean switch If *true* or *nil*, marks are placed on F10 map. If *false* this feature is set to off (default). +-- @param #boolean switch (Optional) If *true* or *nil*, marks are placed on F10 map. If *false* this feature is set to off (default). -- @return #ATIS self function ATIS:SetMapMarks( switch ) if switch == nil or switch == true then @@ -1406,7 +1406,7 @@ end --- Set duration how long subtitles are displayed. -- @param #ATIS self --- @param #number duration Duration in seconds. Default 10 seconds. +-- @param #number duration (Optional) Duration in seconds. Default 10 seconds. -- @return #ATIS self function ATIS:SetSubtitleDuration( duration ) self.subduration = tonumber( duration or 10 ) @@ -1449,7 +1449,7 @@ end --- Set relative humidity. This is used to approximately calculate the dew point. -- Note that the dew point is only an artificial information as DCS does not have an atmospheric model that includes humidity (yet). -- @param #ATIS self --- @param #number Humidity Relative Humidity, i.e. a number between 0 and 100 %. Default is 50 %. +-- @param #number Humidity (Optional) Relative Humidity, i.e. a number between 0 and 100 %. Default is 50 %. -- @return #ATIS self function ATIS:SetRelativeHumidity( Humidity ) self.relHumidity = Humidity or 50 @@ -1524,7 +1524,7 @@ end -- Or you make your life simple and just include the sign so you don't have to bother about East/West. -- -- @param #ATIS self --- @param #number magvar Magnetic variation in degrees. Positive for easterly and negative for westerly variation. Default is magnatic declinaton of the used map, c.f. @{Utilities.Utils#UTILS.GetMagneticDeclination}. +-- @param #number magvar (Optional) Magnetic variation in degrees. Positive for easterly and negative for westerly variation. Default is magnatic declinaton of the used map, c.f. @{Utilities.Utils#UTILS.GetMagneticDeclination}. -- @return #ATIS self function ATIS:SetMagneticDeclination( magvar ) self.magvar = magvar or UTILS.GetMagneticDeclination() @@ -1654,7 +1654,7 @@ end --- Place marks with runway data on the F10 map. -- @param #ATIS self --- @param #boolean markall If true, mark all runways of the map. By default only the current ATIS runways are marked. +-- @param #boolean markall (Optional) If true, mark all runways of the map. By default only the current ATIS runways are marked. function ATIS:MarkRunways( markall ) local airbases = AIRBASE.GetAllAirbases() for _, _airbase in pairs( airbases ) do @@ -1667,11 +1667,11 @@ end --- Use SRS Simple-Text-To-Speech for transmissions. No sound files necessary.`SetSRS()` will try to use as many attributes configured with @{Sound.SRS#MSRS.LoadConfigFile}() as possible. -- @param #ATIS self --- @param #string PathToSRS Path to SRS directory (only necessary if SRS exe backend is used). --- @param #string Gender Gender: "male" or "female" (default). --- @param #string Culture Culture, e.g. "en-GB" (default). --- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. --- @param #number Port SRS port. Default 5002. +-- @param #string PathToSRS (Optional) Path to SRS directory (only necessary if SRS exe backend is used). +-- @param #string Gender (Optional) Gender: "male" or "female" (default). +-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default). +-- @param #string Voice (Optional) Specific voice. Overrides `Gender` and `Culture`. +-- @param #number Port (Optional) SRS port. Default 5002. -- @param #string GoogleKey Path to Google JSON-Key (SRS exe backend) or Google API key (DCS-gRPC backend). -- @return #ATIS self function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey) @@ -1727,7 +1727,7 @@ end --- Set the time interval between radio queue updates. -- @param #ATIS self --- @param #number TimeInterval Interval in seconds. Default 5 sec. +-- @param #number TimeInterval (Optional) Interval in seconds. Default 5 sec. -- @return #ATIS self function ATIS:SetQueueUpdateTime( TimeInterval ) self.dTQueueCheck = TimeInterval or 5 @@ -3195,7 +3195,7 @@ end --- Get active runway runway. -- @param #ATIS self --- @param #boolean Takeoff If `true`, get runway for takeoff. Default is for landing. +-- @param #boolean Takeoff (Optional) If `true`, get runway for takeoff. Default is for landing. -- @return #string Active runway, e.g. "31" for 310 deg. -- @return #boolean Use Left=true, Right=false, or nil. function ATIS:GetActiveRunway(Takeoff) @@ -3305,7 +3305,7 @@ end -- @param #ATIS.Soundfile sound ATIS sound object. -- @param #number interval Interval in seconds after the last transmission finished. -- @param #string subtitle Subtitle of the transmission. --- @param #string path Path to sound file. Default `self.soundpath`. +-- @param #string path (Optional) Path to sound file. Default `self.soundpath`. function ATIS:Transmission( sound, interval, subtitle, path ) self.radioqueue:NewTransmission( sound.filename, sound.duration, path or self.soundpath, nil, interval, subtitle, self.subduration ) end diff --git a/Moose Development/Moose/Ops/AirWing.lua b/Moose Development/Moose/Ops/AirWing.lua index b00f9957d..22efde9ff 100644 --- a/Moose Development/Moose/Ops/AirWing.lua +++ b/Moose Development/Moose/Ops/AirWing.lua @@ -369,9 +369,9 @@ end --- Add a **new** payload to the airwing resources. -- @param #AIRWING self -- @param Wrapper.Unit#UNIT Unit The unit, the payload is extracted from. Can also be given as *#string* name of the unit. --- @param #number Npayloads Number of payloads to add to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited. +-- @param #number Npayloads (Optional) Number of payloads to add to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited. -- @param #table MissionTypes Mission types this payload can be used for. --- @param #number Performance A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50. +-- @param #number Performance (Optional) A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50. -- @return #AIRWING.Payload The payload table or nil if the unit does not exist. function AIRWING:NewPayload(Unit, Npayloads, MissionTypes, Performance) @@ -454,7 +454,7 @@ end --- Set the number of payload available. -- @param #AIRWING self -- @param #AIRWING.Payload Payload The payload table created by the `:NewPayload` function. --- @param #number Navailable Number of payloads available to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited. +-- @param #number Navailable (Optional) Number of payloads available to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited. -- @return #AIRWING self function AIRWING:SetPayloadAmount(Payload, Navailable) @@ -477,7 +477,7 @@ end --- Increase or decrease the amount of available payloads. Unlimited playloads first need to be set to a limited number with the `SetPayloadAmount` function. -- @param #AIRWING self -- @param #AIRWING.Payload Payload The payload table created by the `:NewPayload` function. --- @param #number N Number of payloads to be added. Use negative number to decrease amount. Default 1. +-- @param #number N (Optional) Number of payloads to be added. Use negative number to decrease amount. Default 1. -- @return #AIRWING self function AIRWING:IncreasePayloadAmount(Payload, N) @@ -516,7 +516,7 @@ end -- @param #AIRWING self -- @param #AIRWING.Payload Payload The payload table to which the capability should be added. -- @param #table MissionTypes Mission types to be added. --- @param #number Performance A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50. +-- @param #number Performance (Optional) A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50. -- @return #AIRWING self function AIRWING:AddPayloadCapability(Payload, MissionTypes, Performance) @@ -739,7 +739,7 @@ end --- Set number of CAP flights constantly carried out. -- @param #AIRWING self --- @param #number n Number of flights. Default 1. +-- @param #number n (Optional) Number of flights. Default 1. -- @return #AIRWING self function AIRWING:SetNumberCAP(n) self.nflightsCAP=n or 1 @@ -757,7 +757,7 @@ end --- Set CAP close race track.We'll utilize the AUFTRAG PatrolRaceTrack instead of a standard race track orbit task. -- @param #AIRWING self --- @param #boolean OnOff If true, switch this on, else switch off. Off by default. +-- @param #boolean OnOff (Optional) If true, switch this on, else switch off. Off by default. -- @return #AIRWING self function AIRWING:SetCapCloseRaceTrack(OnOff) self.capOptionPatrolRaceTrack = OnOff @@ -777,7 +777,7 @@ end --- Set number of TANKER flights with Boom constantly in the air. -- @param #AIRWING self --- @param #number Nboom Number of flights. Default 1. +-- @param #number Nboom (Optional) Number of flights. Default 1. -- @return #AIRWING self function AIRWING:SetNumberTankerBoom(Nboom) self.nflightsTANKERboom=Nboom or 1 @@ -799,7 +799,7 @@ end --- Set number of TANKER flights with Probe constantly in the air. -- @param #AIRWING self --- @param #number Nprobe Number of flights. Default 1. +-- @param #number Nprobe (Optional) Number of flights. Default 1. -- @return #AIRWING self function AIRWING:SetNumberTankerProbe(Nprobe) self.nflightsTANKERprobe=Nprobe or 1 @@ -808,7 +808,7 @@ end --- Set number of AWACS flights constantly in the air. -- @param #AIRWING self --- @param #number n Number of flights. Default 1. +-- @param #number n (Optional) Number of flights. Default 1. -- @return #AIRWING self function AIRWING:SetNumberAWACS(n) self.nflightsAWACS=n or 1 @@ -817,7 +817,7 @@ end --- Set number of RECON flights constantly in the air. -- @param #AIRWING self --- @param #number n Number of flights. Default 1. +-- @param #number n (Optional) Number of flights. Default 1. -- @return #AIRWING self function AIRWING:SetNumberRecon(n) self.nflightsRecon=n or 1 @@ -826,7 +826,7 @@ end --- Set number of Rescue helo flights constantly in the air. -- @param #AIRWING self --- @param #number n Number of flights. Default 1. +-- @param #number n (Optional) Number of flights. Default 1. -- @return #AIRWING self function AIRWING:SetNumberRescuehelo(n) self.nflightsRescueHelo=n or 1 @@ -868,13 +868,13 @@ end --- Create a new generic patrol point. -- @param #AIRWING self --- @param #string Type Patrol point type, e.g. "CAP" or "AWACS". Default "Unknown". --- @param Core.Point#COORDINATE Coordinate Coordinate of the patrol point. Default 10-15 NM away from the location of the airwing. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone). --- @param #number Altitude Orbit altitude in feet. Default random between Angels 10 and 20. --- @param #number Heading Heading in degrees. Default random (0, 360] degrees. --- @param #number LegLength Length of race-track orbit in NM. Default 15 NM. --- @param #number Speed Orbit speed in knots. Default 350 knots. --- @param #number RefuelSystem Refueling system: 0=Boom, 1=Probe. Default nil=any. +-- @param #string Type (Optional) Patrol point type, e.g. "CAP" or "AWACS". Default "Unknown". +-- @param Core.Point#COORDINATE Coordinate (Optional) Coordinate of the patrol point. Default 10-15 NM away from the location of the airwing. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone). +-- @param #number Altitude (Optional) Orbit altitude in feet. Default random between Angels 10 and 20. +-- @param #number Heading (Optional) Heading in degrees. Default random (0, 360] degrees. +-- @param #number LegLength (Optional) Length of race-track orbit in NM. Default 15 NM. +-- @param #number Speed (Optional) Orbit speed in knots. Default 350 knots. +-- @param #number RefuelSystem (Optional) Refueling system: 0=Boom, 1=Probe. Default nil=any. -- @return #AIRWING.PatrolData Patrol point table. function AIRWING:NewPatrolPoint(Type, Coordinate, Altitude, Speed, Heading, LegLength, RefuelSystem) @@ -944,7 +944,7 @@ end -- @param #number Speed Orbit speed in knots. -- @param #number Heading Heading in degrees. -- @param #number LegLength Length of race-track orbit in NM. --- @param #number RefuelSystem Set refueling system of tanker: 0=boom, 1=probe. Default any (=nil). +-- @param #number RefuelSystem (Optional) Set refueling system of tanker: 0=boom, 1=probe. Default any (=nil). -- @return #AIRWING self function AIRWING:AddPatrolPointTANKER(Coordinate, Altitude, Speed, Heading, LegLength, RefuelSystem) @@ -984,7 +984,7 @@ end --- Set takeoff type. All assets of this airwing will be spawned with this takeoff type. -- Spawning on runways is not supported. -- @param #AIRWING self --- @param #string TakeoffType Take off type: "Cold" (default) or "Hot" with engines on or "Air" for spawning in air. +-- @param #string TakeoffType (Optional) Take off type: "Cold" (default) or "Hot" with engines on or "Air" for spawning in air. -- @return #AIRWING self function AIRWING:SetTakeoffType(TakeoffType) TakeoffType=TakeoffType or "Cold" @@ -1067,7 +1067,7 @@ end --- Set despawn after landing. Aircraft will be despawned after the landing event. -- Can help to avoid DCS AI taxiing issues. -- @param #AIRWING self --- @param #boolean Switch If `true` (default), activate despawn after landing. +-- @param #boolean Switch (Optional) If `true` (default), activate despawn after landing. -- @return #AIRWING self function AIRWING:SetDespawnAfterLanding(Switch) if Switch then @@ -1081,7 +1081,7 @@ end --- Set despawn after holding. Aircraft will be despawned when they arrive at their holding position at the airbase. -- Can help to avoid DCS AI taxiing issues. -- @param #AIRWING self --- @param #boolean Switch If `true` (default), activate despawn after landing. +-- @param #boolean Switch (Optional) If `true` (default), activate despawn after landing. -- @return #AIRWING self function AIRWING:SetDespawnAfterHolding(Switch) if Switch then @@ -1581,9 +1581,9 @@ end --- Count payloads in stock. -- @param #AIRWING self --- @param #table MissionTypes Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`. --- @param #table UnitTypes Types of units. --- @param #table Payloads Specific payloads to be counted only. +-- @param #table MissionTypes (Optional) Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`. +-- @param #table UnitTypes (Optional) Types of units. +-- @param #table Payloads (Optional) Specific payloads to be counted only. -- @return #number Count of available payloads in stock. function AIRWING:CountPayloadsInStock(MissionTypes, UnitTypes, Payloads) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index 8b9f3d985..5ef27940f 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -2456,7 +2456,7 @@ end --- Set carrier controlled area (CCA). -- This is a large zone around the carrier, which is constantly updated wrt the carrier position. -- @param #AIRBOSS self --- @param #number Radius Radius of zone in nautical miles (NM). Default 50 NM. +-- @param #number Radius (Optional) Radius of zone in nautical miles (NM). Default 50 NM. -- @return #AIRBOSS self function AIRBOSS:SetCarrierControlledArea( Radius ) @@ -2470,7 +2470,7 @@ end --- Set carrier controlled zone (CCZ). -- This is a small zone (usually 5 NM radius) around the carrier, which is constantly updated wrt the carrier position. -- @param #AIRBOSS self --- @param #number Radius Radius of zone in nautical miles (NM). Default 5 NM. +-- @param #number Radius (Optional) Radius of zone in nautical miles (NM). Default 5 NM. -- @return #AIRBOSS self function AIRBOSS:SetCarrierControlledZone( Radius ) @@ -2483,7 +2483,7 @@ end --- Set distance up to which water ahead is scanned for collisions. -- @param #AIRBOSS self --- @param #number Distance Distance in NM. Default 5 NM. +-- @param #number Distance (Optional) Distance in NM. Default 5 NM. -- @return #AIRBOSS self function AIRBOSS:SetCollisionDistance( Distance ) self.collisiondist = UTILS.NMToMeters( Distance or 5 ) @@ -2492,7 +2492,7 @@ end --- Set the default recovery case. -- @param #AIRBOSS self --- @param #number Case Case of recovery. Either 1, 2 or 3. Default 1. +-- @param #number Case (Optional) Case of recovery. Either 1, 2 or 3. Default 1. -- @return #AIRBOSS self function AIRBOSS:SetRecoveryCase( Case ) @@ -2509,7 +2509,7 @@ end -- Usually, this is +-15 or +-30 degrees. You should not use and offset angle >= 90 degrees, because this will cause a devision by zero in some of the equations used to calculate the approach corridor. -- So best stick to the defaults up to 30 degrees. -- @param #AIRBOSS self --- @param #number Offset Offset angle in degrees. Default 0. +-- @param #number Offset (Optional) Offset angle in degrees. Default 0. -- @return #AIRBOSS self function AIRBOSS:SetHoldingOffsetAngle( Offset ) @@ -2524,10 +2524,10 @@ end --- Enable F10 menu to manually start recoveries. -- @param #AIRBOSS self --- @param #number Duration Default duration of the recovery in minutes. Default 30 min. --- @param #number WindOnDeck Default wind on deck in knots. Default 25 knots. --- @param #boolean Uturn U-turn after recovery window closes on=true or off=false/nil. Default off. --- @param #number Offset Relative Marshal radial in degrees for Case II/III recoveries. Default 30°. +-- @param #number Duration (Optional) Default duration of the recovery in minutes. Default 30 min. +-- @param #number WindOnDeck(Optional) Default wind on deck in knots. Default 25 knots. +-- @param #boolean Uturn (Optional) U-turn after recovery window closes on=true or off=false/nil. Default off. +-- @param #number Offset (Optional) Relative Marshal radial in degrees for Case II/III recoveries. Default 30°. -- @return #AIRBOSS self function AIRBOSS:SetMenuRecovery( Duration, WindOnDeck, Uturn, Offset ) @@ -2547,13 +2547,13 @@ end --- Add aircraft recovery time window and recovery case. -- @param #AIRBOSS self --- @param #string starttime Start time, e.g. "8:00" for eight o'clock. Default now. --- @param #string stoptime Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time. --- @param #number case Recovery case for that time slot. Number between one and three. --- @param #number holdingoffset Only for CASE II/III: Angle in degrees the holding pattern is offset. +-- @param #string starttime (Optional) Start time, e.g. "8:00" for eight o'clock. Default now. +-- @param #string stoptime (Optional) Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time. +-- @param #number case (Optional) Recovery case for that time slot. Number between one and three. Defaults to 1. +-- @param #number holdingoffset (Optional) Only for CASE II/III: Angle in degrees the holding pattern is offset. Defaults to 0. -- @param #boolean turnintowind If true, carrier will turn into the wind 5 minutes before the recovery window opens. --- @param #number speed Speed in knots during turn into wind leg. --- @param #boolean uturn If true (or nil), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint. +-- @param #number speed (Optional) Speed in knots during turn into wind leg. Default is 20. +-- @param #boolean uturn (Optional) If true (or nil), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint. -- @return #AIRBOSS.Recovery Recovery window. function AIRBOSS:AddRecoveryWindow( starttime, stoptime, case, holdingoffset, turnintowind, speed, uturn ) @@ -2735,7 +2735,7 @@ end --- Set time before carrier turns and recovery window opens. -- @param #AIRBOSS self --- @param #number Interval Time interval in seconds. Default 300 sec. +-- @param #number Interval (Optional) Time interval in seconds. Default 300 sec. -- @return #AIRBOSS self function AIRBOSS:SetRecoveryTurnTime( Interval ) self.dTturn = Interval or 300 @@ -2744,7 +2744,7 @@ end --- Set multiplayer environment wire correction. -- @param #AIRBOSS self --- @param #number Dcorr Correction distance in meters. Default 12 m. +-- @param #number Dcorr (Optional) Correction distance in meters. Default 12 m. -- @return #AIRBOSS self function AIRBOSS:SetMPWireCorrection( Dcorr ) self.mpWireCorrection = Dcorr or 12 @@ -2753,7 +2753,7 @@ end --- Set time interval for updating queues and other stuff. -- @param #AIRBOSS self --- @param #number TimeInterval Time interval in seconds. Default 30 sec. +-- @param #number TimeInterval (Optional) Time interval in seconds. Default 30 sec. -- @return #AIRBOSS self function AIRBOSS:SetQueueUpdateTime( TimeInterval ) self.dTqueue = TimeInterval or 30 @@ -2762,7 +2762,7 @@ end --- Set time interval between LSO calls. Optimal time in the groove is ~16 seconds. So the default of 4 seconds gives around 3-4 correction calls in the groove. -- @param #AIRBOSS self --- @param #number TimeInterval Time interval in seconds between LSO calls. Default 4 sec. +-- @param #number TimeInterval (Optional) Time interval in seconds between LSO calls. Default 4 sec. -- @return #AIRBOSS self function AIRBOSS:SetLSOCallInterval( TimeInterval ) self.LSOdT = TimeInterval or 4 @@ -2835,7 +2835,7 @@ end --- Give AI aircraft the refueling task if a recovery tanker is present or send them to the nearest divert airfield. -- @param #AIRBOSS self --- @param #number LowFuelThreshold Low fuel threshold in percent. AI will go refueling if their fuel level drops below this value. Default 10 %. +-- @param #number LowFuelThreshold (Optional) Low fuel threshold in percent. AI will go refueling if their fuel level drops below this value. Default 10 %. -- @return #AIRBOSS self function AIRBOSS:SetRefuelAI( LowFuelThreshold ) self.lowfuelAI = LowFuelThreshold or 10 @@ -2844,7 +2844,7 @@ end --- Set max altitude to register flights in the initial zone. Aircraft above this altitude will not be registerered. -- @param #AIRBOSS self --- @param #number MaxAltitude Max altitude in feet. Default 1300 ft. +-- @param #number MaxAltitude (Optional) Max altitude in feet. Default 1300 ft. -- @return #AIRBOSS self function AIRBOSS:SetInitialMaxAlt( MaxAltitude ) self.initialmaxalt = UTILS.FeetToMeters( MaxAltitude or 1300 ) @@ -2878,7 +2878,7 @@ end --- Set time interval for updating player status and other things. -- @param #AIRBOSS self --- @param #number TimeInterval Time interval in seconds. Default 0.5 sec. +-- @param #number TimeInterval (Optional) Time interval in seconds. Default 0.5 sec. -- @return #AIRBOSS self function AIRBOSS:SetStatusUpdateTime( TimeInterval ) self.dTstatus = TimeInterval or 0.5 @@ -2887,7 +2887,7 @@ end --- Set duration how long messages are displayed to players. -- @param #AIRBOSS self --- @param #number Duration Duration in seconds. Default 10 sec. +-- @param #number Duration (Optional) Duration in seconds. Default 10 sec. -- @return #AIRBOSS self function AIRBOSS:SetDefaultMessageDuration( Duration ) self.Tmessage = Duration or 10 @@ -2978,7 +2978,7 @@ end --- Set Case I Marshal radius. This is the radius of the valid zone around "the post" aircraft are supposed to be holding in the Case I Marshal stack. -- The post is 2.5 NM port of the carrier. -- @param #AIRBOSS self --- @param #number Radius Radius in NM. Default 2.8 NM, which gives a diameter of 5.6 NM. +-- @param #number Radius (Optional) Radius in NM. Default 2.8 NM, which gives a diameter of 5.6 NM. -- @return #AIRBOSS self function AIRBOSS:SetMarshalRadius( Radius ) self.marshalradius = UTILS.NMToMeters( Radius or 2.8 ) @@ -3112,9 +3112,9 @@ end --- Set up SRS for usage without sound files -- @param #AIRBOSS self -- @param #string PathToSRS Path to SRS folder, e.g. "C:\\Program Files\\DCS-SimpleRadio\\ExternalAudio". --- @param #number Port Port of the SRS server, defaults to 5002. --- @param #string Culture (Optional, Airboss Culture) Culture, defaults to "en-US". --- @param #string Gender (Optional, Airboss Gender) Gender, e.g. "male" or "female". Defaults to "male". +-- @param #number Port (Optional) Port of the SRS server, defaults to 5002. +-- @param #string Culture (Optional) (Optional, Airboss Culture) Culture, defaults to "en-US". +-- @param #string Gender (Optional) (Optional, Airboss Gender) Gender, e.g. "male" or "female". Defaults to "male". -- @param #string Voice (Optional, Airboss Voice) Set to use a specific voice. Will **override gender and culture** settings. -- @param #string GoogleCreds (Optional) Path to Google credentials, e.g. "C:\\Program Files\\DCS-SimpleRadio-Standalone\\yourgooglekey.json". -- @param #number Volume (Optional) E.g. 0.75. Defaults to 1.0 (loudest). @@ -3365,7 +3365,7 @@ end --- Set number of aircraft units, which can be in the landing pattern before the pattern is full. -- @param #AIRBOSS self --- @param #number nmax Max number. Default 4. Minimum is 1, maximum is 6. +-- @param #number nmax (Optional) Max number. Default 4. Minimum is 1, maximum is 6. -- @return #AIRBOSS self function AIRBOSS:SetMaxLandingPattern( nmax ) nmax = nmax or 4 @@ -3378,7 +3378,7 @@ end --- Set number available Case I Marshal stacks. If Marshal stacks are full, flights requesting Marshal will be told to hold outside 10 NM zone until a stack becomes available again. -- Marshal stacks for Case II/III are unlimited. -- @param #AIRBOSS self --- @param #number nmax Max number of stacks available to players and AI flights. Default 3, i.e. angels 2, 3, 4. Minimum is 1. +-- @param #number nmax (Optional) Max number of stacks available to players and AI flights. Default 3, i.e. angels 2, 3, 4. Minimum is 1. -- @return #AIRBOSS self function AIRBOSS:SetMaxMarshalStacks( nmax ) self.Nmaxmarshal = nmax or 3 @@ -3400,7 +3400,7 @@ end --- Set maximum distance up to which section members are allowed (default: 100 meters). -- @param #AIRBOSS self --- @param #number dmax Max distance in meters (default 100 m). Minimum is 10 m, maximum is 5000 m. +-- @param #number dmax (Optional) Max distance in meters (default 100 m). Minimum is 10 m, maximum is 5000 m. -- @return #AIRBOSS self function AIRBOSS:SetMaxSectionDistance( dmax ) if dmax then @@ -3416,7 +3416,7 @@ end --- Set max number of flights per stack. All members of a section count as one "flight". -- @param #AIRBOSS self --- @param #number nmax Number of max allowed flights per stack. Default is two. Minimum is one, maximum is 4. +-- @param #number nmax (Optional) Number of max allowed flights per stack. Default is two. Minimum is one, maximum is 4. -- @return #AIRBOSS self function AIRBOSS:SetMaxFlightsPerStack( nmax ) nmax = nmax or 2 @@ -3436,7 +3436,7 @@ end --- Will play the inbound calls, commencing, initial, etc. from the player when requesteing marshal -- @param #AIRBOSS self --- @param #AIRBOSS status Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON) +-- @param #AIRBOSS status (Optional) Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON) -- @return #AIRBOSS self function AIRBOSS:SetExtraVoiceOvers(status) self.xtVoiceOvers=status @@ -3445,7 +3445,7 @@ end --- Will simulate the inbound call, commencing, initial, etc from the AI when requested by Airboss -- @param #AIRBOSS self --- @param #AIRBOSS status Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON) +-- @param #AIRBOSS status (Optional) Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON) -- @return #AIRBOSS self function AIRBOSS:SetExtraVoiceOversAI(status) self.xtVoiceOversAI=status @@ -3484,7 +3484,7 @@ end -- * "Naval Aviator" = @{#AIRBOSS.Difficulty.Normal} -- * "TOPGUN Graduate" = @{#AIRBOSS.Difficulty.Hard} -- @param #AIRBOSS self --- @param #string skill Player skill. Default "Naval Aviator". +-- @param #string skill (Optional) Player skill. Default "Naval Aviator". -- @return #AIRBOSS self function AIRBOSS:SetDefaultPlayerSkill( skill ) @@ -3510,8 +3510,8 @@ end --- Enable auto save of player results each time a player is *finally* graded. *Finally* means after the player landed on the carrier! After intermediate passes (bolter or waveoff) the stats are *not* saved. -- @param #AIRBOSS self --- @param #string path Path where to save the asset data file. Default is the DCS root installation directory or your "Saved Games\\DCS" folder if lfs was desanitized. --- @param #string filename File name. Default is generated automatically from airboss carrier name/alias. +-- @param #string path (Optional) Path where to save the asset data file. Default is the DCS root installation directory or your "Saved Games\\DCS" folder if lfs was desanitized. +-- @param #string filename (Optional) File name. Default is generated automatically from airboss carrier name/alias. -- @return #AIRBOSS self function AIRBOSS:SetAutoSave( path, filename ) self.autosave = true @@ -3543,7 +3543,7 @@ end --- Set the magnetic declination (or variation). By default this is set to the standard declination of the map. -- @param #AIRBOSS self --- @param #number declination Declination in degrees or nil for default declination of the map. +-- @param #number declination (Optional) Declination in degrees or nil for default declination of the map. -- @return #AIRBOSS self function AIRBOSS:SetMagneticDeclination( declination ) self.magvar = declination or UTILS.GetMagneticDeclination() @@ -3562,8 +3562,8 @@ end --- Set FunkMan socket. LSO grades and trap sheets will be send to your Discord bot. -- **Requires running FunkMan program**. -- @param #AIRBOSS self --- @param #number Port Port. Default `10042`. --- @param #string Host Host. Default `"127.0.0.1"`. +-- @param #number Port (Optional) Port. Default `10042`. +-- @param #string Host (Optional) Host. Default `"127.0.0.1"`. -- @return #AIRBOSS self function AIRBOSS:SetFunkManOn(Port, Host) @@ -3574,7 +3574,7 @@ end --- Get next time the carrier will start recovering aircraft. -- @param #AIRBOSS self --- @param #boolean InSeconds If true, abs. mission time seconds is returned. Default is a clock #string. +-- @param #boolean InSeconds (Optional) If true, abs. mission time seconds is returned. Default is a clock #string. -- @return #string Clock start (or start time in abs. seconds). -- @return #string Clock stop (or stop time in abs. seconds). function AIRBOSS:GetNextRecoveryTime( InSeconds ) @@ -6737,7 +6737,7 @@ end --- Get marshal altitude and two positions of a counter-clockwise race track pattern. -- @param #AIRBOSS self -- @param #number stack Assigned stack number. Counting starts at one, i.e. stack=1 is the first stack. --- @param #number case Recovery case. Default is self.case. +-- @param #number case (Optional) Recovery case. Default is self.case. -- @return #number Holding altitude in meters. -- @return Core.Point#COORDINATE First race track coordinate. -- @return Core.Point#COORDINATE Second race track coordinate. @@ -7098,8 +7098,8 @@ end --- Get next free Marshal stack. Depending on AI/human and recovery case. -- @param #AIRBOSS self -- @param #boolean ai If true, get a free stack for an AI flight group. --- @param #number case Recovery case. Default current (self) case in progress. --- @param #boolean empty Return lowest stack that is completely empty. +-- @param #number case (Optional) Recovery case. Default current (self) case in progress. +-- @param #boolean empty (Optional) Return lowest stack that is completely empty. -- @return #number Lowest free stack available for the given case or nil if all Case I stacks are taken. function AIRBOSS:_GetFreeStack( ai, case, empty ) @@ -7188,7 +7188,7 @@ end --- Get next free Marshal stack. Depending on AI/human and recovery case. -- @param #AIRBOSS self -- @param #boolean ai If true, get a free stack for an AI flight group. --- @param #number case Recovery case. Default current (self) case in progress. +-- @param #number case (Optional) Recovery case. Default current (self) case in progress. -- @param #boolean empty Return lowest stack that is completely empty. -- @return #number Lowest free stack available for the given case or nil if all Case I stacks are taken. function AIRBOSS:_GetFreeStack_Old( ai, case, empty ) @@ -7256,7 +7256,7 @@ end --- Get number of (airborne) units in a flight. -- @param #AIRBOSS self -- @param #AIRBOSS.FlightGroup flight The flight group. --- @param #boolean onground If true, include units on the ground. By default only airborne units are counted. +-- @param #boolean onground (Optional) If true, include units on the ground. By default only airborne units are counted. -- @return #number Number of units in flight including section members. -- @return #number Number of units in flight excluding section members. -- @return #number Number of section members. @@ -10961,9 +10961,9 @@ end --- Get groove zone. -- @param #AIRBOSS self --- @param #number l Length of the groove in NM. Default 1.5 NM. --- @param #number w Width of the groove in NM. Default 0.25 NM. --- @param #number b Width of the beginning in NM. Default 0.10 NM. +-- @param #number l (Optional) Length of the groove in NM. Default 1.5 NM. +-- @param #number w (Optional) Width of the groove in NM. Default 0.25 NM. +-- @param #number b (Optional) Width of the beginning in NM. Default 0.10 NM. -- @return Core.Zone#ZONE_POLYGON_BASE Groove zone. function AIRBOSS:_GetZoneGroove( l, w, b ) @@ -11134,7 +11134,7 @@ end --- Get approach corridor zone. Shape depends on recovery case. -- @param #AIRBOSS self -- @param #number case Recovery case. --- @param #number l Length of the zone in NM. Default 31 (=21+10) NM. +-- @param #number l (Optional) Length of the zone in NM. Default 31 (=21+10) NM. -- @return Core.Zone#ZONE_POLYGON_BASE Box zone. function AIRBOSS:_GetZoneCorridor( case, l ) @@ -11980,7 +11980,7 @@ end --- Get true (or magnetic) heading of carrier. -- @param #AIRBOSS self --- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned. +-- @param #boolean magnetic (Optional) If true, calculate magnetic heading. By default true heading is returned. -- @return #number Carrier heading in degrees. function AIRBOSS:GetHeading( magnetic ) self:F3( { magnetic = magnetic } ) @@ -12013,8 +12013,8 @@ end --- Get wind direction and speed at carrier position. -- @param #AIRBOSS self --- @param #number alt Altitude ASL in meters. Default 18 m. --- @param #boolean magnetic Direction including magnetic declination. +-- @param #number alt (Optional) Altitude ASL in meters. Default 18 m. +-- @param #boolean magnetic (Optional) Direction including magnetic declination. -- @param Core.Point#COORDINATE coord (Optional) Coordinate at which to get the wind. Default is current carrier position. -- @return #number Direction the wind is blowing **from** in degrees. -- @return #number Wind speed in m/s. @@ -12040,7 +12040,7 @@ end --- Get wind speed on carrier deck parallel and perpendicular to runway. -- @param #AIRBOSS self --- @param #number alt Altitude in meters. Default 18 m. +-- @param #number alt (Optional) Altitude in meters. Default 18 m. -- @return #number Wind component parallel to runway im m/s. -- @return #number Wind component perpendicular to runway in m/s. -- @return #number Total wind strength in m/s. @@ -12086,7 +12086,7 @@ end --- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway. -- @param #AIRBOSS self -- @param #number vdeck Desired wind velocity over deck in knots. --- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned. +-- @param #boolean magnetic (Optional) If true, calculate magnetic heading. By default true heading is returned. -- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position. -- @return #number Carrier heading in degrees. -- @return #number Carrier speed in knots to reach desired wind speed on deck. @@ -12106,7 +12106,7 @@ end --- Get true (or magnetic) heading of carrier into the wind. This accounts for the angled runway. -- @param #AIRBOSS self -- @param #number vdeck Desired wind velocity over deck in knots. --- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned. +-- @param #boolean magnetic (Optional) If true, calculate magnetic heading. By default true heading is returned. -- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position. -- @return #number Carrier heading in degrees. function AIRBOSS:GetHeadingIntoWind_old( vdeck, magnetic, coord ) @@ -12179,7 +12179,7 @@ end -- Implementation based on [Mags & Bambi](https://magwo.github.io/carrier-cruise/). -- @param #AIRBOSS self -- @param #number vdeck Desired wind velocity over deck in knots. --- @param #boolean magnetic If true, calculate magnetic heading. By default true heading is returned. +-- @param #boolean magnetic (Optional) If true, calculate magnetic heading. By default true heading is returned. -- @param Core.Point#COORDINATE coord (Optional) Coordinate from which heading is calculated. Default is current carrier position. -- @return #number Carrier heading in degrees. -- @return #number Carrier speed in knots to reach desired wind speed on deck. @@ -12310,9 +12310,9 @@ end -- -- @param #AIRBOSS self -- @param #number case Recovery case. --- @param #boolean magnetic If true, magnetic radial is returned. Default is true radial. --- @param #boolean offset If true, inlcude holding offset. --- @param #boolean inverse Return inverse, i.e. radial-180 degrees. +-- @param #boolean magnetic (Optional) If true, magnetic radial is returned. Default is true radial. +-- @param #boolean offset (Optional) If true, inlcude holding offset. +-- @param #boolean inverse (Optional) Return inverse, i.e. radial-180 degrees. -- @return #number Radial in degrees. function AIRBOSS:GetRadial( case, magnetic, offset, inverse ) @@ -13258,7 +13258,7 @@ end --- Get short name of the grove step. -- @param #AIRBOSS self -- @param #string step Player step. --- @param #number n Use -1 for previous or +1 for next. Default 0. +-- @param #number n (Optional) Use -1 for previous or +1 for next. Default 0. -- @return #string Shortcut name "X", "RB", "IM", "AR", "IW". function AIRBOSS:_GS( step, n ) local gp @@ -13457,7 +13457,7 @@ end --- Display hint to player. -- @param #AIRBOSS self -- @param #AIRBOSS.PlayerData playerData Player data table. --- @param #number delay Delay before playing sound messages. Default 0 sec. +-- @param #number delay (Optional) Delay before playing sound messages. Default 0 sec. -- @param #boolean soundoff If true, don't play and sound hint. function AIRBOSS:_PlayerHint( playerData, delay, soundoff ) @@ -14279,7 +14279,7 @@ end --- Check Collision. -- @param #AIRBOSS self --- @param Core.Point#COORDINATE fromcoord Coordinate from which the path to the next WP is calculated. Default current carrier position. +-- @param Core.Point#COORDINATE fromcoord (Optional) Coordinate from which the path to the next WP is calculated. Default current carrier position. -- @return #boolean If true, surface type ahead is not deep water. function AIRBOSS:_CheckFreePathToNextWP( fromcoord ) @@ -14357,9 +14357,9 @@ end --- Let the carrier make a detour to a given point. When it reaches the point, it will resume its normal route. -- @param #AIRBOSS self -- @param Core.Point#COORDINATE coord Coordinate of the detour. --- @param #number speed Speed in knots. Default is current carrier velocity. +-- @param #number speed (Optional) Speed in knots. Default is current carrier velocity. -- @param #boolean uturn (Optional) If true, carrier will go back to where it came from before it resumes its route to the next waypoint. --- @param #number uspeed Speed in knots after U-turn. Default is same as before. +-- @param #number uspeed (Optional) Speed in knots after U-turn. Default is same as before. -- @param Core.Point#COORDINATE tcoord Additional coordinate to make turn smoother. -- @return #AIRBOSS self function AIRBOSS:CarrierDetour( coord, speed, uturn, uspeed, tcoord ) @@ -16093,11 +16093,11 @@ end -- @param #AIRBOSS self -- @param #AIRBOSS.PlayerData playerData Player data. -- @param #string message The message to send. --- @param #string sender The person who sends the message or nil. --- @param #string receiver The person who receives the message. Default player's onboard number. Set to "" for no receiver. --- @param #number duration Display message duration. Default 10 seconds. --- @param #boolean clear If true, clear screen from previous messages. --- @param #number delay Delay in seconds, before the message is displayed. +-- @param #string sender (Optional) The person who sends the message or nil. Defaults to nil. +-- @param #string receiver (Optional) The person who receives the message. Default player's onboard number. Set to "" for no receiver. +-- @param #number duration (Optional) Display message duration. Default 10 seconds. +-- @param #boolean clear I(Optional) f true, clear screen from previous messages. Defaults to false. +-- @param #number delay (Optional) Delay in seconds, before the message is displayed. function AIRBOSS:MessageToPlayer( playerData, message, sender, receiver, duration, clear, delay ) self:T({sender,receiver,message}) if playerData and message and message ~= "" then @@ -16221,11 +16221,11 @@ end -- Message format will be "SENDER: RECCEIVER, MESSAGE". -- @param #AIRBOSS self -- @param #string message The message to send. --- @param #string sender The person who sends the message or nil. --- @param #string receiver The person who receives the message. Default player's onboard number. Set to "" for no receiver. --- @param #number duration Display message duration. Default 10 seconds. --- @param #boolean clear If true, clear screen from previous messages. --- @param #number delay Delay in seconds, before the message is displayed. +-- @param #string sender (Optional) The person who sends the message or nil. Defaults to "LSO". +-- @param #string receiver (Optional) The person who receives the message. Default player's onboard number. Set to "" for no receiver. +-- @param #number duration (Optional) Display message duration. Default 10 seconds. +-- @param #boolean clear (Optional) If true, clear screen from previous messages. +-- @param #number delay (Optional) Delay in seconds, before the message is displayed. function AIRBOSS:MessageToPattern( message, sender, receiver, duration, clear, delay ) -- Create new (fake) radio call to show the subtitile. @@ -16240,11 +16240,11 @@ end -- Message format will be "SENDER: RECCEIVER, MESSAGE". -- @param #AIRBOSS self -- @param #string message The message to send. --- @param #string sender The person who sends the message or nil. --- @param #string receiver The person who receives the message. Default player's onboard number. Set to "" for no receiver. --- @param #number duration Display message duration. Default 10 seconds. --- @param #boolean clear If true, clear screen from previous messages. --- @param #number delay Delay in seconds, before the message is displayed. +-- @param #string sender (Optional) The person who sends the message or nil. Defaults to "Marshal". +-- @param #string receiver (Optional) The person who receives the message. Default player's onboard number. Set to "" for no receiver. +-- @param #number duration (Optional) Display message duration. Default 10 seconds. +-- @param #boolean clear (Optional) If true, clear screen from previous messages. +-- @param #number delay (Optional) Delay in seconds, before the message is displayed. function AIRBOSS:MessageToMarshal( message, sender, receiver, duration, clear, delay ) -- Create new (fake) radio call to show the subtitile. @@ -16258,11 +16258,11 @@ end --- Generate a new radio call (deepcopy) from an existing default call. -- @param #AIRBOSS self -- @param #AIRBOSS.RadioCall call Radio call to be enhanced. --- @param #string sender Sender of the message. Default is the radio alias. --- @param #string subtitle Subtitle of the message. Default from original radio call. Use "" for no subtitle. --- @param #number subduration Time in seconds the subtitle is displayed. Default 10 seconds. --- @param #string modexreceiver Onboard number of the receiver or nil. --- @param #string modexsender Onboard number of the sender or nil. +-- @param #string sender (Optional) Sender of the message. Default is the radio alias. +-- @param #string subtitle (Optional) Subtitle of the message. Default from original radio call. Use "" for no subtitle. +-- @param #number subduration (Optional) Time in seconds the subtitle is displayed. Default 10 seconds. +-- @param #string modexreceiver (Optional) Onboard number of the receiver or nil. +-- @param #string modexsender (Optional) Onboard number of the sender or nil. function AIRBOSS:_NewRadioCall( call, sender, subtitle, subduration, modexreceiver, modexsender ) -- Create a new call @@ -19204,7 +19204,7 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param #string path Path where the file is loaded from. Default is the DCS root installation folder or your "Saved Games\\DCS" folder if lfs was desanizied. +-- @param #string path (Optional) Path where the file is loaded from. Default is the DCS root installation folder or your "Saved Games\\DCS" folder if lfs was desanizied. -- @param #string filename (Optional) File name for saving the player grades. Default is "AIRBOSS-_LSOgrades.csv". function AIRBOSS:onafterLoad( From, Event, To, path, filename ) diff --git a/Moose Development/Moose/Ops/ArmyGroup.lua b/Moose Development/Moose/Ops/ArmyGroup.lua index 375cbe145..7efd439fe 100644 --- a/Moose Development/Moose/Ops/ArmyGroup.lua +++ b/Moose Development/Moose/Ops/ArmyGroup.lua @@ -463,10 +463,10 @@ end -- @param #ARMYGROUP self -- @param Core.Point#COORDINATE Coordinate Coordinate of the target. -- @param #string Clock Time when to start the attack. --- @param #number Radius Radius in meters. Default 100 m. --- @param #number Nshots Number of shots to fire. Default 3. --- @param #number WeaponType Type of weapon. Default auto. --- @param #number Prio Priority of the task. +-- @param #number Radius (Optional) Radius in meters. Default 100 m. +-- @param #number Nshots (Optional) Number of shots to fire. Default 3. +-- @param #number WeaponType (Optional) Type of weapon. Default auto. +-- @param #number Prio (Optional) Priority of the task. Defaults to 50. -- @return Ops.OpsGroup#OPSGROUP.Task The task table. function ARMYGROUP:AddTaskFireAtPoint(Coordinate, Clock, Radius, Nshots, WeaponType, Prio) @@ -485,10 +485,10 @@ end -- @param #number Heading Heading min in Degrees. -- @param #number Alpha Shooting angle in Degrees. -- @param #number Altitude Altitude in meters. --- @param #number Radius Radius in meters. Default 100 m. --- @param #number Nshots Number of shots to fire. Default nil. --- @param #number WeaponType Type of weapon. Default auto. --- @param #number Prio Priority of the task. +-- @param #number Radius (Optional) Radius in meters. Default 100 m. +-- @param #number Nshots (Optional) Number of shots to fire. Default nil. +-- @param #number WeaponType (Optional) Type of weapon. Default auto. +-- @param #number Prio (Optional) Priority of the task. Defaults to 50. -- @return Ops.OpsGroup#OPSGROUP.Task The task table. function ARMYGROUP:AddTaskBarrage(Clock, Heading, Alpha, Altitude, Radius, Nshots, WeaponType, Prio) @@ -516,11 +516,11 @@ end --- Add a *waypoint* task to fire at a given coordinate. -- @param #ARMYGROUP self -- @param Core.Point#COORDINATE Coordinate Coordinate of the target. --- @param Ops.OpsGroup#OPSGROUP.Waypoint Waypoint Where the task is executed. Default is next waypoint. --- @param #number Radius Radius in meters. Default 100 m. --- @param #number Nshots Number of shots to fire. Default 3. --- @param #number WeaponType Type of weapon. Default auto. --- @param #number Prio Priority of the task. +-- @param Ops.OpsGroup#OPSGROUP.Waypoint Waypoint (Optional) Where the task is executed. Default is next waypoint. +-- @param #number Radius (Optional) Radius in meters. Default 100 m. +-- @param #number Nshots (Optional) Number of shots to fire. Default 3. +-- @param #number WeaponType (Optional) Type of weapon. Default auto. +-- @param #number Prio (Optional) Priority of the task. Defaults to 50. -- @return Ops.OpsGroup#OPSGROUP.Task The task table. function ARMYGROUP:AddTaskWaypointFireAtPoint(Coordinate, Waypoint, Radius, Nshots, WeaponType, Prio) @@ -538,10 +538,10 @@ end --- Add a *scheduled* task. -- @param #ARMYGROUP self -- @param Wrapper.Group#GROUP TargetGroup Target group. --- @param #number WeaponExpend How much weapons does are used. --- @param #number WeaponType Type of weapon. Default auto. --- @param #string Clock Time when to start the attack. --- @param #number Prio Priority of the task. +-- @param #number WeaponExpend (Optional) How much weapons does are used. Defaults to "Auto". +-- @param #number WeaponType (Optional) Type of weapon. Default auto. +-- @param #string Clock (Optional) Time when to start the attack. Defaults to 5. +-- @param #number Prio (Optional) Priority of the task. Defaults to 50. -- @return Ops.OpsGroup#OPSGROUP.Task The task table. function ARMYGROUP:AddTaskAttackGroup(TargetGroup, WeaponExpend, WeaponType, Clock, Prio) @@ -574,7 +574,7 @@ end --- Define a set of possible retreat zones. -- @param #ARMYGROUP self --- @param Core.Set#SET_ZONE RetreatZoneSet The retreat zone set. Default is an empty set. +-- @param Core.Set#SET_ZONE RetreatZoneSet (Optional) The retreat zone set. Default is an empty set. -- @return #ARMYGROUP self function ARMYGROUP:SetRetreatZones(RetreatZoneSet) self.retreatZones=RetreatZoneSet or SET_ZONE:New() @@ -592,7 +592,7 @@ end --- Set suppression on. average, minimum and maximum time a unit is suppressed each time it gets hit. -- @param #ARMYGROUP self --- @param #number Tave Average time [seconds] a group will be suppressed. Default is 15 seconds. +-- @param #number Tave (Optional) Average time [seconds] a group will be suppressed. Default is 15 seconds. -- @param #number Tmin (Optional) Minimum time [seconds] a group will be suppressed. Default is 5 seconds. -- @param #number Tmax (Optional) Maximum time a group will be suppressed. Default is 25 seconds. -- @return #ARMYGROUP self @@ -995,10 +995,10 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last. --- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint. --- @param #number Speed Speed in knots. Default cruise speed. --- @param #number Formation Formation of the group. +-- @param #number n (Optional) Next waypoint index. Default is the one coming after that one that has been passed last. +-- @param #number N (Optional) Waypoint Max waypoint index to be included in the route. Default is the final waypoint. +-- @param #number Speed (Optional) Speed in knots. Default cruise speed. +-- @param #number Formation (Optional) Formation of the group. function ARMYGROUP:onbeforeUpdateRoute(From, Event, To, n, N, Speed, Formation) -- Is transition allowed? We assume yes until proven otherwise. @@ -1082,10 +1082,10 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last. --- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint. --- @param #number Speed Speed in knots. Default cruise speed. --- @param #number Formation Formation of the group. +-- @param #number n (Optional) Next waypoint index. Default is the one coming after that one that has been passed last. +-- @param #number N (Optional) Waypoint Max waypoint index to be included in the route. Default is the final waypoint. +-- @param #number Speed (Optional) Speed in knots. Default cruise speed. +-- @param #number Formation (Optional) Formation of the group. function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, N, Speed, Formation) -- Update route from this waypoint number onwards. @@ -1358,7 +1358,7 @@ end -- @param #string Event Event. -- @param #string To To state. -- @param Core.Point#COORDINATE Coordinate Coordinate where to go. --- @param #number Speed Speed in knots. Default cruise speed. +-- @param #number Speed (Optional) Speed in knots. Default cruise speed. -- @param #number Formation Formation of the group. -- @param #number ResumeRoute If true, resume route after detour point was reached. If false, the group will stop at the detour point and wait for futher commands. function ARMYGROUP:onafterDetour(From, Event, To, Coordinate, Speed, Formation, ResumeRoute) @@ -1738,7 +1738,7 @@ end -- @param #string To To state. -- @param Wrapper.Group#GROUP Group the group to be engaged. -- @param #number Speed Speed in knots. --- @param #string Formation Formation used in the engagement. Default `ENUMS.Formation.Vehicle.Vee`. +-- @param #string Formation (Optional) Formation used in the engagement. Default `ENUMS.Formation.Vehicle.Vee`. function ARMYGROUP:onbeforeEngageTarget(From, Event, To, Target, Speed, Formation) local dt=nil @@ -1779,7 +1779,7 @@ end -- @param #string To To state. -- @param Ops.Target#TARGET Target The target to be engaged. Can also be a group or unit. -- @param #number Speed Attack speed in knots. --- @param #string Formation Formation used in the engagement. Default `ENUMS.Formation.Vehicle.Vee`. +-- @param #string Formation (Optional) Formation used in the engagement. Default `ENUMS.Formation.Vehicle.Vee`. function ARMYGROUP:onafterEngageTarget(From, Event, To, Target, Speed, Formation) self:T(self.lid.."Engaging Target") @@ -1983,10 +1983,10 @@ end --- Add an a waypoint to the route. -- @param #ARMYGROUP self -- @param Core.Point#COORDINATE Coordinate The coordinate of the waypoint. --- @param #number Speed Speed in knots. Default is default cruise speed or 70% of max speed. --- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint. --- @param #string Formation Formation the group will use. --- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call. +-- @param #number Speed (Optional) Speed in knots. Default is default cruise speed or 70% of max speed. +-- @param #number AfterWaypointWithID (Optional) Insert waypoint after waypoint given ID. Default is to insert as last waypoint. +-- @param #string Formation (Optional) Formation the group will use. +-- @param #boolean Updateroute (Optional) If true or nil, call UpdateRoute. If false, no call. -- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table. function ARMYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Formation, Updateroute) @@ -2047,8 +2047,8 @@ end --- Initialize group parameters. Also initializes waypoints if self.waypoints is nil. -- @param #ARMYGROUP self --- @param #table Template Template used to init the group. Default is `self.template`. --- @param #number Delay Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous. +-- @param #table Template (Optional) Template used to init the group. Default is `self.template`. +-- @param #number Delay (Optional) Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous. -- @return #ARMYGROUP self function ARMYGROUP:_InitGroup(Template, Delay) @@ -2145,9 +2145,9 @@ end --- Switch to a specific formation. -- @param #ARMYGROUP self --- @param #number Formation New formation the group will fly in. Default is the setting of `SetDefaultFormation()`. --- @param #boolean Permanently If true, formation always used from now on. --- @param #boolean NoRouteUpdate If true, route is not updated. +-- @param #number Formation (Optional) New formation the group will fly in. Default is the setting of `SetDefaultFormation()`. +-- @param #boolean Permanently (Optional) If true, formation always used from now on. Defaults to false. +-- @param #boolean NoRouteUpdate (Optional) If true, route is not updated. Defaults to false. -- @return #ARMYGROUP self function ARMYGROUP:SwitchFormation(Formation, Permanently, NoRouteUpdate) @@ -2191,7 +2191,7 @@ end --- Find the neares ammo supply group within a given radius. -- @param #ARMYGROUP self --- @param #number Radius Search radius in NM. Default 30 NM. +-- @param #number Radius (Optional) Search radius in NM. Default 30 NM. -- @return Wrapper.Group#GROUP Closest ammo supplying group or `nil` if no group is in the given radius. -- @return #number Distance to closest group in meters. function ARMYGROUP:FindNearestAmmoSupply(Radius) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 05b5cfa72..73e3d7ff0 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -676,7 +676,7 @@ AUFTRAG.Category={ --- AUFTRAG class version. -- @field #string version -AUFTRAG.version="1.4.0" +AUFTRAG.version="1.4.1" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -1008,7 +1008,7 @@ end --- **[AIR]** Create an ANTI-SHIP mission. -- @param #AUFTRAG self -- @param Wrapper.Positionable#POSITIONABLE Target The target to attack. Can be passed as a @{Wrapper.Group#GROUP} or @{Wrapper.Unit#UNIT} object. --- @param #number Altitude Engage altitude in feet. Default 2000 ft. +-- @param #number Altitude (Optional) Engage altitude in feet. Default 2000 ft. -- @return #AUFTRAG self function AUFTRAG:NewANTISHIP(Target, Altitude) @@ -1038,10 +1038,10 @@ end --- **[AIR ROTARY]** Create an HOVER mission. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Coordinate Where to hover. --- @param #number Altitude Hover altitude in feet AGL. Default is 50 feet above ground. --- @param #number Time Time in seconds to hold the hover. Default 300 seconds. --- @param #number Speed Speed in knots to fly to the target coordinate. Default 150kn. --- @param #number MissionAlt Altitude to fly towards the mission in feet AGL. Default 1000ft. +-- @param #number Altitude (Optional) Hover altitude in feet AGL. Default is 50 feet above ground. +-- @param #number Time (Optional) Time in seconds to hold the hover. Default 300 seconds. +-- @param #number Speed (Optional) Speed in knots to fly to the target coordinate. Default 150kn. +-- @param #number MissionAlt (Optional) Altitude to fly towards the mission in feet AGL. Default 1000ft. -- @return #AUFTRAG self function AUFTRAG:NewHOVER(Coordinate, Altitude, Time, Speed, MissionAlt) @@ -1078,9 +1078,9 @@ end -- @param Core.Point#COORDINATE Coordinate Where to land. -- @param #number OuterRadius (Optional) Vary the coordinate by this many feet, e.g. get a new random coordinate between OuterRadius and (optionally) avoiding InnerRadius of the coordinate. -- @param #number InnerRadius (Optional) Vary the coordinate by this many feet, e.g. get a new random coordinate between OuterRadius and (optionally) avoiding InnerRadius of the coordinate. --- @param #number Time Time in seconds to stay. Default 300 seconds. --- @param #number Speed Speed in knots to fly to the target coordinate. Default 150kn. --- @param #number MissionAlt Altitude to fly towards the mission in feet AGL. Default 1000ft. +-- @param #number Time (Optional) Time in seconds to stay. Default 300 seconds. +-- @param #number Speed (Optional) Speed in knots to fly to the target coordinate. Default 150kn. +-- @param #number MissionAlt A(Optional) ltitude to fly towards the mission in feet AGL. Default 1000ft. -- @param #boolean CombatLanding (Optional) If true, set the Combat Landing option. -- @param #number DirectionAfterLand (Optional) Heading after landing in degrees. -- @return #AUFTRAG self @@ -1168,10 +1168,10 @@ end --- **[AIR]** Create an ORBIT mission, which can be either a circular orbit or a race-track pattern. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Coordinate Where to orbit. --- @param #number Altitude Orbit altitude in feet above sea level. Default is y component of `Coordinate`. --- @param #number Speed Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. --- @param #number Heading Heading of race-track pattern in degrees. If not specified, a circular orbit is performed. --- @param #number Leg Length of race-track in NM. If not specified, a circular orbit is performed. +-- @param #number Altitude (Optional) Orbit altitude in feet above sea level. Default is y component of `Coordinate`. +-- @param #number Speed (Optional) Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. If not specified, a circular orbit is performed. +-- @param #number Leg (Optional) Length of race-track in NM. If not specified, a circular orbit is performed. -- @return #AUFTRAG self function AUFTRAG:NewORBIT(Coordinate, Altitude, Speed, Heading, Leg) @@ -1222,8 +1222,8 @@ end --- **[AIR]** Create an ORBIT mission, where the aircraft will go in a circle around the specified coordinate. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Coordinate Position where to orbit around. --- @param #number Altitude Orbit altitude in feet. Default is y component of `Coordinate`. --- @param #number Speed Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is y component of `Coordinate`. +-- @param #number Speed (Optional) Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. -- @return #AUFTRAG self function AUFTRAG:NewORBIT_CIRCLE(Coordinate, Altitude, Speed) @@ -1235,10 +1235,10 @@ end --- **[AIR]** Create an ORBIT mission, where the aircraft will fly a race-track pattern. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Coordinate Where to orbit. --- @param #number Altitude Orbit altitude in feet. Default is y component of `Coordinate`. --- @param #number Speed Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. --- @param #number Heading Heading of race-track pattern in degrees. Default random in [0, 360) degrees. --- @param #number Leg Length of race-track in NM. Default 10 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is y component of `Coordinate`. +-- @param #number Speed (Optional) Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default random in [0, 360) degrees. +-- @param #number Leg (Optional) Length of race-track in NM. Default 10 NM. -- @return #AUFTRAG self function AUFTRAG:NewORBIT_RACETRACK(Coordinate, Altitude, Speed, Heading, Leg) @@ -1253,12 +1253,12 @@ end --- **[AIR]** Create an ORBIT mission, where the aircraft will fly a circular or race-track pattern over a given group or unit. -- @param #AUFTRAG self -- @param Wrapper.Group#GROUP Group Group where to orbit around. Can also be a UNIT object. --- @param #number Altitude Orbit altitude in feet. Default is 6,000 ft. --- @param #number Speed Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. --- @param #number Leg Length of race-track in NM. Default nil. --- @param #number Heading Heading of race-track pattern in degrees. Default is heading of the group. --- @param DCS#Vec2 OffsetVec2 Offset 2D-vector {x=0, y=0} in NM with respect to the group. Default directly overhead. Can also be given in polar coordinates `{r=5, phi=45}`. --- @param #number Distance Threshold distance in NM before orbit pattern is updated. Default 5 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 6,000 ft. +-- @param #number Speed (Optional) Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. +-- @param #number Leg (Optional) Length of race-track in NM. Default nil. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default is heading of the group. +-- @param DCS#Vec2 OffsetVec2 (Optional) Offset 2D-vector {x=0, y=0} in NM with respect to the group. Default directly overhead. Can also be given in polar coordinates `{r=5, phi=45}`. +-- @param #number Distance (Optional) Threshold distance in NM before orbit pattern is updated. Default 5 NM. -- @return #AUFTRAG self function AUFTRAG:NewORBIT_GROUP(Group, Altitude, Speed, Leg, Heading, OffsetVec2, Distance) @@ -1301,10 +1301,10 @@ end -- themselfs. They wait for the CHIEF to tell them whom to engage. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Coordinate Where to orbit. --- @param #number Altitude Orbit altitude in feet. Default is y component of `Coordinate`. --- @param #number Speed Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. --- @param #number Heading Heading of race-track pattern in degrees. Default random in [0, 360) degrees. --- @param #number Leg Length of race-track in NM. Default 10 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is y component of `Coordinate`. +-- @param #number Speed (Optional) Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default random in [0, 360) degrees. +-- @param #number Leg (Optional) Length of race-track in NM. Default 10 NM. -- @return #AUFTRAG self function AUFTRAG:NewGCICAP(Coordinate, Altitude, Speed, Heading, Leg) @@ -1328,10 +1328,10 @@ end --- **[AIR]** Create a TANKER mission. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Coordinate Where to orbit. --- @param #number Altitude Orbit altitude in feet. Default is y component of `Coordinate`. --- @param #number Speed Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 10 NM. Set to 0 for a simple circular orbit. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is y component of `Coordinate`. +-- @param #number Speed (Optional) Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 10 NM. Set to 0 for a simple circular orbit. -- @param #number RefuelSystem Refueling system (0=boom, 1=probe). This info is *only* for AIRWINGs so they launch the right tanker type. -- @return #AUFTRAG self function AUFTRAG:NewTANKER(Coordinate, Altitude, Speed, Heading, Leg, RefuelSystem) @@ -1367,10 +1367,10 @@ end --- **[AIR]** Create a AWACS mission. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Coordinate Where to orbit. Altitude is also taken from the coordinate. --- @param #number Altitude Orbit altitude in feet. Default is y component of `Coordinate`. --- @param #number Speed Orbit speed in knots. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 10 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is y component of `Coordinate`. +-- @param #number Speed (Optional) Orbit speed in knots. Default 350 kts. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 10 NM. -- @return #AUFTRAG self function AUFTRAG:NewAWACS(Coordinate, Altitude, Speed, Heading, Leg) @@ -1422,12 +1422,12 @@ end --- **[AIR]** Create a CAP mission. -- @param #AUFTRAG self -- @param Core.Zone#ZONE_RADIUS ZoneCAP Circular CAP zone. Detected targets in this zone will be engaged. --- @param #number Altitude Altitude at which to orbit in feet. Default is 10,000 ft. --- @param #number Speed Orbit speed in knots. Default 350 kts. --- @param Core.Point#COORDINATE Coordinate Where to orbit. Default is the center of the CAP zone. --- @param #number Heading Heading of race-track pattern in degrees. If not specified, a simple circular orbit is performed. --- @param #number Leg Length of race-track in NM. If not specified, a simple circular orbit is performed. --- @param #table TargetTypes Table of target types. Default {"Air"}. +-- @param #number Altitude (Optional) Altitude at which to orbit in feet. Default is 10,000 ft. +-- @param #number Speed (Optional) Orbit speed in knots. Default 350 kts. +-- @param Core.Point#COORDINATE Coordinate (Optional) Where to orbit. Default is the center of the CAP zone. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. If not specified, a simple circular orbit is performed. +-- @param #number Leg (Optional) Length of race-track in NM. If not specified, a simple circular orbit is performed. +-- @param #table TargetTypes (Optional) Table of target types. Default {"Air"}. -- @return #AUFTRAG self function AUFTRAG:NewCAP(ZoneCAP, Altitude, Speed, Coordinate, Heading, Leg, TargetTypes) @@ -1464,15 +1464,15 @@ end --- **[AIR]** Create a CAP mission over a (moving) group. -- @param #AUFTRAG self -- @param Wrapper.Group#GROUP Grp The grp to perform the CAP over. --- @param #number Altitude Orbit altitude in feet. Default is 6,000 ft. --- @param #number Speed Orbit speed in knots. Default 250 KIAS. --- @param #number RelHeading Relative heading [0, 360) of race-track pattern in degrees wrt heading of the carrier. Default is heading of the carrier. --- @param #number Leg Length of race-track in NM. Default 14 NM. --- @param #number OffsetDist Relative distance of the first race-track point wrt to the carrier. Default 6 NM. --- @param #number OffsetAngle Relative angle of the first race-track point wrt. to the carrier. Default 180 (behind the boat). --- @param #number UpdateDistance Threshold distance in NM before orbit pattern is updated. Default 5 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 6,000 ft. +-- @param #number Speed (Optional) Orbit speed in knots. Default 250 KIAS. +-- @param #number RelHeading (Optional) Relative heading [0, 360) of race-track pattern in degrees wrt heading of the carrier. Default is heading of the carrier. +-- @param #number Leg (Optional) Length of race-track in NM. Default 14 NM. +-- @param #number OffsetDist (Optional) Relative distance of the first race-track point wrt to the carrier. Default 6 NM. +-- @param #number OffsetAngle (Optional) Relative angle of the first race-track point wrt. to the carrier. Default 180 (behind the boat). +-- @param #number UpdateDistance (Optional) Threshold distance in NM before orbit pattern is updated. Default 5 NM. -- @param #table TargetTypes (Optional) Table of target types. Default `{"Air"}`. --- @param #number EngageRange Max range in nautical miles that the escort group(s) will engage enemies. Default 32 NM (60 km). +-- @param #number EngageRange (Optional) Max range in nautical miles that the escort group(s) will engage enemies. Default 32 NM (60 km). -- @return #AUFTRAG self function AUFTRAG:NewCAPGROUP(Grp, Altitude, Speed, RelHeading, Leg, OffsetDist, OffsetAngle, UpdateDistance, TargetTypes, EngageRange) @@ -1517,11 +1517,11 @@ end --- **[AIR]** Create a CAS mission. -- @param #AUFTRAG self -- @param Core.Zone#ZONE_RADIUS ZoneCAS Circular CAS zone. Detected targets in this zone will be engaged. --- @param #number Altitude Altitude at which to orbit. Default is 10,000 ft. --- @param #number Speed Orbit speed in knots. Default 350 KIAS. --- @param Core.Point#COORDINATE Coordinate Where to orbit. Default is the center of the CAS zone. --- @param #number Heading Heading of race-track pattern in degrees. If not specified, a simple circular orbit is performed. --- @param #number Leg Length of race-track in NM. If not specified, a simple circular orbit is performed. +-- @param #number Altitude (Optional) Altitude at which to orbit. Default is 10,000 ft. +-- @param #number Speed (Optional) Orbit speed in knots. Default 350 KIAS. +-- @param Core.Point#COORDINATE Coordinate (Optional) Where to orbit. Default is the center of the CAS zone. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. If not specified, a simple circular orbit is performed. +-- @param #number Leg (Optional) Length of race-track in NM. If not specified, a simple circular orbit is performed. -- @param #table TargetTypes (Optional) Table of target types. Default `{"Helicopters", "Ground Units", "Light armed ships"}`. -- @return #AUFTRAG self function AUFTRAG:NewCAS(ZoneCAS, Altitude, Speed, Coordinate, Heading, Leg, TargetTypes) @@ -1555,11 +1555,11 @@ end --- **[AIR]** Create a CASENHANCED mission. Group(s) will go to the zone and patrol it randomly. -- @param #AUFTRAG self -- @param Core.Zone#ZONE CasZone The CAS zone. --- @param #number Altitude Altitude in feet. Only for airborne units. Default 2000 feet ASL. --- @param #number Speed Speed in knots. --- @param #number RangeMax Max range in NM. Only detected targets within this radius from the group will be engaged. Default is 25 NM. --- @param Core.Set#SET_ZONE NoEngageZoneSet Set of zones in which targets are *not* engaged. Default is nowhere. --- @param #table TargetTypes Types of target attributes that will be engaged. See [DCS enum attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes). Default `{"Helicopters", "Ground Units", "Light armed ships"}`. +-- @param #number Altitude (Optional) Altitude in feet. Only for airborne units. Default 2000 feet ASL. +-- @param #number Speed (Optional) Speed in knots. +-- @param #number RangeMax (Optional) Max range in NM. Only detected targets within this radius from the group will be engaged. Default is 25 NM. +-- @param Core.Set#SET_ZONE NoEngageZoneSet (Optional) Set of zones in which targets are *not* engaged. Default is nowhere. +-- @param #table TargetTypes (Optional) Types of target attributes that will be engaged. See [DCS enum attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes). Default `{"Helicopters", "Ground Units", "Light armed ships"}`. -- @return #AUFTRAG self function AUFTRAG:NewCASENHANCED(CasZone, Altitude, Speed, RangeMax, NoEngageZoneSet, TargetTypes) @@ -1597,11 +1597,10 @@ end --- **[AIR, GROUND]** Create a FAC mission. Group(s) will go to the zone and patrol it randomly and act as FAC for detected units. -- @param #AUFTRAG self -- @param Core.Zone#ZONE FacZone The FAC zone (or name of zone) where to patrol. --- @param #number Speed Speed in knots. --- @param #number Altitude Altitude in feet. Only for airborne units. Default 2000 feet ASL. --- @param #number Frequency Frequency in MHz. --- @param #number Modulation Modulation. --- @return #AUFTRAG self +-- @param #number Speed (Optional) Speed in knots. +-- @param #number Altitude (Optional) Altitude in feet. Only for airborne units. Default 2000 feet ASL. +-- @param #number Frequency (Optional) Frequency in MHz. Defaults to 133Mhz. +-- @param #number Modulation (Optional) Modulation. Defaults to radio.modulation.AM function AUFTRAG:NewFAC(FacZone, Speed, Altitude, Frequency, Modulation) local mission=AUFTRAG:New(AUFTRAG.Type.FAC) @@ -1638,10 +1637,10 @@ end --- **[AIR]** Create a FACA mission. -- @param #AUFTRAG self -- @param Wrapper.Group#GROUP Target Target group. Must be a GROUP object. --- @param #string Designation Designation of target. See `AI.Task.Designation`. Default `AI.Task.Designation.AUTO`. --- @param #boolean DataLink Enable data link. Default `true`. --- @param #number Frequency Radio frequency in MHz the FAC uses for communication. Default is 133 MHz. --- @param #number Modulation Radio modulation band. Default 0=AM. Use 1 for FM. See radio.modulation.AM or radio.modulaton.FM. +-- @param #string Designation (Optional) Designation of target. See `AI.Task.Designation`. Default `AI.Task.Designation.AUTO`. +-- @param #boolean DataLink (Optional) Enable data link. Default `true`. +-- @param #number Frequency (Optional) Radio frequency in MHz the FAC uses for communication. Default is 133 MHz. +-- @param #number Modulation (Optional) Radio modulation band. Default 0=AM. Use 1 for FM. See radio.modulation.AM or radio.modulaton.FM. -- @return #AUFTRAG self function AUFTRAG:NewFACA(Target, Designation, DataLink, Frequency, Modulation) @@ -1675,7 +1674,7 @@ end --- **[AIR]** Create a BAI mission. -- @param #AUFTRAG self -- @param Wrapper.Positionable#POSITIONABLE Target The target to attack. Can be a GROUP, UNIT or STATIC object. --- @param #number Altitude Engage altitude in feet. Default 5000 ft. +-- @param #number Altitude (Optional) Engage altitude in feet. Default 5000 ft. -- @return #AUFTRAG self function AUFTRAG:NewBAI(Target, Altitude) @@ -1705,7 +1704,7 @@ end --- **[AIR]** Create a SEAD mission. -- @param #AUFTRAG self -- @param Wrapper.Positionable#POSITIONABLE Target The target to attack. Can be a GROUP or UNIT object. --- @param #number Altitude Engage altitude in feet. Default 25000 ft. +-- @param #number Altitude (Optional) Engage altitude in feet. Default 25000 ft. -- @return #AUFTRAG self function AUFTRAG:NewSEAD(Target, Altitude) @@ -1735,9 +1734,9 @@ end --- **[AIR]** Create a SEAD in Zone mission. -- @param #AUFTRAG self -- @param Core.Zone#ZONE TargetZone The target zone to attack. --- @param #number Altitude Engage altitude in feet. Default 25000 ft. --- @param #table TargetTypes Table of string of DCS known target types, defaults to {"Air Defence"}. See [DCS Target Attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes) --- @param #number Duration Engage this much time when the AUFTRAG starts executing. +-- @param #number Altitude (Optional) Engage altitude in feet. Default 25000 ft. +-- @param #table TargetTypes (Optional) Table of string of DCS known target types, defaults to {"Air Defence"}. See [DCS Target Attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @param #number Duration (Optional) Engage this much time when the AUFTRAG starts executing. Default is 1800. -- @return #AUFTRAG self function AUFTRAG:NewSEADInZone(TargetZone, Altitude, TargetTypes, Duration) @@ -1771,8 +1770,8 @@ end --- **[AIR]** Create a STRIKE mission. Flight will attack the closest map object to the specified coordinate. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Target The target coordinate. Can also be given as a GROUP, UNIT, STATIC, SET_GROUP, SET_UNIT, SET_STATIC or TARGET object. --- @param #number Altitude Engage altitude in feet. Default 2000 ft. --- @param #number EngageWeaponType Which weapon to use. Defaults to auto, ie ENUMS.WeaponFlag.Auto. See ENUMS.WeaponFlag for options. +-- @param #number Altitude (Optional) Engage altitude in feet. Default 2000 ft. +-- @param #number EngageWeaponType (Optional) Which weapon to use. Defaults to auto, ie ENUMS.WeaponFlag.Auto. See ENUMS.WeaponFlag for options. -- @return #AUFTRAG self function AUFTRAG:NewSTRIKE(Target, Altitude, EngageWeaponType) @@ -1803,9 +1802,9 @@ end -- See [DCS task bombing](https://wiki.hoggitworld.com/view/DCS_task_bombing). -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT, STATIC, SET_GROUP, SET_UNIT, SET_STATIC or TARGET object. --- @param #number Altitude Engage altitude in feet. Default 25000 ft. --- @param #number EngageWeaponType Which weapon to use. Defaults to auto, ie ENUMS.WeaponFlag.Auto. See ENUMS.WeaponFlag for options. --- @param #boolean Divebomb If true, use a dive bombing attack approach. +-- @param #number Altitude Engage (Optional) altitude in feet. Default 25000 ft. +-- @param #number EngageWeaponType (Optional) Which weapon to use. Defaults to auto, ie ENUMS.WeaponFlag.Auto. See ENUMS.WeaponFlag for options. +-- @param #boolean Divebomb (Optional) If true, use a dive bombing attack approach. -- @return #AUFTRAG self function AUFTRAG:NewBOMBING(Target, Altitude, EngageWeaponType, Divebomb) @@ -1841,8 +1840,8 @@ end -- See [DCS task strafing](https://wiki.hoggitworld.com/view/DCS_task_strafing). -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT, STATIC or TARGET object. --- @param #number Altitude Engage altitude in feet. Default 1000 ft. --- @param #number Length The total length of the strafing target in meters. Default `nil`. +-- @param #number Altitude (Optional) Engage altitude in feet. Default 1000 ft. +-- @param #number Length (Optional) The total length of the strafing target in meters. Default `nil`. -- @return #AUFTRAG self function AUFTRAG:NewSTRAFING(Target, Altitude, Length) @@ -1878,7 +1877,7 @@ end --- **[AIR]** Create a BOMBRUNWAY mission. -- @param #AUFTRAG self -- @param Wrapper.Airbase#AIRBASE Airdrome The airbase to bomb. This must be an airdrome (not a FARP or ship) as these do not have a runway. --- @param #number Altitude Engage altitude in feet. Default 25000 ft. +-- @param #number Altitude (Optional) Engage altitude in feet. Default 25000 ft. -- @return #AUFTRAG self function AUFTRAG:NewBOMBRUNWAY(Airdrome, Altitude) @@ -1916,8 +1915,8 @@ end --- **[AIR]** Create a CARPET BOMBING mission. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT or STATIC object. --- @param #number Altitude Engage altitude in feet. Default 25000 ft. --- @param #number CarpetLength Length of bombing carpet in meters. Default 500 m. +-- @param #number Altitude (Optional) Engage altitude in feet. Default 25000 ft. +-- @param #number CarpetLength (Optional) Length of bombing carpet in meters. Default 500 m. -- @return #AUFTRAG self function AUFTRAG:NewBOMBCARPET(Target, Altitude, CarpetLength) @@ -1954,8 +1953,8 @@ end --- **[AIR/HELO]** Create a GROUNDESCORT (or FOLLOW) mission. Helo will escort a **ground** group and automatically engage certain target types. -- @param #AUFTRAG self -- @param Wrapper.Group#GROUP EscortGroup The ground group to escort. --- @param #number OrbitDistance Orbit to/from the lead unit this many NM. Defaults to 1.5 NM. --- @param #table TargetTypes Types of targets to engage automatically. Default is {"Ground vehicles"}, i.e. all enemy ground units. Use an empty set {} for a simple "FOLLOW" mission. +-- @param #number OrbitDistance(Optional) Orbit to/from the lead unit this many NM. Defaults to 1.5 NM. +-- @param #table TargetTypes (Optional) Types of targets to engage automatically. Default is {"Ground vehicles"}, i.e. all enemy ground units. Use an empty set {} for a simple "FOLLOW" mission. -- @return #AUFTRAG self function AUFTRAG:NewGROUNDESCORT(EscortGroup, OrbitDistance, TargetTypes) @@ -1992,9 +1991,9 @@ end --- **[AIR]** Create an ESCORT (or FOLLOW) mission. Flight will escort another group and automatically engage certain target types. -- @param #AUFTRAG self -- @param Wrapper.Group#GROUP EscortGroup The group to escort. --- @param DCS#Vec3 OffsetVector A table with x, y and z components specifying the offset of the flight to the escorted group. Default {x=-100, y=0, z=200} for z=200 meters to the right, same alitude (y=0), x=-100 meters behind. --- @param #number EngageMaxDistance Max engage distance of targets in nautical miles. Default auto 32 NM. --- @param #table TargetTypes Types of targets to engage automatically. Default is {"Air"}, i.e. all enemy airborne units. Use an empty set {} for a simple "FOLLOW" mission. +-- @param DCS#Vec3 OffsetVector (Optional) A table with x, y and z components specifying the offset of the flight to the escorted group. Default {x=-100, y=0, z=200} for z=200 meters to the right, same alitude (y=0), x=-100 meters behind. +-- @param #number EngageMaxDistance (Optional) Max engage distance of targets in nautical miles. Default auto 32 NM. +-- @param #table TargetTypes (Optional) Types of targets to engage automatically. Default is {"Air"}, i.e. all enemy airborne units. Use an empty set {} for a simple "FOLLOW" mission. -- @return #AUFTRAG self function AUFTRAG:NewESCORT(EscortGroup, OffsetVector, EngageMaxDistance, TargetTypes) @@ -2053,13 +2052,13 @@ end --- **[AIRPANE]** Create a RECOVERY TANKER mission. -- @param #AUFTRAG self -- @param Wrapper.Unit#UNIT Carrier The carrier unit. --- @param #number Altitude Orbit altitude in feet. Default is 6,000 ft. --- @param #number Speed Orbit speed in knots. Default 250 KIAS. --- @param #number Leg Length of race-track in NM. Default 14 NM. --- @param #number RelHeading Relative heading [0, 360) of race-track pattern in degrees wrt heading of the carrier. Default is heading of the carrier. --- @param #number OffsetDist Relative distance of the first race-track point wrt to the carrier. Default 6 NM. --- @param #number OffsetAngle Relative angle of the first race-track point wrt. to the carrier. Default 180 (behind the boat). --- @param #number UpdateDistance Threshold distance in NM before orbit pattern is updated. Default 5 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 6,000 ft. +-- @param #number Speed (Optional) Orbit speed in knots. Default 250 KIAS. +-- @param #number Leg (Optional) Length of race-track in NM. Default 14 NM. +-- @param #number RelHeading (Optional) Relative heading [0, 360) of race-track pattern in degrees wrt heading of the carrier. Default is heading of the carrier. +-- @param #number OffsetDist (Optional) Relative distance of the first race-track point wrt to the carrier. Default 6 NM. +-- @param #number OffsetAngle (Optional) Relative angle of the first race-track point wrt. to the carrier. Default 180 (behind the boat). +-- @param #number UpdateDistance (Optional) Threshold distance in NM before orbit pattern is updated. Default 5 NM. -- @return #AUFTRAG self function AUFTRAG:NewRECOVERYTANKER(Carrier, Altitude, Speed, Leg, RelHeading, OffsetDist, OffsetAngle, UpdateDistance) @@ -2101,8 +2100,8 @@ end -- @param #AUFTRAG self -- @param Core.Set#SET_GROUP TransportGroupSet The set group(s) to be transported. -- @param Core.Point#COORDINATE DropoffCoordinate Coordinate where the helo will land drop off the the troops. --- @param Core.Point#COORDINATE PickupCoordinate Coordinate where the helo will land to pick up the the cargo. Default is the first transport group. --- @param #number PickupRadius Radius around the pickup coordinate in meters. Default 100 m. +-- @param Core.Point#COORDINATE PickupCoordinate(Optional) Coordinate where the helo will land to pick up the the cargo. Default is the first transport group. +-- @param #number PickupRadius (Optional) Radius around the pickup coordinate in meters. Default 100 m. -- @return #AUFTRAG self function AUFTRAG:NewTROOPTRANSPORT(TransportGroupSet, DropoffCoordinate, PickupCoordinate, PickupRadius) @@ -2143,6 +2142,7 @@ function AUFTRAG:NewTROOPTRANSPORT(TransportGroupSet, DropoffCoordinate, PickupC end --- **[AIR ROTARY]** Create a CARGO TRANSPORT mission. +-- This mission is for helicopters only, which transport cargo externally via slingload. -- **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. @@ -2190,7 +2190,7 @@ function AUFTRAG:NewFREIGHTTRANSPORT(StaticCargo, Destination) -- Check if Destination is given if Destination==nil then - self:E(self.lid..string.format("ERROR: Destination is nil for AUFTRAG:NewFREIGHTTRANSPORT! You must specify the destination airbase")) + BASE:E(self.lid..string.format("ERROR: Destination is nil for AUFTRAG:NewFREIGHTTRANSPORT! You must specify the destination airbase")) return nil elseif type(Destination)=="string" then Destination=AIRBASE:FindByName(Destination) @@ -2198,7 +2198,7 @@ function AUFTRAG:NewFREIGHTTRANSPORT(StaticCargo, Destination) -- Check if Cargo is given if StaticCargo==nil then - self:E(self.lid..string.format("ERROR: StaticCargo is nil for AUFTRAG:NewFREIGHTTRANSPORT! You must specify the static object that represents the cargo")) + BASE:E(self.lid..string.format("ERROR: StaticCargo is nil for AUFTRAG:NewFREIGHTTRANSPORT! You must specify the static object that represents the cargo")) return nil elseif type(StaticCargo)=="string" then StaticCargo=STATIC:FindByName(StaticCargo) @@ -2212,6 +2212,15 @@ function AUFTRAG:NewFREIGHTTRANSPORT(StaticCargo, Destination) end local mission=AUFTRAG:New(AUFTRAG.Type.FREIGHTTRANSPORT) + + -- Check that the set is not empty + local Ncargo=StaticCargo:Count() + if Ncargo==0 then + mission:E(mission.lid..string.format("ERROR: No cargo items in set!")) + return nil + else + mission:T(mission.lid..string.format("FREIGHTTRANSPORT with N=%d cargo items in set", Ncargo)) + end mission:_TargetFromObject(StaticCargo) @@ -2277,9 +2286,9 @@ end -- **Note** that it is recommended to set the weapon range via the `OPSGROUP:AddWeaponRange()` function as this cannot be retrieved from the DCS API. -- @param #AUFTRAG self -- @param Core.Point#COORDINATE Target Center of the firing solution. --- @param #number Nshots Number of shots to be fired. Default `#nil`. If value is in (0,1), it is interpreted as per cent of available ammo. --- @param #number Radius Radius of the shells in meters. Default 100 meters. --- @param #number Altitude Altitude in meters. Can be used to setup a Barrage. Default `#nil`. +-- @param #number Nshots (Optional) Number of shots to be fired. Default `#nil`. If value is in (0,1), it is interpreted as per cent of available ammo. +-- @param #number Radius (Optional) Radius of the shells in meters. Default 100 meters. +-- @param #number Altitude (Optional) Altitude in meters. Can be used to setup a Barrage. Default `#nil`. -- @return #AUFTRAG self function AUFTRAG:NewARTY(Target, Nshots, Radius, Altitude) @@ -2312,11 +2321,11 @@ end --- **[GROUND, NAVAL]** Create an BARRAGE mission. Assigned groups will move to a random coordinate within a given zone and start firing into the air. -- @param #AUFTRAG self -- @param Core.Zone#ZONE Zone The zone where the unit will go. --- @param #number Heading Heading in degrees. Default random heading [0, 360). --- @param #number Angle Shooting angle in degrees. Default random [45, 85]. --- @param #number Radius Radius of the shells in meters. Default 100 meters. --- @param #number Altitude Altitude in meters. Default 500 m. --- @param #number Nshots Number of shots to be fired. Default is until ammo is empty (`#nil`). +-- @param #number Heading (Optional) Heading in degrees. Default random heading [0, 360). +-- @param #number Angle (Optional) Shooting angle in degrees. Default random [45, 85]. +-- @param #number Radius (Optional) Radius of the shells in meters. Default 100 meters. +-- @param #number Altitude (Optional) Altitude in meters. Default 500 m. +-- @param #number Nshots (Optional) Number of shots to be fired. Default is until ammo is empty (`#nil`). -- @return #AUFTRAG self function AUFTRAG:NewBARRAGE(Zone, Heading, Angle, Radius, Altitude, Nshots) @@ -2351,8 +2360,8 @@ end -- @param #AUFTRAG self -- @param Core.Zone#ZONE Zone The patrol zone. -- @param #number Speed Speed in knots. --- @param #number Altitude Altitude in feet. Only for airborne units. Default 2000 feet ASL. --- @param #string Formation Formation used by ground units during patrol. Default "Off Road". +-- @param #number Altitude (Optional) Altitude in feet. Only for airborne units. Default 2000 feet ASL. +-- @param #string Formation (Optional) Formation used by ground units during patrol. Default "Off Road". -- @return #AUFTRAG self function AUFTRAG:NewPATROLZONE(Zone, Speed, Altitude, Formation) @@ -2389,8 +2398,8 @@ end -- @param Ops.OpsZone#OPSZONE OpsZone The OPS zone to capture. -- @param #number Coalition The coalition which should capture the zone for the mission to be successful. -- @param #number Speed Speed in knots. --- @param #number Altitude Altitude in feet. Only for airborne units. Default 2000 feet ASL. --- @param #string Formation Formation used by ground units during patrol. Default "Off Road". +-- @param #number Altitude (Optional) Altitude in feet. Only for airborne units. Default 2000 feet ASL. +-- @param #string Formation (Optional) Formation used by ground units during patrol. Default "Off Road". -- @param #number StayInZoneTime Stay this many seconds in the zone when done, only then drive back. -- @return #AUFTRAG self function AUFTRAG:NewCAPTUREZONE(OpsZone, Coalition, Speed, Altitude, Formation, StayInZoneTime) @@ -2454,8 +2463,8 @@ end -- Therefore, we resort to this workaround, which guides the attacking group to the vicinity of the target. Then they start shooting on their own, once they detect the target. -- @param #AUFTRAG self -- @param Wrapper.Positionable#POSITIONABLE Target The target to attack. Can be a GROUP, UNIT or STATIC object. --- @param #number Speed Speed in knots. Default max. --- @param #string Formation The attack formation, e.g. "Wedge", "Vee" etc. Default `ENUMS.Formation.Vehicle.Vee`. Only working for ground, not naval! +-- @param #number Speed (Optional) Speed in knots. Default max. +-- @param #string Formation (Optional) The attack formation, e.g. "Wedge", "Vee" etc. Default `ENUMS.Formation.Vehicle.Vee`. Only working for ground, not naval! -- @return #AUFTRAG self function AUFTRAG:NewGROUNDATTACK(Target, Speed, Formation) @@ -2487,8 +2496,8 @@ end -- Therefore, we resort to this workaround, which guides the attacking group to the vicinity of the target. Then they start shooting on their own, once they detect the target. -- @param #AUFTRAG self -- @param Wrapper.Positionable#POSITIONABLE Target The target to attack. Can be a GROUP, UNIT or STATIC object. --- @param #number Speed Speed in knots. Default max. --- @param #number Depth The attack depth in meters. Only for submarines! +-- @param #number Speed (Optional) Speed in knots. Default max. +-- @param #number Depth (Optional) The attack depth in meters. Only for submarines! Defaults to 0. -- @return #AUFTRAG self function AUFTRAG:NewNAVALENGAGEMENT(Target, Speed, Depth) @@ -2517,8 +2526,8 @@ end --- **[AIR, GROUND, NAVAL]** Create a RECON mission. -- @param #AUFTRAG self -- @param Core.Set#SET_ZONE ZoneSet The recon zones. --- @param #number Speed Speed in knots. --- @param #number Altitude Altitude in feet. Only for airborne units. Default 2000 feet ASL. +-- @param #number Speed (Optional) Speed in knots. +-- @param #number Altitude (Optional) Altitude in feet. Only for airborne units. Default 2000 feet ASL. -- @param #boolean Adinfinitum If `true`, the group will start over again after reaching the final zone. -- @param #boolean Randomly If `true`, the group will select a random zone. -- @param #string Formation Formation used during recon route. @@ -3010,7 +3019,7 @@ end --- Set mission start and stop time. -- @param #AUFTRAG self --- @param #string ClockStart Time the mission is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added. +-- @param #string ClockStart (Optional) Time the mission is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added. -- @param #string ClockStop (Optional) Time the mission is stopped, e.g. "13:00" for 1 pm. If mission could not be started at that time, it will be removed from the queue. If specified as a #number it will be relative (in seconds) to the current mission time. -- @return #AUFTRAG self function AUFTRAG:SetTime(ClockStart, ClockStop) @@ -3096,9 +3105,9 @@ end --- Set mission priority and (optional) urgency. Urgent missions can cancel other running missions. -- @param #AUFTRAG self --- @param #number Prio Priority 1=high, 100=low. Default 50. +-- @param #number Prio (Optional) Priority 1=high, 100=low. Default 50. -- @param #boolean Urgent If *true*, another running mission might be cancelled if it has a lower priority. --- @param #number Importance Number 1-10. If missions with lower value are in the queue, these have to be finished first. Default is `nil`. +-- @param #number Importance (Optional) Number 1-10. If missions with lower value are in the queue, these have to be finished first. Default is `nil`. -- @return #AUFTRAG self function AUFTRAG:SetPriority(Prio, Urgent, Importance) self.prio=Prio or 50 @@ -3109,7 +3118,7 @@ end --- **[LEGION, COMMANDER, CHIEF]** Set how many times the mission is repeated. Only valid if the mission is handled by a LEGION (AIRWING, BRIGADE, FLEET) or higher level. -- @param #AUFTRAG self --- @param #number Nrepeat Number of repeats. Default 0. +-- @param #number Nrepeat (Optional) Number of repeats. Default 0. -- @return #AUFTRAG self function AUFTRAG:SetRepeat(Nrepeat) self.Nrepeat=Nrepeat or 0 @@ -3119,7 +3128,7 @@ end --- **[LEGION, COMMANDER, CHIEF]** Set the repeat delay in seconds after a mission is successful/failed. Only valid if the mission is handled by a LEGION (AIRWING, BRIGADE, FLEET) or higher level. -- @param #AUFTRAG self --- @param #number RepeatDelay Repeat delay in seconds. Default 1. +-- @param #number RepeatDelay (Optional) Repeat delay in seconds. Default 1. -- @return #AUFTRAG self function AUFTRAG:SetRepeatDelay(RepeatDelay) self.repeatDelay = RepeatDelay @@ -3128,7 +3137,7 @@ end --- **[LEGION, COMMANDER, CHIEF]** Set how many times the mission is repeated if it fails. Only valid if the mission is handled by a LEGION (AIRWING, BRIGADE, FLEET) or higher level. -- @param #AUFTRAG self --- @param #number Nrepeat Number of repeats. Default 0. +-- @param #number Nrepeat (Optional) Number of repeats. Default 0. -- @return #AUFTRAG self function AUFTRAG:SetRepeatOnFailure(Nrepeat) self.NrepeatFailure=Nrepeat or 0 @@ -3137,7 +3146,7 @@ end --- **[LEGION, COMMANDER, CHIEF]** Set how many times the mission is repeated if it was successful. Only valid if the mission is handled by a LEGION (AIRWING, BRIGADE, FLEET) or higher level. -- @param #AUFTRAG self --- @param #number Nrepeat Number of repeats. Default 0. +-- @param #number Nrepeat (Optional) Number of repeats. Default 0. -- @return #AUFTRAG self function AUFTRAG:SetRepeatOnSuccess(Nrepeat) self.NrepeatSuccess=Nrepeat or 0 @@ -3158,8 +3167,8 @@ end --- **[LEGION, COMMANDER, CHIEF]** Define how many assets are required to do the job. Only used if the mission is handled by a **LEGION** (AIRWING, BRIGADE, ...) or higher level. -- @param #AUFTRAG self --- @param #number NassetsMin Minimum number of asset groups. Default 1. --- @param #number NassetsMax Maximum Number of asset groups. Default is same as `NassetsMin`. +-- @param #number NassetsMin (Optional) Minimum number of asset groups. Default 1. +-- @param #number NassetsMax (Optional) Maximum Number of asset groups. Default is same as `NassetsMin`. -- @return #AUFTRAG self function AUFTRAG:SetRequiredAssets(NassetsMin, NassetsMax) @@ -3226,11 +3235,11 @@ end --- **[LEGION, COMMANDER, CHIEF]** Define how many assets are required that escort the mission assets. -- Only used if the mission is handled by a **LEGION** (AIRWING, BRIGADE, FLEET) or higher level. -- @param #AUFTRAG self --- @param #number NescortMin Minimum number of asset groups. Default 1. --- @param #number NescortMax Maximum Number of asset groups. Default is same as `NassetsMin`. --- @param #string MissionType Mission type assets will be optimized for and payload selected, *e.g.* `AUFTRAG.Type.SEAD`. Default nil. --- @param #table TargetTypes Target Types that will be engaged by the escort group(s). Default `{"Air"}` for aircraft and `{"Ground Units"}` for helos. Set, *e.g.*, `{"Air Defence"}` for SEAD. --- @param #number EngageRange Max range in nautical miles that the escort group(s) will engage enemies. Default 32 NM (60 km). +-- @param #number NescortMin (Optional) Minimum number of asset groups. Default 1. +-- @param #number NescortMax (Optional) Maximum Number of asset groups. Default is same as `NassetsMin`. +-- @param #string MissionType (Optional) Mission type assets will be optimized for and payload selected, *e.g.* `AUFTRAG.Type.SEAD`. Default nil. +-- @param #table TargetTypes (Optional) Target Types that will be engaged by the escort group(s). Default `{"Air"}` for aircraft and `{"Ground Units"}` for helos. Set, *e.g.*, `{"Air Defence"}` for SEAD. +-- @param #number EngageRange (Optional) Max range in nautical miles that the escort group(s) will engage enemies. Default 32 NM (60 km). -- @return #AUFTRAG self function AUFTRAG:SetRequiredEscorts(NescortMin, NescortMax, MissionType, TargetTypes, EngageRange) @@ -3256,7 +3265,7 @@ end --- Set mission name. -- @param #AUFTRAG self --- @param #string Name Name of the mission. Default is "Auftrag Nr. X", where X is a running number, which is automatically increased. +-- @param #string Name (Optional) Name of the mission. Default is "Auftrag Nr. X", where X is a running number, which is automatically increased. -- @return #AUFTRAG self function AUFTRAG:SetName(Name) self.name=Name or string.format("Auftrag Nr. %d", self.auftragsnummer) @@ -3265,7 +3274,7 @@ end --- Enable markers, which dispay the mission status on the F10 map. -- @param #AUFTRAG self --- @param #number Coalition The coaliton side to which the markers are dispayed. Default is to all. +-- @param #number Coalition (Optional) The coaliton side to which the markers are dispayed. Default is to all. -- @return #AUFTRAG self function AUFTRAG:SetEnableMarkers(Coalition) self.markerOn=true @@ -3275,7 +3284,7 @@ end --- Set verbosity level. -- @param #AUFTRAG self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #AUFTRAG self function AUFTRAG:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -3284,7 +3293,7 @@ end --- Set weapon type used for the engagement. -- @param #AUFTRAG self --- @param #number WeaponType Weapon type. Default is `ENUMS.WeaponFlag.Auto`. +-- @param #number WeaponType (Optional) Weapon type. Default is `ENUMS.WeaponFlag.Auto`. -- @return #AUFTRAG self function AUFTRAG:SetWeaponType(WeaponType) @@ -3298,7 +3307,7 @@ end --- Set number of weapons to expend. -- @param #AUFTRAG self --- @param #number WeaponExpend How much of the weapon load is expended during the attack, e.g. `AI.Task.WeaponExpend.ALL`. Default "Auto". +-- @param #number WeaponExpend (Optional) How much of the weapon load is expended during the attack, e.g. `AI.Task.WeaponExpend.ALL`. Default "Auto". -- @return #AUFTRAG self function AUFTRAG:SetWeaponExpend(WeaponExpend) @@ -3330,7 +3339,7 @@ end --- Set engage altitude. This is the altitude passed to the DCS task. In the ME it is the tickbox ALTITUDE ABOVE. -- @param #AUFTRAG self --- @param #string Altitude Altitude in feet. Default 6000 ft. +-- @param #string Altitude (Optional) Altitude in feet. Default 6000 ft. -- @return #AUFTRAG self function AUFTRAG:SetEngageAltitude(Altitude) @@ -3344,10 +3353,10 @@ end --- Enable to automatically engage detected targets. -- @param #AUFTRAG self --- @param #number RangeMax Max range in NM. Only detected targets within this radius from the group will be engaged. Default is 25 NM. --- @param #table TargetTypes Types of target attributes that will be engaged. See [DCS enum attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes). Default "All". --- @param Core.Set#SET_ZONE EngageZoneSet Set of zones in which targets are engaged. Default is anywhere. --- @param Core.Set#SET_ZONE NoEngageZoneSet Set of zones in which targets are *not* engaged. Default is nowhere. +-- @param #number RangeMax (Optional) Max range in NM. Only detected targets within this radius from the group will be engaged. Default is 25 NM. +-- @param #table TargetTypes (Optional) Types of target attributes that will be engaged. See [DCS enum attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes). Default "All". +-- @param Core.Set#SET_ZONE EngageZoneSet (Optional) Set of zones in which targets are engaged. Default is anywhere. +-- @param Core.Set#SET_ZONE NoEngageZoneSet (Optional) Set of zones in which targets are *not* engaged. Default is nowhere. -- @return #AUFTRAG self function AUFTRAG:SetEngageDetected(RangeMax, TargetTypes, EngageZoneSet, NoEngageZoneSet) @@ -3400,7 +3409,7 @@ end --- Set max mission range. Only applies if the AUFTRAG is handled by an AIRWING or CHIEF. This is the max allowed distance from the airbase to the target. -- @param #AUFTRAG self --- @param #number Range Max range in NM. Default 100 NM. +-- @param #number Range (Optional) Max range in NM. Default 100 NM. -- @return #AUFTRAG self function AUFTRAG:SetMissionRange(Range) self.engageRange=UTILS.NMToMeters(Range or 100) @@ -3426,8 +3435,8 @@ end --- **[LEGION, COMMANDER, CHIEF]** Attach OPS transport to the mission. Mission assets will be transported before the mission is started at the OPSGROUP level. -- @param #AUFTRAG self -- @param Core.Zone#ZONE DeployZone Zone where assets are deployed. --- @param #number NcarriersMin Number of carriers *at least* required. Default 1. --- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. +-- @param #number NcarriersMin (Optional) Number of carriers *at least* required. Default 1. +-- @param #number NcarriersMax (Optional) Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. -- @param Core.Zone#ZONE DisembarkZone Zone where assets are disembarked to. -- @param #table Categories Group categories. -- @param #table Attributes Generalizes group attributes. @@ -3489,8 +3498,8 @@ end --- **[LEGION, COMMANDER, CHIEF]** Set number of required carrier groups if an OPSTRANSPORT assignment is required. -- @param #AUFTRAG self --- @param #number NcarriersMin Number of carriers *at least* required. Default 1. --- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. +-- @param #number NcarriersMin (Optional) Number of carriers *at least* required. Default 1. +-- @param #number NcarriersMax (Optional) Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. -- @param #table Categories Group categories. -- @param #table Attributes Group attributes. See `GROUP.Attribute.` -- @param #table Properties DCS attributes. @@ -3755,7 +3764,7 @@ end --- Set radio frequency and modulation for this mission. -- @param #AUFTRAG self -- @param #number Frequency Frequency in MHz. --- @param #number Modulation Radio modulation. Default 0=AM. +-- @param #number Modulation (Optional) Radio modulation. Default 0=AM. -- @return #AUFTRAG self function AUFTRAG:SetRadio(Frequency, Modulation) @@ -3769,9 +3778,9 @@ end --- Set TACAN beacon channel and Morse code for this mission. -- @param #AUFTRAG self -- @param #number Channel TACAN channel. --- @param #string Morse Morse code. Default "XXX". --- @param #string UnitName Name of the unit in the group for which acts as TACAN beacon. Default is the first unit in the group. --- @param #string Band Tacan channel mode ("X" or "Y"). Default is "X" for ground/naval and "Y" for aircraft. +-- @param #string Morse (Optional) Morse code. Default "XXX". +-- @param #string UnitName (Optional) Name of the unit in the group for which acts as TACAN beacon. Default is the first unit in the group. +-- @param #string Band (Optional) Tacan channel mode ("X" or "Y"). Default is "X" for ground/naval and "Y" for aircraft. -- @return #AUFTRAG self function AUFTRAG:SetTACAN(Channel, Morse, UnitName, Band) @@ -3787,8 +3796,8 @@ end --- Set ICLS beacon channel and Morse code for this mission. -- @param #AUFTRAG self -- @param #number Channel ICLS channel. --- @param #string Morse Morse code. Default "XXX". --- @param #string UnitName Name of the unit in the group for which acts as ICLS beacon. Default is the first unit in the group. +-- @param #string Morse (Optional) Morse code. Default "XXX". +-- @param #string UnitName (Optional) Name of the unit in the group for which acts as ICLS beacon. Default is the first unit in the group. -- @return #AUFTRAG self function AUFTRAG:SetICLS(Channel, Morse, UnitName) @@ -3802,7 +3811,7 @@ end --- Set time interval between mission done and success/failure evaluation. -- @param #AUFTRAG self --- @param #number Teval Time in seconds before the mission result is evaluated. Default depends on mission type. +-- @param #number Teval (Optional) Time in seconds before the mission result is evaluated. Default depends on mission type. -- @return #AUFTRAG self function AUFTRAG:SetEvaluationTime(Teval) @@ -5710,6 +5719,27 @@ function AUFTRAG:GetTargetLife() end end +--- Get cargo items as set SET object. +-- This returns the cargo item(s) as set `SET` object for mission types `CARGOTRANSPORT`, `TROOPTRANSPORT` and `FREIGHTTRANSPORT`. +-- @param #AUFTRAG self +-- @return Core.Set#SET_BASE The cargo set. +function AUFTRAG:GetCargoSet() + + if self.type==AUFTRAG.Type.CARGOTRANSPORT then + local set=SET_STATIC:New() + set:AddObject(self.DCStask.params.cargo) + return set + elseif self.type==AUFTRAG.Type.TROOPTRANSPORT then + return self.transportGroupSet + elseif self.type==AUFTRAG.Type.FREIGHTTRANSPORT then + return self.DCStask.params.cargo + else + self:E(self.lid.."ERROR: GetCargoSet() is only for transport types!") + return nil + end + +end + --- Get target. -- @param #AUFTRAG self -- @return Ops.Target#TARGET The target object. Could be many things. @@ -5979,7 +6009,7 @@ end --- Set randomization of the mission waypoint coordinate. Each assigned group will get a random ingress coordinate, where the mission is executed. -- @param #AUFTRAG self --- @param #number Radius Distance in meters. Default `#nil`. +-- @param #number Radius (Optional) Distance in meters. Default `#nil`. -- @return #AUFTRAG self function AUFTRAG:SetMissionWaypointRandomization(Radius) self.missionWaypointRadius=Radius @@ -7170,7 +7200,7 @@ function AUFTRAG:_GetDCSAttackTask(Target, DCStasks) elseif target.Type==TARGET.ObjectType.UNIT or target.Type==TARGET.ObjectType.STATIC then - local DCStask=CONTROLLABLE.TaskAttackUnit(nil, target.Object, self.engageAsGroup, self.WeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType) + local DCStask=CONTROLLABLE.TaskAttackUnit(nil, target.Object, self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType) table.insert(DCStasks, DCStask) diff --git a/Moose Development/Moose/Ops/Awacs.lua b/Moose Development/Moose/Ops/Awacs.lua index 9ec9049b4..261ddfd16 100644 --- a/Moose Development/Moose/Ops/Awacs.lua +++ b/Moose Development/Moose/Ops/Awacs.lua @@ -1410,9 +1410,9 @@ end --- [User] Set the tactical information option, create 10 radio channels groups can subscribe and get Bogey Dope on a specific frequency automatically. You **need** to set up SRS first before using this! -- @param #AWACS self --- @param #number BaseFreq Base Frequency to use, defaults to 130. --- @param #number Increase Increase to use, defaults to 0.5, thus channels created are 130, 130.5, 131 .. etc. --- @param #number Modulation Modulation to use, defaults to radio.modulation.AM. +-- @param #number BaseFreq (Optional) Base Frequency to use, defaults to 130. +-- @param #number Increase (Optional) Increase to use, defaults to 0.5, thus channels created are 130, 130.5, 131 .. etc. +-- @param #number Modulation (Optional) Modulation to use, defaults to radio.modulation.AM. -- @param #number Interval Seconds between each update call. -- @param #number Number Number of Frequencies to create, can be 1..10. -- @return #AWACS self @@ -1694,8 +1694,8 @@ end --- [User] Set TOS Time-on-Station in Hours -- @param #AWACS self --- @param #number AICHours AWACS stays this number of hours on station before shift change, default is 4. --- @param #number CapHours (optional) CAP stays this number of hours on station before shift change, default is 4. +-- @param #number AICHours (Optional) AWACS stays this number of hours on station before shift change, default is 4. +-- @param #number CapHours (Optional) CAP stays this number of hours on station before shift change, default is 4. -- @return #AWACS self function AWACS:SetTOS(AICHours,CapHours) self:T(self.lid.."SetTOS") @@ -1990,7 +1990,7 @@ end --- [User] Set AWACS Player Guidance - influences missile callout and the "New" label in group callouts. -- @param #AWACS self --- @param #boolean Switch If true (default) it is on, if false, it is off. +-- @param #boolean Switch (Optional) If true (default) it is on, if false, it is off. -- @return #AWACS self function AWACS:SetPlayerGuidance(Switch) if (Switch == nil) or (Switch == true) then @@ -2010,9 +2010,9 @@ end --- [User] Set AWACS intercept timeline support distance. -- @param #AWACS self --- @param #number TacDistance Distance for TAC call, default 45nm --- @param #number MeldDistance Distance for Meld call, default 35nm --- @param #number ThreatDistance Distance for Threat call, default 25nm +-- @param #number TacDistance (Optional) Distance for TAC call, default 45nm +-- @param #number MeldDistance (Optional) Distance for Meld call, default 35nm +-- @param #number ThreatDistance (Optional) Distance for Threat call, default 25nm -- @return #AWACS self function AWACS:SetInterceptTimeline(TacDistance, MeldDistance, ThreatDistance) self.TacDistance = TacDistance or 45 @@ -2119,12 +2119,12 @@ end --- [User] Set AWACS flight details -- @param #AWACS self --- @param #number CallSign Defaults to CALLSIGN.AWACS.Magic --- @param #number CallSignNo Defaults to 1 --- @param #number Angels Defaults to 25 (i.e. 25000 ft) --- @param #number Speed Defaults to 250kn --- @param #number Heading Defaults to 0 (North) --- @param #number Leg Defaults to 25nm +-- @param #number CallSign (Optional) Defaults to CALLSIGN.AWACS.Magic +-- @param #number CallSignNo (Optional) Defaults to 1 +-- @param #number Angels (Optional) Defaults to 25 (i.e. 25000 ft) +-- @param #number Speed (Optional) Defaults to 250kn +-- @param #number Heading (Optional) Defaults to 0 (North) +-- @param #number Leg (Optional) Defaults to 25nm -- @return #AWACS self function AWACS:SetAwacsDetails(CallSign,CallSignNo,Angels,Speed,Heading,Leg) self:T(self.lid.."SetAwacsDetails") @@ -2176,13 +2176,13 @@ end --- [User] Set AWACS SRS TTS details - see @{Sound.SRS} for details. `SetSRS()` will try to use as many attributes configured with @{Sound.SRS#MSRS.LoadConfigFile}() as possible. -- @param #AWACS self --- @param #string PathToSRS Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" --- @param #string Gender Defaults to "male" --- @param #string Culture Defaults to "en-US" --- @param #number Port Defaults to 5002 +-- @param #string PathToSRS (Optional) Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" +-- @param #string Gender (Optional) Defaults to "male" +-- @param #string Culture (Optional) Defaults to "en-US" +-- @param #number Port (Optional) Defaults to 5002 -- @param #string Voice (Optional) Use a specifc voice with the @{Sound.SRS#SetVoice} function, e.g, `:SetVoice("Microsoft Hedda Desktop")`. -- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS. --- @param #number Volume Volume - between 0.0 (silent) and 1.0 (loudest) +-- @param #number Volume (Optional) Volume - between 0.0 (silent) and 1.0 (loudest) Defaults to 1.0. -- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS; if you use a config file for MSRS, hand in nil here. -- @param #string AccessKey (Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, hand in nil here. -- @param #string Backend (Optional) Your MSRS Backend if different from your config file settings, e.g. MSRS.Backend.SRSEXE or MSRS.Backend.GRPC @@ -2223,8 +2223,8 @@ end --- [User] Set AWACS Voice Details for AI CAP Planes - SRS TTS - see @{Sound.SRS} for details -- @param #AWACS self --- @param #string Gender Defaults to "male" --- @param #string Culture Defaults to "en-US" +-- @param #string Gender (Optional) Defaults to "male" +-- @param #string Culture (Optional) Defaults to "en-US" -- @param #string Voice (Optional) Use a specifc voice with the @{#MSRS.SetVoice} function, e.g, `:SetVoice("Microsoft Hedda Desktop")`. -- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS. -- @return #AWACS self @@ -2238,10 +2238,10 @@ end --- [User] Set AI CAP Plane Details -- @param #AWACS self --- @param #number Callsign Callsign name of AI CAP, e.g. CALLSIGN.Aircraft.Dodge. Defaults to CALLSIGN.Aircraft.Colt. Note that not all available callsigns work for all plane types. --- @param #number MaxAICap Maximum number of AI CAP planes on station that AWACS will set up automatically. Default to 4. --- @param #number TOS Time on station, in hours. AI planes might go back to base earlier if they run out of fuel or missiles. --- @param #number Speed Airspeed to be used in knots. Will be adjusted to flight height automatically. Defaults to 270. +-- @param #number Callsign (Optional) Callsign name of AI CAP, e.g. CALLSIGN.Aircraft.Dodge. Defaults to CALLSIGN.Aircraft.Colt. Note that not all available callsigns work for all plane types. +-- @param #number MaxAICap (Optional) Maximum number of AI CAP planes on station that AWACS will set up automatically. Default to 4. +-- @param #number TOS (Optional) Time on station, in hours. AI planes might go back to base earlier if they run out of fuel or missiles. Defaults to 4. +-- @param #number Speed (Optional) Airspeed to be used in knots. Will be adjusted to flight height automatically. Defaults to 270. -- @return #AWACS self function AWACS:SetAICAPDetails(Callsign,MaxAICap,TOS,Speed) self:T(self.lid.."SetAICAPDetails") @@ -2257,7 +2257,7 @@ end -- @param #number EscortNumber Number of fighther plane GROUPs to accompany this AWACS. 0 or nil means no escorts. If you want >1 plane in an escort group, you can either set the respective squadron grouping to the desired number, or use a template for escorts with >1 unit. -- @param #number Formation Formation the escort should take (if more than one plane), e.g. `ENUMS.Formation.FixedWing.FingerFour.Group`. Formation is used on GROUP level, multiple groups of one unit will NOT conform to this formation. -- @param #table OffsetVector Offset the escorts should fly behind the AWACS, given as table, distance in meters, e.g. `{x=-500,y=0,z=500}` - 500m behind (negative value) and to the right (negative for left), no vertical separation (positive over, negative under the AWACS flight). For multiple groups, the vectors will be slightly changed to avoid collisions. --- @param #number EscortEngageMaxDistance Escorts engage air targets max this NM away, defaults to 45NM. +-- @param #number EscortEngageMaxDistance (Optional) Escorts engage air targets max this NM away, defaults to 45NM. -- @return #AWACS self function AWACS:SetEscort(EscortNumber,Formation,OffsetVector,EscortEngageMaxDistance) self:T(self.lid.."SetEscort") diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index c68be9667..cc95f9804 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -151,7 +151,7 @@ do -- -- ## 2. Options -- --- The following options are available (with their defaults). Only set the ones you want changed: +-- The following options are available (with their defaults). Don't waste your time adding those in your script if your not going to change the value. -- -- my_ctld.useprefix = true -- (DO NOT SWITCH THIS OFF UNLESS YOU KNOW WHAT YOU ARE DOING!) Adjust **before** starting CTLD. If set to false, *all* choppers of the coalition side will be enabled for CTLD. -- my_ctld.CrateDistance = 35 -- List and Load crates in this radius only. @@ -199,6 +199,8 @@ do -- my_ctld.validateAndRepositionUnits = false -- Uses Disposition and other logic to find better ground positions for ground units avoiding trees, water, roads, runways, map scenery, statics and other units in the area. (Default is false) -- my_ctld.loadSavedCrates = true -- Load back crates (STATIC) from the save file. Useful for mission restart cleanup. (Default is true) -- my_ctld.UseC130LoadAndUnload = false -- When set to true, forces the C-130 player to use the C-130J built system to load the cargo onboard and to unload. (Default is false) +-- my_ctld.UseC130DynamicCargoAutoBuild = false -- When true (and UseC130LoadAndUnload is true), C-130 DynamicCargo unload completion is bridged to CTLD engineer-path auto-build. +-- my_ctld.C130DynamicCargoAutoBuildMergeSeconds = 10 -- Merge window in seconds for C-130 auto-build handoff; ready sets from same C-130 are batched into one engineer build call. -- my_ctld.locale = "en" -- Language locale to use, available are "en" (default), "de" and "fr" -- -- ## 2.1 CH-47 Chinook support @@ -224,7 +226,7 @@ do -- -- All other kinds of cargo can be sling-loaded. -- --- ## 2.1.2 Recommended settings +-- ## 2.1.3 Recommended settings -- -- my_ctld.onestepmenu = true -- This will enable Get and load, drop and build, etc. All will be done in one step. works for every module except the C-130J-30 with my_ctld.UseC130LoadAndUnload = true -- my_ctld.C130basetype = "cds_crate" -- This can be changed to other cargo. This is only for the C-130J-30 @@ -236,10 +238,50 @@ do -- my_ctld.movecratesbeforebuild = true -- leave as is at the pain of building crate still **inside** of the Hook. -- my_ctld.nobuildinloadzones = true -- don't build where you load. -- my_ctld.ChinookTroopCircleRadius = 5 -- Radius for troops dropping in a nice circle. Adjust to your planned squad size for the Chinook. --- --- ## 2.2 User functions +-- my_ctld.CrateDistance = 65 -- Distance from the aircraft and the max range where we will detect cargo. Default 35. +-- my_ctld.PackDistance = 65 -- Distance from the aircraft and the max range where we will detect units to pack. Default 35. +-- +-- ## 2.2 C-130J-30 support and cargo airdrop auto-build. +-- +-- **Important:** This auto-build flow only applies to cargo obtained via CTLD **Get Crates**. +-- Cargo spawned from the C-130 **Loadsheet** is **not** tracked by this feature. +-- +-- The C-130J-30 can auto-build airdropped CTLD cargo when this feature is enabled. +-- This allows players to airdrop build cargo without manually deploying engineers. +-- +-- CTLD tracks supported C-130 cargo from the moment it is spawned via "Get Crates". +-- After a valid airdrop and landing, CTLD automatically starts the build. +-- +-- If multiple compatible cargo sets are dropped close together, CTLD waits briefly +-- (10 seconds by default) and then processes them together. +-- +-- ### Required settings +-- +-- my_ctld.UseC130LoadAndUnload = true -- This option forces C-130 cargo loading/unloading through the C-130J-30 load system. +-- my_ctld.UseC130DynamicCargoAutoBuild = true -- When true (and UseC130LoadAndUnload is true), C-130 DynamicCargo unload completion is bridged to CTLD engineer-path auto-build. +-- my_ctld.enableFixedWing = true -- This will activate the fixed-wing related functions, including the auto-build for airdropped cargo. +-- +-- Adding cargo in your config for the C-130 can be deeply customized. For example you can have a cargo shape only used for the C-130 while all other aircraft will get something else. +-- +-- my_ctld:AddCratesCargoNoMove("IRIS T System", {"CTLD_CARGO_IRISTSLM_System"}, CTLD_CARGO.Enum.FOB, 3, 2800, 10, "SAM/AAA", nil,nil,nil,nil,"cds_crate",nil, "iso_container_small") +-- +-- In the example above: +-- +-- * `AddCratesCargoNoMove` means the built unit/group will not receive an auto-move command after spawn. +-- * `IRIS T System` is the menu/display name. +-- * `CTLD_CARGO_IRISTSLM_System` is the mission editor template. +-- * `CTLD_CARGO.Enum.FOB` defines the cargo/build type. FOB builds keep the mission-editor orientation. +-- * `3` is crates required, `2800` is per-crate mass (kg), and `10` is stock. +-- * `SAM/AAA` is the submenu label (used when `my_ctld.usesubcats = true`). +-- * `cds_crate` is the default cargo shape for non-C130 aircraft when provided; if omitted, CTLD falls back to `my_ctld.basetype`. +-- * `iso_container_small` is the C-130-specific cargo shape override, even if `my_ctld.C130basetype` is set to something else. +-- * **Important:** If you do not want to set stock (the `10` parameter), pass `nil` in that position. +-- Keep `nil` placeholders for skipped parameters before later values. +-- +-- +-- ## 2.3 User functions -- --- ### 2.2.1 Adjust or add chopper unit-type capabilities +-- ### 2.3.1 Adjust or add chopper unit-type capabilities -- -- Use this function to adjust what a heli type can or cannot do: -- @@ -269,7 +311,7 @@ do -- ["OH58D"] = {type="OH58D", crates=false, troops=false, cratelimit = 0, trooplimit = 0, length = 14, cargoweightlimit = 400}, -- ["CH-47Fbl1"] = {type="CH-47Fbl1", crates=true, troops=true, cratelimit = 4, trooplimit = 31, length = 20, cargoweightlimit = 8000}, -- --- ### 2.2.2 Activate and deactivate zones +-- ### 2.3.2 Activate and deactivate zones -- -- Activate a zone: -- @@ -281,7 +323,7 @@ do -- -- Deactivate zone called Name of type #CTLD.CargoZoneType ZoneType: -- my_ctld:DeactivateZone(Name,CTLD.CargoZoneType.DROP) -- --- ## 2.2.3 Limit and manage available resources +-- ## 2.3.3 Limit and manage available resources -- -- When adding generic cargo types, you can effectively limit how many units can be dropped/build by the players, e.g. -- @@ -305,7 +347,7 @@ do -- Notes: -- Troops dropped back into a LOAD zone will effectively be added to the stock. Crates lost in e.g. a heli crash are just that - lost. -- --- ## 2.2.4 Create own SET_GROUP to manage CTLD Pilot groups +-- ## 2.3.4 Create own SET_GROUP to manage CTLD Pilot groups -- -- -- Parameter: Set The SET_GROUP object created by the mission designer/user to represent the CTLD pilot groups. -- -- Needs to be set before starting the CTLD instance. @@ -538,18 +580,6 @@ do -- -- So if the Vulcan in the example now needs six crates to complete, you have to bring two Hercs with three Vulcan crates each and drop them very close together... -- --- ### 5.4 C-130J-30 support --- --- The C130-J-30 will work only by setting up --- --- my_ctld.enableFixedWing = true -- false by default. --- --- -- The rest below is default values but can be changed to something else. --- --- my_ctld.C130basetype = "cds_crate" -- this is default. --- my_ctld.FixedMinAngels = 155 -- for troop/cargo drop via chute in meters, ca 470 ft --- my_ctld.FixedMaxAngels = 2000 -- for troop/cargo drop via chute in meters, ca 6000 ft --- my_ctld.FixedMaxSpeed = 77 -- 77mps or 270kph or 150kn -- -- -- You can also enable my_ctld.UseC130LoadAndUnload and set it to true, false is default, this means you will not be able to get and load items but rather "Get" only. @@ -691,6 +721,8 @@ CTLD = { dropOffZones = {}, pickupZones = {}, DynamicCargo = {}, + UseC130DynamicCargoAutoBuild = false, + C130DynamicCargoAutoBuildMergeSeconds = 10, ChinookTroopCircleRadius = 5, TroopUnloadDistGround = 5, TroopUnloadDistGroundHerc = 25, @@ -943,6 +975,12 @@ function CTLD:New(Coalition, Prefixes, Alias) self.Loaded_Cargo = {} self.Spawned_Crates = {} self.Spawned_Cargo = {} + self._c130DcAutoSets = {} + self._c130DcAutoMap = {} + self._c130DcAutoBatches = {} + self._c130DcAutoSeq = 0 + self._c130DcAutoTimer = nil + self._c130DcAutoActiveSetId = nil self.MenusDone = {} self.DroppedTroops = {} self.DroppedCrates = {} @@ -1053,6 +1091,12 @@ function CTLD:New(Coalition, Prefixes, Alias) -- use C-130J-30 load and unload method, false by default. self.UseC130LoadAndUnload = false + + -- when true, bridge DynamicCargo C-130 transport states to CTLD auto-build via engineer path. + self.UseC130DynamicCargoAutoBuild = false + + -- merge ready C-130 auto-build sets from the same aircraft for this many seconds. + self.C130DynamicCargoAutoBuildMergeSeconds = 10 -- Smokes and Flares self.SmokeColor = SMOKECOLOR.Red @@ -1627,6 +1671,846 @@ function CTLD:AddPlayerTask(PlayerTask) return self end +--- (Internal) Check whether cargo type is eligible for C-130 DynamicCargo auto-build. +-- @param #CTLD self +-- @param #CTLD_CARGO Cargo +-- @return #boolean Outcome +function CTLD:_C130DcAutoIsBuildableCargo(Cargo) + if not Cargo then return false end + local ctype = Cargo:GetType() + return ctype == CTLD_CARGO.Enum.VEHICLE or ctype == CTLD_CARGO.Enum.FOB +end + +--- (Internal) Ensure C-130 DynamicCargo auto-build runtime state tables exist. +-- @param #CTLD self +-- @return #CTLD self +function CTLD:_C130DcAutoEnsureState() + self._c130DcAutoSets = self._c130DcAutoSets or {} + self._c130DcAutoMap = self._c130DcAutoMap or {} + self._c130DcAutoBatches = self._c130DcAutoBatches or {} + self._c130DcAutoSeq = self._c130DcAutoSeq or 0 + return self +end + +--- (Internal) Filter crate list to the currently active C-130 auto-build set. +-- @param #CTLD self +-- @param #table Crates +-- @param #string|#table SetIdOrScope +-- @return #table Filtered +-- @return #number Count +function CTLD:_C130DcAutoFilterCrates(Crates, SetIdOrScope) + if not SetIdOrScope then + local t = Crates or {} + local n = 0 + for _,_ in pairs(t) do + n = n + 1 + end + return t, n + end + + local scopeIds = {} + if type(SetIdOrScope) == "table" then + for k,v in pairs(SetIdOrScope) do + if type(k) == "number" and type(v) == "string" then + scopeIds[v] = true + elseif type(k) == "string" and v then + scopeIds[k] = true + end + end + elseif type(SetIdOrScope) == "string" then + scopeIds[SetIdOrScope] = true + end + if not next(scopeIds) then + return {}, 0 + end + + local allowedIds = {} + local allowedNames = {} + for setId,_ in pairs(scopeIds) do + local setData = self._c130DcAutoSets and self._c130DcAutoSets[setId] or nil + if setData then + for _,entry in ipairs(setData.entries or {}) do + if entry.cargoId then + allowedIds[entry.cargoId] = true + end + if entry.cargoObject and entry.cargoObject.GetID then + local id = entry.cargoObject:GetID() + if id then + allowedIds[id] = true + end + end + if entry.proxyCargo and entry.proxyCargo.GetID then + local id = entry.proxyCargo:GetID() + if id then + allowedIds[id] = true + end + end + if entry.spawnName then + allowedNames[entry.spawnName] = true + end + if entry.dynamicName then + allowedNames[entry.dynamicName] = true + end + end + end + end + + local filtered = {} + for _,_crate in pairs(Crates or {}) do + local crate = _crate -- #CTLD_CARGO + local include = false + if crate then + local cid = crate.GetID and crate:GetID() or nil + if cid and allowedIds[cid] then + include = true + else + local pos = crate.GetPositionable and crate:GetPositionable() or nil + local pname = pos and pos.GetName and pos:GetName() or nil + if pname and allowedNames[pname] then + include = true + end + end + end + if include then + filtered[#filtered + 1] = crate + end + end + return filtered, #filtered +end + +--- (Internal) Register one spawned C-130 CTLD crate in DynamicCargo database and emit NewDynamicCargo. +-- @param #CTLD self +-- @param Wrapper.Positionable#POSITIONABLE Positionable +-- @return Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo +function CTLD:_C130DcAutoRegisterDynamicCargo(Positionable) + if not Positionable or not _DATABASE then return nil end + local pname = Positionable.GetName and Positionable:GetName() or nil + if not pname or pname == "" then return nil end + local dcargo = _DATABASE:FindDynamicCargo(pname) + if not dcargo then + dcargo = _DATABASE:AddDynamicCargo(pname) + if dcargo then + self:T(self.lid.." C130DcAuto RegisterDynamicCargo "..pname) + _DATABASE:CreateEventNewDynamicCargo(dcargo) + end + end + return dcargo +end + +--- (Internal) Get best-effort unit name from dynamic cargo event. +-- @param #CTLD self +-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo +-- @return #string Unit name +function CTLD:_C130DcAutoGetCarrierUnitName(DynamicCargo) + if not DynamicCargo then return nil end + if DynamicCargo.GetCarrierUnitName then + local uname = DynamicCargo:GetCarrierUnitName() + if uname and uname ~= "" then + return uname + end + end + local owner = DynamicCargo.Owner + if owner and owner ~= "" and owner ~= "None" then + local byPlayer = CLIENT:FindByPlayerName(owner) + if byPlayer and byPlayer:IsAlive() then + return byPlayer:GetName() + end + end + return nil +end + +--- (Internal) Get best-effort group name from dynamic cargo event. +-- @param #CTLD self +-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo +-- @return #string Group name +function CTLD:_C130DcAutoGetCarrierGroupName(DynamicCargo) + if not DynamicCargo then return nil end + if DynamicCargo.GetCarrierGroupName then + local gname = DynamicCargo:GetCarrierGroupName() + if gname and gname ~= "" then + return gname + end + end + local uname = self:_C130DcAutoGetCarrierUnitName(DynamicCargo) + if uname then + local unit = UNIT:FindByName(uname) + if unit and unit:IsAlive() then + local grp = unit:GetGroup() + if grp then + return grp:GetName() + end + end + end + return nil +end + +--- (Internal) Check whether this dynamic cargo event belongs to C-130J transport. +-- @param #CTLD self +-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo +-- @return #boolean Outcome +function CTLD:_C130DcAutoIsC130Event(DynamicCargo) + if not DynamicCargo then return false end + if DynamicCargo.GetCarrierTypeName then + local tname = DynamicCargo:GetCarrierTypeName() + if tname and tname ~= "" then + return tname == "C-130J-30" + end + end + local uname = self:_C130DcAutoGetCarrierUnitName(DynamicCargo) + if uname then + local unit = UNIT:FindByName(uname) + if unit then + local utype = unit:GetTypeName() or "none" + if self.C130JTypes and self.C130JTypes[utype] then + return true + end + return utype == "C-130J-30" + end + end + return false +end + +--- (Internal) Register a new C-130 DynamicCargo auto-build set. +-- @param #CTLD self +-- @param Wrapper.Group#GROUP Group +-- @param Wrapper.Unit#UNIT Unit +-- @param #CTLD_CARGO Cargo +-- @param Core.Zone#ZONE PickupZone +-- @return #string Set id or nil +function CTLD:_C130DcAutoRegisterSet(Group, Unit, Cargo, PickupZone) + if not Group or not Unit or not Cargo then return nil end + if not self.UseC130LoadAndUnload or not self.UseC130DynamicCargoAutoBuild then return nil end + if not self:IsC130J(Unit) then return nil end + if not self:_C130DcAutoIsBuildableCargo(Cargo) then return nil end + + self:_C130DcAutoEnsureState() + self._c130DcAutoSeq = self._c130DcAutoSeq + 1 + local seq = self._c130DcAutoSeq + local setId = string.format("%s|%s|%d", Unit:GetName() or "none", Cargo:GetName() or "cargo", seq) + local cc, ct, cs = Cargo:GetStaticTypeAndShape() + local recipe = { + cargoName = Cargo:GetName(), + cargoDisplayName = Cargo:GetDisplayName(), + templates = UTILS.DeepCopy(Cargo:GetTemplates()), + cargoType = Cargo:GetType(), + cratesNeeded = Cargo:GetCratesNeeded(), + perCrateMass = Cargo:GetMass(), + subcategory = Cargo.Subcategory, + staticCategory = cc, + staticType = ct, + staticShape = cs, + resourceMap = UTILS.DeepCopy(Cargo:GetStaticResourceMap()), + typeNames = UTILS.DeepCopy(Cargo.TypeNames), + } + local now = timer.getTime() + local setData = { + id = setId, + created = now, + ttl = now + 3600, + groupName = Group:GetName(), + unitName = Unit:GetName(), + pickupZoneName = (PickupZone and PickupZone.GetName and PickupZone:GetName()) or (type(PickupZone) == "string" and PickupZone or nil), + recipe = recipe, + entries = {}, + completed = false, + failed = false, + buildStarted = false, + handoffClaimed = false, + helperGroupName = nil, + helperUnitName = nil, + cleanupAt = nil, + } + self._c130DcAutoSets[setId] = setData + self:T(self.lid.." C130DcAuto RegisterSet "..setId) + return setId +end + +--- (Internal) Register one spawned crate entry inside a C-130 DynamicCargo auto-build set. +-- @param #CTLD self +-- @param #string SetId +-- @param #CTLD_CARGO Cargo +-- @return #boolean Outcome +function CTLD:_C130DcAutoRegisterEntry(SetId, Cargo) + if not SetId or not Cargo then return false end + self:_C130DcAutoEnsureState() + local setData = self._c130DcAutoSets[SetId] + if not setData then return false end + + local pos = Cargo:GetPositionable() + local pname = pos and pos.GetName and pos:GetName() or nil + local pcoord = pos and pos.GetCoordinate and pos:GetCoordinate() or nil + local entryId = string.format("%s#%d", SetId, #setData.entries + 1) + local entry = { + id = entryId, + state = "pending", + cargoId = Cargo:GetID(), + cargoObject = Cargo, + cargoName = Cargo:GetName(), + spawnName = pname, + dynamicName = nil, + spawnVec2 = pcoord and pcoord:GetVec2() or nil, + spawnVec3 = pcoord and pcoord:GetVec3() or nil, + landedVec2 = nil, + landedVec3 = nil, + proxyCargo = nil, + proxyAdded = false, + } + setData.entries[#setData.entries + 1] = entry + if pname then + self._c130DcAutoMap[pname] = { setId = SetId, entryId = entryId } + end + return true +end + +--- (Internal) Get mapped C-130 DynamicCargo auto-build entry. +-- @param #CTLD self +-- @param #string DynamicCargoName +-- @return #table SetData +-- @return #table EntryData +function CTLD:_C130DcAutoGetMappedEntry(DynamicCargoName) + if not DynamicCargoName or not self._c130DcAutoMap then return nil, nil end + local link = self._c130DcAutoMap[DynamicCargoName] + if not link then return nil, nil end + local setData = self._c130DcAutoSets and self._c130DcAutoSets[link.setId] or nil + if not setData then return nil, nil end + for _,entry in ipairs(setData.entries or {}) do + if entry.id == link.entryId then + return setData, entry + end + end + return nil, nil +end + +--- (Internal) Resolve closest pending/loaded set entry for a dynamic cargo event. +-- @param #CTLD self +-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo +-- @param #boolean PreferLoaded If true only loaded-state entries are considered. +-- @return #table SetData +-- @return #table EntryData +function CTLD:_C130DcAutoResolveEntry(DynamicCargo, PreferLoaded) + local cargoCoord = DynamicCargo and DynamicCargo.GetLastPosition and DynamicCargo:GetLastPosition() or nil + local unitName = self:_C130DcAutoGetCarrierUnitName(DynamicCargo) + local groupName = self:_C130DcAutoGetCarrierGroupName(DynamicCargo) + local bestSet = nil + local bestEntry = nil + local bestDist = math.huge + + for _,setData in pairs(self._c130DcAutoSets or {}) do + if not setData.completed and not setData.failed then + local ownerMatch = false + if unitName and setData.unitName and setData.unitName == unitName then + ownerMatch = true + elseif groupName and setData.groupName and setData.groupName == groupName then + ownerMatch = true + end + if ownerMatch then + for _,entry in ipairs(setData.entries or {}) do + local stateOk = false + if PreferLoaded then + stateOk = entry.state == "loaded" + else + stateOk = entry.state == "pending" or entry.state == "loaded" + end + if stateOk then + local dist = 0 + if cargoCoord and entry.spawnVec2 then + local dx = (cargoCoord.x or 0) - (entry.spawnVec2.x or 0) + local dz = (cargoCoord.z or 0) - (entry.spawnVec2.y or 0) + dist = math.sqrt(dx*dx + dz*dz) + elseif cargoCoord and entry.landedVec2 then + local dx = (cargoCoord.x or 0) - (entry.landedVec2.x or 0) + local dz = (cargoCoord.z or 0) - (entry.landedVec2.y or 0) + dist = math.sqrt(dx*dx + dz*dz) + else + dist = 999999 + end + if dist < bestDist then + bestDist = dist + bestSet = setData + bestEntry = entry + end + end + end + end + end + end + if bestSet and bestEntry and bestDist <= 200 then + return bestSet, bestEntry + end + return nil, nil +end + +--- (Internal) Create CTLD cargo proxy from landed DynamicCargo for build handoff. +-- @param #CTLD self +-- @param #table SetData +-- @param #table Entry +-- @param Wrapper.DynamicCargo#DYNAMICCARGO DynamicCargo +-- @return #CTLD_CARGO ProxyCargo +function CTLD:_C130DcAutoCreateProxyCargo(SetData, Entry, DynamicCargo) + if not SetData or not Entry or not DynamicCargo then return nil end + if Entry.proxyAdded and Entry.proxyCargo then return Entry.proxyCargo end + + -- Primary path: rebind the original CTLD crate object to landed DynamicCargo. + -- This avoids duplicate crate entries in self.Spawned_Cargo. + local original = Entry.cargoObject + if original then + original.Positionable = DynamicCargo + original:SetWasDropped(true, true) + Entry.proxyCargo = original + Entry.proxyAdded = true + return original + end + + -- Fallback path (should be rare): synthesize a proxy cargo object. + local recipe = SetData.recipe or {} + self.CargoCounter = self.CargoCounter + 1 + local proxy = CTLD_CARGO:New( + self.CargoCounter, + recipe.cargoName, + UTILS.DeepCopy(recipe.templates), + recipe.cargoType, + true, + false, + recipe.cratesNeeded, + DynamicCargo, + true, + recipe.perCrateMass, + nil, + recipe.subcategory + ) + proxy:SetDisplayName(recipe.cargoDisplayName) + proxy:SetStaticTypeAndShape(recipe.staticCategory, recipe.staticType, recipe.staticShape) + proxy:SetStaticResourceMap(UTILS.DeepCopy(recipe.resourceMap)) + if recipe.typeNames then + proxy.TypeNames = UTILS.DeepCopy(recipe.typeNames) + end + proxy:SetWasDropped(true, true) + table.insert(self.Spawned_Cargo, proxy) + Entry.proxyCargo = proxy + Entry.proxyAdded = true + return proxy +end + +--- (Internal) Get C-130 auto-build batch owner key. +-- @param #CTLD self +-- @param #table SetData +-- @return #string Owner key +function CTLD:_C130DcAutoGetOwnerKey(SetData) + if not SetData then return nil end + return SetData.unitName or SetData.groupName +end + +--- (Internal) Spawn one helper infantry group and handoff build for multiple sets. +-- @param #CTLD self +-- @param #string OwnerKey +-- @param #table SetIds +-- @return #boolean Outcome +function CTLD:_C130DcAutoSpawnBuildHelperForSets(OwnerKey, SetIds) + if not SetIds or #SetIds < 1 then return false end + local sx = 0 + local sy = 0 + local count = 0 + local validSetIds = {} + for _,setId in ipairs(SetIds) do + local setData = self._c130DcAutoSets and self._c130DcAutoSets[setId] or nil + if setData and not setData.failed and not setData.completed and not setData.buildStarted then + validSetIds[#validSetIds + 1] = setId + for _,entry in ipairs(setData.entries or {}) do + local vec2 = entry.landedVec2 or entry.spawnVec2 + if vec2 then + sx = sx + vec2.x + sy = sy + vec2.y + count = count + 1 + end + end + end + end + if #validSetIds < 1 or count < 1 then + return false + end + + local center = { x = sx / count, y = sy / count } + local helperGroupName = string.format("CTLD_C130_AUTOBUILD_HELPER_%d", math.random(100000, 999999)) + local helperUnitName = helperGroupName .. "_1" + local isRed = self.coalition == coalition.side.RED + local helperCountry = isRed and country.id.RUSSIA or country.id.USA + local helperType = isRed and "Infantry AK" or "Soldier M4" + + local groupData = { + visible = false, + task = "Ground Nothing", + tasks = {}, + route = { + points = { + [1] = { + x = center.x, + y = center.y, + action = "Off Road", + speed = 0, + task = { id = "ComboTask", params = { tasks = {} } }, + } + } + }, + units = { + [1] = { + x = center.x, + y = center.y, + type = helperType, + name = helperUnitName, + heading = 0, + skill = "Excellent", + } + }, + name = helperGroupName, + } + + coalition.addGroup(helperCountry, Group.Category.GROUND, groupData) + local helperGroup = GROUP:FindByName(helperGroupName) + local helperUnit = helperGroup and helperGroup:GetUnit(1) or nil + if not helperGroup or not helperUnit then + self:T(self.lid.." C130DcAuto helper spawn failed for owner "..tostring(OwnerKey)) + for _,setId in ipairs(validSetIds) do + local setData = self._c130DcAutoSets and self._c130DcAutoSets[setId] or nil + if setData then + setData.handoffClaimed = false + end + end + return false + end + + local cleanupAt = timer.getTime() + math.max(5, (self.buildtime or 0) + 5) + for _,setId in ipairs(validSetIds) do + local setData = self._c130DcAutoSets and self._c130DcAutoSets[setId] or nil + if setData then + setData.buildStarted = true + setData.completed = true + setData.helperGroupName = helperGroupName + setData.helperUnitName = helperUnitName + setData.cleanupAt = cleanupAt + end + end + + self:T(self.lid.." C130DcAuto build handoff for owner "..tostring(OwnerKey).." sets="..table.concat(validSetIds,",")) + local prevScope = self._c130DcAutoActiveSetId + self._c130DcAutoActiveSetId = validSetIds + self:_BuildCrates(helperGroup, helperUnit, true, true) + self._c130DcAutoActiveSetId = prevScope + return true +end + +--- (Internal) Flush queued ready sets for a specific owner key. +-- @param #CTLD self +-- @param #string OwnerKey +-- @return #CTLD self +function CTLD:_C130DcAutoFlushOwnerBatch(OwnerKey) + local batch = self._c130DcAutoBatches and self._c130DcAutoBatches[OwnerKey] or nil + if not batch then return self end + + if batch.timer and batch.timer.IsRunning and batch.timer:IsRunning() then + batch.timer:Stop() + end + batch.timer = nil + + local setIds = {} + local failedSetIds = {} + for setId,_ in pairs(batch.setIds or {}) do + local setData = self._c130DcAutoSets and self._c130DcAutoSets[setId] or nil + if setData and not setData.failed and not setData.completed and not setData.buildStarted then + local total = 0 + local landed = 0 + local failed = false + for _,entry in ipairs(setData.entries or {}) do + total = total + 1 + if entry.state == "failed" then + failed = true + break + end + if entry.state == "landed" then + landed = landed + 1 + end + end + if failed then + setData.failed = true + failedSetIds[#failedSetIds + 1] = setId + elseif total > 0 and landed == total and setData.handoffClaimed then + setIds[#setIds + 1] = setId + else + setData.handoffClaimed = false + end + end + end + + self._c130DcAutoBatches[OwnerKey] = nil + + for _,setId in ipairs(failedSetIds) do + self:_C130DcAutoCleanupSet(setId, "failed") + end + + if #setIds < 1 then + return self + end + + table.sort(setIds) + local ok = self:_C130DcAutoSpawnBuildHelperForSets(OwnerKey, setIds) + if not ok then + for _,setId in ipairs(setIds) do + local setData = self._c130DcAutoSets and self._c130DcAutoSets[setId] or nil + if setData and not setData.failed then + setData.handoffClaimed = false + end + end + end + return self +end + +--- (Internal) Queue a ready set for merge-window handoff. +-- @param #CTLD self +-- @param #string SetId +-- @return #boolean Outcome +function CTLD:_C130DcAutoQueueReadySet(SetId) + local setData = self._c130DcAutoSets and self._c130DcAutoSets[SetId] or nil + if not setData or setData.failed then return false end + if setData.completed or setData.buildStarted or setData.handoffClaimed then return true end + + local ownerKey = self:_C130DcAutoGetOwnerKey(setData) or SetId + local window = tonumber(self.C130DynamicCargoAutoBuildMergeSeconds) or 10 + if window < 0 then + window = 0 + end + + setData.handoffClaimed = true + setData.readyAt = timer.getTime() + + local batch = self._c130DcAutoBatches[ownerKey] + if not batch then + batch = { + ownerKey = ownerKey, + setIds = {}, + created = timer.getTime(), + dueAt = timer.getTime() + window, + timer = nil + } + self._c130DcAutoBatches[ownerKey] = batch + end + batch.setIds[SetId] = true + + if window <= 0 then + self:_C130DcAutoFlushOwnerBatch(ownerKey) + return true + end + + if not batch.timer or (batch.timer.IsRunning and not batch.timer:IsRunning()) then + batch.timer = TIMER:New(CTLD._C130DcAutoFlushOwnerBatch, self, ownerKey) + batch.timer:Start(window) + self:T(self.lid.." C130DcAuto queue set "..SetId.." owner="..tostring(ownerKey).." merge="..tostring(window)) + else + self:T(self.lid.." C130DcAuto merge set "..SetId.." owner="..tostring(ownerKey)) + end + return true +end + +--- (Internal) Cleanup C-130 DynamicCargo auto-build set. +-- @param #CTLD self +-- @param #string SetId +-- @param #string Result +-- @return #CTLD self +function CTLD:_C130DcAutoCleanupSet(SetId, Result) + self:_C130DcAutoEnsureState() + local setData = self._c130DcAutoSets[SetId] + if not setData then return self end + + if setData.helperGroupName then + local helper = GROUP:FindByName(setData.helperGroupName) + if helper and helper:IsAlive() then + helper:Destroy(false) + end + end + + for _,entry in ipairs(setData.entries or {}) do + if entry.spawnName then + self._c130DcAutoMap[entry.spawnName] = nil + end + if entry.dynamicName then + self._c130DcAutoMap[entry.dynamicName] = nil + end + end + + local batchRemove = {} + for ownerKey,batch in pairs(self._c130DcAutoBatches or {}) do + if batch.setIds and batch.setIds[SetId] then + batch.setIds[SetId] = nil + if not next(batch.setIds) then + if batch.timer and batch.timer.IsRunning and batch.timer:IsRunning() then + batch.timer:Stop() + end + batchRemove[#batchRemove + 1] = ownerKey + end + end + end + for _,ownerKey in ipairs(batchRemove) do + self._c130DcAutoBatches[ownerKey] = nil + end + + self._c130DcAutoSets[SetId] = nil + self:T(self.lid.." C130DcAuto CleanupSet "..SetId.." result="..tostring(Result)) + return self +end + +--- (Internal) Try to complete a C-130 DynamicCargo auto-build set. +-- @param #CTLD self +-- @param #string SetId +-- @return #boolean Outcome +function CTLD:_C130DcAutoTryCompleteSet(SetId) + local setData = self._c130DcAutoSets and self._c130DcAutoSets[SetId] or nil + if not setData or setData.failed then return false end + if setData.completed or setData.buildStarted or setData.handoffClaimed then return true end + local total = 0 + local landed = 0 + for _,entry in ipairs(setData.entries or {}) do + total = total + 1 + if entry.state == "failed" then + setData.failed = true + self:_C130DcAutoCleanupSet(SetId, "failed") + return false + end + if entry.state == "landed" then + landed = landed + 1 + end + end + if total > 0 and landed == total then + return self:_C130DcAutoQueueReadySet(SetId) + end + return false +end + +--- (Internal) Handle DynamicCargoLoaded for mapped C-130 auto-build sets. +-- @param #CTLD self +-- @param Core.Event#EVENTDATA EventData +-- @return #boolean Handled +function CTLD:_C130DcAutoOnDynamicLoaded(EventData) + self:_C130DcAutoEnsureState() + local dcargo = EventData.IniDynamicCargo + if not dcargo then return false end + + local setData, entry = self:_C130DcAutoGetMappedEntry(EventData.IniDynamicCargoName) + if not setData or not entry then + setData, entry = self:_C130DcAutoResolveEntry(dcargo, false) + end + if not setData or not entry then + return false + end + + if not self:_C130DcAutoIsC130Event(dcargo) then + return false + end + + entry.state = "loaded" + entry.dynamicName = EventData.IniDynamicCargoName + self._c130DcAutoMap[EventData.IniDynamicCargoName] = { setId = setData.id, entryId = entry.id } + local unitName = self:_C130DcAutoGetCarrierUnitName(dcargo) + local groupName = self:_C130DcAutoGetCarrierGroupName(dcargo) + if unitName then setData.unitName = unitName end + if groupName then setData.groupName = groupName end + setData.ttl = timer.getTime() + 3600 + self:T(self.lid.." C130DcAuto mapped loaded "..EventData.IniDynamicCargoName.." set="..setData.id) + return true +end + +--- (Internal) Handle DynamicCargoUnloaded for mapped C-130 auto-build sets. +-- @param #CTLD self +-- @param Core.Event#EVENTDATA EventData +-- @return #boolean Handled +function CTLD:_C130DcAutoOnDynamicUnloaded(EventData) + self:_C130DcAutoEnsureState() + local dcargo = EventData.IniDynamicCargo + if not dcargo then return false end + + local setData, entry = self:_C130DcAutoGetMappedEntry(EventData.IniDynamicCargoName) + if not setData or not entry then + setData, entry = self:_C130DcAutoResolveEntry(dcargo, true) + end + if not setData or not entry then + return false + end + + if not self:_C130DcAutoIsC130Event(dcargo) then + return false + end + + if setData.completed or setData.buildStarted or setData.handoffClaimed then + return true + end + if entry.state == "landed" then + -- ignore duplicate unload notifications for already landed entry + return true + end + + if dcargo.IsDetached and not dcargo:IsDetached() then + return false + end + if dcargo.IsLandedStable and not dcargo:IsLandedStable() then + return false + end + if DYNAMICCARGO and DYNAMICCARGO.C130RequireAirborne and dcargo.WasAirborneTransport and not dcargo:WasAirborneTransport() then + return false + end + + entry.state = "landed" + entry.dynamicName = EventData.IniDynamicCargoName + self._c130DcAutoMap[EventData.IniDynamicCargoName] = { setId = setData.id, entryId = entry.id } + local dpos = dcargo.GetLastPosition and dcargo:GetLastPosition() or nil + if dpos then + entry.landedVec2 = dpos:GetVec2() + entry.landedVec3 = dpos:GetVec3() + end + self:_C130DcAutoCreateProxyCargo(setData, entry, dcargo) + setData.ttl = timer.getTime() + 3600 + self:T(self.lid.." C130DcAuto mapped unloaded "..EventData.IniDynamicCargoName.." set="..setData.id) + self:_C130DcAutoTryCompleteSet(setData.id) + return true +end + +--- (Internal) Handle DynamicCargoRemoved for mapped C-130 auto-build sets. +-- @param #CTLD self +-- @param Core.Event#EVENTDATA EventData +-- @return #boolean Handled +function CTLD:_C130DcAutoOnDynamicRemoved(EventData) + self:_C130DcAutoEnsureState() + local setData, entry = self:_C130DcAutoGetMappedEntry(EventData.IniDynamicCargoName) + if not setData or not entry then return false end + if entry.state ~= "landed" then + entry.state = "failed" + setData.failed = true + self:T(self.lid.." C130DcAuto entry failed/removed "..EventData.IniDynamicCargoName.." set="..setData.id) + self:_C130DcAutoCleanupSet(setData.id, "removed") + end + return true +end + +--- (Internal) C-130 DynamicCargo auto-build housekeeping tick. +-- @param #CTLD self +-- @return #CTLD self +function CTLD:_C130DcAutoTick() + self:_C130DcAutoEnsureState() + local now = timer.getTime() + local cleanup = {} + for setId,setData in pairs(self._c130DcAutoSets or {}) do + if setData.failed then + cleanup[#cleanup + 1] = { setId = setId, reason = "failed" } + elseif setData.completed then + if setData.cleanupAt and now >= setData.cleanupAt then + cleanup[#cleanup + 1] = { setId = setId, reason = "completed" } + end + elseif setData.ttl and now > setData.ttl then + cleanup[#cleanup + 1] = { setId = setId, reason = "ttl" } + end + end + for _,entry in ipairs(cleanup) do + self:_C130DcAutoCleanupSet(entry.setId, entry.reason) + end + return self +end + --- (Internal) Event handler function -- @param #CTLD self -- @param Core.Event#EVENTDATA EventData @@ -1703,6 +2587,12 @@ function CTLD:_EventHandler(EventData) -------------- elseif event.id == EVENTS.DynamicCargoLoaded then self:T(self.lid.."GC Loaded Event "..event.IniDynamicCargoName) + if self.UseC130LoadAndUnload and self.UseC130DynamicCargoAutoBuild then + local handled = self:_C130DcAutoOnDynamicLoaded(event) + if handled then + return self + end + end --------------- -- New dynamic cargo system Handling LOADING -------------- @@ -1738,6 +2628,12 @@ function CTLD:_EventHandler(EventData) -------------- elseif event.id == EVENTS.DynamicCargoUnloaded then self:T(self.lid.."GC Unload Event "..event.IniDynamicCargoName) + if self.UseC130LoadAndUnload and self.UseC130DynamicCargoAutoBuild then + local handled = self:_C130DcAutoOnDynamicUnloaded(event) + if handled then + return self + end + end --------------- -- New dynamic cargo system Handling UNLOADING -------------- @@ -1787,6 +2683,9 @@ function CTLD:_EventHandler(EventData) -------------- elseif event.id == EVENTS.DynamicCargoRemoved then self:T(self.lid.."GC Remove Event "..event.IniDynamicCargoName) + if self.UseC130LoadAndUnload and self.UseC130DynamicCargoAutoBuild then + self:_C130DcAutoOnDynamicRemoved(event) + end --------------- -- New dynamic cargo system Handling REMOVE -------------- @@ -3032,6 +3931,10 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack, quiet, suppress local fwZeroAngleSetHeading = nil local fwNonZeroAngleSetHeading = nil + local c130DcAutoSetId = nil + if not drop and not pack and self.UseC130LoadAndUnload and self.UseC130DynamicCargoAutoBuild and self:IsC130J(Unit) and self:_C130DcAutoIsBuildableCargo(cargotype) then + c130DcAutoSetId = self:_C130DcAutoRegisterSet(Group, Unit, cargotype, zone) + end for i = 1, number do local currentAngleOffset = 0 @@ -3217,6 +4120,10 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack, quiet, suppress end local CCat4, CType4, CShape4 = cargotype:GetStaticTypeAndShape() realcargo:SetStaticTypeAndShape(CCat4, CType4, CShape4) + if c130DcAutoSetId and realcargo then + self:_C130DcAutoRegisterDynamicCargo(realcargo:GetPositionable()) + self:_C130DcAutoRegisterEntry(c130DcAutoSetId, realcargo) + end table.insert(self.Spawned_Cargo, realcargo) end @@ -4392,7 +5299,8 @@ end -- @param Wrapper.Unit#UNIT Unit -- @param #boolean Engineering If true build is by an engineering team. -- @param #boolean MultiDrop If true and not engineering or FOB, vary position a bit. -function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop) +-- @param Wrapper.Group#GROUP NotifyGroup Optional group to receive engineer/autobuild messages. +function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop,NotifyGroup) self:T(self.lid .. " _BuildCrates") -- avoid users trying to build from flying Hercs if self:IsFixedWing(Unit) and self.enableFixedWing and not Engineering then @@ -4418,10 +5326,42 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop) local baseDist = self.CrateDistance or 35 local finddist=baseDist --if Engineering and self.EngineerSearch and self.EngineerSearch>baseDist then - if Engineering and self.EngineerSearch and self.EngineerSearch>baseDist then -- this make also helicopter to be able to crates that are further away due to herc airdrop + if Engineering and self.EngineerSearch and self.EngineerSearch>baseDist then -- this make also helicopter to be able to crates that are further away due to herc airdrop finddist=self.EngineerSearch end local crates,number = self:_FindCratesNearby(Group,Unit,finddist,true,true,not Engineering) -- #table + local activeSetId = Engineering and self._c130DcAutoActiveSetId or nil + local notifyGroup = (not Engineering) and Group or nil + if activeSetId then + crates, number = self:_C130DcAutoFilterCrates(crates, activeSetId) + local notifySetId = nil + if type(activeSetId) == "table" then + notifySetId = activeSetId[1] or next(activeSetId) + else + notifySetId = activeSetId + end + local setData = notifySetId and self._c130DcAutoSets and self._c130DcAutoSets[notifySetId] or nil + if setData and setData.groupName then + notifyGroup = GROUP:FindByName(setData.groupName) or notifyGroup + end + local scopeText = tostring(activeSetId) + if type(activeSetId) == "table" then + local ids = {} + for k,v in pairs(activeSetId) do + if type(k) == "number" then + ids[#ids + 1] = tostring(v) + else + ids[#ids + 1] = tostring(k) + end + end + table.sort(ids) + scopeText = table.concat(ids, ",") + end + self:T(self.lid.." C130DcAuto engineer scope set="..scopeText.." crates="..tostring(number)) + end + if NotifyGroup then + notifyGroup = NotifyGroup + end local buildables = {} local foundbuilds = false local canbuild = false @@ -4500,7 +5440,9 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop) report:Add("------------------------------------------------------------") local text = report:Text() if not Engineering then - self:_SendMessage(text, 30, true, Group,true) + self:_SendMessage(text, 30, true, notifyGroup or Group, true) + elseif notifyGroup then + self:_SendMessage(text, 30, true, notifyGroup,true) else self:T(text) end @@ -4523,6 +5465,9 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop) if full == 1 then local cratesNow, numberNow = self:_FindCratesNearby(Group,Unit, finddist,true,true, not Engineering) + if activeSetId then + cratesNow, numberNow = self:_C130DcAutoFilterCrates(cratesNow, activeSetId) + end self:_CleanUpCrates(cratesNow,build,numberNow) self:_RefreshLoadCratesMenu(Group,Unit) if self.buildtime and self.buildtime > 0 then @@ -4531,7 +5476,8 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop) if not notified then local msg = self.gettext:GetEntry("BUILD_STARTED",self.locale) msg = string.format(msg,self.buildtime) - self:_SendMessage(msg, 15, false, Group) + local startMsgGroup = (not Engineering and (notifyGroup or Group)) or notifyGroup + self:_SendMessage(msg, 15, false, startMsgGroup) --self:_SendMessage(string.format("Build started, ready in %d seconds!",self.buildtime),15,false,Group) notified=true end @@ -4543,6 +5489,9 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop) local start = -((full-1)*sep)/2 for n=1,full do local cratesNow, numberNow = self:_FindCratesNearby(Group,Unit, finddist,true,true, not Engineering) + if activeSetId then + cratesNow, numberNow = self:_C130DcAutoFilterCrates(cratesNow, activeSetId) + end self:_CleanUpCrates(cratesNow,build,numberNow) self:_RefreshLoadCratesMenu(Group,Unit) local off = start + (n-1)*sep @@ -4554,7 +5503,10 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop) if not notified then local msg = self.gettext:GetEntry("BUILD_STARTED",self.locale) msg = string.format(msg,self.buildtime) - self:_SendMessage(msg, 15, false, Group) + local startMsgGroup = (not Engineering and (notifyGroup or Group)) or notifyGroup + if startMsgGroup then + self:_SendMessage(msg, 15, false, startMsgGroup) + end --self:_SendMessage(string.format("Build started, ready in %d seconds!",self.buildtime),15,false,Group) notified=true end @@ -5746,7 +6698,7 @@ function CTLD:_RefreshLoadCratesMenu(Group,Unit) local label local loadkey = self.gettext:GetEntry("MENU_LOAD_SINGLE",self.locale) if left>=needed then - label=string.format("%d. %s %s",lineIndex,loadkey, cName) + label=string.format("%d. %s %s",lineIndex,loadkey,cName) i=i+needed else label=string.format("%d. %s %s (%d/%d)",lineIndex,loadkey, cName,left,needed) @@ -8843,6 +9795,19 @@ end self:HandleEvent(EVENTS.DynamicCargoRemoved, self._EventHandler) self:HandleEvent(EVENTS.Land, self._EventHandler) self:HandleEvent(EVENTS.Takeoff, self._EventHandler) + self:_C130DcAutoEnsureState() + self._c130DcAutoSets = {} + self._c130DcAutoMap = {} + self._c130DcAutoBatches = {} + self._c130DcAutoActiveSetId = nil + if self._c130DcAutoTimer and self._c130DcAutoTimer:IsRunning() then + self._c130DcAutoTimer:Stop() + end + self._c130DcAutoTimer = nil + if self.UseC130LoadAndUnload and self.UseC130DynamicCargoAutoBuild then + self._c130DcAutoTimer = TIMER:New(CTLD._C130DcAutoTick, self) + self._c130DcAutoTimer:Start(30, 30) + end self:__Status(-5) -- AutoSave @@ -8937,6 +9902,26 @@ end -- @return #CTLD self function CTLD:onafterStop(From, Event, To) self:T({From, Event, To}) + if self._c130DcAutoTimer and self._c130DcAutoTimer:IsRunning() then + self._c130DcAutoTimer:Stop() + end + self._c130DcAutoTimer = nil + local cleanup = {} + for setId,_ in pairs(self._c130DcAutoSets or {}) do + cleanup[#cleanup + 1] = setId + end + for _,setId in ipairs(cleanup) do + self:_C130DcAutoCleanupSet(setId, "stop") + end + for _,batch in pairs(self._c130DcAutoBatches or {}) do + if batch.timer and batch.timer.IsRunning and batch.timer:IsRunning() then + batch.timer:Stop() + end + end + self._c130DcAutoSets = {} + self._c130DcAutoMap = {} + self._c130DcAutoBatches = {} + self._c130DcAutoActiveSetId = nil self:UnHandleEvent(EVENTS.PlayerEnterAircraft) self:UnHandleEvent(EVENTS.PlayerEnterUnit) self:UnHandleEvent(EVENTS.PlayerLeaveUnit) diff --git a/Moose Development/Moose/Ops/CTLD_CARGO.lua b/Moose Development/Moose/Ops/CTLD_CARGO.lua index 3c39233d9..ca3ea6ba1 100644 --- a/Moose Development/Moose/Ops/CTLD_CARGO.lua +++ b/Moose Development/Moose/Ops/CTLD_CARGO.lua @@ -88,8 +88,8 @@ CTLD_CARGO = { -- @param #number PerCrateMass Mass in kg -- @param #number Stock Number of builds available, nil for unlimited -- @param #string Subcategory Name of subcategory, handy if using > 10 types to load. - -- @param #boolean DontShowInMenu Show this item in menu or not (default: false == show it). - -- @param Core.Zone#ZONE Location (optional) Where the cargo is available (one location only). + -- @param #boolean DontShowInMenu (Optional) Show this item in menu or not (default: false == show it). + -- @param Core.Zone#ZONE Location (Optional) Where the cargo is available (one location only). -- @return #CTLD_CARGO self function CTLD_CARGO:New(ID, Name, Templates, Sorte, HasBeenMoved, LoadDirectly, CratesNeeded, Positionable, Dropped, PerCrateMass, Stock, Subcategory, DontShowInMenu, Location) -- Inherit everything from BASE class. diff --git a/Moose Development/Moose/Ops/Chief.lua b/Moose Development/Moose/Ops/Chief.lua index 802c19621..d88d39955 100644 --- a/Moose Development/Moose/Ops/Chief.lua +++ b/Moose Development/Moose/Ops/Chief.lua @@ -362,8 +362,8 @@ CHIEF.version="0.7.1" --- Create a new CHIEF object and start the FSM. -- @param #CHIEF self -- @param #number Coalition Coalition side, e.g. `coaliton.side.BLUE`. Can also be passed as a string "red", "blue" or "neutral". --- @param Core.Set#SET_GROUP AgentSet Set of agents (groups) providing intel. Default is an empty set. --- @param #string Alias An *optional* alias how this object is called in the logs etc. +-- @param Core.Set#SET_GROUP AgentSet (Optional) Set of agents (groups) providing intel. Default is an empty set. +-- @param #string Alias (Optional) An *optional* alias how this object is called in the logs etc. -- @return #CHIEF self function CHIEF:New(Coalition, AgentSet, Alias) @@ -741,8 +741,8 @@ end --- Set a threat level range that will be engaged. Threat level is a number between 0 and 10, where 10 is a very dangerous threat. -- Targets with threat level 0 are usually harmless. -- @param #CHIEF self --- @param #number ThreatLevelMin Min threat level. Default 1. --- @param #number ThreatLevelMax Max threat level. Default 10. +-- @param #number ThreatLevelMin (Optional) Min threat level. Default 1. +-- @param #number ThreatLevelMax (Optional) Max threat level. Default 10. -- @return #CHIEF self function CHIEF:SetThreatLevelRange(ThreatLevelMin, ThreatLevelMax) @@ -784,10 +784,10 @@ end --- Create a new resource list of required assets. -- @param #CHIEF self -- @param #string MissionType The mission type. --- @param #number Nmin Min number of required assets. Default 1. --- @param #number Nmax Max number of requried assets. Default 1. --- @param #table Attributes Generalized attribute(s). Default `nil`. --- @param #table Properties DCS attribute(s). Default `nil`. +-- @param #number Nmin (Optional) Min number of required assets. Default 1. +-- @param #number Nmax (Optional) Max number of requried assets. Default 1. +-- @param #table Attributes (Optional) Generalized attribute(s). Default `nil`. +-- @param #table Properties (Optional) DCS attribute(s). Default `nil`. -- @param #table Categories Group categories. -- @return #CHIEF.Resources The newly created resource list table. -- @return #CHIEF.Resource The resource object that was added. @@ -804,8 +804,8 @@ end -- @param #CHIEF self -- @param #CHIEF.Resources Resource List of resources. -- @param #string MissionType Mission Type. --- @param #number Nmin Min number of required assets. Default 1. --- @param #number Nmax Max number of requried assets. Default equal `Nmin`. +-- @param #number Nmin (Optional) Min number of required assets. Default 1. +-- @param #number Nmax (Optional) Max number of requried assets. Default equal `Nmin`. -- @param #table Attributes Generalized attribute(s). -- @param #table Properties DCS attribute(s). Default `nil`. -- @param #table Categories Group categories. @@ -847,8 +847,8 @@ end --- Define which assets will be transported and define the number and attributes/properties of the cargo carrier assets. -- @param #CHIEF self -- @param #CHIEF.Resource Resource Resource table. --- @param #number Nmin Min number of required assets. Default 1. --- @param #number Nmax Max number of requried assets. Default is equal to `Nmin`. +-- @param #number Nmin (Optional) Min number of required assets. Default 1. +-- @param #number Nmax (Optional) Max number of requried assets. Default is equal to `Nmin`. -- @param #table CarrierAttributes Generalized attribute(s) of the carrier assets. -- @param #table CarrierProperties DCS attribute(s) of the carrier assets. -- @param #table CarrierCategories Group categories of the carrier assets. @@ -886,12 +886,12 @@ end --- Set number of assets requested for detected targets. -- @param #CHIEF self --- @param #number NassetsMin Min number of assets. Should be at least 1. Default 1. --- @param #number NassetsMax Max number of assets. Default is same as `NassetsMin`. --- @param #number ThreatLevel Only apply this setting if the target threat level is greater or equal this number. Default 0. +-- @param #number NassetsMin (Optional) Min number of assets. Should be at least 1. Default 1. +-- @param #number NassetsMax (Optional) Max number of assets. Default is same as `NassetsMin`. +-- @param #number ThreatLevel (Optional) Only apply this setting if the target threat level is greater or equal this number. Default 0. -- @param #string TargetCategory Only apply this setting if the target is of this category, e.g. `TARGET.Category.AIRCRAFT`. -- @param #string MissionType Only apply this setting for this mission type, e.g. `AUFTRAG.Type.INTERCEPT`. --- @param #string Nunits Only apply this setting if the number of enemy units is greater or equal this number. +-- @param #string Nunits (Optional) Only apply this setting if the number of enemy units is greater or equal this number. Defaults to 1. -- @param #string Defcon Only apply this setting if this defense condition is in place. -- @param #string Strategy Only apply this setting if this strategy is in currently. place. -- @return #CHIEF self @@ -1040,8 +1040,8 @@ end --- Set limit for number of total or specific missions to be executed simultaniously. -- @param #CHIEF self --- @param #number Limit Number of max. mission of this type. Default 10. --- @param #string MissionType Type of mission, e.g. `AUFTRAG.Type.BAI`. Default `"Total"` for total number of missions. +-- @param #number Limit (Optional) Number of max. mission of this type. Default 10. +-- @param #string MissionType (Optional) Type of mission, e.g. `AUFTRAG.Type.BAI`. Default `"Total"` for total number of missions. -- @return #CHIEF self function CHIEF:SetLimitMission(Limit, MissionType) self.commander:SetLimitMission(Limit, MissionType) @@ -1067,7 +1067,7 @@ end --- Set strategy. -- @param #CHIEF self --- @param #string Strategy Strategy. See @{#CHIEF.strategy}, e.g. `CHIEF.Strategy.DEFENSIVE` (default). +-- @param #string Strategy (Optional) Strategy. See @{#CHIEF.strategy}, e.g. `CHIEF.Strategy.DEFENSIVE` (default). -- @return #CHIEF self function CHIEF:SetStrategy(Strategy) @@ -1297,8 +1297,8 @@ end -- -- @param #CHIEF self -- @param Ops.OpsZone#OPSZONE OpsZone OPS zone object. --- @param #number Priority Priority. Default 50. --- @param #number Importance Importance. Default `#nil`. +-- @param #number Priority (Optional) Priority. Default 50. +-- @param #number Importance (Optional) Importance. Default `#nil`. -- @param #CHIEF.Resources ResourceOccupied (Optional) Resources used then zone is occupied by the enemy. -- @param #CHIEF.Resources ResourceEmpty (Optional) Resources used then zone is empty. -- @return #CHIEF.StrategicZone The strategic zone. @@ -1395,7 +1395,7 @@ end --- Remove strategically important zone. All runing missions are cancelled. -- @param #CHIEF self -- @param Ops.OpsZone#OPSZONE OpsZone OPS zone object. --- @param #number Delay Delay in seconds before the zone is removed. Default immidiately. +-- @param #number Delay (Optional) Delay in seconds before the zone is removed. Default immidiately. -- @return #CHIEF self function CHIEF:RemoveStrategicZone(OpsZone, Delay) @@ -1469,10 +1469,10 @@ end --- Add a CAP zone. Flights will engage detected targets inside this zone. -- @param #CHIEF self -- @param Core.Zone#ZONE Zone CAP Zone. Has to be a circular zone. --- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet. --- @param #number Speed Orbit speed in KIAS. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 30 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet. +-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts. +-- @param #number Heading(Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM. -- @return Ops.Airwing#AIRWING.PatrolZone The CAP zone data. function CHIEF:AddCapZone(Zone, Altitude, Speed, Heading, Leg) @@ -1485,10 +1485,10 @@ end --- Add a GCI CAP. -- @param #CHIEF self -- @param Core.Zone#ZONE Zone Zone, where the flight orbits. --- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet. --- @param #number Speed Orbit speed in KIAS. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 30 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet. +-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM. -- @return Ops.Airwing#AIRWING.PatrolZone The CAP zone data. function CHIEF:AddGciCapZone(Zone, Altitude, Speed, Heading, Leg) @@ -1512,10 +1512,10 @@ end --- Add an AWACS zone. -- @param #CHIEF self -- @param Core.Zone#ZONE Zone Zone. --- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet. --- @param #number Speed Orbit speed in KIAS. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 30 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet. +-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM. -- @return Ops.Airwing#AIRWING.PatrolZone The AWACS zone data. function CHIEF:AddAwacsZone(Zone, Altitude, Speed, Heading, Leg) @@ -1539,10 +1539,10 @@ end --- Add a refuelling tanker zone. -- @param #CHIEF self -- @param Core.Zone#ZONE Zone Zone. --- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet. --- @param #number Speed Orbit speed in KIAS. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 30 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet. +-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM. -- @param #number RefuelSystem Refuelling system. -- @return Ops.Airwing#AIRWING.TankerZone The tanker zone data. function CHIEF:AddTankerZone(Zone, Altitude, Speed, Heading, Leg, RefuelSystem) diff --git a/Moose Development/Moose/Ops/Cohort.lua b/Moose Development/Moose/Ops/Cohort.lua index 3bb75c370..8e0e1e834 100644 --- a/Moose Development/Moose/Ops/Cohort.lua +++ b/Moose Development/Moose/Ops/Cohort.lua @@ -109,8 +109,8 @@ _COHORTNAMES={} --- Create a new COHORT object and start the FSM. -- @param #COHORT self -- @param #string TemplateGroupName Name of the template group. --- @param #number Ngroups Number of asset groups of this Cohort. Default 3. --- @param #string CohortName Name of the cohort. +-- @param #number Ngroups (Optional) Number of asset groups of this Cohort. Default 3. +-- @param #string CohortName (Optional) Name of the cohort. Defaults to TemplateGroupName. -- @return #COHORT self function COHORT:New(TemplateGroupName, Ngroups, CohortName) @@ -357,7 +357,7 @@ end --- Set verbosity level. -- @param #COHORT self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #COHORT self function COHORT:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -366,8 +366,8 @@ end --- Set turnover and repair time. If an asset returns from a mission, it will need some time until the asset is available for further missions. -- @param #COHORT self --- @param #number MaintenanceTime Time in minutes it takes until a flight is combat ready again. Default is 0 min. --- @param #number RepairTime Time in minutes it takes to repair a flight for each life point taken. Default is 0 min. +-- @param #number MaintenanceTime (Optional) Time in minutes it takes until a flight is combat ready again. Default is 0 min. +-- @param #number RepairTime (Optional) Time in minutes it takes to repair a flight for each life point taken. Default is 0 min. -- @return #COHORT self function COHORT:SetTurnoverTime(MaintenanceTime, RepairTime) self.maintenancetime=MaintenanceTime and MaintenanceTime*60 or 0 @@ -377,8 +377,8 @@ end --- Set radio frequency and modulation the cohort uses. -- @param #COHORT self --- @param #number Frequency Radio frequency in MHz. Default 251 MHz. --- @param #number Modulation Radio modulation. Default 0=AM. +-- @param #number Frequency (Optional) Radio frequency in MHz. Default 251 MHz. +-- @param #number Modulation (Optional) Radio modulation. Default 0=AM. -- @return #COHORT self function COHORT:SetRadio(Frequency, Modulation) self.radioFreq=Frequency or 251 @@ -388,7 +388,7 @@ end --- Set number of units in groups. -- @param #COHORT self --- @param #number nunits Number of units. Default 2. +-- @param #number nunits (Optional) Number of units. Default 2. -- @return #COHORT self function COHORT:SetGrouping(nunits) self.ngrouping=nunits or 2 @@ -398,7 +398,7 @@ end --- Set mission types this cohort is able to perform. -- @param #COHORT self -- @param #table MissionTypes Table of mission types. Can also be passed as a #string if only one type. --- @param #number Performance Performance describing how good this mission can be performed. Higher is better. Default 50. Max 100. +-- @param #number Performance (Optional) Performance describing how good this mission can be performed. Higher is better. Default 50. Max 100. -- @return #COHORT self function COHORT:AddMissionCapability(MissionTypes, Performance) @@ -505,7 +505,7 @@ end --- Set max mission range. Only missions in a circle of this radius around the cohort base are executed. -- @param #COHORT self --- @param #number Range Range in NM. Default 150 NM. +-- @param #number Range (Optional) Range in NM. Default 150 NM. -- @return #COHORT self function COHORT:SetMissionRange(Range) self.engageRange=UTILS.NMToMeters(Range or 150) @@ -628,8 +628,8 @@ end --- Remove assets from pool. Not that assets must not be spawned or already reserved or requested. -- @param #COHORT self --- @param #number N Number of assets to be removed. Default 1. --- @param #number Delay Delay in seconds before assets are removed. +-- @param #number N (Optional) Number of assets to be removed. Default 1. +-- @param #number Delay (Optional) Delay in seconds before assets are removed. Defaults to 0. -- @return #COHORT self function COHORT:RemoveAssets(N, Delay) self:T2(self.lid..string.format("Remove %d assets of Cohort", N)) @@ -818,9 +818,9 @@ end --- Add a weapon range for ARTY missions (@{Ops.Auftrag#AUFTRAG}). -- @param #COHORT self --- @param #number RangeMin Minimum range in nautical miles. Default 0 NM. --- @param #number RangeMax Maximum range in nautical miles. Default 10 NM. --- @param #number BitType Bit mask of weapon type for which the given min/max ranges apply. Default is `ENUMS.WeaponFlag.Auto`, i.e. for all weapon types. +-- @param #number RangeMin (Optional) Minimum range in nautical miles. Default 0 NM. +-- @param #number RangeMax (Optional) Maximum range in nautical miles. Default 10 NM. +-- @param #number BitType (Optional) Bit mask of weapon type for which the given min/max ranges apply. Default is `ENUMS.WeaponFlag.Auto`, i.e. for all weapon types. -- @return #COHORT self function COHORT:AddWeaponRange(RangeMin, RangeMax, BitType) diff --git a/Moose Development/Moose/Ops/Commander.lua b/Moose Development/Moose/Ops/Commander.lua index da7d6c9d8..f4637b281 100644 --- a/Moose Development/Moose/Ops/Commander.lua +++ b/Moose Development/Moose/Ops/Commander.lua @@ -389,7 +389,7 @@ end --- Set verbosity level. -- @param #COMMANDER self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #COMMANDER self function COMMANDER:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -398,8 +398,8 @@ end --- Set limit for number of total or specific missions to be executed simultaniously. -- @param #COMMANDER self --- @param #number Limit Number of max. mission of this type. Default 10. --- @param #string MissionType Type of mission, e.g. `AUFTRAG.Type.BAI`. Default `"Total"` for total number of missions. +-- @param #number Limit (Optional) Number of max. mission of this type. Default 10. +-- @param #string MissionType (Optional) Type of mission, e.g. `AUFTRAG.Type.BAI`. Default `"Total"` for total number of missions. -- @return #COMMANDER self function COMMANDER:SetLimitMission(Limit, MissionType) MissionType=MissionType or "Total" @@ -664,10 +664,10 @@ end --- Add a CAP zone. -- @param #COMMANDER self -- @param Core.Zone#ZONE Zone CapZone Zone. --- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet. --- @param #number Speed Orbit speed in KIAS. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 30 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet. +-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM. -- @return Ops.Airwing#AIRWING.PatrolZone The CAP zone data. function COMMANDER:AddCapZone(Zone, Altitude, Speed, Heading, Leg) @@ -690,10 +690,10 @@ end --- Add a GCICAP zone. -- @param #COMMANDER self -- @param Core.Zone#ZONE Zone CapZone Zone. --- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet. --- @param #number Speed Orbit speed in KIAS. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 30 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet. +-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM. -- @return Ops.Airwing#AIRWING.PatrolZone The CAP zone data. function COMMANDER:AddGciCapZone(Zone, Altitude, Speed, Heading, Leg) @@ -736,10 +736,10 @@ end --- Add an AWACS zone. -- @param #COMMANDER self -- @param Core.Zone#ZONE Zone Zone. --- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet. --- @param #number Speed Orbit speed in KIAS. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 30 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet. +-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM. -- @return Ops.Airwing#AIRWING.PatrolZone The AWACS zone data. function COMMANDER:AddAwacsZone(Zone, Altitude, Speed, Heading, Leg) @@ -783,10 +783,10 @@ end --- Add a refuelling tanker zone. -- @param #COMMANDER self -- @param Core.Zone#ZONE Zone Zone. --- @param #number Altitude Orbit altitude in feet. Default is 12,000 feet. --- @param #number Speed Orbit speed in KIAS. Default 350 kts. --- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 30 NM. +-- @param #number Altitude (Optional) Orbit altitude in feet. Default is 12,000 feet. +-- @param #number Speed (Optional) Orbit speed in KIAS. Default 350 kts. +-- @param #number Heading (Optional) Heading of race-track pattern in degrees. Default 270 (East to West). +-- @param #number Leg (Optional) Length of race-track in NM. Default 30 NM. -- @param #number RefuelSystem Refuelling system. -- @return Ops.Airwing#AIRWING.TankerZone The tanker zone data. function COMMANDER:AddTankerZone(Zone, Altitude, Speed, Heading, Leg, RefuelSystem) @@ -851,10 +851,10 @@ end -- @param #COMMANDER self -- @param Ops.Cohort#COHORT Cohort The cohort to be relocated. -- @param Ops.Legion#LEGION Legion The legion where the cohort is relocated to. --- @param #number Delay Delay in seconds before relocation takes place. Default `nil`, *i.e.* ASAP. --- @param #number NcarriersMin Min number of transport carriers in case the troops should be transported. Default `nil` for no transport. +-- @param #number Delay (Optional) Delay in seconds before relocation takes place. Default `nil`, *i.e.* ASAP. +-- @param #number NcarriersMin (Optional) Min number of transport carriers in case the troops should be transported. Default `nil` for no transport. -- @param #number NcarriersMax Max number of transport carriers. --- @param #table TransportLegions Legion(s) assigned for transportation. Default is all legions of the commander. +-- @param #table TransportLegions (Optional) Legion(s) assigned for transportation. Default is all legions of the commander. -- @return #COMMANDER self function COMMANDER:RelocateCohort(Cohort, Legion, Delay, NcarriersMin, NcarriersMax, TransportLegions) @@ -1620,7 +1620,7 @@ end --- Set how many missions can be assigned in a single status iteration. (eg. This is useful for persistent missions where you need to load all AUFTRAGs on mission start and then change it back to default) --- Warning: Increasing this value will increase the number of missions started per iteration and thus may lead to performance issues if too many missions are started at once. -- @param #COMMANDER self --- @param #number Number of missions assigned per status iteration. Default is 1. +-- @param #number MaxMissionsAssignPerCycle (Optional) Number of missions assigned per status iteration. Default is 1. -- @return #COMMANDER self. function COMMANDER:SetMaxMissionsAssignPerCycle(MaxMissionsAssignPerCycle) self.maxMissionsAssignPerCycle = MaxMissionsAssignPerCycle or 1 @@ -2229,7 +2229,7 @@ end --- Get assets on given mission or missions. -- @param #COMMANDER self --- @param #table MissionTypes Types on mission to be checked. Default all. +-- @param #table MissionTypes (Optional) Types on mission to be checked. Default all. -- @return #table Assets on pending requests. function COMMANDER:GetAssetsOnMission(MissionTypes) diff --git a/Moose Development/Moose/Ops/EasyA2G.lua b/Moose Development/Moose/Ops/EasyA2G.lua index 96f3e6a0d..4764f809c 100644 --- a/Moose Development/Moose/Ops/EasyA2G.lua +++ b/Moose Development/Moose/Ops/EasyA2G.lua @@ -408,7 +408,7 @@ end --- Set Tanker and Scouts to be invisible to enemy AI eyes -- @param #EASYA2G self --- @param #boolean Switch Set to true or false, by default this is set to true already +-- @param #boolean Switch (Optional) Set to true or false, by default this is set to true already -- @return #EASYA2G self function EASYA2G:SetTankerAndScoutsInvisible(Switch) self:T(self.lid.."SetTankerAndScoutsInvisible") @@ -418,7 +418,7 @@ end --- Set default A2G Speed in knots -- @param #EASYA2G self --- @param #number Speed Speed defaults to 300 +-- @param #number Speed (Optional) Speed defaults to 300 -- @return #EASYA2G self function EASYA2G:SetDefaultA2GSpeed(Speed) self:T(self.lid.."SetDefaultSpeed") @@ -428,7 +428,7 @@ end --- Set A2G Flight formation. -- @param #EASYA2G self --- @param #number Formation Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group +-- @param #number Formation (Optional) Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group -- @return #EASYA2G self function EASYA2G:SetA2GFormation(Formation) self:T(self.lid.."SetA2GFormation") @@ -438,7 +438,7 @@ end --- Set default A2G Altitude in feet -- @param #EASYA2G self --- @param #number Altitude Altitude defaults to 25000 +-- @param #number Altitude (Optional) Altitude defaults to 25000 -- @return #EASYA2G self function EASYA2G:SetDefaultA2GAlt(Altitude) self:T(self.lid.."SetDefaultAltitude") @@ -448,7 +448,7 @@ end --- Set default A2G lieg initial direction in degrees -- @param #EASYA2G self --- @param #number Direction Direction defaults to 90 (East) +-- @param #number Direction (Optional) Direction defaults to 90 (East) -- @return #EASYA2G self function EASYA2G:SetDefaultA2GDirection(Direction) self:T(self.lid.."SetDefaultDirection") @@ -458,7 +458,7 @@ end --- Set default leg length in NM -- @param #EASYA2G self --- @param #number Leg Leg defaults to 5 +-- @param #number Leg (Optional) Leg defaults to 5 -- @return #EASYA2G self function EASYA2G:SetDefaultA2GLeg(Leg) self:T(self.lid.."SetDefaultLeg") @@ -468,7 +468,7 @@ end --- Set default grouping, i.e. how many airplanes per A2G point -- @param #EASYA2G self --- @param #number Grouping Grouping defaults to 2 +-- @param #number Grouping (Optional) Grouping defaults to 2 -- @return #EASYA2G self function EASYA2G:SetDefaultA2GGrouping(Grouping) self:T(self.lid.."SetDefaultA2GGrouping") @@ -489,7 +489,7 @@ end --- Set which target types A2G flights will prefer to engage, defaults to {"Ground"} -- @param #EASYA2G self --- @param #table types Table of comma separated #string entries, defaults to {"Ground"} (everything that is ground and is not a weapon). Useful other options are e.g. {"Armored vehicles"}, {"Tanks"}, +-- @param #table types (Optional) Table of comma separated #string entries, defaults to {"Ground"} (everything that is ground and is not a weapon). Useful other options are e.g. {"Armored vehicles"}, {"Tanks"}, -- or {"APC"} or combinations like {"APC", "Tanks", "Artillery"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes). -- @return #EASYA2G self function EASYA2G:SetA2GEngageTargetTypes(types) @@ -501,10 +501,10 @@ end -- @param #EASYA2G self -- @param #string AirbaseName Name of the Wing's airbase -- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone). --- @param #number Altitude Defaults to 25000 feet ASL. --- @param #number Speed Defaults to 300 knots TAS. --- @param #number Heading Defaults to 90 degrees (East). --- @param #number LegLength Defaults to 15 NM. +-- @param #number Altitude (Optional) Defaults to 25000 feet ASL. +-- @param #number Speed (Optional) Defaults to 300 knots TAS. +-- @param #number Heading (Optional) Defaults to 90 degrees (East). +-- @param #number LegLength (Optional) Defaults to 15 NM. -- @return #EASYA2G self function EASYA2G:AddHoldingPointA2G(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength) self:T(self.lid.."AddHoldingPointA2G")--..Coordinate:ToStringLLDDM()) diff --git a/Moose Development/Moose/Ops/EasyGCICAP.lua b/Moose Development/Moose/Ops/EasyGCICAP.lua index a1433f052..50bc14284 100644 --- a/Moose Development/Moose/Ops/EasyGCICAP.lua +++ b/Moose Development/Moose/Ops/EasyGCICAP.lua @@ -447,7 +447,7 @@ end --- Set "fuel low" threshold for CAP and INTERCEPT flights. -- @param #EASYGCICAP self --- @param #number Percent RTB if fuel at this percent. Values: 1..100, defaults to 25. +-- @param #number Percent (Optional) RTB if fuel at this percent. Values: 1..100, defaults to 25. -- @return #EASYGCICAP self function EASYGCICAP:SetFuelLow(Percent) self:T(self.lid.."SetFuelLow") @@ -470,7 +470,7 @@ end --- Set "fuel critical" threshold for CAP and INTERCEPT flights. -- @param #EASYGCICAP self --- @param #number Percent RTB if fuel at this percent. Values: 1..100, defaults to 10. +-- @param #number Percent (Optional) RTB if fuel at this percent. Values: 1..100, defaults to 10. -- @return #EASYGCICAP self function EASYGCICAP:SetFuelCritical(Percent) self:T(self.lid.."SetFuelCritical") @@ -480,7 +480,7 @@ end --- Set CAP formation. -- @param #EASYGCICAP self --- @param #number Formation Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group +-- @param #number Formation (Optional) Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group -- @return #EASYGCICAP self function EASYGCICAP:SetCAPFormation(Formation) self:T(self.lid.."SetCAPFormation") @@ -514,7 +514,7 @@ end --- Set Maximum of alive missions created by this instance to stop airplanes spamming the map -- @param #EASYGCICAP self --- @param #number Maxiumum Maxmimum number of parallel missions allowed. Count is Intercept-Missions + Alert5-Missions, default is 8 +-- @param #number Maxiumum (Optional) Maxmimum number of parallel missions allowed. Count is Intercept-Missions + Alert5-Missions, default is 8 -- @return #EASYGCICAP self function EASYGCICAP:SetMaxAliveMissions(Maxiumum) self:T(self.lid.."SetMaxAliveMissions") @@ -524,7 +524,7 @@ end --- Add default time to resurrect Airwing building if destroyed -- @param #EASYGCICAP self --- @param #number Seconds Seconds, defaults to 900 +-- @param #number Seconds (Optional) Seconds, defaults to 900 -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultResurrection(Seconds) self:T(self.lid.."SetDefaultResurrection") @@ -534,7 +534,7 @@ end --- Add default repeat attempts if an Intruder intercepts fails. -- @param #EASYGCICAP self --- @param #number Retries Retries, defaults to 3 +-- @param #number Retries (Optional) Retries, defaults to 3 -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultRepeatOnFailure(Retries) self:T(self.lid.."SetDefaultRepeatOnFailure") @@ -544,7 +544,7 @@ end --- Add default take off type for the airwings. -- @param #EASYGCICAP self --- @param #string Takeoff Can be "hot", "cold", or "air" - default is "hot". +-- @param #string Takeoff (Optional) Can be "hot", "cold", or "air" - default is "hot". -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultTakeOffType(Takeoff) self:T(self.lid.."SetDefaultTakeOffType") @@ -554,7 +554,7 @@ end --- Set default CAP Speed in knots -- @param #EASYGCICAP self --- @param #number Speed Speed defaults to 300 +-- @param #number Speed (Optional) Speed defaults to 300 -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultCAPSpeed(Speed) self:T(self.lid.."SetDefaultSpeed") @@ -564,7 +564,7 @@ end --- Set default CAP Altitude in feet -- @param #EASYGCICAP self --- @param #number Altitude Altitude defaults to 25000 +-- @param #number Altitude (Optional) Altitude defaults to 25000 -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultCAPAlt(Altitude) self:T(self.lid.."SetDefaultAltitude") @@ -574,7 +574,7 @@ end --- Set default CAP lieg initial direction in degrees -- @param #EASYGCICAP self --- @param #number Direction Direction defaults to 90 (East) +-- @param #number Direction (Optional) Direction defaults to 90 (East) -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultCAPDirection(Direction) self:T(self.lid.."SetDefaultDirection") @@ -584,7 +584,7 @@ end --- Set default leg length in NM -- @param #EASYGCICAP self --- @param #number Leg Leg defaults to 15 +-- @param #number Leg (Optional) Leg defaults to 15 -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultCAPLeg(Leg) self:T(self.lid.."SetDefaultLeg") @@ -594,7 +594,7 @@ end --- Set default grouping, i.e. how many airplanes per CAP point -- @param #EASYGCICAP self --- @param #number Grouping Grouping defaults to 2 +-- @param #number Grouping (Optional) Grouping defaults to 2 -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultCAPGrouping(Grouping) self:T(self.lid.."SetDefaultCAPGrouping") @@ -604,7 +604,7 @@ end --- Set default range planes can fly from their homebase in NM -- @param #EASYGCICAP self --- @param #number Range Range defaults to 100 NM +-- @param #number Range (Optional) Range defaults to 100 NM -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultMissionRange(Range) self:T(self.lid.."SetDefaultMissionRange") @@ -614,8 +614,8 @@ end --- Set default turnover times for squadrons in minutes -- @param #EASYGCICAP self --- @param #number MaintenanceTime Time in minutes it takes until a flight is combat ready again. Default is 5 min. --- @param #number RepairTime Time in minutes it takes to repair a flight for each life point taken. Default is 10 min. +-- @param #number MaintenanceTime (Optional) Time in minutes it takes until a flight is combat ready again. Default is 5 min. +-- @param #number RepairTime (Optional) Time in minutes it takes to repair a flight for each life point taken. Default is 10 min. -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultTurnoverTime(MaintenanceTime,RepairTime) self:T(self.lid.."SetDefaultTurnoverTime") @@ -626,7 +626,7 @@ end --- Set default number of airframes standing by for intercept tasks (visible on the airfield) -- @param #EASYGCICAP self --- @param #number Airframes defaults to 2 +-- @param #number Airframes (Optional) defaults to 2 -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultNumberAlert5Standby(Airframes) self:T(self.lid.."SetDefaultNumberAlert5Standby") @@ -636,7 +636,7 @@ end --- Set default engage range for intruders detected by CAP flights in NM. -- @param #EASYGCICAP self --- @param #number Range defaults to 50NM +-- @param #number Range (Optional) defaults to 50NM -- @return #EASYGCICAP self function EASYGCICAP:SetDefaultEngageRange(Range) self:T(self.lid.."SetDefaultEngageRange") @@ -689,7 +689,7 @@ end --- Set which target types CAP flights will prefer to engage, defaults to {"Air"} -- @param #EASYGCICAP self --- @param #table types Table of comma separated #string entries, defaults to {"Air"} (everything that flies and is not a weapon). Useful other options are e.g. {"Bombers"}, {"Fighters"}, +-- @param #table types (Optional) Table of comma separated #string entries, defaults to {"Air"} (everything that flies and is not a weapon). Useful other options are e.g. {"Bombers"}, {"Fighters"}, -- or {"Helicopters"} or combinations like {"Bombers", "Fighters", "UAVs"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes). -- @return #EASYGCICAP self function EASYGCICAP:SetCAPEngageTargetTypes(types) @@ -860,10 +860,10 @@ end -- @param #EASYGCICAP self -- @param #string AirbaseName Name of the Wing's airbase -- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone). --- @param #number Altitude Defaults to 25000 feet ASL. --- @param #number Speed Defaults to 300 knots TAS. --- @param #number Heading Defaults to 90 degrees (East). --- @param #number LegLength Defaults to 15 NM. +-- @param #number Altitude (Optional) Defaults to 25000 feet ASL. +-- @param #number Speed (Optional) Defaults to 300 knots TAS. +-- @param #number Heading (Optional) Defaults to 90 degrees (East). +-- @param #number LegLength(Optional) Defaults to 15 NM. -- @return #EASYGCICAP self function EASYGCICAP:AddPatrolPointCAP(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength) self:T(self.lid.."AddPatrolPointCAP")--..Coordinate:ToStringLLDDM()) @@ -891,10 +891,10 @@ end -- @param #EASYGCICAP self -- @param #string AirbaseName Name of the Wing's airbase -- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone). --- @param #number Altitude Defaults to 25000 feet. --- @param #number Speed Defaults to 300 knots. --- @param #number Heading Defaults to 90 degrees (East). --- @param #number LegLength Defaults to 15 NM. +-- @param #number Altitude (Optional) Defaults to 25000 feet. +-- @param #number Speed (Optional) Defaults to 300 knots. +-- @param #number Heading (Optional) Defaults to 90 degrees (East). +-- @param #number LegLength (Optional) Defaults to 15 NM. -- @return #EASYGCICAP self function EASYGCICAP:AddPatrolPointRecon(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength) self:T(self.lid.."AddPatrolPointRecon "..Coordinate:ToStringLLDDM()) @@ -916,10 +916,10 @@ end -- @param #EASYGCICAP self -- @param #string AirbaseName Name of the Wing's airbase -- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone). --- @param #number Altitude Defaults to 25000 feet. --- @param #number Speed Defaults to 300 knots. --- @param #number Heading Defaults to 90 degrees (East). --- @param #number LegLength Defaults to 15 NM. +-- @param #number Altitude (Optional) Defaults to 25000 feet. +-- @param #number Speed (Optional) Defaults to 300 knots. +-- @param #number Heading (Optional) Defaults to 90 degrees (East). +-- @param #number LegLength (Optional) Defaults to 15 NM. -- @return #EASYGCICAP self function EASYGCICAP:AddPatrolPointTanker(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength) self:T(self.lid.."AddPatrolPointTanker "..Coordinate:ToStringLLDDM()) @@ -941,10 +941,10 @@ end -- @param #EASYGCICAP self -- @param #string AirbaseName Name of the Wing's airbase -- @param Core.Point#COORDINATE Coordinate. Can be handed as a Core.Zone#ZONE object (e.g. in case you want the point to align with a moving zone). --- @param #number Altitude Defaults to 25000 feet. --- @param #number Speed Defaults to 300 knots. --- @param #number Heading Defaults to 90 degrees (East). --- @param #number LegLength Defaults to 15 NM. +-- @param #number Altitude (Optional) Defaults to 25000 feet. +-- @param #number Speed (Optional) Defaults to 300 knots. +-- @param #number Heading (Optional) Defaults to 90 degrees (East). +-- @param #number LegLength (Optional) Defaults to 15 NM. -- @return #EASYGCICAP self function EASYGCICAP:AddPatrolPointAwacs(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength) self:T(self.lid.."AddPatrolPointAwacs "..Coordinate:ToStringLLDDM()) diff --git a/Moose Development/Moose/Ops/FlightControl.lua b/Moose Development/Moose/Ops/FlightControl.lua index bc13affeb..e4e5175b8 100644 --- a/Moose Development/Moose/Ops/FlightControl.lua +++ b/Moose Development/Moose/Ops/FlightControl.lua @@ -359,11 +359,11 @@ FLIGHTCONTROL.version="0.7.7" --- Create a new FLIGHTCONTROL class object for an associated airbase. -- @param #FLIGHTCONTROL self -- @param #string AirbaseName Name of the airbase. --- @param #number Frequency Radio frequency in MHz. Default 143.00 MHz. Can also be given as a `#table` of multiple frequencies. --- @param #number Modulation Radio modulation: 0=AM (default), 1=FM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. Can also be given as a `#table` of multiple modulations. --- @param #string PathToSRS Path to the directory, where SRS is located. --- @param #number Port Port of SRS Server, defaults to 5002 --- @param #string GoogleKey Path to the Google JSON-Key. +-- @param #number Frequency (Optional) Radio frequency in MHz. Default 143.00 MHz. Can also be given as a `#table` of multiple frequencies. +-- @param #number Modulation (Optional) Radio modulation: 0=AM (default), 1=FM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. Can also be given as a `#table` of multiple modulations. +-- @param #string PathToSRS (Optional) Path to the directory, where SRS is located. +-- @param #number Port (Optional) Port of SRS Server, defaults to 5002 +-- @param #string GoogleKey (Optional) Path to the Google JSON-Key. -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port, GoogleKey) @@ -570,7 +570,7 @@ end --- Set verbosity level. -- @param #FLIGHTCONTROL self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -620,8 +620,8 @@ end --- Set the tower frequency. -- @param #FLIGHTCONTROL self --- @param #number Frequency Frequency in MHz. Default 305 MHz. --- @param #number Modulation Modulation `radio.modulation.AM`=0, `radio.modulation.FM`=1. Default `radio.modulation.AM`. +-- @param #number Frequency (Optional) Frequency in MHz. Default 305 MHz. +-- @param #number Modulation (Optional) Modulation `radio.modulation.AM`=0, `radio.modulation.FM`=1. Default `radio.modulation.AM`. -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetFrequency(Frequency, Modulation) @@ -643,7 +643,7 @@ end --- Set the SRS server port. -- @param #FLIGHTCONTROL self --- @param #number Port Port to be used. Defaults to 5002. +-- @param #number Port (Optional) Port to be used. Defaults to 5002. -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetSRSPort(Port) self.Port = Port or 5002 @@ -653,13 +653,13 @@ end --- Set SRS options for a given MSRS object. -- @param #FLIGHTCONTROL self -- @param Sound.SRS#MSRS msrs Moose SRS object. --- @param #string Gender Gender: "male" or "female" (default). --- @param #string Culture Culture, e.g. "en-GB" (default). +-- @param #string Gender (Optional) Gender: "male" or "female" (default). +-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default). -- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. --- @param #number Volume Volume. Default 1.0. +-- @param #number Volume (Optional) Volume. Default 1.0. -- @param #string Label Name under which SRS transmits. --- @param #string PathToGoogleCredentials Path to google credentials json file. --- @param #number Port Server port for SRS +-- @param #string PathToGoogleCredentials (Optional) Path to google credentials json file. +-- @param #number Port (Optional) Server port for SRS. Defaults to 5002. -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:_SetSRSOptions(msrs, Gender, Culture, Voice, Volume, Label, PathToGoogleCredentials, Port) @@ -683,11 +683,11 @@ end --- Set SRS options for tower voice. -- @param #FLIGHTCONTROL self --- @param #string Gender Gender: "male" or "female" (default). --- @param #string Culture Culture, e.g. "en-GB" (default). +-- @param #string Gender (Optional) Gender: "male" or "female" (default). +-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default). -- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. See [Google Voices](https://cloud.google.com/text-to-speech/docs/voices). --- @param #number Volume Volume. Default 1.0. --- @param #string Label Name under which SRS transmits. Default `self.alias`. +-- @param #number Volume (Optional) Volume. Default 1.0. +-- @param #string Label (Optional) Name under which SRS transmits. Default `self.alias`. -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetSRSTower(Gender, Culture, Voice, Volume, Label) @@ -700,11 +700,11 @@ end --- Set SRS options for pilot voice. -- @param #FLIGHTCONTROL self --- @param #string Gender Gender: "male" (default) or "female". --- @param #string Culture Culture, e.g. "en-US" (default). +-- @param #string Gender (Optional) Gender: "male" (default) or "female". +-- @param #string Culture (Optional) Culture, e.g. "en-US" (default). -- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. --- @param #number Volume Volume. Default 1.0. --- @param #string Label Name under which SRS transmits. Default "Pilot". +-- @param #number Volume (Optional) Volume. Default 1.0. +-- @param #string Label (Optional) Name under which SRS transmits. Default "Pilot". -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetSRSPilot(Gender, Culture, Voice, Volume, Label) @@ -726,8 +726,8 @@ end -- in cases where simultaneous takeoffs and landings are unproblematic. Note that only because there are multiple runways, it does not mean the AI uses them. -- -- @param #FLIGHTCONTROL self --- @param #number Nlanding Max number of aircraft landing simultaneously. Default 2. --- @param #number Ntakeoff Allowed number of aircraft taking off for groups to get landing clearance. Default 0. +-- @param #number Nlanding (Optional) Max number of aircraft landing simultaneously. Default 2. +-- @param #number Ntakeoff (Optional) Allowed number of aircraft taking off for groups to get landing clearance. Default 0. -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetLimitLanding(Nlanding, Ntakeoff) @@ -740,7 +740,7 @@ end --- Set time interval between landing clearance of groups. -- @param #FLIGHTCONTROL self --- @param #number dt Time interval in seconds. Default 180 sec (3 min). +-- @param #number dt (Optional) Time interval in seconds. Default 180 sec (3 min). -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetLandingInterval(dt) @@ -763,9 +763,9 @@ end -- NOTE that human players are *not* restricted as they should behave better (hopefully) than the AI. -- -- @param #FLIGHTCONTROL self --- @param #number Ntaxi Max number of groups allowed to taxi. Default 2. +-- @param #number Ntaxi (Optional) Max number of groups allowed to taxi. Default 2. -- @param #boolean IncludeInbound If `true`, the above --- @param #number Nlanding Max number of landing flights. Default 0. +-- @param #number Nlanding (Optional) Max number of landing flights. Default 0. -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetLimitTaxi(Ntaxi, IncludeInbound, Nlanding) @@ -783,10 +783,10 @@ end -- @param #FLIGHTCONTROL self -- @param Core.Zone#ZONE ArrivalZone Zone where planes arrive. -- @param #number Heading Heading in degrees. --- @param #number Length Length in nautical miles. Default 15 NM. --- @param #number FlightlevelMin Min flight level. Default 5. --- @param #number FlightlevelMax Max flight level. Default 15. --- @param #number Prio Priority. Lower is higher. Default 50. +-- @param #number Length (Optional) Length in nautical miles. Default 15 NM. +-- @param #number FlightlevelMin (Optional) Min flight level. Default 5. +-- @param #number FlightlevelMax (Optional) Max flight level. Default 15. +-- @param #number Prio (Optional) Priority. Lower is higher. Default 50. -- @return #FLIGHTCONTROL.HoldingPattern Holding pattern table. function FLIGHTCONTROL:AddHoldingPattern(ArrivalZone, Heading, Length, FlightlevelMin, FlightlevelMax, Prio) @@ -946,7 +946,7 @@ end -- Note that this is the time, the DCS engine uses not something we can control on a user level or we could get via scripting. -- You need to input the value. On the DCS forum it was stated that this is currently one hour. Hence this is the default value. -- @param #FLIGHTCONTROL self --- @param #number RepairTime Time in seconds until the runway is repaired. Default 3600sec (one hour). +-- @param #number RepairTime (Optional) Time in seconds until the runway is repaired. Default 3600sec (one hour). -- @return #FLIGHTCONTROL self function FLIGHTCONTROL:SetRunwayRepairtime(RepairTime) self.runwayrepairtime=RepairTime or 3600 @@ -2020,7 +2020,7 @@ end -- @param #FLIGHTCONTROL self -- @param #string Status Return only flights in this flightcontrol status, e.g. `FLIGHTCONTROL.Status.XXX`. -- @param #string GroupStatus Return only flights in this FSM status, e.g. `OPSGROUP.GroupStatus.TAXIING`. --- @param #boolean AI If `true` only AI flights are returned. If `false`, only flights with clients are returned. If `nil` (default), all flights are returned. +-- @param #boolean AI (Optional) If `true` only AI flights are returned. If `false`, only flights with clients are returned. If `nil` (default), all flights are returned. -- @return #table Table of flights. function FLIGHTCONTROL:GetFlights(Status, GroupStatus, AI) @@ -2054,7 +2054,7 @@ end -- @param #FLIGHTCONTROL self -- @param #string Status Return only flights in this status. -- @param #string GroupStatus Count only flights in this FSM status, e.g. `OPSGROUP.GroupStatus.TAXIING`. --- @param #boolean AI If `true` only AI flights are counted. If `false`, only flights with clients are counted. If `nil` (default), all flights are counted. +-- @param #boolean AI (Optional) If `true` only AI flights are counted. If `false`, only flights with clients are counted. If `nil` (default), all flights are counted. -- @return #number Number of flights. function FLIGHTCONTROL:CountFlights(Status, GroupStatus, AI) @@ -2101,7 +2101,7 @@ end --- Get the name of the active runway. -- @param #FLIGHTCONTROL self --- @param #boolean Takeoff If true, return takeoff runway name. Default is landing. +-- @param #boolean Takeoff (Optional) If true, return takeoff runway name. Default is landing. -- @return #string Runway text, e.g. "31L" or "09". function FLIGHTCONTROL:GetActiveRunwayText(Takeoff) @@ -2243,7 +2243,7 @@ end --- Set parking spot to RESERVED and update F10 marker. -- @param #FLIGHTCONTROL self -- @param Wrapper.Airbase#AIRBASE.ParkingSpot spot The parking spot data table. --- @param #string unitname Name of the unit occupying the spot. Default "unknown". +-- @param #string unitname (Optional) Name of the unit occupying the spot. Default "unknown". function FLIGHTCONTROL:SetParkingReserved(spot, unitname) -- Get spot. @@ -2263,7 +2263,7 @@ end --- Set parking spot to OCCUPIED and update F10 marker. -- @param #FLIGHTCONTROL self -- @param Wrapper.Airbase#AIRBASE.ParkingSpot spot The parking spot data table. --- @param #string unitname Name of the unit occupying the spot. Default "unknown". +-- @param #string unitname (Optional) Name of the unit occupying the spot. Default "unknown". function FLIGHTCONTROL:SetParkingOccupied(spot, unitname) -- Get spot. @@ -4351,7 +4351,7 @@ end -- @param #FLIGHTCONTROL self -- @param #string Text The text to transmit. -- @param Ops.FlightGroup#FLIGHTGROUP Flight The flight. --- @param #number Delay Delay in seconds before the text is transmitted. Default 0 sec. +-- @param #number Delay (Optional) Delay in seconds before the text is transmitted. Default 0 sec. function FLIGHTCONTROL:TransmissionTower(Text, Flight, Delay) if self.radioOnlyIfPlayers==true and self.Nplayers==0 then @@ -4387,7 +4387,7 @@ end -- @param #FLIGHTCONTROL self -- @param #string Text The text to transmit. -- @param Ops.FlightGroup#FLIGHTGROUP Flight The flight. --- @param #number Delay Delay in seconds before the text is transmitted. Default 0 sec. +-- @param #number Delay (Optional) Delay in seconds before the text is transmitted. Default 0 sec. function FLIGHTCONTROL:TransmissionPilot(Text, Flight, Delay) if self.radioOnlyIfPlayers==true and self.Nplayers==0 then @@ -4445,9 +4445,9 @@ end -- @param #FLIGHTCONTROL self -- @param #string Text The text to transmit. -- @param Ops.FlightGroup#FLIGHTGROUP Flight The flight. --- @param #number Duration Duration in seconds. Default 5. +-- @param #number Duration (Optional) Duration in seconds. Default 5. -- @param #boolean Clear Clear screen. --- @param #number Delay Delay in seconds before the text is transmitted. Default 0 sec. +-- @param #number Delay (Optional) Delay in seconds before the text is transmitted. Default 0 sec. function FLIGHTCONTROL:TextMessageToFlight(Text, Flight, Duration, Clear, Delay) if Delay and Delay>0 then @@ -4591,8 +4591,8 @@ end --- [User] Set callsign options for TTS output. See @{Wrapper.Group#GROUP.GetCustomCallSign}() on how to set customized callsigns. -- @param #FLIGHTCONTROL self --- @param #boolean ShortCallsign If true, only call out the major flight number. Default = `true`. --- @param #boolean Keepnumber If true, keep the **customized callsign** in the #GROUP name for players as-is, no amendments or numbers. Default = `true`. +-- @param #boolean ShortCallsign (Optional) If true, only call out the major flight number. Default = `true`. +-- @param #boolean Keepnumber (Optional) If true, keep the **customized callsign** in the #GROUP name for players as-is, no amendments or numbers. Default = `true`. -- @param #table CallsignTranslations (optional) Table to translate between DCS standard callsigns and bespoke ones. Does not apply if using customized -- callsigns from playername or group name. -- @return #FLIGHTCONTROL self diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index 86a2be4a0..916739b66 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -837,7 +837,7 @@ end --- Set if group is ready for taxi/takeoff if controlled by a `FLIGHTCONTROL`. -- @param #FLIGHTGROUP self -- @param #boolean ReadyTO If `true`, flight is ready for takeoff. --- @param #number Delay Delay in seconds before value is set. Default 0 sec. +-- @param #number Delay (Optional) Delay in seconds before value is set. Default 0 sec. -- @return #FLIGHTGROUP self function FLIGHTGROUP:SetReadyForTakeoff(ReadyTO, Delay) if Delay and Delay>0 then @@ -922,7 +922,7 @@ end --- Set low fuel threshold. Triggers event "FuelLow" and calls event function "OnAfterFuelLow". -- @param #FLIGHTGROUP self --- @param #number threshold Fuel threshold in percent. Default 25 %. +-- @param #number threshold (Optional) Fuel threshold in percent. Default 25 %. -- @return #FLIGHTGROUP self function FLIGHTGROUP:SetFuelLowThreshold(threshold) self.fuellowthresh=threshold or 25 @@ -983,7 +983,7 @@ end --- Set fuel critical threshold. Triggers event "FuelCritical" and event function "OnAfterFuelCritical". -- @param #FLIGHTGROUP self --- @param #number threshold Fuel threshold in percent. Default 10 %. +-- @param #number threshold (Optional) Fuel threshold in percent. Default 10 %. -- @return #FLIGHTGROUP self function FLIGHTGROUP:SetFuelCriticalThreshold(threshold) self.fuelcriticalthresh=threshold or 10 @@ -2629,8 +2629,8 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last. --- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint. +-- @param #number n (Optional) Next waypoint index. Default is the one coming after that one that has been passed last. +-- @param #number N(Optional) Waypoint Max waypoint index to be included in the route. Default is the final waypoint. -- @return #boolean Transision allowed? function FLIGHTGROUP:onbeforeUpdateRoute(From, Event, To, n, N) @@ -2752,8 +2752,8 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param #number n Next waypoint index. Default is the one coming after that one that has been passed last. --- @param #number N Waypoint Max waypoint index to be included in the route. Default is the final waypoint. +-- @param #number n (Optional) Next waypoint index. Default is the one coming after that one that has been passed last. +-- @param #number N (Optional) Waypoint Max waypoint index to be included in the route. Default is the final waypoint. function FLIGHTGROUP:onafterUpdateRoute(From, Event, To, n, N) -- Update route from this waypoint number onwards. @@ -3100,9 +3100,9 @@ end -- @param #string Event Event. -- @param #string To To state. -- @param Wrapper.Airbase#AIRBASE airbase The airbase to hold at. --- @param #number SpeedTo Speed used for traveling from current position to holding point in knots. Default 75% of max speed. --- @param #number SpeedHold Holding speed in knots. Default 250 kts. --- @param #number SpeedLand Landing speed in knots. Default 170 kts. +-- @param #number SpeedTo (Optional) Speed used for traveling from current position to holding point in knots. Default 75% of max speed. +-- @param #number SpeedHold (Optional) Holding speed in knots. Default 250 kts. +-- @param #number SpeedLand (Optional) Landing speed in knots. Default 170 kts. function FLIGHTGROUP:onafterRTB(From, Event, To, airbase, SpeedTo, SpeedHold, SpeedLand) -- Debug info. @@ -3195,9 +3195,9 @@ end --- Land at an airbase. -- @param #FLIGHTGROUP self -- @param Wrapper.Airbase#AIRBASE airbase Airbase where the group shall land. --- @param #number SpeedTo Speed used for travelling from current position to holding point in knots. --- @param #number SpeedHold Holding speed in knots. --- @param #number SpeedLand Landing speed in knots. Default 170 kts. +-- @param #number (Optional) SpeedTo Speed used for travelling from current position to holding point in knots. Defaults to speedCruise. +-- @param #number (Optional) SpeedHold Holding speed in knots. Defaults to 250kts. +-- @param #number (Optional) SpeedLand Landing speed in knots. Default 170 kts. function FLIGHTGROUP:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand) -- Set current airbase. @@ -3381,9 +3381,9 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param #number Duration Duration how long the group will be waiting in seconds. Default `nil` (=forever). --- @param #number Altitude Altitude in feet. Default 10,000 ft for airplanes and 1,000 feet for helos. --- @param #number Speed Speed in knots. Default 250 kts for airplanes and 20 kts for helos. +-- @param #number Duration (Optional) Duration how long the group will be waiting in seconds. Default `nil` (=forever). +-- @param #number Altitude (Optional) Altitude in feet. Default 10,000 ft for airplanes and 1,000 feet for helos. +-- @param #number Speed (Optional) Speed in knots. Default 250 kts for airplanes and 20 kts for helos. function FLIGHTGROUP:onbeforeWait(From, Event, To, Duration, Altitude, Speed) local allowed=true @@ -3417,9 +3417,9 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param #number Duration Duration how long the group will be waiting in seconds. Default `nil` (=forever). --- @param #number Altitude Altitude in feet. Default 10,000 ft for airplanes and 1,000 feet for helos. --- @param #number Speed Speed in knots. Default 250 kts for airplanes and 20 kts for helos. +-- @param #number Duration (Optional) Duration how long the group will be waiting in seconds. Default `nil` (=forever). +-- @param #number Altitude (Optional) Altitude in feet. Default 10,000 ft for airplanes and 1,000 feet for helos. +-- @param #number Speed (Optional) Speed in knots. Default 250 kts for airplanes and 20 kts for helos. function FLIGHTGROUP:onafterWait(From, Event, To, Duration, Altitude, Speed) -- Group will orbit at its current position. @@ -3696,8 +3696,8 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param Core.Point#COORDINATE Coordinate The coordinate where to land. Default is current position. --- @param #number Duration The duration in seconds to remain on ground. Default 600 sec (10 min). +-- @param Core.Point#COORDINATE (Optional) Coordinate The coordinate where to land. Default is current position. +-- @param #number Duration (Optional) The duration in seconds to remain on ground. Default 600 sec (10 min). function FLIGHTGROUP:onbeforeLandAt(From, Event, To, Coordinate, Duration) return self.isHelo end @@ -3707,8 +3707,8 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param Core.Point#COORDINATE Coordinate The coordinate where to land. Default is current position. --- @param #number Duration The duration in seconds to remain on ground. Default `nil` = forever. +-- @param Core.Point#COORDINATE (Optional) Coordinate The coordinate where to land. Default is current position. +-- @param #number Duration (Optional) The duration in seconds to remain on ground. Default `nil` = forever. function FLIGHTGROUP:onafterLandAt(From, Event, To, Coordinate, Duration) -- Duration. @@ -3879,8 +3879,8 @@ end --- Initialize group parameters. Also initializes waypoints if self.waypoints is nil. -- @param #FLIGHTGROUP self --- @param #table Template Template used to init the group. Default is `self.template`. --- @param #number Delay Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous. +-- @param #table Template (Optional) Template used to init the group. Default is `self.template`. +-- @param #number Delay (Optional) Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous. -- @return #FLIGHTGROUP self function FLIGHTGROUP:_InitGroup(Template, Delay) @@ -4040,7 +4040,7 @@ end --- Find the nearest friendly airbase (same or neutral coalition). -- @param #FLIGHTGROUP self --- @param #number Radius Search radius in NM. Default 50 NM. +-- @param #number Radius (Optional) Search radius in NM. Default 50 NM. -- @return Wrapper.Airbase#AIRBASE Closest tanker group #nil. function FLIGHTGROUP:FindNearestAirbase(Radius) @@ -4075,7 +4075,7 @@ end --- Find the nearest tanker. -- @param #FLIGHTGROUP self --- @param #number Radius Search radius in NM. Default 50 NM. +-- @param #number Radius (Optional) Search radius in NM. Default 50 NM. -- @return Wrapper.Group#GROUP Closest tanker group or `nil` if no tanker is in the given radius. function FLIGHTGROUP:FindNearestTanker(Radius) @@ -4226,7 +4226,7 @@ end --- Check if the final waypoint is in the air. -- @param #FLIGHTGROUP self --- @param #table wp Waypoint. Default final waypoint. +-- @param #table wp (Optional) Waypoint. Default final waypoint. -- @return #boolean If `true` final waypoint is a turning or flyover but not a landing type waypoint. function FLIGHTGROUP:IsLandingAir(wp) @@ -4247,7 +4247,7 @@ end --- Check if the final waypoint is at an airbase. -- @param #FLIGHTGROUP self --- @param #table wp Waypoint. Default final waypoint. +-- @param #table wp (Optional) Waypoint. Default final waypoint. -- @return #boolean If `true`, final waypoint is a landing waypoint at an airbase. function FLIGHTGROUP:IsLandingAirbase(wp) @@ -4270,10 +4270,10 @@ end --- Add an AIR waypoint to the flight plan. -- @param #FLIGHTGROUP self -- @param Core.Point#COORDINATE Coordinate The coordinate of the waypoint. Use COORDINATE:SetAltitude(altitude) to define the altitude. --- @param #number Speed Speed in knots. Default is cruise speed. --- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint. --- @param #number Altitude Altitude in feet. Default is y-component of Coordinate. Note that these altitudes are wrt to sea level (barometric altitude). --- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call. +-- @param #number Speed (Optional) Speed in knots. Default is cruise speed. +-- @param #number AfterWaypointWithID (Optional) Insert waypoint after waypoint given ID. Default is to insert as last waypoint. +-- @param #number Altitude (Optional) Altitude in feet. Default is y-component of Coordinate. Note that these altitudes are wrt to sea level (barometric altitude). +-- @param #boolean Updateroute (Optional) If true or nil, call UpdateRoute. If false, no call. -- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table. function FLIGHTGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Altitude, Updateroute) @@ -4323,10 +4323,10 @@ end --- Add an LANDING waypoint to the flight plan. -- @param #FLIGHTGROUP self -- @param Wrapper.Airbase#AIRBASE Airbase The airbase where the group should land. --- @param #number Speed Speed in knots. Default 350 kts. --- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint. --- @param #number Altitude Altitude in feet. Default is y-component of Coordinate. Note that these altitudes are wrt to sea level (barometric altitude). --- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call. +-- @param #number Speed (Optional) Speed in knots. Default 350 kts. +-- @param #number AfterWaypointWithID (Optional) Insert waypoint after waypoint given ID. Default is to insert as last waypoint. +-- @param #number Altitude (Optional) Altitude in feet. Default is y-component of Coordinate. Note that these altitudes are wrt to sea level (barometric altitude). +-- @param #boolean Updateroute (Optional) If true or nil, call UpdateRoute. If false, no call. -- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table. function FLIGHTGROUP:AddWaypointLanding(Airbase, Speed, AfterWaypointWithID, Altitude, Updateroute) @@ -4541,7 +4541,7 @@ end --- Returns the parking spot of the element. -- @param #FLIGHTGROUP self -- @param Ops.OpsGroup#OPSGROUP.Element element Element of the flight group. --- @param #number maxdist Distance threshold in meters. Default 5 m. +-- @param #number maxdist (Optional) Distance threshold in meters. Default 5 m. -- @param Wrapper.Airbase#AIRBASE airbase (Optional) The airbase to check for parking. Default is closest airbase to the element. -- @return Wrapper.Airbase#AIRBASE.ParkingSpot Parking spot or nil if no spot is within distance threshold. function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase) diff --git a/Moose Development/Moose/Ops/Flotilla.lua b/Moose Development/Moose/Ops/Flotilla.lua index adc13b73e..449aa61cc 100644 --- a/Moose Development/Moose/Ops/Flotilla.lua +++ b/Moose Development/Moose/Ops/Flotilla.lua @@ -56,7 +56,7 @@ FLOTILLA.version="0.1.0" --- Create a new FLOTILLA object and start the FSM. -- @param #FLOTILLA self -- @param #string TemplateGroupName Name of the template group. --- @param #number Ngroups Number of asset groups of this flotilla. Default 3. +-- @param #number Ngroups (Optional) Number of asset groups of this flotilla. Default 3. -- @param #string FlotillaName Name of the flotilla. Must be **unique**! -- @return #FLOTILLA self function FLOTILLA:New(TemplateGroupName, Ngroups, FlotillaName) diff --git a/Moose Development/Moose/Ops/Intelligence.lua b/Moose Development/Moose/Ops/Intelligence.lua index 173abfcdc..e18e331f8 100644 --- a/Moose Development/Moose/Ops/Intelligence.lua +++ b/Moose Development/Moose/Ops/Intelligence.lua @@ -411,8 +411,8 @@ end --- Set to accept accoustic detection. -- @param #INTEL self --- @param #number Radius Radius in which we can "hear" units. Defaults to 1000 meters. --- @param #table UnitCategories Set what Unit Categories we can "hear". Defaults to `{Unit.Category.GROUND_UNIT,Unit.Category.HELICOPTER}` +-- @param #number Radius (Optional) Radius in which we can "hear" units. Defaults to 1000 meters. +-- @param #table UnitCategories(Optional) Set what Unit Categories we can "hear". Defaults to `{Unit.Category.GROUND_UNIT,Unit.Category.HELICOPTER}` -- @return #INTEL self function INTEL:SetAccousticDetectionOn(Radius,UnitCategories) self.DetectAccoustic = true @@ -572,7 +572,7 @@ end -- Previously known contacts that are not detected any more, are "lost" after this time. -- This avoids fast oscillations between a contact being detected and undetected. -- @param #INTEL self --- @param #number TimeInterval Time interval in seconds. Default is 120 sec. +-- @param #number TimeInterval (Optional) Time interval in seconds. Default is 120 sec. -- @return #INTEL self function INTEL:SetForgetTime(TimeInterval) return self @@ -607,10 +607,10 @@ end --- Method to make the radar detection less accurate, e.g. for WWII scenarios. -- @param #INTEL self --- @param #number minheight Minimum flight height to be detected, in meters AGL (above ground) --- @param #number thresheight Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance) --- @param #number thresblur Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found) --- @param #number closing Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20. +-- @param #number minheight (Optional) Minimum flight height to be detected, in meters AGL (above ground). Defaults to 250m. +-- @param #number thresheight (Optional) Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance) +-- @param #number thresblur (Optional) Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found) +-- @param #number closing (Optional) Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20. -- @return #INTEL self function INTEL:SetRadarBlur(minheight,thresheight,thresblur,closing) self.RadarBlur = true @@ -737,7 +737,7 @@ end --- Change radius of the Clusters. -- @param #INTEL self --- @param #number radius The radius of the clusters in kilometers. Default 15 km. +-- @param #number radius (Optional) The radius of the clusters in kilometers. Default 15 km. -- @return #INTEL self function INTEL:SetClusterRadius(radius) self.clusterradius = (radius or 15)*1000 @@ -1445,7 +1445,7 @@ end -- @param #INTEL self -- @param Wrapper.Positionable#POSITIONABLE Positionable Group or static object. -- @param #string RecceName Name of the recce group that detected this object. --- @param #number Tdetected Abs. mission time in seconds, when the object is detected. Default now. +-- @param #number Tdetected (Optional) Abs. mission time in seconds, when the object is detected. Default now. -- @return #INTEL self function INTEL:KnowObject(Positionable, RecceName, Tdetected) @@ -2016,7 +2016,7 @@ end --- Calculate cluster future position after given seconds. -- @param #INTEL self -- @param #INTEL.Cluster cluster The cluster of contacts. --- @param #number seconds Time interval in seconds. Default is `self.prediction`. +-- @param #number seconds (Optional) Time interval in seconds. Default is `self.prediction`. -- @return Core.Point#COORDINATE Calculated future position of the cluster. function INTEL:CalcClusterFuturePosition(cluster, seconds) @@ -2258,7 +2258,7 @@ end --- Get the coordinate of a cluster. -- @param #INTEL self -- @param #INTEL.Cluster Cluster The cluster. --- @param #boolean Update If `true`, update the coordinate. Default is to just return the last stored position. +-- @param #boolean Update (Optional) If `true`, update the coordinate. Default is to just return the last stored position. -- @return Core.Point#COORDINATE The coordinate of this cluster. function INTEL:GetClusterCoordinate(Cluster, Update) @@ -2309,8 +2309,8 @@ end --- Check if the coordindate of the cluster changed. -- @param #INTEL self -- @param #INTEL.Cluster Cluster The cluster. --- @param #number Threshold in meters. Default 100 m. --- @param Core.Point#COORDINATE Coordinate Reference coordinate. Default is the last known coordinate of the cluster. +-- @param #number (Optional) Threshold in meters. Default 100 m. +-- @param Core.Point#COORDINATE Coordinate (Optional) Reference coordinate. Default is the last known coordinate of the cluster. -- @return #boolean If `true`, the coordinate changed by more than the given threshold. function INTEL:_CheckClusterCoordinateChanged(Cluster, Coordinate, Threshold) @@ -2641,7 +2641,7 @@ end --- Function to set how long INTEL DLINK remembers contacts. -- @param #INTEL_DLINK self - -- @param #number seconds Remember this many seconds. Defaults to 180. + -- @param #number seconds (Optional) Remember this many seconds. Defaults to 120. -- @return #INTEL_DLINK self function INTEL_DLINK:SetDLinkCacheTime(seconds) self.cachetime = math.abs(seconds or 120) diff --git a/Moose Development/Moose/Ops/Legion.lua b/Moose Development/Moose/Ops/Legion.lua index 513ed07f0..9995da864 100644 --- a/Moose Development/Moose/Ops/Legion.lua +++ b/Moose Development/Moose/Ops/Legion.lua @@ -316,7 +316,7 @@ end --- Set verbosity level. -- @param #LEGION self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #LEGION self function LEGION:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -468,10 +468,10 @@ end -- @param #LEGION self -- @param Ops.Cohort#COHORT Cohort The cohort to be relocated. -- @param Ops.Legion#LEGION Legion The legion where the cohort is relocated to. --- @param #number Delay Delay in seconds before relocation takes place. Default `nil`, *i.e.* ASAP. --- @param #number NcarriersMin Min number of transport carriers in case the troops should be transported. Default `nil` for no transport. +-- @param #number Delay (Optional) Delay in seconds before relocation takes place. Default `nil`, *i.e.* ASAP. +-- @param #number NcarriersMin (Optional) Min number of transport carriers in case the troops should be transported. Default `nil` for no transport. -- @param #number NcarriersMax Max number of transport carriers. --- @param #table TransportLegions Legion(s) assigned for transportation. Default is that transport assets can only be recruited from this legion. +-- @param #table TransportLegions (Optional) Legion(s) assigned for transportation. Default is that transport assets can only be recruited from this legion. -- @return #LEGION self function LEGION:RelocateCohort(Cohort, Legion, Delay, NcarriersMin, NcarriersMax, TransportLegions) @@ -1927,7 +1927,7 @@ end --- Check if an asset is currently on a mission (STARTED or EXECUTING). -- @param #LEGION self -- @param Functional.Warehouse#WAREHOUSE.Assetitem asset The asset. --- @param #table MissionTypes Types on mission to be checked. Default all. +-- @param #table MissionTypes (Optional) Types on mission to be checked. Default all. -- @return #boolean If true, asset has at least one mission of that type in the queue. function LEGION:IsAssetOnMission(asset, MissionTypes) @@ -1980,7 +1980,7 @@ end --- Count payloads in stock. -- @param #LEGION self --- @param #table MissionTypes Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`. +-- @param #table MissionTypes (Optional) Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`. -- @param #table UnitTypes Types of units. -- @param #table Payloads Specific payloads to be counted only. -- @return #number Count of available payloads in stock. @@ -2056,7 +2056,7 @@ end --- Count missions in mission queue. -- @param #LEGION self --- @param #table MissionTypes Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`. +-- @param #table MissionTypes (Optional) Types on mission to be checked. Default *all* possible types `AUFTRAG.Type`. -- @param #boolean OnlyRunning If `true`, only count running missions. -- @return #number Number of missions that are not over yet. function LEGION:CountMissionsInQueue(MissionTypes, OnlyRunning) @@ -2171,8 +2171,8 @@ end --- Count assets on mission. -- @param #LEGION self --- @param #table MissionTypes Types on mission to be checked. Default all. --- @param Ops.Cohort#COHORT Cohort Only count assets of this cohort. Default count assets of all cohorts. +-- @param #table MissionTypes (Optional) Types on mission to be checked. Default all. +-- @param Ops.Cohort#COHORT Cohort (Optional) Only count assets of this cohort. Default count assets of all cohorts. -- @return #number Number of pending and queued assets. -- @return #number Number of pending assets. -- @return #number Number of queued assets. @@ -2215,7 +2215,7 @@ end --- Get assets on mission. -- @param #LEGION self --- @param #table MissionTypes Types on mission to be checked. Default all. +-- @param #table MissionTypes (Optional) Types on mission to be checked. Default all. -- @return #table Assets on pending requests. function LEGION:GetAssetsOnMission(MissionTypes) @@ -2248,7 +2248,7 @@ end --- Get the unit types of this legion. These are the unit types of all assigned cohorts. -- @param #LEGION self -- @param #boolean onlyactive Count only the active ones. --- @param #table cohorts Table of cohorts. Default all. +-- @param #table cohorts (Optional) Table of cohorts. Default all. -- @return #table Table of unit types. function LEGION:GetAircraftTypes(onlyactive, cohorts) @@ -2789,7 +2789,7 @@ end --- Recruit assets from Cohorts for the given parameters. **NOTE** that we set the `asset.isReserved=true` flag so it cannot be recruited by anyone else. -- @param #table Cohorts Cohorts included. -- @param #string MissionTypeRecruit Mission type for recruiting the cohort assets. --- @param #string MissionTypeOpt Mission type for which the assets are optimized. Default is the same as `MissionTypeRecruit`. +-- @param #string MissionTypeOpt (Optional) Mission type for which the assets are optimized. Default is the same as `MissionTypeRecruit`. -- @param #number NreqMin Minimum number of required assets. -- @param #number NreqMax Maximum number of required assets. -- @param DCS#Vec2 TargetVec2 Target position as 2D vector. diff --git a/Moose Development/Moose/Ops/NavyGroup.lua b/Moose Development/Moose/Ops/NavyGroup.lua index 5f2869d03..fa007435c 100644 --- a/Moose Development/Moose/Ops/NavyGroup.lua +++ b/Moose Development/Moose/Ops/NavyGroup.lua @@ -434,7 +434,7 @@ end --- Enable/disable pathfinding. -- @param #NAVYGROUP self -- @param #boolean Switch If true, enable pathfinding. --- @param #number CorridorWidth Corridor with in meters. Default 400 m. +-- @param #number CorridorWidth (Optional) Corridor with in meters. Default 400 m. -- @return #NAVYGROUP self function NAVYGROUP:SetPathfinding(Switch, CorridorWidth) self.pathfindingOn=Switch @@ -444,7 +444,7 @@ end --- Enable pathfinding. -- @param #NAVYGROUP self --- @param #number CorridorWidth Corridor with in meters. Default 400 m. +-- @param #number CorridorWidth (Optional) Corridor with in meters. Default 400 m. -- @return #NAVYGROUP self function NAVYGROUP:SetPathfindingOn(CorridorWidth) self:SetPathfinding(true, CorridorWidth) @@ -476,9 +476,9 @@ end -- @param #NAVYGROUP self -- @param Core.Point#COORDINATE Coordinate Coordinate of the target. -- @param #string Clock Time when to start the attack. --- @param #number Radius Radius in meters. Default 100 m. --- @param #number Nshots Number of shots to fire. Default 3. --- @param #number WeaponType Type of weapon. Default auto. +-- @param #number Radius (Optional) Radius in meters. Default 100 m. +-- @param #number Nshots (Optional) Number of shots to fire. Default 3. +-- @param #number WeaponType (Optional) Type of weapon. Default auto. -- @param #number Prio Priority of the task. -- @return Ops.OpsGroup#OPSGROUP.Task The task data. function NAVYGROUP:AddTaskFireAtPoint(Coordinate, Clock, Radius, Nshots, WeaponType, Prio) @@ -493,12 +493,12 @@ end --- Add a *waypoint* task. -- @param #NAVYGROUP self -- @param Core.Point#COORDINATE Coordinate Coordinate of the target. --- @param Ops.OpsGroup#OPSGROUP.Waypoint Waypoint Where the task is executed. Default is next waypoint. --- @param #number Radius Radius in meters. Default 100 m. --- @param #number Nshots Number of shots to fire. Default 3. --- @param #number WeaponType Type of weapon. Default auto. --- @param #number Prio Priority of the task. --- @param #number Duration Duration in seconds after which the task is cancelled. Default *never*. +-- @param Ops.OpsGroup#OPSGROUP.Waypoint (Optional) Waypoint Where the task is executed. Default is next waypoint. +-- @param #number Radius (Optional) Radius in meters. Default 100 m. +-- @param #number Nshots (Optional) Number of shots to fire. Default 3. +-- @param #number WeaponType (Optional) Type of weapon. Default auto. +-- @param #number Prio (Optional) Priority of the task. Defaults to 50. +-- @param #number Duration (Optional) Duration in seconds after which the task is cancelled. Default *never*. -- @return Ops.OpsGroup#OPSGROUP.Task The task table. function NAVYGROUP:AddTaskWaypointFireAtPoint(Coordinate, Waypoint, Radius, Nshots, WeaponType, Prio, Duration) @@ -515,10 +515,10 @@ end --- Add a *scheduled* task. -- @param #NAVYGROUP self -- @param Wrapper.Group#GROUP TargetGroup Target group. --- @param #number WeaponExpend How much weapons does are used. --- @param #number WeaponType Type of weapon. Default auto. --- @param #string Clock Time when to start the attack. --- @param #number Prio Priority of the task. +-- @param #number WeaponExpend (Optional) How much weapons does are used. +-- @param #number WeaponType (Optional) Type of weapon. Default auto. +-- @param #string Clock (Optional) Time when to start the attack. +-- @param #number Prio (Optional) Priority of the task. Defaults to 50. -- @return Ops.OpsGroup#OPSGROUP.Task The task data. function NAVYGROUP:AddTaskAttackGroup(TargetGroup, WeaponExpend, WeaponType, Clock, Prio) @@ -531,11 +531,11 @@ end --- Create a turn into wind window. Note that this is not executed as it not added to the queue. -- @param #NAVYGROUP self --- @param #string starttime Start time, e.g. "8:00" for eight o'clock. Default now. --- @param #string stoptime Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time. --- @param #number speed Speed in knots during turn into wind leg. --- @param #boolean uturn If true (or nil), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint. --- @param #number offset Offset angle in degrees, e.g. to account for an angled runway. Default 0 deg. +-- @param #string starttime (Optional) Start time, e.g. "8:00" for eight o'clock. Default now. +-- @param #string stoptime (Optional) Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time. +-- @param #number speed (Optional) Speed in knots during turn into wind leg. Defaults to 20. +-- @param #boolean uturn (Optional) If true (or nil), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint. +-- @param #number offset (Optional) Offset angle in degrees, e.g. to account for an angled runway. Default 0 deg. -- @return #NAVYGROUP.IntoWind Recovery window. function NAVYGROUP:_CreateTurnIntoWind(starttime, stoptime, speed, uturn, offset) @@ -598,11 +598,11 @@ end --- Add a time window, where the groups steams into the wind. -- @param #NAVYGROUP self --- @param #string starttime Start time, e.g. "8:00" for eight o'clock. Default now. --- @param #string stoptime Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time. --- @param #number speed Wind speed on deck in knots during turn into wind leg. Default 20 knots. --- @param #boolean uturn If `true` (or `nil`), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint. --- @param #number offset Offset angle clock-wise in degrees, *e.g.* to account for an angled runway. Default 0 deg. Use around -9.1° for US carriers. +-- @param #string starttime (Optional) Start time, e.g. "8:00" for eight o'clock. Default now. +-- @param #string stoptime (Optional) Stop time, e.g. "9:00" for nine o'clock. Default 90 minutes after start time. +-- @param #number speed (Optional) Wind speed on deck in knots during turn into wind leg. Default 20 knots. +-- @param #boolean uturn (Optional) If `true` (or `nil`), carrier wil perform a U-turn and go back to where it came from before resuming its route to the next waypoint. If false, it will go directly to the next waypoint. +-- @param #number offset (Optional) Offset angle clock-wise in degrees, *e.g.* to account for an angled runway. Default 0 deg. Use around -9.1° for US carriers. -- @return #NAVYGROUP.IntoWind Turn into window data table. function NAVYGROUP:AddTurnIntoWind(starttime, stoptime, speed, uturn, offset) @@ -644,7 +644,7 @@ end --- Extend duration of turn into wind. -- @param #NAVYGROUP self --- @param #number Duration Duration in seconds. Default 300 sec. +-- @param #number Duration (Optional) Duration in seconds. Default 300 sec. -- @param #NAVYGROUP.IntoWind TurnIntoWind (Optional) Turn into window data table. If not given, the currently open one is used (if there is any). -- @return #NAVYGROUP self function NAVYGROUP:ExtendTurnIntoWind(Duration, TurnIntoWind) @@ -1832,10 +1832,10 @@ end --- Add an a waypoint to the route. -- @param #NAVYGROUP self -- @param Core.Point#COORDINATE Coordinate The coordinate of the waypoint. Use `COORDINATE:SetAltitude()` to define the altitude. --- @param #number Speed Speed in knots. Default is default cruise speed or 70% of max speed. --- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint. --- @param #number Depth Depth at waypoint in feet. Only for submarines. --- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call. +-- @param #number Speed (Optional) Speed in knots. Default is default cruise speed or 70% of max speed. +-- @param #number AfterWaypointWithID (Optional) Insert waypoint after waypoint given ID. Default is to insert as last waypoint. +-- @param #number Depth (Optional) Depth at waypoint in feet. Only for submarines. +-- @param #boolean Updateroute (Optional) If true or nil, call UpdateRoute. If false, no call. -- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table. function NAVYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Depth, Updateroute) @@ -1875,8 +1875,8 @@ end --- Initialize group parameters. Also initializes waypoints if self.waypoints is nil. -- @param #NAVYGROUP self --- @param #table Template Template used to init the group. Default is `self.template`. --- @param #number Delay Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous. +-- @param #table Template (Optional) Template used to init the group. Default is `self.template`. +-- @param #number Delay (Optional) Delay in seconds before group is initialized. Default `nil`, *i.e.* instantaneous. -- @return #NAVYGROUP self function NAVYGROUP:_InitGroup(Template, Delay) @@ -1981,7 +1981,7 @@ end --- Check for possible collisions between two coordinates. -- @param #NAVYGROUP self --- @param #number DistanceMax Max distance in meters ahead to check. Default 5000. +-- @param #number DistanceMax (Optional) Max distance in meters ahead to check. Default 5000. -- @param #number dx -- @return #number Free distance in meters. function NAVYGROUP:_CheckFreePath(DistanceMax, dx) @@ -2167,7 +2167,7 @@ end --- Get wind direction and speed at current position. -- @param #NAVYGROUP self --- @param #number Altitude Altitude in meters above main sea level at which the wind is calculated. Default 18 meters. +-- @param #number Altitude (Optional) Altitude in meters above main sea level at which the wind is calculated. Default 18 meters. -- @return #number Direction the wind is blowing **from** in degrees. -- @return #number Wind speed in m/s. function NAVYGROUP:GetWind(Altitude) diff --git a/Moose Development/Moose/Ops/Operation.lua b/Moose Development/Moose/Ops/Operation.lua index 34834439a..bfe2b5eee 100644 --- a/Moose Development/Moose/Ops/Operation.lua +++ b/Moose Development/Moose/Ops/Operation.lua @@ -145,7 +145,7 @@ OPERATION.version="0.2.0" --- Create a new generic OPERATION object. -- @param #OPERATION self --- @param #string Name Name of the operation. Be creative! Default "Operation-01" where the last number is a running number. +-- @param #string Name (Optional) Name of the operation. Be creative! Default "Operation-01" where the last number is a running number. -- @return #OPERATION self function OPERATION:New(Name) @@ -349,7 +349,7 @@ end --- Set verbosity level. -- @param #OPERATION self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #OPERATION self function OPERATION:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -358,7 +358,7 @@ end --- Set start and stop time of the operation. -- @param #OPERATION self --- @param #string ClockStart Time the mission is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added. +-- @param #string ClockStart (Optional) Time the mission is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added. -- @param #string ClockStop (Optional) Time the mission is stopped, e.g. "13:00" for 1 pm. If mission could not be started at that time, it will be removed from the queue. If specified as a #number it will be relative (in seconds) to the current mission time. -- @return #OPERATION self function OPERATION:SetTime(ClockStart, ClockStop) @@ -415,9 +415,9 @@ end --- Add a new phase to the operation. This is added add the end of all previously added phases (if any). -- @param #OPERATION self --- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number. --- @param #OPERATION.Branch Branch The branch to which this phase is added. Default is the master branch. --- @param #number Duration Duration in seconds how long the phase will last. Default `nil`=forever. +-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number. +-- @param #OPERATION.Branch Branch (Optional) The branch to which this phase is added. Default is the master branch. +-- @param #number Duration (Optional) Duration in seconds how long the phase will last. Default `nil`=forever. -- @return #OPERATION.Phase Phase table object. function OPERATION:AddPhase(Name, Branch, Duration) @@ -445,7 +445,7 @@ end ---Insert a new phase after an already defined phase of the operation. -- @param #OPERATION self -- @param #OPERATION.Phase PhaseAfter The phase after which the new phase is inserted. --- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number. +-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number. -- @return #OPERATION.Phase Phase table object. function OPERATION:InsertPhaseAfter(PhaseAfter, Name) @@ -472,7 +472,7 @@ end --- Get a phase by its name. -- @param #OPERATION self --- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number. +-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number. -- @return #OPERATION.Phase Phase table object or nil if phase could not be found. function OPERATION:GetPhaseByName(Name) @@ -610,7 +610,7 @@ end --- Get name of a phase. -- @param #OPERATION self --- @param #OPERATION.Phase Phase The phase of which the name is returned. Default is the currently active phase. +-- @param #OPERATION.Phase Phase (Optional) The phase of which the name is returned. Default is the currently active phase. -- @return #string The name of the phase or "None" if no phase is given or active. function OPERATION:GetPhaseName(Phase) @@ -752,7 +752,7 @@ end --- Get name of the branch. -- @param #OPERATION self --- @param #OPERATION.Branch Branch The branch of which the name is requested. Default is the currently active or master branch. +-- @param #OPERATION.Branch (Optional) Branch The branch of which the name is requested. Default is the currently active or master branch. -- @return #string Name Name or "None" function OPERATION:GetBranchName(Branch) Branch=Branch or self:GetBranchActive() @@ -1336,7 +1336,7 @@ end --- Create a new phase object. -- @param #OPERATION self --- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number. +-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number. -- @return #OPERATION.Phase Phase table object. function OPERATION:_CreatePhase(Name) @@ -1356,7 +1356,7 @@ end --- Create a new branch object. -- @param #OPERATION self --- @param #string Name Name of the phase. Default "Phase-01" where the last number is a running number. +-- @param #string Name (Optional) Name of the phase. Default "Phase-01" where the last number is a running number. -- @return #OPERATION.Branch Branch table object. function OPERATION:_CreateBranch(Name) diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index c5617c94c..2a483c54b 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -514,7 +514,7 @@ OPSGROUP.CargoStatus={ --- OpsGroup version. -- @field #string version -OPSGROUP.version="1.0.5" +OPSGROUP.version="1.0.6" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -1016,7 +1016,7 @@ end --- Set verbosity level. -- @param #OPSGROUP self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #OPSGROUP self function OPSGROUP:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -1068,7 +1068,7 @@ end --- Set default cruise altitude. -- @param #OPSGROUP self --- @param #number Altitude Altitude in feet. Default is 10,000 ft for airplanes and 1,500 feet for helicopters. +-- @param #number Altitude (Optional) Altitude in feet. Default is 10,000 ft for airplanes and 1,500 feet for helicopters. -- @return #OPSGROUP self function OPSGROUP:SetDefaultAltitude(Altitude) if Altitude then @@ -1097,7 +1097,7 @@ end --- Set current altitude. -- @param #OPSGROUP self --- @param #number Altitude Altitude in feet. Default is 10,000 ft for airplanes and 1,500 feet for helicopters. +-- @param #number Altitude (Optional) Altitude in feet. Default is 10,000 ft for airplanes and 1,500 feet for helicopters. -- @param #boolean Keep If `true` the group will maintain that speed on passing waypoints. If `nil` or `false` the group will return to the speed as defined by their route. -- @return #OPSGROUP self function OPSGROUP:SetAltitude(Altitude, Keep, RadarAlt) @@ -1147,7 +1147,7 @@ end --- Set current speed. -- @param #OPSGROUP self --- @param #number Speed Speed in knots. Default is 70% of max speed. +-- @param #number Speed (Optional) Speed in knots. Default is 70% of max speed. -- @param #boolean Keep If `true` the group will maintain that speed on passing waypoints. If `nil` or `false` the group will return to the speed as defined by their route. -- @param #boolean AltCorrected If `true`, use altitude corrected indicated air speed. -- @return #OPSGROUP self @@ -1176,7 +1176,7 @@ end --- Set detection on or off. -- If detection is on, detected targets of the group will be evaluated and FSM events triggered. -- @param #OPSGROUP self --- @param #boolean Switch If `true`, detection is on. If `false` or `nil`, detection is off. Default is off. +-- @param #boolean Switch (Optional) If `true`, detection is on. If `false` or `nil`, detection is off. Default is off. -- @return #OPSGROUP self function OPSGROUP:SetDetection(Switch) self:T(self.lid..string.format("Detection is %s", tostring(Switch))) @@ -1335,7 +1335,7 @@ end -- @param Core.Point#COORDINATE TargetCoord Coordinate of the target. -- @param #number WeaponBitType Weapon type. -- @param Core.Point#COORDINATE RefCoord Reference coordinate. --- @param #table SurfaceTypes Valid surfaces types of the coordinate. Default any (nil). +-- @param #table SurfaceTypes (Optional) Valid surfaces types of the coordinate. Default any (nil). -- @return Core.Point#COORDINATE Coordinate in weapon range function OPSGROUP:GetCoordinateInRange(TargetCoord, WeaponBitType, RefCoord, SurfaceTypes) @@ -1411,10 +1411,10 @@ end --- Set LASER parameters. -- @param #OPSGROUP self --- @param #number Code Laser code. Default 1688. --- @param #boolean CheckLOS Check if lasing unit has line of sight to target coordinate. Default is `true`. +-- @param #number Code (Optional) Laser code. Default 1688. +-- @param #boolean CheckLOS (Optional) Check if lasing unit has line of sight to target coordinate. Default is `true`. -- @param #boolean IROff If true, then dont switch on the additional IR pointer. --- @param #number UpdateTime Time interval in seconds the beam gets up for moving targets. Default every 0.5 sec. +-- @param #number UpdateTime (Optional) Time interval in seconds the beam gets up for moving targets. Default every 0.5 sec. -- @return #OPSGROUP self function OPSGROUP:SetLaser(Code, CheckLOS, IROff, UpdateTime) self.spot.Code=Code or 1688 @@ -1473,10 +1473,10 @@ end --- Add a weapon range for ARTY auftrag. -- @param #OPSGROUP self --- @param #number RangeMin Minimum range in nautical miles. Default 0 NM. --- @param #number RangeMax Maximum range in nautical miles. Default 10 NM. --- @param #number BitType Bit mask of weapon type for which the given min/max ranges apply. Default is `ENUMS.WeaponFlag.Auto`, i.e. for all weapon types. --- @param #function ConversionToMeters Function that converts input units of ranges to meters. Defaul `UTILS.NMToMeters`. +-- @param #number RangeMin (Optional) Minimum range in nautical miles. Default 0 NM. +-- @param #number RangeMax (Optional) Maximum range in nautical miles. Default 10 NM. +-- @param #number BitType (Optional) Bit mask of weapon type for which the given min/max ranges apply. Default is `ENUMS.WeaponFlag.Auto`, i.e. for all weapon types. +-- @param #function ConversionToMeters (Optional) Function that converts input units of ranges to meters. Defaul `UTILS.NMToMeters`. -- @return #OPSGROUP self function OPSGROUP:AddWeaponRange(RangeMin, RangeMax, BitType, ConversionToMeters) @@ -1536,8 +1536,8 @@ end --- Get highest detected threat. Detection must be turned on. The threat level is a number between 0 and 10, where 0 is the lowest, e.g. unarmed units. -- @param #OPSGROUP self --- @param #number ThreatLevelMin Only consider threats with level greater or equal to this number. Default 1 (so unarmed units wont be considered). --- @param #number ThreatLevelMax Only consider threats with level smaller or queal to this number. Default 10. +-- @param #number ThreatLevelMin (Optional) Only consider threats with level greater or equal to this number. Default 1 (so unarmed units wont be considered). +-- @param #number ThreatLevelMax (Optional) Only consider threats with level smaller or queal to this number. Default 10. -- @return Wrapper.Unit#UNIT Highest threat unit detected by the group or `nil` if no threat is currently detected. -- @return #number Threat level. function OPSGROUP:GetThreat(ThreatLevelMin, ThreatLevelMax) @@ -1593,10 +1593,10 @@ end --- Enable to automatically engage detected targets. -- @param #OPSGROUP self --- @param #number RangeMax Max range in NM. Only detected targets within this radius from the group will be engaged. Default is 25 NM. --- @param #table TargetTypes Types of target attributes that will be engaged. See [DCS enum attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes). Default "All". --- @param Core.Set#SET_ZONE EngageZoneSet Set of zones in which targets are engaged. Default is anywhere. --- @param Core.Set#SET_ZONE NoEngageZoneSet Set of zones in which targets are *not* engaged. Default is nowhere. +-- @param #number RangeMax (Optional) Max range in NM. Only detected targets within this radius from the group will be engaged. Default is 25 NM. +-- @param #table TargetTypes (Optional) Types of target attributes that will be engaged. See [DCS enum attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes). Default "All". +-- @param Core.Set#SET_ZONE EngageZoneSet (Optional) Set of zones in which targets are engaged. Default is anywhere. +-- @param Core.Set#SET_ZONE NoEngageZoneSet (Optional) Set of zones in which targets are *not* engaged. Default is nowhere. -- @return #OPSGROUP self function OPSGROUP:SetEngageDetectedOn(RangeMax, TargetTypes, EngageZoneSet, NoEngageZoneSet) @@ -1783,7 +1783,7 @@ end --- Get MOOSE UNIT object. -- @param #OPSGROUP self --- @param #number UnitNumber Number of the unit in the group. Default first unit. +-- @param #number UnitNumber (Optional) Number of the unit in the group. Default first unit. -- @return Wrapper.Unit#UNIT The MOOSE UNIT object. function OPSGROUP:GetUnit(UnitNumber) @@ -1799,7 +1799,7 @@ end --- Get DCS GROUP object. -- @param #OPSGROUP self --- @param #number UnitNumber Number of the unit in the group. Default first unit. +-- @param #number UnitNumber (Optional) Number of the unit in the group. Default first unit. -- @return DCS#Unit DCS group object. function OPSGROUP:GetDCSUnit(UnitNumber) @@ -2059,8 +2059,8 @@ end --- Despawn a unit of the group. A "Remove Unit" event is generated by default. -- @param #OPSGROUP self -- @param #string UnitName Name of the unit --- @param #number Delay Delay in seconds before the group will be despawned. Default immediately. --- @param #boolean NoEventRemoveUnit If true, no event "Remove Unit" is generated. +-- @param #number Delay (Optional) Delay in seconds before the group will be despawned. Default immediately. +-- @param #boolean NoEventRemoveUnit (Optional) If true, no event "Remove Unit" is generated. -- @return #OPSGROUP self function OPSGROUP:DespawnUnit(UnitName, Delay, NoEventRemoveUnit) @@ -2096,8 +2096,8 @@ end --- Despawn an element/unit of the group. -- @param #OPSGROUP self -- @param #OPSGROUP.Element Element The element that will be despawned. --- @param #number Delay Delay in seconds before the element will be despawned. Default immediately. --- @param #boolean NoEventRemoveUnit If true, no event "Remove Unit" is generated. +-- @param #number Delay (Optional) Delay in seconds before the element will be despawned. Default immediately. +-- @param #boolean NoEventRemoveUnit (Optional) If true, no event "Remove Unit" is generated. -- @return #OPSGROUP self function OPSGROUP:DespawnElement(Element, Delay, NoEventRemoveUnit) @@ -2133,7 +2133,7 @@ end -- If no `Remove Unit` event should be generated, the second optional parameter needs to be set to `true`. -- If this group belongs to an AIRWING, BRIGADE or FLEET, it will be added to the warehouse stock if the `NoEventRemoveUnit` parameter is `false` or `nil`. -- @param #OPSGROUP self --- @param #number Delay Delay in seconds before the group will be despawned. Default immediately. +-- @param #number Delay (Optional) Delay in seconds before the group will be despawned. Default immediately. -- @param #boolean NoEventRemoveUnit If `true`, **no** event "Remove Unit" is generated. -- @return #OPSGROUP self function OPSGROUP:Despawn(Delay, NoEventRemoveUnit) @@ -2176,7 +2176,7 @@ end --- Return group back to the legion it belongs to. -- Group is despawned and added back to the stock. -- @param #OPSGROUP self --- @param #number Delay Delay in seconds before the group will be despawned. Default immediately +-- @param #number Delay (Optional) Delay in seconds before the group will be despawned. Default immediately -- @return #OPSGROUP self function OPSGROUP:ReturnToLegion(Delay) @@ -2200,7 +2200,7 @@ end --- Destroy a unit of the group. A *Unit Lost* for aircraft or *Dead* event for ground/naval units is generated. -- @param #OPSGROUP self -- @param #string UnitName Name of the unit which should be destroyed. --- @param #number Delay Delay in seconds before the group will be destroyed. Default immediately. +-- @param #number Delay (Optional) Delay in seconds before the group will be destroyed. Default immediately. -- @return #OPSGROUP self function OPSGROUP:DestroyUnit(UnitName, Delay) @@ -2232,7 +2232,7 @@ end --- Destroy group. The whole group is despawned and a *Unit Lost* for aircraft or *Dead* event for ground/naval units is generated for all current units. -- @param #OPSGROUP self --- @param #number Delay Delay in seconds before the group will be destroyed. Default immediately. +-- @param #number Delay (Optional) Delay in seconds before the group will be destroyed. Default immediately. -- @return #OPSGROUP self function OPSGROUP:Destroy(Delay) @@ -2316,9 +2316,9 @@ end --- Self destruction of group. An explosion is created at the position of each element. -- @param #OPSGROUP self --- @param #number Delay Delay in seconds. Default now. +-- @param #number Delay (Optional) Delay in seconds. Default now. -- @param #number ExplosionPower (Optional) Explosion power in kg TNT. Default 100 kg. --- @param #string ElementName Name of the element that should be destroyed. Default is all elements. +-- @param #string ElementName (Optional) Name of the element that should be destroyed. Default is all elements. -- @return #OPSGROUP self function OPSGROUP:SelfDestruction(Delay, ExplosionPower, ElementName) @@ -2348,13 +2348,13 @@ end --- Use SRS Simple-Text-To-Speech for transmissions. -- @param #OPSGROUP self -- @param #string PathToSRS Path to SRS directory. --- @param #string Gender Gender: "male" or "female" (default). --- @param #string Culture Culture, e.g. "en-GB" (default). --- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. --- @param #number Port SRS port. Default 5002. --- @param #string PathToGoogleKey Full path to the google credentials JSON file, e.g. `"C:\Users\myUsername\Downloads\key.json"`. --- @param #string Label Label of the SRS comms for the SRS Radio overlay. Defaults to "ROBOT". No spaces allowed! --- @param #number Volume Volume to be set, 0.0 = silent, 1.0 = loudest. Defaults to 1.0 +-- @param #string Gender (Optional) Gender: "male" or "female" (default). +-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default). +-- @param #string Voice (Optional) Specific voice. Overrides `Gender` and `Culture`. +-- @param #number Port (Optional) SRS port. Default 5002. +-- @param #string PathToGoogleKey (Optional) Full path to the google credentials JSON file, e.g. `"C:\Users\myUsername\Downloads\key.json"`. +-- @param #string Label (Optional) Label of the SRS comms for the SRS Radio overlay. Defaults to "ROBOT". No spaces allowed! +-- @param #number Volume (Optional) Volume to be set, 0.0 = silent, 1.0 = loudest. Defaults to 1.0 -- @return #OPSGROUP self function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label, Volume) self.useSRS=true @@ -2379,8 +2379,8 @@ end -- @param #OPSGROUP self -- @param #string Text Text of transmission. -- @param #number Delay Delay in seconds before the transmission is started. --- @param #boolean SayCallsign If `true`, the callsign is prepended to the given text. Default `false`. --- @param #number Frequency Override sender frequency, helpful when you need multiple radios from the same sender. Default is the frequency set for the OpsGroup. +-- @param #boolean SayCallsign (Optional) If `true`, the callsign is prepended to the given text. Default `false`. +-- @param #number Frequency (Optional) Override sender frequency, helpful when you need multiple radios from the same sender. Default is the frequency set for the OpsGroup. -- @return #OPSGROUP self function OPSGROUP:RadioTransmission(Text, Delay, SayCallsign, Frequency) @@ -2421,8 +2421,8 @@ end --- Set that this carrier is an all aspect loader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierLoaderAllAspect(Length, Width) self.carrierLoader.type="front" @@ -2433,8 +2433,8 @@ end --- Set that this carrier is a front loader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierLoaderFront(Length, Width) self.carrierLoader.type="front" @@ -2445,8 +2445,8 @@ end --- Set that this carrier is a back loader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierLoaderBack(Length, Width) self.carrierLoader.type="back" @@ -2457,8 +2457,8 @@ end --- Set that this carrier is a starboard (right side) loader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierLoaderStarboard(Length, Width) self.carrierLoader.type="right" @@ -2469,8 +2469,8 @@ end --- Set that this carrier is a port (left side) loader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierLoaderPort(Length, Width) self.carrierLoader.type="left" @@ -2482,8 +2482,8 @@ end --- Set that this carrier is an all aspect unloader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierUnloaderAllAspect(Length, Width) self.carrierUnloader.type="front" @@ -2494,8 +2494,8 @@ end --- Set that this carrier is a front unloader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierUnloaderFront(Length, Width) self.carrierUnloader.type="front" @@ -2506,8 +2506,8 @@ end --- Set that this carrier is a back unloader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierUnloaderBack(Length, Width) self.carrierUnloader.type="back" @@ -2518,8 +2518,8 @@ end --- Set that this carrier is a starboard (right side) unloader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierUnloaderStarboard(Length, Width) self.carrierUnloader.type="right" @@ -2530,8 +2530,8 @@ end --- Set that this carrier is a port (left side) unloader. -- @param #OPSGROUP self --- @param #number Length Length of loading zone in meters. Default 50 m. --- @param #number Width Width of loading zone in meters. Default 20 m. +-- @param #number Length (Optional) Length of loading zone in meters. Default 50 m. +-- @param #number Width (Optional) Width of loading zone in meters. Default 20 m. -- @return #OPSGROUP self function OPSGROUP:SetCarrierUnloaderPort(Length, Width) self.carrierUnloader.type="left" @@ -3076,7 +3076,7 @@ end --- Mark waypoints on F10 map. -- @param #OPSGROUP self --- @param #number Duration Duration in seconds how long the waypoints are displayed before they are automatically removed. Default is that they are never removed. +-- @param #number Duration (Optional) Duration in seconds how long the waypoints are displayed before they are automatically removed. Default is that they are never removed. -- @return #OPSGROUP self function OPSGROUP:MarkWaypoints(Duration) @@ -3106,7 +3106,7 @@ end --- Remove waypoints markers on the F10 map. -- @param #OPSGROUP self --- @param #number Delay Delay in seconds before the markers are removed. Default is immediately. +-- @param #number Delay (Optional) Delay in seconds before the markers are removed. Default is immediately. -- @return #OPSGROUP self function OPSGROUP:RemoveWaypointMarkers(Delay) @@ -3196,8 +3196,8 @@ end --- Get next waypoint index. -- @param #OPSGROUP self --- @param #boolean cyclic If `true`, return first waypoint if last waypoint was reached. Default is patrol ad infinitum value set. --- @param #number i Waypoint index from which the next index is returned. Default is the last waypoint passed. +-- @param #boolean cyclic (Optional) If `true`, return first waypoint if last waypoint was reached. Default is patrol ad infinitum value set. +-- @param #number i (Optional) Waypoint index from which the next index is returned. Default is the last waypoint passed. -- @return #number Next waypoint index. function OPSGROUP:GetWaypointIndexNext(cyclic, i) @@ -3232,7 +3232,7 @@ end --- Get waypoint index after waypoint with given ID. So if the waypoint has index 3 it will return 4. -- @param #OPSGROUP self --- @param #number uid Unique ID of the waypoint. Default is new waypoint index after the last current one. +-- @param #number uid (Optional) Unique ID of the waypoint. Default is new waypoint index after the last current one. -- @return #number Index after waypoint with given ID. function OPSGROUP:GetWaypointIndexAfterID(uid) @@ -3369,7 +3369,7 @@ end --- Get distance to waypoint. -- @param #OPSGROUP self --- @param #number indx Waypoint index. Default is the next waypoint. +-- @param #number indx (Optional) Waypoint index. Default is the next waypoint. -- @return #number Distance in meters. function OPSGROUP:GetDistanceToWaypoint(indx) local dist=0 @@ -3394,7 +3394,7 @@ end --- Get time to waypoint based on current velocity. -- @param #OPSGROUP self --- @param #number indx Waypoint index. Default is the next waypoint. +-- @param #number indx (Optional) Waypoint index. Default is the next waypoint. -- @return #number Time in seconds. If velocity is 0 function OPSGROUP:GetTimeToWaypoint(indx) @@ -3847,10 +3847,10 @@ end --- Add a *scheduled* task. -- @param #OPSGROUP self -- @param #table task DCS task table structure. --- @param #string clock Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds. +-- @param #string clock (Optional) Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds. -- @param #string description Brief text describing the task, e.g. "Attack SAM". --- @param #number prio Priority of the task. --- @param #number duration Duration before task is cancelled in seconds counted after task started. Default never. +-- @param #number prio (Optional) Priority of the task. Default is 50. +-- @param #number duration (Optional) Duration before task is cancelled in seconds counted after task started. Default never. -- @return #OPSGROUP.Task The task structure. function OPSGROUP:AddTask(task, clock, description, prio, duration) @@ -3869,10 +3869,10 @@ end --- Create a *scheduled* task. -- @param #OPSGROUP self -- @param #table task DCS task table structure. --- @param #string clock Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds. +-- @param #string clock (Optional) Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds. -- @param #string description Brief text describing the task, e.g. "Attack SAM". --- @param #number prio Priority of the task. --- @param #number duration Duration before task is cancelled in seconds counted after task started. Default never. +-- @param #number prio (Optional) Priority of the task. Default is 50. +-- @param #number duration (Optional) Duration before task is cancelled in seconds counted after task started. Default never. -- @return #OPSGROUP.Task The task structure. function OPSGROUP:NewTaskScheduled(task, clock, description, prio, duration) @@ -3909,10 +3909,10 @@ end --- Add a *waypoint* task. -- @param #OPSGROUP self -- @param #table task DCS task table structure. --- @param #OPSGROUP.Waypoint Waypoint where the task is executed. Default is the at *next* waypoint. +-- @param #OPSGROUP.Waypoint Waypoint (Optional) where the task is executed. Default is the at *next* waypoint. -- @param #string description Brief text describing the task, e.g. "Attack SAM". --- @param #number prio Priority of the task. Number between 1 and 100. Default is 50. --- @param #number duration Duration before task is cancelled in seconds counted after task started. Default never. +-- @param #number prio (Optional) Priority of the task. Number between 1 and 100. Default is 50. +-- @param #number duration(Optional) Duration before task is cancelled in seconds counted after task started. Default never. -- @return #OPSGROUP.Task The task structure. function OPSGROUP:AddTaskWaypoint(task, Waypoint, description, prio, duration) @@ -4767,7 +4767,7 @@ function OPSGROUP:_UpdateTask(Task, Mission) local tvec2=UTILS.Vec2Translate(vec2, distance, heading) -- Debug info. - self:T(self.lid..string.format("Barrage: Shots=%s, Altitude=%d m, Angle=%d°, heading=%03d°, distance=%d m", tostring(param.shots), Altitude, Alpha, heading, distance)) + self:T(self.lid..string.format("Barrage: Shots=%s, Altitude=%d m, Angle=%d°, heading=%03d°, distance=%d m", tostring(param.shots), Altitude, Alpha, heading, distance)) -- Set fire at point task. DCSTask=CONTROLLABLE.TaskFireAtPoint(nil, tvec2, param.radius, param.shots, param.weaponType, Altitude) @@ -4842,8 +4842,8 @@ end -- @param #OPSGROUP self -- @param DCS#Task DCSTask The DCS task. -- @param Ops.OpsGroup#OPSGROUP.Task Task --- @param #boolean SetTask Set task instead of pushing it. --- @param #number Delay Delay in seconds. Default nil. +-- @param #boolean SetTask (Optional) Set task instead of pushing it. Default is to push it. +-- @param #number Delay (Optional) Delay in seconds. Default nil. function OPSGROUP:_SandwitchDCSTask(DCSTask, Task, SetTask, Delay) if Delay and Delay>0 then @@ -4896,7 +4896,7 @@ end -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. --- @param #OPSGROUP.Task Task The task to cancel. Default is the current task (if any). +-- @param #OPSGROUP.Task Task (Optional) The task to cancel. Default is the current task (if any). function OPSGROUP:onafterTaskCancel(From, Event, To, Task) -- Get current task. @@ -6154,63 +6154,63 @@ function OPSGROUP:RouteToMission(mission, delay) end - elseif mission.type==AUFTRAG.Type.FREIGHTTRANSPORT then + elseif mission.type==AUFTRAG.Type.FREIGHTTRANSPORT then - --- - -- FREIGHTTRANSPORT - --- - - local destination=mission.DCStask.params.destination - local cargo=mission.DCStask.params.cargo - - -- Set the waypoint coordinate directly above the airbase. - -- The only way to ensure the cargo is delivered there, because when the task is executed, the cargo is delivered to the closest airbase. - -- Hopefully, ED will change the behaviour of this task but at the moment, it is what it is. - waypointcoord=destination:GetCoordinate() - - -- Get additional parameters - mission.DCStask.params.destination=destination --Wrapper.Airbase#AIRBASE - mission.DCStask.params.cargo=cargo --Core.Set#SET_STATIC - - -- Get transport unit - local unit=self.group:GetFirstUnit() - local unitIdTransport=unit:GetID() - local vec2=unit:GetVec2() - - -- Create tasks to load/transport statics cargos - local tasks={} - for StaticName, StaticObject in pairs(cargo:GetSet()) do - local static=StaticObject --Wrapper.Static#STATIC + --- + -- FREIGHTTRANSPORT + --- + + local destination=mission.DCStask.params.destination + local cargo=mission.DCStask.params.cargo - -- Task to transport cargo. - local TaskCargoTransportation={ - id = "CargoTransportationPlane", - params = { - x=vec2.x, - y=vec2.y, - unitIdTransport=unitIdTransport, - groupId=static:GetID(), - unitId=static:GetID(), + -- Set the waypoint coordinate directly above the airbase. + -- The only way to ensure the cargo is delivered there, because when the task is executed, the cargo is delivered to the closest airbase. + -- Hopefully, ED will change the behaviour of this task but at the moment, it is what it is. + waypointcoord=destination:GetCoordinate() + + -- Get additional parameters + mission.DCStask.params.destination=destination --Wrapper.Airbase#AIRBASE + mission.DCStask.params.cargo=cargo --Core.Set#SET_STATIC + + -- Get transport unit + local unit=self.group:GetFirstUnit() + local unitIdTransport=unit:GetID() + local vec2=unit:GetVec2() + + -- Create tasks to load/transport statics cargos + local tasks={} + for StaticName, StaticObject in pairs(cargo:GetSet()) do + local static=StaticObject --Wrapper.Static#STATIC + + -- Task to transport cargo. + local TaskCargoTransportation={ + id = "CargoTransportationPlane", + params = { + x=vec2.x, + y=vec2.y, + unitIdTransport=unitIdTransport, + groupId=static:GetID(), + unitId=static:GetID(), + } } - } - - table.insert(tasks, TaskCargoTransportation) - end - - -- If we have multiple tasks, we create a combo task - local TaskCargo=nil - if #tasks==1 then - TaskCargo=tasks[1] - else - TaskCargo=CONTROLLABLE.TaskCombo(nil, tasks) - end - - -- We set the task to load the cargo into the aircraft. - -- We must be careful when calling updateroute because there the task is overwritten. - -- We also clear present "UpdateRoute" FSM events - self:_ClearFSMEvent( "UpdateRoute" ) - delayGo=-30 - self.group:SetTask(TaskCargo) + + table.insert(tasks, TaskCargoTransportation) + end + + -- If we have multiple tasks, we create a combo task + local TaskCargo=nil + if #tasks==1 then + TaskCargo=tasks[1] + else + TaskCargo=CONTROLLABLE.TaskCombo(nil, tasks) + end + + -- We set the task to load the cargo into the aircraft. + -- We must be careful when calling updateroute because there the task is overwritten. + -- We also clear present "UpdateRoute" FSM events + self:_ClearFSMEvent( "UpdateRoute" ) + delayGo=-50 --30 sec was not enough for CH-47 to load more than one cargo item + self.group:SetTask(TaskCargo) elseif mission.type==AUFTRAG.Type.ARTY then @@ -7772,8 +7772,8 @@ end --- Teleport the group to a different location. -- @param #OPSGROUP self -- @param Core.Point#COORDINATE Coordinate Coordinate where the group is teleported to. --- @param #number Delay Delay in seconds before respawn happens. Default 0. --- @param #boolean NoPauseMission If `true`, dont pause a running mission. +-- @param #number Delay (Optional) Delay in seconds before respawn happens. Default 0. +-- @param #boolean NoPauseMission (Optional) If `true`, dont pause a running mission. -- @return #OPSGROUP self function OPSGROUP:Teleport(Coordinate, Delay, NoPauseMission) @@ -7861,9 +7861,9 @@ end --- Respawn the group. -- @param #OPSGROUP self --- @param #number Delay Delay in seconds before respawn happens. Default 0. --- @param DCS#Template Template (optional) The template of the Group retrieved with GROUP:GetTemplate(). If the template is not provided, the template will be retrieved of the group itself. --- @param #boolean Reset Reset waypoints and reinit group if `true`. +-- @param #number Delay (Optional) Delay in seconds before respawn happens. Default 0. +-- @param DCS#Template Template (Optional) The template of the Group retrieved with GROUP:GetTemplate(). If the template is not provided, the template will be retrieved of the group itself. +-- @param #boolean Reset (Optional) Reset waypoints and reinit group if `true`. -- @return #OPSGROUP self function OPSGROUP:_Respawn(Delay, Template, Reset) @@ -7956,8 +7956,8 @@ end --- Spawn group from a given template. -- @param #OPSGROUP self --- @param #number Delay Delay in seconds before respawn happens. Default 0. --- @param DCS#Template Template (optional) The template of the Group retrieved with GROUP:GetTemplate(). If the template is not provided, the template will be retrieved of the group itself. +-- @param #number Delay (Optional) Delay in seconds before respawn happens. Default 0. +-- @param DCS#Template Template (Optional) The template of the Group retrieved with GROUP:GetTemplate(). If the template is not provided, the template will be retrieved of the group itself. -- @return #OPSGROUP self function OPSGROUP:_Spawn(Delay, Template) if Delay and Delay>0 then @@ -8960,8 +8960,8 @@ end --- Get total weight of the group including cargo. Optionally, the total weight of a specific unit can be requested. -- @param #OPSGROUP self --- @param #string UnitName Name of the unit. Default is of the whole group. --- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. +-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group. +-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. -- @return #number Total weight in kg. function OPSGROUP:GetWeightTotal(UnitName, IncludeReserved) @@ -8996,8 +8996,8 @@ end --- Get free cargo bay weight. -- @param #OPSGROUP self --- @param #string UnitName Name of the unit. Default is of the whole group. --- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. +-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group. +-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. -- @return #number Free cargo bay in kg. function OPSGROUP:GetFreeCargobay(UnitName, IncludeReserved) @@ -9018,8 +9018,8 @@ end --- Get relative free cargo bay in percent. -- @param #OPSGROUP self --- @param #string UnitName Name of the unit. Default is of the whole group. --- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. +-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group. +-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. -- @return #number Free cargo bay in percent. function OPSGROUP:GetFreeCargobayRelative(UnitName, IncludeReserved) @@ -9034,8 +9034,8 @@ end --- Get relative used (loaded) cargo bay in percent. -- @param #OPSGROUP self --- @param #string UnitName Name of the unit. Default is of the whole group. --- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. +-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group. +-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. -- @return #number Used cargo bay in percent. function OPSGROUP:GetUsedCargobayRelative(UnitName, IncludeReserved) local free=self:GetFreeCargobayRelative(UnitName, IncludeReserved) @@ -9075,8 +9075,8 @@ end --- Get weight of the internal cargo the group is carriing right now. -- @param #OPSGROUP self --- @param #string UnitName Name of the unit. Default is of the whole group. --- @param #boolean IncludeReserved If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. +-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group. +-- @param #boolean IncludeReserved (Optional) If `false`, cargo weight that is only *reserved* is **not** counted. By default (`true` or `nil`), the reserved cargo is included. -- @return #number Cargo weight in kg. function OPSGROUP:GetWeightCargo(UnitName, IncludeReserved) @@ -9125,7 +9125,7 @@ end --- Get max weight of the internal cargo the group can carry. Optionally, the max cargo weight of a specific unit can be requested. -- @param #OPSGROUP self --- @param #string UnitName Name of the unit. Default is of the whole group. +-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group. -- @return #number Max cargo weight in kg. This does **not** include any cargo loaded or reserved currently. function OPSGROUP:GetWeightCargoMax(UnitName) @@ -9163,7 +9163,7 @@ end --- Add weight to the internal cargo of an element of the group. -- @param #OPSGROUP self --- @param #string UnitName Name of the unit. Default is of the whole group. +-- @param #string UnitName (Optional) Name of the unit. Default is of the whole group. -- @param #number Weight Cargo weight to be added in kg. function OPSGROUP:AddWeightCargo(UnitName, Weight) @@ -11529,7 +11529,7 @@ end --- Initialize Mission Editor waypoints. -- @param #OPSGROUP self -- @param #OPSGROUP.Waypoint waypoint Waypoint data. --- @param #number wpnumber Waypoint index/number. Default is as last waypoint. +-- @param #number wpnumber (Optional) Waypoint index/number. Default is as last waypoint. function OPSGROUP:_AddWaypoint(waypoint, wpnumber) -- Index. @@ -11999,7 +11999,7 @@ end --- Set the default ROE for the group. This is the ROE state gets when the group is spawned or to which it defaults back after a mission. -- @param #OPSGROUP self --- @param #number roe ROE of group. Default is `ENUMS.ROE.ReturnFire`. +-- @param #number roe (Optional) ROE of group. Default is `ENUMS.ROE.ReturnFire`. -- @return #OPSGROUP self function OPSGROUP:SetDefaultROE(roe) self.optionDefault.ROE=roe or ENUMS.ROE.ReturnFire @@ -12008,7 +12008,7 @@ end --- Set current ROE for the group. -- @param #OPSGROUP self --- @param #string roe ROE of group. Default is value set in `SetDefaultROE` (usually `ENUMS.ROE.ReturnFire`). +-- @param #string roe (Optional) ROE of group. Default is value set in `SetDefaultROE` (usually `ENUMS.ROE.ReturnFire`). -- @return #OPSGROUP self function OPSGROUP:SwitchROE(roe) @@ -12061,7 +12061,7 @@ end --- Set the default ROT for the group. This is the ROT state gets when the group is spawned or to which it defaults back after a mission. -- @param #OPSGROUP self --- @param #number rot ROT of group. Default is `ENUMS.ROT.PassiveDefense`. +-- @param #number rot (Optional) ROT of group. Default is `ENUMS.ROT.PassiveDefense`. -- @return #OPSGROUP self function OPSGROUP:SetDefaultROT(rot) self.optionDefault.ROT=rot or ENUMS.ROT.PassiveDefense @@ -12070,7 +12070,7 @@ end --- Set ROT for the group. -- @param #OPSGROUP self --- @param #string rot ROT of group. Default is value set in `:SetDefaultROT` (usually `ENUMS.ROT.PassiveDefense`). +-- @param #string rot (Optional) ROT of group. Default is value set in `:SetDefaultROT` (usually `ENUMS.ROT.PassiveDefense`). -- @return #OPSGROUP self function OPSGROUP:SwitchROT(rot) @@ -12110,7 +12110,7 @@ end --- Set the default Alarm State for the group. This is the state gets when the group is spawned or to which it defaults back after a mission. -- @param #OPSGROUP self --- @param #number alarmstate Alarm state of group. Default is `AI.Option.Ground.val.ALARM_STATE.AUTO` (0). +-- @param #number alarmstate (Optional) Alarm state of group. Default is `AI.Option.Ground.val.ALARM_STATE.AUTO` (0). -- @return #OPSGROUP self function OPSGROUP:SetDefaultAlarmstate(alarmstate) self.optionDefault.Alarm=alarmstate or 0 @@ -12124,7 +12124,7 @@ end -- * 2 = "Red" -- -- @param #OPSGROUP self --- @param #number alarmstate Alarm state of group. Default is 0="Auto". +-- @param #number alarmstate (Optional) Alarm state of group. Default is 0="Auto". -- @return #OPSGROUP self function OPSGROUP:SwitchAlarmstate(alarmstate) @@ -12171,7 +12171,7 @@ end --- Set the default EPLRS for the group. -- @param #OPSGROUP self --- @param #boolean OnOffSwitch If `true`, EPLRS is on by default. If `false` default EPLRS setting is off. If `nil`, default is on if group has EPLRS and off if it does not have a datalink. +-- @param #boolean OnOffSwitch (Optional) If `true`, EPLRS is on by default. If `false` default EPLRS setting is off. If `nil`, default is on if group has EPLRS and off if it does not have a datalink. -- @return #OPSGROUP self function OPSGROUP:SetDefaultEPLRS(OnOffSwitch) @@ -12226,7 +12226,7 @@ end --- Set the default emission state for the group. -- @param #OPSGROUP self --- @param #boolean OnOffSwitch If `true`, EPLRS is on by default. If `false` default EPLRS setting is off. If `nil`, default is on if group has EPLRS and off if it does not have a datalink. +-- @param #boolean OnOffSwitch (Optional) If `true`, EPLRS is on by default. If `false` default EPLRS setting is off. If `nil`, default is on if group has EPLRS and off if it does not have a datalink. -- @return #OPSGROUP self function OPSGROUP:SetDefaultEmission(OnOffSwitch) @@ -12281,7 +12281,7 @@ end --- Set the default invisible for the group. -- @param #OPSGROUP self --- @param #boolean OnOffSwitch If `true`, group is ivisible by default. +-- @param #boolean OnOffSwitch (Optional) If `true`, group is ivisible by default. -- @return #OPSGROUP self function OPSGROUP:SetDefaultInvisible(OnOffSwitch) @@ -12330,7 +12330,7 @@ end --- Set the default immortal for the group. -- @param #OPSGROUP self --- @param #boolean OnOffSwitch If `true`, group is immortal by default. +-- @param #boolean OnOffSwitch (Optional) If `true`, group is immortal by default. -- @return #OPSGROUP self function OPSGROUP:SetDefaultImmortal(OnOffSwitch) @@ -12382,11 +12382,11 @@ end --- Set default TACAN parameters. -- @param #OPSGROUP self --- @param #number Channel TACAN channel. Default is 74. --- @param #string Morse Morse code. Default "XXX". +-- @param #number Channel (Optional) TACAN channel. Default is 74. +-- @param #string Morse(Optional) Morse code. Default "XXX". -- @param #string UnitName Name of the unit acting as beacon. --- @param #string Band TACAN mode. Default is "X" for ground and "Y" for airborne units. --- @param #boolean OffSwitch If true, TACAN is off by default. +-- @param #string Band (Optional) TACAN mode. Default is "X" for ground and "Y" for airborne units. +-- @param #boolean OffSwitch (Optional) If true, TACAN is off by default. -- @return #OPSGROUP self function OPSGROUP:SetDefaultTACAN(Channel, Morse, UnitName, Band, OffSwitch) @@ -12415,7 +12415,7 @@ end --- Activate/switch TACAN beacon settings. -- @param #OPSGROUP self --- @param #OPSGROUP.Beacon Tacan TACAN data table. Default is the default TACAN settings. +-- @param #OPSGROUP.Beacon Tacan (Optional) TACAN data table. Default is the default TACAN settings. -- @return #OPSGROUP self function OPSGROUP:_SwitchTACAN(Tacan) @@ -12438,9 +12438,9 @@ end --- Activate/switch TACAN beacon settings. -- @param #OPSGROUP self -- @param #number Channel TACAN Channel. --- @param #string Morse TACAN morse code. Default is the value set in @{#OPSGROUP.SetDefaultTACAN} or if not set "XXX". --- @param #string UnitName Name of the unit in the group which should activate the TACAN beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group. --- @param #string Band TACAN channel mode "X" or "Y". Default is "Y" for aircraft and "X" for ground and naval groups. +-- @param #string Morse (Optional) TACAN morse code. Default is the value set in @{#OPSGROUP.SetDefaultTACAN} or if not set "XXX". +-- @param #string UnitName (Optional) Name of the unit in the group which should activate the TACAN beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group. +-- @param #string Band (Optional) TACAN channel mode "X" or "Y". Default is "Y" for aircraft and "X" for ground and naval groups. -- @return #OPSGROUP self function OPSGROUP:SwitchTACAN(Channel, Morse, UnitName, Band) @@ -12547,10 +12547,10 @@ end --- Set default ICLS parameters. -- @param #OPSGROUP self --- @param #number Channel ICLS channel. Default is 1. --- @param #string Morse Morse code. Default "XXX". +-- @param #number Channel (Optional) ICLS channel. Default is 1. +-- @param #string Morse (Optional) Morse code. Default "XXX". -- @param #string UnitName Name of the unit acting as beacon. --- @param #boolean OffSwitch If true, TACAN is off by default. +-- @param #boolean OffSwitch (Optional) If true, TACAN is off by default. -- @return #OPSGROUP self function OPSGROUP:SetDefaultICLS(Channel, Morse, UnitName, OffSwitch) @@ -12593,9 +12593,9 @@ end --- Activate/switch ICLS beacon settings. -- @param #OPSGROUP self --- @param #number Channel ICLS Channel. Default is what is set in `SetDefaultICLS()` so usually channel 1. --- @param #string Morse ICLS morse code. Default is what is set in `SetDefaultICLS()` so usually "XXX". --- @param #string UnitName Name of the unit in the group which should activate the ICLS beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group. +-- @param #number Channel (Optional) ICLS Channel. Default is what is set in `SetDefaultICLS()` so usually channel 1. +-- @param #string Morse (Optional) ICLS morse code. Default is what is set in `SetDefaultICLS()` so usually "XXX". +-- @param #string UnitName (Optional) Name of the unit in the group which should activate the ICLS beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group. -- @return #OPSGROUP self function OPSGROUP:SwitchICLS(Channel, Morse, UnitName) @@ -12669,9 +12669,9 @@ end --- Set default Radio frequency and modulation. -- @param #OPSGROUP self --- @param #number Frequency Radio frequency in MHz. Default 251 MHz. --- @param #number Modulation Radio modulation. Default `radio.modulation.AM`. --- @param #boolean OffSwitch If true, radio is OFF by default. +-- @param #number Frequency (Optional) Radio frequency in MHz. Default 251 MHz. +-- @param #number Modulation (Optional) Radio modulation. Default `radio.modulation.AM`. +-- @param #boolean OffSwitch (Optional) If true, radio is OFF by default. -- @return #OPSGROUP self function OPSGROUP:SetDefaultRadio(Frequency, Modulation, OffSwitch) @@ -12698,8 +12698,8 @@ end --- Turn radio on or switch frequency/modulation. -- @param #OPSGROUP self --- @param #number Frequency Radio frequency in MHz. Default is value set in `SetDefaultRadio` (usually 251 MHz). --- @param #number Modulation Radio modulation. Default is value set in `SetDefaultRadio` (usually `radio.modulation.AM`). +-- @param #number Frequency (Optional) Radio frequency in MHz. Default is value set in `SetDefaultRadio` (usually 251 MHz). +-- @param #number Modulation (Optional) Radio modulation. Default is value set in `SetDefaultRadio` (usually `radio.modulation.AM`). -- @return #OPSGROUP self function OPSGROUP:SwitchRadio(Frequency, Modulation) @@ -12778,7 +12778,7 @@ end --- Switch to a specific formation. -- @param #OPSGROUP self --- @param #number Formation New formation the group will fly in. Default is the setting of `SetDefaultFormation()`. +-- @param #number Formation (Optional) New formation the group will fly in. Default is the setting of `SetDefaultFormation()`. -- @return #OPSGROUP self function OPSGROUP:SwitchFormation(Formation) @@ -12815,7 +12815,7 @@ end --- Set default callsign. -- @param #OPSGROUP self -- @param #number CallsignName Callsign name. --- @param #number CallsignNumber Callsign number. Default 1. +-- @param #number CallsignNumber (Optional) Callsign number. Default 1. -- @return #OPSGROUP self function OPSGROUP:SetDefaultCallsign(CallsignName, CallsignNumber) @@ -13540,7 +13540,7 @@ end --- Get the number of shells a unit or group currently has. For a group the ammo count of all units is summed up. -- @param #OPSGROUP self -- @param Wrapper.Unit#UNIT unit The unit object. --- @param #boolean display Display ammo table as message to all. Default false. +-- @param #boolean display (Optional) Display ammo table as message to all. Default false. -- @return #OPSGROUP.Ammo Ammo data. function OPSGROUP:GetAmmoUnit(unit, display) @@ -13975,7 +13975,7 @@ end --- Set the template of the group. -- @param #OPSGROUP self --- @param #table Template Template to set. Default is from the GROUP. +-- @param #table Template (Optional) Template to set. Default is from the GROUP. -- @return #OPSGROUP self function OPSGROUP:_SetTemplate(Template) @@ -14012,8 +14012,8 @@ end --- Clear waypoints. -- @param #OPSGROUP self --- @param #number IndexMin Clear waypoints up to this min WP index. Default 1. --- @param #number IndexMax Clear waypoints up to this max WP index. Default `#self.waypoints`. +-- @param #number IndexMin (Optional) Clear waypoints up to this min WP index. Default 1. +-- @param #number IndexMax (Optional) Clear waypoints up to this max WP index. Default `#self.waypoints`. function OPSGROUP:ClearWaypoints(IndexMin, IndexMax) IndexMin=IndexMin or 1 diff --git a/Moose Development/Moose/Ops/OpsTransport.lua b/Moose Development/Moose/Ops/OpsTransport.lua index a6bbf9061..ebed80df3 100644 --- a/Moose Development/Moose/Ops/OpsTransport.lua +++ b/Moose Development/Moose/Ops/OpsTransport.lua @@ -566,7 +566,7 @@ end -- @param #OPSTRANSPORT self -- @param Core.Set#SET_GROUP GroupSet Set of groups to be transported. Can also be passed as a single GROUP or OPSGROUP object. -- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo Transport zone combo. --- @param #boolean DisembarkActivation If `true`, cargo group is activated when disembarked. If `false`, cargo groups are late activated when disembarked. Default `nil` (usually activated). +-- @param #boolean DisembarkActivation (Optional) If `true`, cargo group is activated when disembarked. If `false`, cargo groups are late activated when disembarked. Default `nil` (usually activated). -- @param Core.Zone#ZONE DisembarkZone Zone where the groups disembark to. -- @param Core.Set#SET_OPSGROUP DisembarkCarriers Carrier groups where the cargo directly disembarks to. -- @return #OPSTRANSPORT self @@ -644,8 +644,8 @@ end -- @param Wrapper.Storage#STORAGE StorageTo Storage warehouse to which the cargo is delivered. -- @param #string CargoType Type of cargo, *e.g.* `"weapons.bombs.Mk_84"` or liquid type as #number. -- @param #number CargoAmount Amount of cargo. Liquids in kg. --- @param #number CargoWeight Weight of a single cargo item in kg. Default 1 kg. --- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo Transport zone combo if other than default. +-- @param #number CargoWeight (Optional) Weight of a single cargo item in kg. Default 1 kg. +-- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo (Optional) Transport zone combo if other than default. -- @return #OPSTRANSPORT self function OPSTRANSPORT:AddCargoStorage(StorageFrom, StorageTo, CargoType, CargoAmount, CargoWeight, TransportZoneCombo) @@ -1052,8 +1052,8 @@ end --- Set number of required carrier groups for an OPSTRANSPORT assignment. Only used if transport is assigned at **LEGION** or higher level. -- @param #OPSTRANSPORT self --- @param #number NcarriersMin Number of carriers *at least* required. Default 1. --- @param #number NcarriersMax Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. +-- @param #number NcarriersMin (Optional) Number of carriers *at least* required. Default 1. +-- @param #number NcarriersMax (Optional) Number of carriers *at most* used for transportation. Default is same as `NcarriersMin`. -- @return #OPSTRANSPORT self function OPSTRANSPORT:SetRequiredCarriers(NcarriersMin, NcarriersMax) @@ -1258,7 +1258,7 @@ end --- Set transport start and stop time. -- @param #OPSTRANSPORT self --- @param #string ClockStart Time the transport is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added. +-- @param #string ClockStart (Optional) Time the transport is started, e.g. "05:00" for 5 am. If specified as a #number, it will be relative (in seconds) to the current mission time. Default is 5 seconds after mission was added. -- @param #string ClockStop (Optional) Time the transport is stopped, e.g. "13:00" for 1 pm. If mission could not be started at that time, it will be removed from the queue. If specified as a #number it will be relative (in seconds) to the current mission time. -- @return #OPSTRANSPORT self function OPSTRANSPORT:SetTime(ClockStart, ClockStop) @@ -1294,9 +1294,9 @@ end --- Set mission priority and (optional) urgency. Urgent missions can cancel other running missions. -- @param #OPSTRANSPORT self --- @param #number Prio Priority 1=high, 100=low. Default 50. --- @param #number Importance Number 1-10. If missions with lower value are in the queue, these have to be finished first. Default is `nil`. --- @param #boolean Urgent If *true*, another running mission might be cancelled if it has a lower priority. +-- @param #number Prio (Optional) Priority 1=high, 100=low. Default 50. +-- @param #number Importance (Optional) Number 1-10. If missions with lower value are in the queue, these have to be finished first. Default is `nil`. +-- @param #boolean Urgent (Optional) If *true*, another running mission might be cancelled if it has a lower priority. -- @return #OPSTRANSPORT self function OPSTRANSPORT:SetPriority(Prio, Importance, Urgent) self.prio=Prio or 50 @@ -1307,7 +1307,7 @@ end --- Set verbosity. -- @param #OPSTRANSPORT self --- @param #number Verbosity Be more verbose. Default 0 +-- @param #number Verbosity (Optional) Be more verbose. Default 0 -- @return #OPSTRANSPORT self function OPSTRANSPORT:SetVerbosity(Verbosity) self.verbose=Verbosity or 0 @@ -1345,8 +1345,8 @@ end -- path. -- @param #OPSTRANSPORT self -- @param Wrapper.Group#GROUP PathGroup A (late activated) GROUP defining a transport path by their waypoints. --- @param #number Radius Randomization radius in meters. Default 0 m. --- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo Transport Zone combo. +-- @param #number Radius (Optional) Randomization radius in meters. Default 0 m. +-- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo (Optional) Transport Zone combo. -- @return #OPSTRANSPORT self function OPSTRANSPORT:AddPathTransport(PathGroup, Reversed, Radius, TransportZoneCombo) @@ -1731,7 +1731,7 @@ end --- Check if all cargo was delivered (or is dead). -- @param #OPSTRANSPORT self --- @param #number Nmin Number of groups that must be actually delivered (and are not dead). Default 0. +-- @param #number Nmin (Optional) Number of groups that must be actually delivered (and are not dead). Default 0. -- @return #boolean If true, all possible cargo was delivered. function OPSTRANSPORT:IsDelivered(Nmin) local is=self:is(OPSTRANSPORT.Status.DELIVERED) @@ -2298,7 +2298,7 @@ end -- @param Wrapper.Storage#STORAGE StorageTo Storage to. -- @param #string CargoType Type of cargo. -- @param #number CargoAmount Total amount of cargo that should be transported. Liquids in kg. --- @param #number CargoWeight Weight of a single cargo item in kg. Default 1 kg. +-- @param #number CargoWeight (Optional) Weight of a single cargo item in kg. Default 1 kg. -- @param #OPSTRANSPORT.TransportZoneCombo TransportZoneCombo Transport zone combo. -- @return Ops.OpsGroup#OPSGROUP.CargoGroup Cargo group data. function OPSTRANSPORT:_CreateCargoStorage(StorageFrom, StorageTo, CargoType, CargoAmount, CargoWeight, TransportZoneCombo) diff --git a/Moose Development/Moose/Ops/OpsZone.lua b/Moose Development/Moose/Ops/OpsZone.lua index 9a47b16ae..6ff5eaf32 100644 --- a/Moose Development/Moose/Ops/OpsZone.lua +++ b/Moose Development/Moose/Ops/OpsZone.lua @@ -121,7 +121,7 @@ OPSZONE.version="0.6.2" --- Create a new OPSZONE class object. -- @param #OPSZONE self -- @param Core.Zone#ZONE Zone The zone. Can be passed as ZONE\_RADIUS, ZONE_POLYGON, ZONE\_AIRBASE or simply as the name of the airbase. --- @param #number CoalitionOwner Initial owner of the coaliton. Default `coalition.side.NEUTRAL`. +-- @param #number CoalitionOwner (Optional) Initial owner of the coaliton. Default `coalition.side.NEUTRAL`. -- @return #OPSZONE self -- @usage -- myopszone = OPSZONE:New(ZONE:FindByName("OpsZoneOne"), coalition.side.RED) -- base zone from the mission editor @@ -385,7 +385,7 @@ end --- Set verbosity level. -- @param #OPSZONE self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #OPSZONE self function OPSZONE:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -400,7 +400,7 @@ end -- Which units can capture zones can be further refined by `:SetUnitCategories()`. -- -- @param #OPSZONE self --- @param #table Categories Object categories. Default is `{Object.Category.UNIT, Object.Category.STATIC}`. +-- @param #table Categories (Optional) Object categories. Default is `{Object.Category.UNIT, Object.Category.STATIC}`. -- @return #OPSZONE self function OPSZONE:SetObjectCategories(Categories) @@ -417,7 +417,7 @@ end --- Set categories of units that can capture or hold the zone. See [DCS Class Unit](https://wiki.hoggitworld.com/view/DCS_Class_Unit). -- @param #OPSZONE self --- @param #table Categories Table of unit categories. Default `{Unit.Category.GROUND_UNIT}`. +-- @param #table Categories (Optional) Table of unit categories. Default `{Unit.Category.GROUND_UNIT}`. -- @return #OPSZONE self function OPSZONE:SetUnitCategories(Categories) @@ -435,7 +435,7 @@ end --- Set threat level threshold that the offending units must have to capture a zone. -- The reason why you might want to set this is that unarmed units (*e.g.* fuel trucks) should not be able to capture a zone as they do not pose a threat. -- @param #OPSZONE self --- @param #number Threatlevel Threat level threshold. Default 0. +-- @param #number Threatlevel (Optional) Threat level threshold. Default 0. -- @return #OPSZONE self function OPSZONE:SetCaptureThreatlevel(Threatlevel) @@ -446,7 +446,7 @@ end --- Set how many units must be present in a zone to capture it. By default, one unit is enough. -- @param #OPSZONE self --- @param #number Nunits Number of units. Default 1. +-- @param #number Nunits (Optional) Number of units. Default 1. -- @return #OPSZONE self function OPSZONE:SetCaptureNunits(Nunits) @@ -460,7 +460,7 @@ end --- Set time how long an attacking coalition must have troops inside a zone before it captures the zone. -- @param #OPSZONE self --- @param #number Tcapture Time in seconds. Default 0. +-- @param #number Tcapture (Optional) Time in seconds. Default 0. -- @return #OPSZONE self function OPSZONE:SetCaptureTime(Tcapture) diff --git a/Moose Development/Moose/Ops/Platoon.lua b/Moose Development/Moose/Ops/Platoon.lua index 8b380a134..564cb9d58 100644 --- a/Moose Development/Moose/Ops/Platoon.lua +++ b/Moose Development/Moose/Ops/Platoon.lua @@ -55,7 +55,7 @@ PLATOON.version="0.1.0" --- Create a new PLATOON object and start the FSM. -- @param #PLATOON self -- @param #string TemplateGroupName Name of the template group. --- @param #number Ngroups Number of asset groups of this platoon. Default 3. +-- @param #number Ngroups (Optional) Number of asset groups of this platoon. Default 3. -- @param #string PlatoonName Name of the platoon. Must be **unique**! -- @return #PLATOON self function PLATOON:New(TemplateGroupName, Ngroups, PlatoonName) diff --git a/Moose Development/Moose/Ops/PlayerRecce.lua b/Moose Development/Moose/Ops/PlayerRecce.lua index 544c25034..1356b4d90 100644 --- a/Moose Development/Moose/Ops/PlayerRecce.lua +++ b/Moose Development/Moose/Ops/PlayerRecce.lua @@ -1542,9 +1542,9 @@ end --- [User] Set SRS TTS details - see @{Sound.SRS} for details -- @param #PLAYERRECCE self --- @param #number Frequency Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations! --- @param #number Modulation Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies! --- @param #string PathToSRS Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" +-- @param #number Frequency (Optional) Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations! +-- @param #number Modulation (Optional) Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies! +-- @param #string PathToSRS (Optional) Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" -- @param #string Gender (Optional) Defaults to "male" -- @param #string Culture (Optional) Defaults to "en-US" -- @param #number Port (Optional) Defaults to 5002 diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index a43909dfb..6348b0be7 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -115,9 +115,9 @@ PLAYERTASK.version="0.1.31" -- @param #PLAYERTASK self -- @param Ops.Auftrag#AUFTRAG.Type Type Type of this task -- @param Ops.Target#TARGET Target Target for this task --- @param #boolean Repeat Repeat this task if true (default = false) --- @param #number Times Repeat on failure this many times if Repeat is true (default = 1) --- @param #string TTSType TTS friendly task type name +-- @param #boolean Repeat (Optional) Repeat this task if true (default = false) +-- @param #number Times (Optional) Repeat on failure this many times if Repeat is true (default = 1) +-- @param #string TTSType (Optional) TTS friendly task type name. Defaultsto "close air support". -- @return #PLAYERTASK self function PLAYERTASK:New(Type, Target, Repeat, Times, TTSType) @@ -272,8 +272,8 @@ end --- Constructor that automatically determines the task type based on the target. -- @param #PLAYERTASK self -- @param Ops.Target#TARGET Target Target for this task --- @param #boolean Repeat Repeat this task if true (default = false) --- @param #number Times Repeat on failure this many times if Repeat is true (default = 1) +-- @param #boolean Repeat (Optional) Repeat this task if true (default = false) +-- @param #number Times (Optional) Repeat on failure this many times if Repeat is true (default = 1) -- @param #string TTSType TTS friendly task type name -- @return #PLAYERTASK self function PLAYERTASK:NewFromTarget(Target, Repeat, Times, TTSType) @@ -486,7 +486,7 @@ end --- [USER] Set if a task can have a smoke marker. -- @param #PLAYERTASK self --- @param #boolean OnOff If true (default) it can be smoke, false if not. +-- @param #boolean OnOff (Optional) If true (default) it can be smoke, false if not. -- @return #PLAYERTASK self function PLAYERTASK:SetCanSmoke(OnOff) self:T(self.lid.."AddSSetCanSmokeubType") @@ -496,7 +496,7 @@ end --- [USER] Set if a task can show threat details. -- @param #PLAYERTASK self --- @param #boolean OnOff If true (default) it can be shown, false if not. +-- @param #boolean OnOff (Optional) If true (default) it can be shown, false if not. -- @return #PLAYERTASK self function PLAYERTASK:SetShowThreatDetails(OnOff) self:T(self.lid.."SetShowThreatDetails") @@ -686,7 +686,7 @@ end --- [USER] Adds a time limit for the task to be completed. -- @param #PLAYERTASK self --- @param #number TimeLimit Time limit in seconds for the task to be completed. (Default 0 = no time limit) +-- @param #number TimeLimit (Optional) Time limit in seconds for the task to be completed. (Default 0 = no time limit) -- @return #PLAYERTASK self -- @usage -- local mytask = PLAYERTASK:New(AUFTRAG.Type.RECON, ZONE:New("WF Zone"), true, 50, "Deep Earth") @@ -892,7 +892,7 @@ end --- [User] Smoke Target -- @param #PLAYERTASK self --- @param #number Color, defaults to SMOKECOLOR.Red +-- @param #number Color (Optional) Color, defaults to SMOKECOLOR.Red -- @return #PLAYERTASK self function PLAYERTASK:SmokeTarget(Color) self:T(self.lid.."SmokeTarget") @@ -911,7 +911,7 @@ end --- [User] Flare Target -- @param #PLAYERTASK self --- @param #number Color, defaults to FLARECOLOR.Red +-- @param #number Color (Optional) Color, defaults to FLARECOLOR.Red -- @return #PLAYERTASK self function PLAYERTASK:FlareTarget(Color) self:T(self.lid.."SmokeTarget") @@ -927,8 +927,8 @@ end --- [User] Illuminate Target Area -- @param #PLAYERTASK self --- @param #number Power Power of illumination bomb in Candela. Default 1000 cd. --- @param #number Height Height above target used to release the bomb, default 150m. +-- @param #number Power (Optional) Power of illumination bomb in Candela. Default 1000 cd. +-- @param #number Height (Optional) Height above target used to release the bomb, default 150m. -- @return #PLAYERTASK self function PLAYERTASK:IlluminateTarget(Power,Height) self:T(self.lid.."IlluminateTarget") @@ -2021,9 +2021,9 @@ PLAYERTASKCONTROLLER.version="0.1.73" --- Create and run a new TASKCONTROLLER instance. -- @param #PLAYERTASKCONTROLLER self -- @param #string Name Name of this controller --- @param #number Coalition of this controller, e.g. coalition.side.BLUE --- @param #string Type Type of the tasks controlled, defaults to PLAYERTASKCONTROLLER.Type.A2G --- @param #string ClientFilter (optional) Additional prefix filter for the SET_CLIENT. Can be handed as @{Core.Set#SET_CLIENT} also. +-- @param #number Coalition (Optional) Coalition of this controller. Defaults to coalition.side.BLUE +-- @param #string Type (Optional) Type of the tasks controlled, defaults to PLAYERTASKCONTROLLER.Type.A2G +-- @param #string ClientFilter (Optional) Additional prefix filter for the SET_CLIENT. Can be handed as @{Core.Set#SET_CLIENT} also. -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:New(Name, Coalition, Type, ClientFilter) @@ -2317,7 +2317,7 @@ end --- [User] Set flash directions option for player (player based info) -- @param #PLAYERTASKCONTROLLER self --- @param #boolean OnOff Set to `true` to switch on and `false` to switch off. Default is OFF. +-- @param #boolean OnOff (Optional) Set to `true` to switch on and `false` to switch off. Default is OFF. -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SetAllowFlashDirection(OnOff) self:T(self.lid.."SetAllowFlashDirection") @@ -2327,7 +2327,7 @@ end --- [User] Set to show a menu entry to retrieve the radio frequencies used. -- @param #PLAYERTASKCONTROLLER self --- @param #boolean OnOff Set to `true` to switch on and `false` to switch off. Default is OFF. +-- @param #boolean OnOff (Optional) Set to `true` to switch on and `false` to switch off. Default is OFF. -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SetShowRadioInfoMenu(OnOff) self:T(self.lid.."SetAllowRadioInfoMenu") @@ -2436,8 +2436,8 @@ end --- [User] Set repetition options for tasks. -- @param #PLAYERTASKCONTROLLER self --- @param #boolean OnOff Set to `true` to switch on and `false` to switch off (defaults to true) --- @param #number Repeats Number of repeats (defaults to 5) +-- @param #boolean OnOff (Optional) Set to `true` to switch on and `false` to switch off (defaults to true) +-- @param #number Repeats (Optional) Number of repeats (defaults to 5) -- @return #PLAYERTASKCONTROLLER self -- @usage `taskmanager:SetTaskRepetition(true, 5)` function PLAYERTASKCONTROLLER:SetTaskRepetition(OnOff, Repeats) @@ -2454,7 +2454,7 @@ end --- [User] Set how long the briefing is shown on screen. -- @param #PLAYERTASKCONTROLLER self --- @param #number Seconds Duration in seconds. Defaults to 30 seconds. +-- @param #number Seconds (Optional) Duration in seconds. Defaults to 30 seconds. -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SetBriefingDuration(Seconds) self:T(self.lid.."SetBriefingDuration") @@ -2484,7 +2484,7 @@ end -- @param #PLAYERTASKCONTROLLER self -- @param Ops.FlightGroup#FLIGHTGROUP FlightGroup The FlightGroup (e.g. drone) to be used for lasing (one unit in one group only). -- Can optionally be handed as Ops.ArmyGroup#ARMYGROUP - **Note** might not find an LOS spot or get lost on the way. Cannot island-hop. --- @param #number LaserCode The lasercode to be used. Defaults to 1688. +-- @param #number LaserCode (Optional) The lasercode to be used. Defaults to 1688. -- @param Core.Point#COORDINATE HoldingPoint (Optional) Point where the drone should initially circle. If not set, defaults to BullsEye of the coalition. -- @param #number Alt (Optional) Altitude in feet. Only applies if using a FLIGHTGROUP object! Defaults to 10000. -- @param #number Speed (Optional) Speed in knots. Only applies if using a FLIGHTGROUP object! Defaults to 120. @@ -2567,7 +2567,7 @@ end -- @param #PLAYERTASKCONTROLLER self -- @param Ops.FlightGroup#FLIGHTGROUP FlightGroup The FlightGroup (e.g. drone) to be used for lasing (one unit in one group only). -- Can optionally be handed as Ops.ArmyGroup#ARMYGROUP - **Note** might not find an LOS spot or get lost on the way. Cannot island-hop. --- @param #number LaserCode The lasercode to be used. Defaults to 1688. +-- @param #number LaserCode (Optional) The lasercode to be used. Defaults to 1688. -- @param Core.Point#COORDINATE HoldingPoint (Optional) Point where the drone should initially circle. If not set, defaults to BullsEye of the coalition. -- @param #number Alt (Optional) Altitude in feet. Only applies if using a FLIGHTGROUP object! Defaults to 10000. -- @param #number Speed (Optional) Speed in knots. Only applies if using a FLIGHTGROUP object! Defaults to 120. @@ -2704,8 +2704,8 @@ end -- @param #PLAYERTASKCONTROLLER self -- @param #boolean InfoMenu If `true` this option will allow to show the Task Info-Menu also when a player has an active task. -- Since the menu isn't refreshed if a player holds an active task, the info in there might be stale. --- @param #number ItemLimit Number of items per task type to show, default 5. --- @param #number HoldTime Minimum number of seconds between menu refreshes (called every 30 secs) if a player has **no active task**. +-- @param #number ItemLimit (Optional) Number of items per task type to show, default 5. +-- @param #number HoldTime (Optional) Minimum number of seconds between menu refreshes (called every 30 secs) if a player has **no active task**. -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SetMenuOptions(InfoMenu,ItemLimit,HoldTime) self:T(self.lid.."SetMenuOptions") @@ -2840,7 +2840,7 @@ end --- [User] Set target radius. Determines the zone radius to distinguish CAS from BAI tasks and to find enemies if the TARGET object is a COORDINATE. -- @param #PLAYERTASKCONTROLLER self --- @param #number Radius Radius to use in meters. Defaults to 500 meters. +-- @param #number Radius (Optional) Radius to use in meters. Defaults to 500 meters. -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SetTargetRadius(Radius) self:T(self.lid.."SetTargetRadius") @@ -2851,7 +2851,7 @@ end --- [User] Set the cluster radius if you want to use target clusters rather than single group detection. -- Note that for a controller type A2A target clustering is on by default. Also remember that the diameter of the resulting zone is double the radius. -- @param #PLAYERTASKCONTROLLER self --- @param #number Radius Target cluster radius in kilometers. Default is 0.5km. +-- @param #number Radius (Optional) Target cluster radius in kilometers. Default is 0.5km. -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SetClusterRadius(Radius) self:T(self.lid.."SetClusterRadius") @@ -2873,7 +2873,7 @@ end --- [User] Switch usage of target names for menu entries on or off -- @param #PLAYERTASKCONTROLLER self --- @param #boolean OnOff If true, set to on (default), if nil or false, set to off +-- @param #boolean OnOff (Optional) If true, set to on (default), if nil or false, set to off -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SwitchUseGroupNames(OnOff) self:T(self.lid.."SwitchUseGroupNames") @@ -2887,7 +2887,7 @@ end --- [User] Switch showing additional magnetic angles -- @param #PLAYERTASKCONTROLLER self --- @param #boolean OnOff If true, set to on (default), if nil or false, set to off +-- @param #boolean OnOff (Optional) If true, set to on (default), if nil or false, set to off -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SwitchMagenticAngles(OnOff) self:T(self.lid.."SwitchMagenticAngles") @@ -3782,7 +3782,7 @@ end --- Calculate group future position after given seconds. -- @param #PLAYERTASKCONTROLLER self -- @param Wrapper.Group#GROUP group The group to calculate for. --- @param #number seconds Time interval in seconds. Default is `self.prediction`. +-- @param #number seconds (Optional) Time interval in seconds. Default is `self.prediction`. -- @return Core.Point#COORDINATE Calculated future position of the cluster. function PLAYERTASKCONTROLLER:_CalcGroupFuturePosition(group, seconds) @@ -4898,9 +4898,9 @@ end --- [User] Set SRS TTS details - see @{Sound.SRS} for details.`SetSRS()` will try to use as many attributes configured with @{Sound.SRS#MSRS.LoadConfigFile}() as possible. -- @param #PLAYERTASKCONTROLLER self --- @param #number Frequency Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations! --- @param #number Modulation Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies! --- @param #string PathToSRS Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" +-- @param #number Frequency (Optional) Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations! +-- @param #number Modulation (Optional) Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies! +-- @param #string PathToSRS (Optional) Defaults to "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" -- @param #string Gender (Optional) Defaults to "male" -- @param #string Culture (Optional) Defaults to "en-US" -- @param #number Port (Optional) Defaults to 5002 @@ -4909,7 +4909,7 @@ end -- @param #number Volume (Optional) Volume - between 0.0 (silent) and 1.0 (loudest) -- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS; if you use a config file for MSRS, hand in nil here. -- @param #string AccessKey (Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, hand in nil here. --- @param Core.Point#COORDINATE Coordinate Coordinate from which the controller radio is sending +-- @param Core.Point#COORDINATE Coordinate (Optional) Coordinate from which the controller radio is sending -- @param #string Backend (Optional) MSRS Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC; if you use a config file for MSRS, hand in nil here. -- @return #PLAYERTASKCONTROLLER self function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Coordinate,Backend) diff --git a/Moose Development/Moose/Ops/RecoveryTanker.lua b/Moose Development/Moose/Ops/RecoveryTanker.lua index 59c38e9b2..b0d67e438 100644 --- a/Moose Development/Moose/Ops/RecoveryTanker.lua +++ b/Moose Development/Moose/Ops/RecoveryTanker.lua @@ -564,7 +564,7 @@ end --- Set the speed the tanker flys in its orbit pattern. -- @param #RECOVERYTANKER self --- @param #number speed True air speed (TAS) in knots. Default 274 knots, which results in ~250 KIAS. +-- @param #number speed (Optional) True air speed (TAS) in knots. Default 274 knots, which results in ~250 KIAS. -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetSpeed(speed) self.speed=UTILS.KnotsToMps(speed or 274) @@ -573,7 +573,7 @@ end --- Set orbit pattern altitude of the tanker. -- @param #RECOVERYTANKER self --- @param #number altitude Tanker altitude in feet. Default 6000 ft. +-- @param #number altitude (Optional) Tanker altitude in feet. Default 6000 ft. -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetAltitude(altitude) self.altitude=UTILS.FeetToMeters(altitude or 6000) @@ -582,8 +582,8 @@ end --- Set race-track distances. -- @param #RECOVERYTANKER self --- @param #number distbow Distance [NM] in front of the carrier. Default 10 NM. --- @param #number diststern Distance [NM] behind the carrier. Default 4 NM. +-- @param #number distbow (Optional) Distance [NM] in front of the carrier. Default 10 NM. +-- @param #number diststern (Optional) Distance [NM] behind the carrier. Default 4 NM. -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetRacetrackDistances(distbow, diststern) self.distBow=UTILS.NMToMeters(distbow or 10) @@ -593,7 +593,7 @@ end --- Set minimum pattern update interval. After a pattern update this time interval has to pass before the next update is allowed. -- @param #RECOVERYTANKER self --- @param #number interval Min interval in minutes. Default is 10 minutes. +-- @param #number interval(Optional) Min interval in minutes. Default is 10 minutes. -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetPatternUpdateInterval(interval) self.dTupdate=(interval or 10)*60 @@ -602,7 +602,7 @@ end --- Set pattern update distance threshold. Tanker will update its pattern when the carrier changes its position by more than this distance. -- @param #RECOVERYTANKER self --- @param #number distancechange Distance threshold in NM. Default 5 NM (=9.62 km). +-- @param #number distancechange (Optional) Distance threshold in NM. Default 5 NM (=9.62 km). -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetPatternUpdateDistance(distancechange) self.Dupdate=UTILS.NMToMeters(distancechange or 5) @@ -611,7 +611,7 @@ end --- Set pattern update heading threshold. Tanker will update its pattern when the carrier changes its heading by more than this value. -- @param #RECOVERYTANKER self --- @param #number headingchange Heading threshold in degrees. Default 5 degrees. +-- @param #number headingchange (Optional) Heading threshold in degrees. Default 5 degrees. -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetPatternUpdateHeading(headingchange) self.Hupdate=headingchange or 5 @@ -620,7 +620,7 @@ end --- Set low fuel state of tanker. When fuel is below this threshold, the tanker will RTB or be respawned if takeoff type is in air. -- @param #RECOVERYTANKER self --- @param #number fuelthreshold Low fuel threshold in percent. Default 10 % of max fuel. +-- @param #number fuelthreshold (Optional) Low fuel threshold in percent. Default 10 % of max fuel. -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetLowFuelThreshold(fuelthreshold) self.lowfuel=fuelthreshold or 10 @@ -794,9 +794,9 @@ end --- Set TACAN channel of tanker. Note that mode is automatically set to "Y" for AA TACAN since only that works. -- @param #RECOVERYTANKER self --- @param #number channel TACAN channel. Default 1. --- @param #string morse TACAN morse code identifier. Three letters. Default "TKR". --- @param #string mode TACAN mode, which can be either "Y" (default) or "X". +-- @param #number channel (Optional) TACAN channel. Default 1. +-- @param #string morse (Optional) TACAN morse code identifier. Three letters. Default "TKR". +-- @param #string mode (Optional) TACAN mode, which can be either "Y" (default) or "X". -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetTACAN(channel, morse, mode) self.TACANchannel=channel or 1 @@ -808,8 +808,8 @@ end --- Set radio frequency and optionally modulation of the tanker. -- @param #RECOVERYTANKER self --- @param #number frequency Radio frequency in MHz. Default 251 MHz. --- @param #string modulation Radio modulation, either "AM" or "FM". Default "AM". +-- @param #number frequency (Optional) Radio frequency in MHz. Default 251 MHz. +-- @param #string modulation (Optional) Radio modulation, either "AM" or "FM". Default "AM". -- @return #RECOVERYTANKER self function RECOVERYTANKER:SetRadio(frequency, modulation) self.RadioFreq=frequency or 251 @@ -1537,8 +1537,8 @@ end --- Init waypoint after spawn. Tanker is first guided to a position astern the carrier and starts its racetrack pattern from there. -- @param #RECOVERYTANKER self --- @param #number dist Distance [NM] of initial waypoint astern carrier. Default 8 NM. --- @param #number delay Delay before routing in seconds. Default 1 second. +-- @param #number dist (Optional) Distance [NM] of initial waypoint astern carrier. Default 8 NM. +-- @param #number delay (Optional) Delay before routing in seconds. Default 1 second. function RECOVERYTANKER:_InitRoute(dist, delay) -- Defaults. diff --git a/Moose Development/Moose/Ops/RescueHelo.lua b/Moose Development/Moose/Ops/RescueHelo.lua index 65190c11d..a2dba720a 100644 --- a/Moose Development/Moose/Ops/RescueHelo.lua +++ b/Moose Development/Moose/Ops/RescueHelo.lua @@ -455,7 +455,7 @@ end --- Set low fuel state of helo. When fuel is below this threshold, the helo will RTB or be respawned if takeoff type is in air. -- @param #RESCUEHELO self --- @param #number threshold Low fuel threshold in percent. Default 5%. +-- @param #number threshold (Optional) Low fuel threshold in percent. Default 5%. -- @return #RESCUEHELO self function RESCUEHELO:SetLowFuelThreshold(threshold) self.lowfuel=threshold or 5 @@ -480,7 +480,7 @@ end --- Set rescue zone radius. Crashed or ejected units inside this radius of the carrier will be rescued if possible. -- @param #RESCUEHELO self --- @param #number radius Radius of rescue zone in nautical miles. Default is 15 NM. +-- @param #number radius (Optional) Radius of rescue zone in nautical miles. Default is 15 NM. -- @return #RESCUEHELO self function RESCUEHELO:SetRescueZone(radius) radius=UTILS.NMToMeters(radius or 15) @@ -490,7 +490,7 @@ end --- Set rescue hover speed. -- @param #RESCUEHELO self --- @param #number speed Speed in knots. Default 5 kts. +-- @param #number speed (Optional) Speed in knots. Default 5 kts. -- @return #RESCUEHELO self function RESCUEHELO:SetRescueHoverSpeed(speed) self.rescuespeed=UTILS.KnotsToMps(speed or 5) @@ -499,7 +499,7 @@ end --- Set rescue duration. This is the time it takes to rescue a pilot at the crash site. -- @param #RESCUEHELO self --- @param #number duration Duration in minutes. Default 5 min. +-- @param #number duration (Optional) Duration in minutes. Default 5 min. -- @return #RESCUEHELO self function RESCUEHELO:SetRescueDuration(duration) self.rescueduration=(duration or 5)*60 @@ -541,7 +541,7 @@ end --- Set takeoff type. -- @param #RESCUEHELO self --- @param #number takeofftype Takeoff type. Default SPAWN.Takeoff.Hot. +-- @param #number takeofftype (Optional) Takeoff type. Default SPAWN.Takeoff.Hot. -- @return #RESCUEHELO self function RESCUEHELO:SetTakeoff(takeofftype) self.takeoff=takeofftype or SPAWN.Takeoff.Hot @@ -574,7 +574,7 @@ end --- Set altitude of helo. -- @param #RESCUEHELO self --- @param #number alt Altitude in meters. Default 70 m. +-- @param #number alt (Optional) Altitude in meters. Default 70 m. -- @return #RESCUEHELO self function RESCUEHELO:SetAltitude(alt) self.altitude=alt or 70 @@ -583,7 +583,7 @@ end --- Set offset parallel to orientation of carrier. -- @param #RESCUEHELO self --- @param #number distance Offset distance in meters. Default 200 m (~660 ft). +-- @param #number distance (Optional) Offset distance in meters. Default 200 m (~660 ft). -- @return #RESCUEHELO self function RESCUEHELO:SetOffsetX(distance) self.offsetX=distance or 200 @@ -592,7 +592,7 @@ end --- Set offset perpendicular to orientation to carrier. -- @param #RESCUEHELO self --- @param #number distance Offset distance in meters. Default 240 m (~780 ft). +-- @param #number distance (Optional) Offset distance in meters. Default 240 m (~780 ft). -- @return #RESCUEHELO self function RESCUEHELO:SetOffsetZ(distance) self.offsetZ=distance or 240 @@ -650,7 +650,7 @@ end --- Set follow time update interval. -- @param #RESCUEHELO self --- @param #number dt Time interval in seconds. Default 1.0 sec. +-- @param #number dt (Optional) Time interval in seconds. Default 1.0 sec. -- @return #RESCUEHELO self function RESCUEHELO:SetFollowTimeInterval(dt) self.dtFollow=dt or 1.0 diff --git a/Moose Development/Moose/Ops/Squadron.lua b/Moose Development/Moose/Ops/Squadron.lua index 15d5768ef..61dde58f9 100644 --- a/Moose Development/Moose/Ops/Squadron.lua +++ b/Moose Development/Moose/Ops/Squadron.lua @@ -92,7 +92,7 @@ SQUADRON.version="0.8.1" --- Create a new SQUADRON object and start the FSM. -- @param #SQUADRON self -- @param #string TemplateGroupName Name of the template group. --- @param #number Ngroups Number of asset groups of this squadron. Default 3. +-- @param #number Ngroups (Optional) Number of asset groups of this squadron. Default 3. -- @param #string SquadronName Name of the squadron, e.g. "VFA-37". Must be **unique**! -- @return #SQUADRON self function SQUADRON:New(TemplateGroupName, Ngroups, SquadronName) @@ -125,7 +125,7 @@ end --- Set number of units in groups. -- @param #SQUADRON self --- @param #number nunits Number of units. Must be >=1 and <=4. Default 2. +-- @param #number nunits (Optional) Number of units. Must be >=1 and <=4. Default 2. -- @return #SQUADRON self function SQUADRON:SetGrouping(nunits) self.ngrouping=nunits or 2 @@ -150,7 +150,7 @@ end --- Set takeoff type. All assets of this squadron will be spawned with cold (default) or hot engines. -- Spawning on runways is not supported. -- @param #SQUADRON self --- @param #string TakeoffType Take off type: "Cold" (default) or "Hot" with engines on or "Air" for spawning in air. +-- @param #string TakeoffType (Optional) Take off type: "Cold" (default) or "Hot" with engines on or "Air" for spawning in air. -- @return #SQUADRON self function SQUADRON:SetTakeoffType(TakeoffType) TakeoffType=TakeoffType or "Cold" @@ -193,7 +193,7 @@ end --- Set despawn after landing. Aircraft will be despawned after the landing event. -- Can help to avoid DCS AI taxiing issues. -- @param #SQUADRON self --- @param #boolean Switch If `true` (default), activate despawn after landing. +-- @param #boolean Switch (Optional) If `true` (default), activate despawn after landing. -- @return #SQUADRON self function SQUADRON:SetDespawnAfterLanding(Switch) if Switch then @@ -207,7 +207,7 @@ end --- Set despawn after holding. Aircraft will be despawned when they arrive at their holding position at the airbase. -- Can help to avoid DCS AI taxiing issues. -- @param #SQUADRON self --- @param #boolean Switch If `true` (default), activate despawn after holding. +-- @param #boolean Switch (Optional) If `true` (default), activate despawn after holding. -- @return #SQUADRON self function SQUADRON:SetDespawnAfterHolding(Switch) if Switch then @@ -221,7 +221,7 @@ end --- Set low fuel threshold. -- @param #SQUADRON self --- @param #number LowFuel Low fuel threshold in percent. Default 25. +-- @param #number LowFuel (Optional) Low fuel threshold in percent. Default 25. -- @return #SQUADRON self function SQUADRON:SetFuelLowThreshold(LowFuel) self.fuellow=LowFuel or 25 diff --git a/Moose Development/Moose/Ops/Target.lua b/Moose Development/Moose/Ops/Target.lua index 5a3b75464..96899505b 100644 --- a/Moose Development/Moose/Ops/Target.lua +++ b/Moose Development/Moose/Ops/Target.lua @@ -400,7 +400,7 @@ end --- Set priority of the target. -- @param #TARGET self --- @param #number Priority Priority of the target. Default 50. +-- @param #number Priority (Optional) Priority of the target. Default 50. -- @return #TARGET self function TARGET:SetPriority(Priority) self.prio=Priority or 50 @@ -409,7 +409,7 @@ end --- Set importance of the target. -- @param #TARGET self --- @param #number Importance Importance of the target. Default `nil`. +-- @param #number Importance (Optional) Importance of the target. Default `nil`. -- @return #TARGET self function TARGET:SetImportance(Importance) self.importance=Importance @@ -508,10 +508,10 @@ end --- Add mission type and number of required assets to resource. -- @param #TARGET self -- @param #string MissionType Mission Type. --- @param #number Nmin Min number of required assets. --- @param #number Nmax Max number of requried assets. +-- @param #number Nmin (Optional) Min number of required assets. Default is 1. +-- @param #number Nmax (Optional) Max number of requried assets. Default is 1. -- @param #table Attributes Generalized attribute(s). --- @param #table Properties DCS attribute(s). Default `nil`. +-- @param #table Properties (Optional) DCS attribute(s). Default `nil`. -- @return #TARGET.Resource The resource table. function TARGET:AddResource(MissionType, Nmin, Nmax, Attributes, Properties) diff --git a/Moose Development/Moose/Sound/RadioQueue.lua b/Moose Development/Moose/Sound/RadioQueue.lua index e09ba3c3d..a6baded56 100644 --- a/Moose Development/Moose/Sound/RadioQueue.lua +++ b/Moose Development/Moose/Sound/RadioQueue.lua @@ -170,7 +170,7 @@ end --- Set radio power. Note that this only applies if no relay unit is used. -- @param #RADIOQUEUE self --- @param #number power Radio power in Watts. Default 100 W. +-- @param #number power (Optional) Radio power in Watts. Default 100 W. -- @return #RADIOQUEUE self The RADIOQUEUE object. function RADIOQUEUE:SetRadioPower(power) self.power=power or 100 @@ -179,8 +179,8 @@ end --- Set SRS. -- @param #RADIOQUEUE self --- @param #string PathToSRS Path to SRS. --- @param #number Port SRS port. Default 5002. +-- @param #string PathToSRS (Optional) Path to SRS. +-- @param #number Port (Optional) SRS port. Default 5002. -- @return #RADIOQUEUE self The RADIOQUEUE object. function RADIOQUEUE:SetSRS(PathToSRS, Port) local path = PathToSRS or MSRS.path @@ -195,9 +195,9 @@ end -- @param #number digit The digit 0-9. -- @param #string filename The name of the sound file. -- @param #number duration The duration of the sound file in seconds. --- @param #string path The directory within the miz file where the sound is located. Default "l10n/DEFAULT/". +-- @param #string path (Optional) The directory within the miz file where the sound is located. Default "l10n/DEFAULT/". -- @param #string subtitle Subtitle of the transmission. --- @param #number subduration Duration [sec] of the subtitle being displayed. Default 5 sec. +-- @param #number subduration (Optional) Duration [sec] of the subtitle being displayed. Default 5 sec. -- @return #RADIOQUEUE self The RADIOQUEUE object. function RADIOQUEUE:SetDigit(digit, filename, duration, path, subtitle, subduration) @@ -245,11 +245,11 @@ end -- @param #RADIOQUEUE self -- @param #string filename Name of the sound file. Usually an ogg or wav file type. -- @param #number duration Duration in seconds the file lasts. --- @param #number path Directory path inside the miz file where the sound file is located. Default "l10n/DEFAULT/". --- @param #number tstart Start time (abs) seconds. Default now. --- @param #number interval Interval in seconds after the last transmission finished. +-- @param #number path (Optional) Directory path inside the miz file where the sound file is located. Default "l10n/DEFAULT/". +-- @param #number tstart (Optional) Start time (abs) seconds. Default now. +-- @param #number interval (Optional) Interval in seconds after the last transmission finished. Defaults to 0. -- @param #string subtitle Subtitle of the transmission. --- @param #number subduration Duration [sec] of the subtitle being displayed. Default 5 sec. +-- @param #number subduration (Optional) Duration [sec] of the subtitle being displayed. Default 5 sec. -- @return #RADIOQUEUE.Transmission Radio transmission table. function RADIOQUEUE:NewTransmission(filename, duration, path, tstart, interval, subtitle, subduration) @@ -295,8 +295,8 @@ end --- Add a SOUNDFILE to the radio queue. -- @param #RADIOQUEUE self -- @param Sound.SoundOutput#SOUNDFILE soundfile Sound file object to be added. --- @param #number tstart Start time (abs) seconds. Default now. --- @param #number interval Interval in seconds after the last transmission finished. +-- @param #number tstart (Optional) Start time (abs) seconds. Default now. +-- @param #number interval (Optional) Interval in seconds after the last transmission finished. Defaults to 0. -- @return #RADIOQUEUE self function RADIOQUEUE:AddSoundFile(soundfile, tstart, interval) --env.info(string.format("FF add soundfile: name=%s%s", soundfile:GetPath(), soundfile:GetFileName())) @@ -308,8 +308,8 @@ end --- Add a SOUNDTEXT to the radio queue. -- @param #RADIOQUEUE self -- @param Sound.SoundOutput#SOUNDTEXT soundtext Text-to-speech text. --- @param #number tstart Start time (abs) seconds. Default now. --- @param #number interval Interval in seconds after the last transmission finished. +-- @param #number tstart (Optional) Start time (abs) seconds. Default now. +-- @param #number interval (Optional) Interval in seconds after the last transmission finished. Defaults to 0. -- @return #RADIOQUEUE self function RADIOQUEUE:AddSoundText(soundtext, tstart, interval) diff --git a/Moose Development/Moose/Sound/SRS.lua b/Moose Development/Moose/Sound/SRS.lua index f3fb51bd4..cd20b5033 100644 --- a/Moose Development/Moose/Sound/SRS.lua +++ b/Moose Development/Moose/Sound/SRS.lua @@ -793,10 +793,10 @@ end -- set the path to the exe file via @{#MSRS.SetPath}. -- -- @param #MSRS self --- @param #string Path Path to SRS directory. Default `C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio`. --- @param #number Frequency Radio frequency in MHz. Default 143.00 MHz. Can also be given as a #table of multiple frequencies. --- @param #number Modulation Radio modulation: 0=AM (default), 1=FM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. Can also be given as a #table of multiple modulations. --- @param #string Backend Backend used: `MSRS.Backend.SRSEXE` (default) or `MSRS.Backend.GRPC`. +-- @param #string Path (Optional) Path to SRS directory. Default `C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio`. +-- @param #number Frequency (Optional) Radio frequency in MHz. Default 143.00 MHz. Can also be given as a #table of multiple frequencies. +-- @param #number Modulation (Optional) Radio modulation: 0=AM (default), 1=FM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. Can also be given as a #table of multiple modulations. +-- @param #string Backend (Optional) Backend used: `MSRS.Backend.SRSEXE` (default) or `MSRS.Backend.GRPC`. -- @return #MSRS self function MSRS:New(Path, Frequency, Modulation, Backend) @@ -866,7 +866,7 @@ end -- - `MSRS.Backend.GRPC`: Via DCS-gRPC. -- -- @param #MSRS self --- @param #string Backend Backend used. Default is `MSRS.Backend.SRSEXE`. +-- @param #string Backend (Optional) Backend used. Default is `MSRS.Backend.SRSEXE`. -- @return #MSRS self function MSRS:SetBackend(Backend) self:F( {Backend=Backend} ) @@ -944,7 +944,7 @@ end --- Set path to SRS install directory. More precisely, path to where the `DCS-SR-ExternalAudio.exe` is located. -- @param #MSRS self --- @param #string Path Path to the directory, where the sound file is located. Default is `C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio`. +-- @param #string Path (Optional) Path to the directory, where the sound file is located. Default is `C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio`. -- @return #MSRS self function MSRS:SetPath(Path) self:F( {Path=Path} ) @@ -993,7 +993,7 @@ end --- Set label. -- @param #MSRS self --- @param #number Label. Default "ROBOT" +-- @param #number Label (Optional) Label. Default "ROBOT" -- @return #MSRS self function MSRS:SetLabel(Label) self:F( {Label=Label} ) @@ -1010,7 +1010,7 @@ end --- Set port. -- @param #MSRS self --- @param #number Port Port. Default 5002. +-- @param #number Port (Optional) Port. Default 5002. -- @return #MSRS self function MSRS:SetPort(Port) self:F( {Port=Port} ) @@ -1028,7 +1028,7 @@ end --- Set coalition. -- @param #MSRS self --- @param #number Coalition Coalition. Default 0. +-- @param #number Coalition (Optional) Coalition. Default 0. -- @return #MSRS self function MSRS:SetCoalition(Coalition) self:F( {Coalition=Coalition} ) @@ -1114,7 +1114,7 @@ end --- Set gender. -- @param #MSRS self --- @param #string Gender Gender: "male" or "female" (default). +-- @param #string Gender (Optional) Gender: "male" or "female" (default). -- @return #MSRS self function MSRS:SetGender(Gender) self:F( {Gender=Gender} ) @@ -1153,7 +1153,7 @@ end --- Set to use a specific voice for a given provider. Note that this will override any gender and culture settings. -- @param #MSRS self -- @param #string Voice Voice. --- @param #string Provider Provider. Default is as set by @{#MSRS.SetProvider}, which itself defaults to `MSRS.Provider.WINDOWS` if not set. +-- @param #string Provider (Optional) Provider. Default is as set by @{#MSRS.SetProvider}, which itself defaults to `MSRS.Provider.WINDOWS` if not set. -- @return #MSRS self function MSRS:SetVoiceProvider(Voice, Provider) self:F( {Voice=Voice, Provider=Provider} ) @@ -1166,7 +1166,7 @@ end --- Set to use a specific voice if Microsoft Windows' native TTS is use as provider. Note that this will override any gender and culture settings. -- @param #MSRS self --- @param #string Voice Voice. Default `"Microsoft Hazel Desktop"`. +-- @param #string Voice (Optional) Voice. Default `"Microsoft Hazel Desktop"`. -- @return #MSRS self function MSRS:SetVoiceWindows(Voice) self:F( {Voice=Voice} ) @@ -1177,7 +1177,7 @@ end --- Set to use a specific voice if Google is use as provider. Note that this will override any gender and culture settings. -- @param #MSRS self --- @param #string Voice Voice. Default `MSRS.Voices.Google.Standard.en_GB_Standard_A`. +-- @param #string Voice (Optional) Voice. Default `MSRS.Voices.Google.Standard.en_GB_Standard_A`. -- @return #MSRS self function MSRS:SetVoiceGoogle(Voice) self:F( {Voice=Voice} ) @@ -1188,7 +1188,7 @@ end --- Set to use a specific voice if Piper is used as provider (only Hound-TTS backend). Note that this will override any gender and culture settings. -- @param #MSRS self --- @param #string Voice [Piper Voices](https://rhasspy.github.io/piper-samples/). Default `"en_US-ryan-low"`. +-- @param #string Voice (Optional) [Piper Voices](https://rhasspy.github.io/piper-samples/). Default `"en_US-ryan-low"`. -- @return #MSRS self function MSRS:SetVoicePiper(Voice) self:F( {Voice=Voice} ) @@ -1199,7 +1199,7 @@ end --- Set to use a specific voice if Microsoft Azure is use as provider (only DCS-gRPC backend). Note that this will override any gender and culture settings. -- @param #MSRS self --- @param #string Voice [Azure Voice](https://learn.microsoft.com/azure/cognitive-services/speech-service/language-support). Default `"en-US-AriaNeural"`. +-- @param #string Voice (Optional) [Azure Voice](https://learn.microsoft.com/azure/cognitive-services/speech-service/language-support). Default `"en-US-AriaNeural"`. -- @return #MSRS self function MSRS:SetVoiceAzure(Voice) self:F( {Voice=Voice} ) @@ -1210,7 +1210,7 @@ end --- Set to use a specific voice if Amazon Web Service is use as provider (only DCS-gRPC backend). Note that this will override any gender and culture settings. -- @param #MSRS self --- @param #string Voice [AWS Voice](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html). Default `"Brian"`. +-- @param #string Voice (Optional) [AWS Voice](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html). Default `"Brian"`. -- @return #MSRS self function MSRS:SetVoiceAmazon(Voice) self:F( {Voice=Voice} ) @@ -1221,7 +1221,7 @@ end --- Get voice. -- @param #MSRS self --- @param #string Provider Provider. Default is the currently set provider (`self.provider`). +-- @param #string Provider (Optional) Provider. Default is the currently set provider (`self.provider`). -- @return #string Voice. function MSRS:GetVoice(Provider) @@ -1396,7 +1396,7 @@ end --- Get provider options. -- @param #MSRS self --- @param #string Provider Provider. Default is as set via @{#MSRS.SetProvider}. +-- @param #string Provider (Optional) Provider. Default is as set via @{#MSRS.SetProvider}. -- @return #MSRS.ProviderOptions Provider options. function MSRS:GetProviderOptions(Provider) return self.poptions[Provider or self.provider] or {} @@ -1718,7 +1718,7 @@ end -- @param #number volume Volume. -- @param #number speed Speed. -- @param #number port Port. --- @param #string label Label, defaults to "ROBOT" (displayed sender name in the radio overlay of SRS) - No spaces allowed! +-- @param #string label (Optional) Label, defaults to "ROBOT" (displayed sender name in the radio overlay of SRS) - No spaces allowed! -- @param Core.Point#COORDINATE coordinate Coordinate. -- @return #string Command. function MSRS:_GetCommand(freqs, modus, coal, gender, voice, culture, volume, speed, port, label, coordinate) @@ -2020,9 +2020,9 @@ end -- @param #string Message The text to speak. -- @param #table Frequencies The table of frequencies to use. -- @param #table Modulations The table of modulations to use. --- @param #number Volume The volume to use, defaults to 1.0. --- @param #string Label The label to use, defaults to "MSRS". --- @param #number Coalition The coalition to use. +-- @param #number Volume (Optional) The volume to use, defaults to 1.0. +-- @param #string Label (Optional) The label to use, defaults to "MSRS". +-- @param #number Coalition (Optional) The coalition to use. -- @param Core.Point#COORDINATE Point (Optional) The point from which the voice is sent. -- @param #number Speed (Optional) How fast to speak, defaults to 1.0. -- @param #string Gender (Optional) Gender to use. @@ -2162,8 +2162,8 @@ end --- Hound speech time calculator. Use to determine how long it takes to speak something out. -- @param MSRS self -- @param #string Message The message to measure. Can also be handed as string lenght. --- @param #number Speed The speed to use, defaults to 1.0. --- @param #boolean UseGoogle If to use google. Default: no. +-- @param #number Speed (Optional) The speed to use, defaults to 1.0. +-- @param #boolean UseGoogle (Optional) If to use google. Default: no. function MSRS:_HoundSpeechTime(Message,Speed,UseGoogle) local speed = Speed or 1.0 local speechtime = HoundTTS.getSpeechTime(Message, speed, UseGoogle) @@ -2176,8 +2176,8 @@ end --- Get central SRS configuration to be able to play tts over SRS radio using the `DCS-SR-ExternalAudio.exe`. -- @param #MSRS self --- @param #string Path Path to config file, defaults to "C:\Users\\Saved Games\DCS\Config" --- @param #string Filename File to load, defaults to "Moose_MSRS.lua" +-- @param #string Path (Optional) Path to config file, defaults to "C:\Users\\Saved Games\DCS\Config" +-- @param #string Filename (Optional) File to load, defaults to "Moose_MSRS.lua" -- @return #boolean success -- @usage -- 0) Benefits: Centralize configuration of SRS, keep paths and keys out of the mission source code, making it safer and easier to move missions to/between servers, @@ -2320,7 +2320,7 @@ end -- * (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min -- -- @param #number length can also be passed as #string --- @param #number speed Defaults to 1.0 +-- @param #number speed (Optional) Defaults to 1.0 -- @param #boolean isGoogle We're using Google TTS function MSRS.getSpeechTime(length,speed,isGoogle) @@ -2477,22 +2477,22 @@ end --- Create a new transmission and add it to the radio queue. -- @param #MSRSQUEUE self -- @param #string text Text to play. --- @param #number duration Duration in seconds the file lasts. Default is determined by number of characters of the text message. +-- @param #number duration (Optional) Duration in seconds the file lasts. Default is determined by number of characters of the text message. -- @param Sound.SRS#MSRS msrs MOOSE SRS object. --- @param #number tstart Start time (abs) seconds. Default now. --- @param #number interval Interval in seconds after the last transmission finished. +-- @param #number tstart (Optional) Start time (abs) seconds. Default now. +-- @param #number interval (Optional) Interval in seconds after the last transmission finished. -- @param #table subgroups Groups that should receive the subtiltle. -- @param #string subtitle Subtitle displayed when the message is played. --- @param #number subduration Duration [sec] of the subtitle being displayed. Default 5 sec. --- @param #number frequency Radio frequency if other than MSRS default. --- @param #number modulation Radio modulation if other then MSRS default. --- @param #string gender Gender of the voice --- @param #string culture Culture of the voice --- @param #string voice Specific voice --- @param #number volume Volume setting --- @param #string label Label to be used --- @param Core.Point#COORDINATE coordinate Coordinate to be used --- @param #number speed Speed to be used +-- @param #number subduration (Optional) Duration [sec] of the subtitle being displayed. Default 5 sec. +-- @param #number frequency (Optional) Radio frequency if other than MSRS default. +-- @param #number modulation (Optional) Radio modulation if other then MSRS default. +-- @param #string gender (Optional) Gender of the voice +-- @param #string culture C(Optional) ulture of the voice +-- @param #string voice (Optional) Specific voice +-- @param #number volume (Optional) Volume setting +-- @param #string label (Optional) Label to be used +-- @param Core.Point#COORDINATE coordinate (Optional) Coordinate to be used +-- @param #number speed (Optional) Speed to be used -- @return #MSRSQUEUE.Transmission Radio transmission table. function MSRSQUEUE:NewTransmission(text, duration, msrs, tstart, interval, subgroups, subtitle, subduration, frequency, modulation, gender, culture, voice, volume, label,coordinate,speed) self:T({Text=text, Dur=duration, start=tstart, int=interval, sub=subgroups, subt=subtitle, sudb=subduration, F=frequency, M=modulation, G=gender, C=culture, V=voice, Vol=volume, L=label, S=speed}) diff --git a/Moose Development/Moose/Sound/SoundOutput.lua b/Moose Development/Moose/Sound/SoundOutput.lua index 7692b63fa..aa54b895c 100644 --- a/Moose Development/Moose/Sound/SoundOutput.lua +++ b/Moose Development/Moose/Sound/SoundOutput.lua @@ -61,7 +61,7 @@ do -- Sound Base -- * (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min -- -- @param #string Text The text string to analyze. - -- @param #number Speed Speed factor. Default 1. + -- @param #number Speed (Optional) Speed factor. Default 1. -- @param #boolean isGoogle If true, google text-to-speech is used. function SOUNDBASE:GetSpeechTime(length,speed,isGoogle) @@ -158,9 +158,9 @@ do -- Sound File --- Constructor to create a new SOUNDFILE object. -- @param #SOUNDFILE self -- @param #string FileName The name of the sound file, e.g. "Hello World.ogg". - -- @param #string Path The path of the directory, where the sound file is located. Default is "l10n/DEFAULT/" within the miz file. - -- @param #number Duration Duration in seconds, how long it takes to play the sound file. Default is 3 seconds. - -- @param #boolean UseSrs Set if SRS should be used to play this file. Default is false. + -- @param #string Path (Optional) The path of the directory, where the sound file is located. Default is "l10n/DEFAULT/" within the miz file. + -- @param #number Duration (Optional) Duration in seconds, how long it takes to play the sound file. Default is 3 seconds. + -- @param #boolean UseSrs (Optional) Set if SRS should be used to play this file. Default is false. -- @return #SOUNDFILE self function SOUNDFILE:New(FileName, Path, Duration, UseSrs) @@ -187,7 +187,7 @@ do -- Sound File --- Set path, where the sound file is located. -- @param #SOUNDFILE self - -- @param #string Path Path to the directory, where the sound file is located. In case this is nil, it defaults to the DCS mission temp directory. + -- @param #string Path (Optional) Path to the directory, where the sound file is located. In case this is nil, it defaults to the DCS mission temp directory. -- @return #SOUNDFILE self function SOUNDFILE:SetPath(Path) self:F( {Path} ) @@ -228,7 +228,7 @@ do -- Sound File --- Set sound file name. This must be a .ogg or .mp3 file! -- @param #SOUNDFILE self - -- @param #string FileName Name of the file. Default is "Hello World.mp3". + -- @param #string FileName (Optional) Name of the file. Default is "Hello World.mp3". -- @return #SOUNDFILE self function SOUNDFILE:SetFileName(FileName) --TODO: check that sound file is really .ogg or .mp3 @@ -246,7 +246,7 @@ do -- Sound File --- Set duration how long it takes to play the sound file. -- @param #SOUNDFILE self - -- @param #string Duration Duration in seconds. Default 3 seconds. + -- @param #string Duration (Optional) Duration in seconds. Default 3 seconds. -- @return #SOUNDFILE self function SOUNDFILE:SetDuration(Duration) if Duration and type(Duration)=="string" then @@ -353,7 +353,7 @@ do -- Text-To-Speech --- Constructor to create a new SOUNDTEXT object. -- @param #SOUNDTEXT self -- @param #string Text The text to speak. - -- @param #number Duration Duration in seconds, how long it takes to play the text. Default is 3 seconds. + -- @param #number Duration (Optional) Duration in seconds, how long it takes to play the text. Default is 3 seconds. -- @return #SOUNDTEXT self function SOUNDTEXT:New(Text, Duration) @@ -373,7 +373,7 @@ do -- Text-To-Speech --- Set text. -- @param #SOUNDTEXT self - -- @param #string Text Text to speak. Default "Hello World!". + -- @param #string Text (Optional) Text to speak. Default "Hello World!". -- @return #SOUNDTEXT self function SOUNDTEXT:SetText(Text) @@ -384,7 +384,7 @@ do -- Text-To-Speech --- Set duration, how long it takes to speak the text. -- @param #SOUNDTEXT self - -- @param #number Duration Duration in seconds. Default 3 seconds. + -- @param #number Duration (Optional) Duration in seconds. Default 3 seconds. -- @return #SOUNDTEXT self function SOUNDTEXT:SetDuration(Duration) @@ -395,7 +395,7 @@ do -- Text-To-Speech --- Set gender. -- @param #SOUNDTEXT self - -- @param #string Gender Gender: "male" or "female" (default). + -- @param #string Gender (Optional) Gender: "male" or "female" (default). -- @return #SOUNDTEXT self function SOUNDTEXT:SetGender(Gender) @@ -406,7 +406,7 @@ do -- Text-To-Speech --- Set TTS culture - local for the voice. -- @param #SOUNDTEXT self - -- @param #string Culture TTS culture. Default "en-GB". + -- @param #string Culture (Optional) TTS culture. Default "en-GB". -- @return #SOUNDTEXT self function SOUNDTEXT:SetCulture(Culture) diff --git a/Moose Development/Moose/Utilities/Enums.lua b/Moose Development/Moose/Utilities/Enums.lua index f1d499109..1281bbf64 100644 --- a/Moose Development/Moose/Utilities/Enums.lua +++ b/Moose Development/Moose/Utilities/Enums.lua @@ -131,14 +131,24 @@ ENUMS.WeaponFlag={ Cannons = 805306368, -- GUN_POD + BuiltInCannon --- Torpedo Torpedo = 4294967296, + --- Decoy + Decoys = 8589934592, + --- Shell + SmokeShell = 17179869184, + IlluminationShell = 34359738368, + MarkerShell = 51539607552, + MarkerWeapon = 51539620864, + SubmunitionDispenserShell = 68719476736, + ConventionalShell = 206963736576, --- -- Even More Genral - Auto = 3221225470, -- Any Weapon (AnyBomb + AnyRocket + AnyMissile + Cannons) - AutoDCS = 1073741822, -- Something if often see - AnyAG = 2956984318, -- Any Air-To-Ground Weapon - AnyAA = 264241152, -- Any Air-To-Air Weapon - AnyUnguided = 2952822768, -- Any Unguided Weapon - AnyGuided = 268402702, -- Any Guided Weapon + Auto = 265214230526, -- Any Weapon (AnyBomb + AnyRocket + AnyMissile + Cannons + Torpedos) + AutoDCS = 1073741822, -- Something if often see + AnyAG = 2956984318, -- Any Air-To-Ground Weapon + AnyAA = 264241152, -- Any Air-To-Air Weapon + AnyUnguided = 2952822768, -- Any Unguided Weapon + AnyGuided = 268402702, -- Any Guided Weapon + AnyShell = 258503344128, -- Any Shell } --- Weapon types by category. See the [Weapon Flag](https://wiki.hoggitworld.com/view/DCS_enum_weapon_flag) enumerator on hoggit wiki. @@ -220,11 +230,11 @@ ENUMS.WeaponType.Torpedo={ } ENUMS.WeaponType.Any={ -- General combinations - Weapon = 3221225470, -- Any Weapon (AnyBomb + AnyRocket + AnyMissile + Cannons) - AG = 2956984318, -- Any Air-To-Ground Weapon - AA = 264241152, -- Any Air-To-Air Weapon - Unguided = 2952822768, -- Any Unguided Weapon - Guided = 268402702, -- Any Guided Weapon + Weapon = 265214230526, -- Any Weapon (AnyBomb + AnyRocket + AnyMissile + Cannons + Torpedos) + AG = 2956984318, -- Any Air-To-Ground Weapon + AA = 264241152, -- Any Air-To-Air Weapon + Unguided = 2952822768, -- Any Unguided Weapon + Guided = 268402702, -- Any Guided Weapon } diff --git a/Moose Development/Moose/Utilities/Profiler.lua b/Moose Development/Moose/Utilities/Profiler.lua index 821ab6672..7d9ebff93 100644 --- a/Moose Development/Moose/Utilities/Profiler.lua +++ b/Moose Development/Moose/Utilities/Profiler.lua @@ -126,8 +126,8 @@ PROFILER = { ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Start profiler. --- @param #number Delay Delay in seconds before profiler is stated. Default is immediately. --- @param #number Duration Duration in (game) seconds before the profiler is stopped. Default is when mission ends. +-- @param #number Delay (Optional) Delay in seconds before profiler is stated. Default is immediately. +-- @param #number Duration (Optional) Duration in (game) seconds before the profiler is stopped. Default is when mission ends. function PROFILER.Start( Delay, Duration ) -- Check if os, io and lfs are available. diff --git a/Moose Development/Moose/Utilities/Socket.lua b/Moose Development/Moose/Utilities/Socket.lua index 93d64e3a0..c4a2cc1c2 100644 --- a/Moose Development/Moose/Utilities/Socket.lua +++ b/Moose Development/Moose/Utilities/Socket.lua @@ -77,8 +77,8 @@ SOCKET.version="0.3.0" --- Create a new SOCKET object. -- @param #SOCKET self --- @param #number Port UDP port. Default `10042`. --- @param #string Host Host. Default `"127.0.0.1"`. +-- @param #number Port (Optional) UDP port. Default `10042`. +-- @param #string Host (Optional) Host. Default `"127.0.0.1"`. -- @return #SOCKET self function SOCKET:New(Port, Host) @@ -103,7 +103,7 @@ end --- Set port. -- @param #SOCKET self --- @param #number Port Port. Default 10042. +-- @param #number Port (Optional) Port. Default 10042. -- @return #SOCKET self function SOCKET:SetPort(Port) self.port=Port or 10042 @@ -111,7 +111,7 @@ end --- Set host. -- @param #SOCKET self --- @param #string Host Host. Default `"127.0.0.1"`. +-- @param #string Host (Optional) Host. Default `"127.0.0.1"`. -- @return #SOCKET self function SOCKET:SetHost(Host) self.host=Host or "127.0.0.1" @@ -159,11 +159,11 @@ end --- Send a text-to-speech message. -- @param #SOCKET self -- @param #string Text The text message to speek. --- @param #number Provider The TTS provider: 0=Microsoft (default), 1=Google. +-- @param #number Provider (Optional) The TTS provider: 0=Microsoft (default), 1=Google. -- @param #string Voice The specific voice to use, e.g. `"Microsoft David Desktop"` or "`en-US-Standard-A`". If not set, the service will choose a voice based on the other parameters such as culture and gender. -- @param #string Culture The Culture or language code, *e.g.* `"en-US"`. --- @param #string Gender The Gender, *i.e.* "male", "female". Default "female". --- @param #number Volume The volume. Microsoft: [0,100] default 50, Google: [-96, 10] default 0. +-- @param #string Gender (Optional) The Gender, *i.e.* "male", "female". Default "female". +-- @param #number Volume (Optional) The volume. Microsoft: [0,100] default 50, Google: [-96, 10] default 0. -- @return #SOCKET self function SOCKET:SendTextToSpeech(Text, Provider, Voice, Culture, Gender, Volume) diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index 8a489e082..4b9d3ee82 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -522,43 +522,77 @@ function UTILS.TableLength(T) end --- Print a table to log in a nice format --- @param #table table The table to print --- @param #number indent Number of indents +-- @param #table t The table to print +-- @param #number indent (Optional) Number of indents. Defaults to 0. -- @param #boolean noprint Don't log but return text +-- @param #number maxDepth (Optional) Only cycle this deep, defaults to 5. +-- @param #table seen (Optional) -- @return #string text Text created on the fly of the log output -function UTILS.PrintTableToLog(table, indent, noprint) - local text = "\n" - if not table or type(table) ~= "table" then +function UTILS.PrintTableToLog(t, indent, noprint, maxDepth, seen) + maxDepth = maxDepth or 5 + indent = indent or 0 + seen = seen or {} + + if not t or type(t) ~= "table" then env.warning("No table passed!") return nil end - if not indent then indent = 0 end - for k, v in pairs(table) do - if string.find(k," ") then k='"'..k..'"'end - if type(v) == "table" and UTILS.TableLength(v) > 0 then + + -- Max depth guard + if indent > maxDepth then + local msg = string.rep(" ", indent) .. "\n" + if not noprint then env.info(msg) end + return msg + end + + -- Cycle / repeated reference guard + if seen[t] then + local msg = string.rep(" ", indent) .. "\n" + if not noprint then env.info(msg) end + return msg + end + seen[t] = true + + local text = "\n" + + for k, v in pairs(t) do + local key = k + if type(key) == "string" and key:find(" ", 1, true) then + key = '"' .. key .. '"' + else + key = tostring(key) + end + + if type(v) == "table" and next(v) ~= nil then if not noprint then - env.info(string.rep(" ", indent) .. tostring(k) .. " = {") + env.info(string.rep(" ", indent) .. key .. " = {") end - text = text ..string.rep(" ", indent) .. tostring(k) .. " = {\n" - text = text .. tostring(UTILS.PrintTableToLog(v, indent + 1), noprint).."\n" + + text = text .. string.rep(" ", indent) .. key .. " = {\n" + text = text .. UTILS.PrintTableToLog(v, indent + 1, noprint, maxDepth, seen) + text = text .. string.rep(" ", indent) .. "},\n" + if not noprint then env.info(string.rep(" ", indent) .. "},") end - text = text .. string.rep(" ", indent) .. "},\n" + elseif type(v) == "function" then + -- skip functions (optional: log "") else local value - if tostring(v) == "true" or tostring(v) == "false" or tonumber(v) ~= nil then - value=v + if type(v) == "boolean" or type(v) == "number" then + value = tostring(v) else - value = '"'..tostring(v)..'"' + value = '"' .. tostring(v) .. '"' end + if not noprint then - env.info(string.rep(" ", indent) .. tostring(k) .. " = " .. tostring(value)..",\n") + env.info(string.rep(" ", indent) .. key .. " = " .. value .. ",") end - text = text .. string.rep(" ", indent) .. tostring(k) .. " = " .. tostring(value)..",\n" + text = text .. string.rep(" ", indent) .. key .. " = " .. value .. ",\n" end end + return text end @@ -1339,7 +1373,7 @@ function UTILS.ClockToSeconds(clock) end --- Display clock and mission time on screen as a message to all. --- @param #number duration Duration in seconds how long the time is displayed. Default is 5 seconds. +-- @param #number duration (Optional) Duration in seconds how long the time is displayed. Default is 5 seconds. function UTILS.DisplayMissionTime(duration) duration=duration or 5 local Tnow=timer.getAbsTime() @@ -1353,7 +1387,7 @@ end --- Replace illegal characters [<>|/?*:\\] in a string. -- @param #string Text Input text. --- @param #string ReplaceBy Replace illegal characters by this character or string. Default underscore "_". +-- @param #string ReplaceBy (Optional) Replace illegal characters by this character or string. Default underscore "_". -- @return #string The input text with illegal chars replaced. function UTILS.ReplaceIllegalCharacters(Text, ReplaceBy) ReplaceBy=ReplaceBy or "_" @@ -2227,7 +2261,7 @@ function UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, Rising, Tlocal) -- @param #number Latitude Latitude. -- @param #number Longitude Longitude. -- @param #boolean Rising If true, calc sun rise, or sun set otherwise. --- @param #number Tlocal Local time offset in hours. E.g. +4 for a location which has GMT+4. Default 0. +-- @param #number Tlocal (Optional) Local time offset in hours. E.g. +4 for a location which has GMT+4. Default 0. -- @return #number Sun rise in seconds of the day. function UTILS.GetSunrise(Day, Month, Year, Latitude, Longitude, Tlocal) @@ -2243,7 +2277,7 @@ end -- @param #number Latitude Latitude. -- @param #number Longitude Longitude. -- @param #boolean Rising If true, calc sun rise, or sun set otherwise. --- @param #number Tlocal Local time offset in hours. E.g. +4 for a location which has GMT+4. Default 0. +-- @param #number Tlocal (Optional) Local time offset in hours. E.g. +4 for a location which has GMT+4. Default 0. -- @return #number Sun rise in seconds of the day. function UTILS.GetSunset(Day, Month, Year, Latitude, Longitude, Tlocal) @@ -2921,12 +2955,12 @@ end -- @param #boolean Reduce If false, existing loaded groups will not be reduced to fit the saved number. -- @param #boolean Structured (Optional, needs Reduce = true) If true, and the data has been saved as structure before, remove the correct unit types as per the saved list. -- @param #boolean Cinematic (Optional, needs Structured = true) If true, place a fire/smoke effect on the dead static position. --- @param #number Effect (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke. --- @param #number Density (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5. --- @param #boolean Resurrection If true, dead units can be restored on load. Defaults to false. --- @param #number ResurrectPercentage Use this percentage of probability to resurrect a unit. [0..100], defaults to 25. --- @param #number Healmin If set, life points of a resurrected unit will be randomly restored to min this percentage. [0..100], defaults to 25. --- @param #number Healmax If set, life points of a resurrected unit will be randomly restored to max this percentage. [0..100], defaults to 75. +-- @param #number Effect (Optional) (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke. +-- @param #number Density (Optional) (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5. +-- @param #boolean Resurrection (Optional) If true, dead units can be restored on load. Defaults to false. +-- @param #number ResurrectPercentage (Optional) Use this percentage of probability to resurrect a unit. [0..100], defaults to 25. +-- @param #number Healmin (Optional) If set, life points of a resurrected unit will be randomly restored to min this percentage. [0..100], defaults to 25. +-- @param #number Healmax (Optional) If set, life points of a resurrected unit will be randomly restored to max this percentage. [0..100], defaults to 75. -- @return #table Table of data objects (tables) containing groupname, coordinate and group object. Returns nil when file cannot be read. -- @return #table When using Cinematic: table of names of smoke and fire objects, so they can be extinguished with `COORDINATE.StopBigSmokeAndFire( name )` function UTILS.LoadStationaryListOfGroups(Path,Filename,Reduce,Structured,Cinematic,Effect,Density,Resurrection,ResurrectPercentage,Healmin,Healmax) @@ -3049,8 +3083,8 @@ end -- @param #boolean Spawn If set to false, do not re-spawn the groups loaded in location and reduce to size. -- @param #boolean Structured (Optional, needs Spawn=true)If true, and the data has been saved as structure before, remove the correct unit types as per the saved list. -- @param #boolean Cinematic (Optional, needs Structured=true) If true, place a fire/smoke effect on the dead static position. --- @param #number Effect (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke. --- @param #number Density (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5. +-- @param #number Effect (Optional) (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke. +-- @param #number Density (Optional) (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5. -- @return Core.Set#SET_GROUP Set of GROUP objects. -- Returns nil when file cannot be read. Returns a table of data entries if Spawn is false: `{ groupname=groupname, size=size, coordinate=coordinate, template=template }` -- @return #table When using Cinematic: table of names of smoke and fire objects, so they can be extinguished with `COORDINATE.StopBigSmokeAndFire( name )` @@ -3235,8 +3269,8 @@ end -- @param #boolean Reduce If false, do not destroy the units with size=0. -- @param #boolean Dead (Optional, needs Reduce = true) If Dead is true, re-spawn the dead object as dead and do not just delete it. -- @param #boolean Cinematic (Optional, needs Dead = true) If true, place a fire/smoke effect on the dead static position. --- @param #number Effect (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke. --- @param #number Density (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5. +-- @param #number Effect (Optional) (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke. +-- @param #number Density (Optional) (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5. -- @return #table Table of data objects (tables) containing staticname, size (0=dead else 1), coordinate and the static object. Dead objects will have coordinate points `{x=0,y=0,z=0}` -- @return #table When using Cinematic: table of names of smoke and fire objects, so they can be extinguished with `COORDINATE.StopBigSmokeAndFire( name )` -- Returns nil when file cannot be read. @@ -3405,13 +3439,13 @@ end --- Helper function to plot a racetrack on the F10 Map - curtesy of Buur. -- @param Core.Point#COORDINATE Coordinate -- @param #number Altitude Altitude in feet --- @param #number Speed Speed in knots --- @param #number Heading Heading in degrees --- @param #number Leg Leg in NM --- @param #number Coalition Coalition side, e.g. coaltion.side.RED or coaltion.side.BLUE --- @param #table Color Color of the line in RGB, e.g. {1,0,0} for red --- @param #number Alpha Transparency factor, between 0.1 and 1 --- @param #number LineType Line type to be used, line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. +-- @param #number Speed (Optional) Speed in knots. Defaults to 350. +-- @param #number Heading (Optional) Heading in degrees. Defaults to 270. +-- @param #number Leg (Optional) Leg in NM. Defaults to 10nm. +-- @param #number Coalition (Optional) Coalition side, e.g. coaltion.side.RED or coaltion.side.BLUE. Defaults to -1. +-- @param #table Color (Optional) Color of the line in RGB, e.g. {1,0,0} for red, Defaults to {1,0,0}. +-- @param #number Alpha (Optional) Transparency factor, between 0.1 and 1. Defaults to 1. +-- @param #number LineType (Optional) Line type to be used, line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid. -- @param #boolean ReadOnly function UTILS.PlotRacetrack(Coordinate, Altitude, Speed, Heading, Leg, Coalition, Color, Alpha, LineType, ReadOnly) local fix_coordinate = Coordinate @@ -4214,7 +4248,7 @@ function UTILS.ReadCSV(filename) end --- Seed the LCG random number generator. --- @param #number seed Seed value. Default is a random number using math.random() +-- @param #number seed (Optional) Seed value. Default is a random number using math.random() function UTILS.LCGRandomSeed(seed) UTILS.lcg = { seed = seed or math.random(1, 2^32 - 1), @@ -4278,24 +4312,24 @@ end -- References: [DCS Forum Topic](https://forum.dcs.world/topic/282989-farp-equipment-to-run-it) -- @param #string Name Name of this FARP installation. Must be unique. -- @param Core.Point#COORDINATE Coordinate Where to spawn the FARP. --- @param #string FARPType Type of FARP, can be one of the known types ENUMS.FARPType.FARP, ENUMS.FARPType.INVISIBLE, ENUMS.FARPType.HELIPADSINGLE, ENUMS.FARPType.PADSINGLE. Defaults to ENUMS.FARPType.FARP. --- @param #number Coalition Coalition of this FARP, i.e. coalition.side.BLUE or coalition.side.RED, defaults to coalition.side.BLUE. --- @param #number Country Country of this FARP, defaults to country.id.USA (blue) or country.id.RUSSIA (red). --- @param #number CallSign Callsign of the FARP ATC, defaults to CALLSIGN.FARP.Berlin. --- @param #number Frequency Frequency of the FARP ATC Radio, defaults to 127.5 (MHz). --- @param #number Modulation Modulation of the FARP ATC Radio, defaults to radio.modulation.AM. +-- @param #string FARPType (Optional) Type of FARP, can be one of the known types ENUMS.FARPType.FARP, ENUMS.FARPType.INVISIBLE, ENUMS.FARPType.HELIPADSINGLE, ENUMS.FARPType.PADSINGLE. Defaults to ENUMS.FARPType.FARP. +-- @param #number Coalition (Optional) Coalition of this FARP, i.e. coalition.side.BLUE or coalition.side.RED, defaults to coalition.side.BLUE. +-- @param #number Country (Optional) Country of this FARP, defaults to country.id.USA (blue) or country.id.RUSSIA (red). +-- @param #number CallSign (Optional) Callsign of the FARP ATC, defaults to CALLSIGN.FARP.Berlin. +-- @param #number Frequency (Optional) Frequency of the FARP ATC Radio, defaults to 127.5 (MHz). +-- @param #number Modulation (Optional) Modulation of the FARP ATC Radio, defaults to radio.modulation.AM. -- @param #number ADF ADF Beacon (FM) Frequency in KHz, e.g. 428. If not nil, creates an VHF/FM ADF Beacon for this FARP. Requires a sound called "beacon.ogg" to be in the mission (trigger "sound to" ...) --- @param #number SpawnRadius Radius of the FARP, i.e. where the FARP objects will be placed in meters, not more than 150m away. Defaults to 100. +-- @param #number SpawnRadius (Optional) Radius of the FARP, i.e. where the FARP objects will be placed in meters, not more than 150m away. Defaults to 100. -- @param #string VehicleTemplate, template name for additional vehicles. Can be nil for no additional vehicles. --- @param #number Liquids Tons of fuel to be added initially to the FARP. Defaults to 10 (tons). Set to 0 for no fill. --- @param #number Equipment Number of equipment items per known item to be added initially to the FARP. Defaults to 10 (items). Set to 0 for no fill. +-- @param #number Liquids (Optional) Tons of fuel to be added initially to the FARP. Defaults to 10 (tons). Set to 0 for no fill. +-- @param #number Equipment(Optional) Number of equipment items per known item to be added initially to the FARP. Defaults to 10 (items). Set to 0 for no fill. -- @param #number Airframes Number of helicopter airframes per known type in Ops.CSAR#CSAR.AircraftType to be added initially to the FARP. Set to 0 for no airframes. -- @param #string F10Text Text to display on F10 map if given. Handy to post things like the ADF beacon Frequency, Callsign and ATC Frequency. -- @param #boolean DynamicSpawns If true, allow Dynamic Spawns from this FARP. -- @param #boolean HotStart If true and DynamicSpawns is true, allow hot starts for Dynamic Spawns from this FARP. -- @param #number NumberPads If given, spawn this number of pads. --- @param #number SpacingX For NumberPads > 1, space this many meters horizontally. Defaults to 100. --- @param #number SpacingY For NumberPads > 1, space this many meters vertically. Defaults to 100. +-- @param #number SpacingX (Optional) For NumberPads > 1, space this many meters horizontally. Defaults to 100. +-- @param #number SpacingY (Optional) For NumberPads > 1, space this many meters vertically. Defaults to 100. -- @return #list Table of spawned objects and vehicle object (if given). -- @return #string ADFBeaconName Name of the ADF beacon, to be able to remove/stop it later. -- @return #number MarkerID ID of the F10 Text, to be able to remove it later. @@ -4480,9 +4514,9 @@ end -- @param #number ADF (Optional) ADF Frequency in kHz (Kilohertz), if given activate an ADF Beacon at the location of the MASH. -- @param #string Livery (Optional) The livery of the static CH-47, defaults to dark green. -- @param #boolean DeployHelo (Optional) If true, deploy the helicopter static. --- @param #number MASHRadio MASH Radio Frequency, defaults to 127.5. --- @param #number MASHRadioModulation MASH Radio Modulation, defaults to radio.modulation.AM. --- @param #number MASHCallsign Defaults to CALLSIGN.FARP.Berlin. +-- @param #number MASHRadio (Optional) MASH Radio Frequency, defaults to 127.5. +-- @param #number MASHRadioModulation (Optional) MASH Radio Modulation, defaults to radio.modulation.AM. +-- @param #number MASHCallsign (Optional) Defaults to CALLSIGN.FARP.Berlin. -- @param #table Templates (Optional) You can hand in your own template table of numbered(!) entries. Each entry consist of a relative(!) x,y position and data of a -- static, shape_name is optional. Also, livery_id is optional, but is applied to the helicopter static only. -- @return #table Table of Wrapper.Static#STATIC objects that were spawned. @@ -4826,13 +4860,13 @@ end --- Show a picture on the screen to all -- @param #string FileName File name of the picture --- @param #number Duration Duration in seconds, defaults to 10 --- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false --- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0 --- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right --- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom --- @param #number Size Size of the picture in percent, defaults to 100 --- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size +-- @param #number Duration (Optional) Duration in seconds, defaults to 10 +-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false +-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0 +-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1. +-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1. +-- @param #number Size (Optional) Size of the picture in percent, defaults to 100 +-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0. function UTILS.ShowPictureToAll(FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits) ClearView = ClearView or false StartDelay = StartDelay or 0 @@ -4849,13 +4883,13 @@ end --- Show a picture on the screen to Coalition -- @param #number Coalition Coalition ID, can be coalition.side.BLUE, coalition.side.RED or coalition.side.NEUTRAL -- @param #string FileName File name of the picture --- @param #number Duration Duration in seconds, defaults to 10 --- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false --- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0 --- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right --- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom --- @param #number Size Size of the picture in percent, defaults to 100 --- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size +-- @param #number Duration (Optional) Duration in seconds, defaults to 10 +-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false +-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0 +-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1. +-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1. +-- @param #number Size (Optional) Size of the picture in percent, defaults to 100 +-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0. function UTILS.ShowPictureToCoalition(Coalition, FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits) ClearView = ClearView or false StartDelay = StartDelay or 0 @@ -4874,13 +4908,13 @@ end --- Show a picture on the screen to Country -- @param #number Country Country ID, can be country.id.USA, country.id.RUSSIA, etc. -- @param #string FileName File name of the picture --- @param #number Duration Duration in seconds, defaults to 10 --- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false --- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0 --- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right --- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom --- @param #number Size Size of the picture in percent, defaults to 100 --- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size +-- @param #number Duration (Optional) Duration in seconds, defaults to 10 +-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false +-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0 +-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1. +-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1. +-- @param #number Size(Optional) Size of the picture in percent, defaults to 100 +-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0. function UTILS.ShowPictureToCountry(Country, FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits) ClearView = ClearView or false StartDelay = StartDelay or 0 @@ -4897,13 +4931,13 @@ end --- Show a picture on the screen to Group -- @param Wrapper.Group#GROUP Group Group to show the picture to -- @param #string FileName File name of the picture --- @param #number Duration Duration in seconds, defaults to 10 --- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false --- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0 --- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right --- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom --- @param #number Size Size of the picture in percent, defaults to 100 --- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size +-- @param #number Duration (Optional) Duration in seconds, defaults to 10 +-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false +-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0 +-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1. +-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1. +-- @param #number Size (Optional) Size of the picture in percent, defaults to 100 +-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0. function UTILS.ShowPictureToGroup(Group, FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits) ClearView = ClearView or false StartDelay = StartDelay or 0 @@ -4920,13 +4954,13 @@ end --- Show a picture on the screen to Unit -- @param Wrapper.Unit#UNIT Unit Unit to show the picture to -- @param #string FileName File name of the picture --- @param #number Duration Duration in seconds, defaults to 10 --- @param #boolean ClearView If true, clears the view before showing the picture, defaults to false --- @param #number StartDelay Delay in seconds before showing the picture, defaults to 0 --- @param #number HorizontalAlign Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right --- @param #number VerticalAlign Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom --- @param #number Size Size of the picture in percent, defaults to 100 --- @param #number SizeUnits Size units, 0 for % of original picture size, and 1 for % of window size +-- @param #number Duration (Optional) Duration in seconds, defaults to 10 +-- @param #boolean ClearView (Optional) If true, clears the view before showing the picture, defaults to false +-- @param #number StartDelay (Optional) Delay in seconds before showing the picture, defaults to 0 +-- @param #number HorizontalAlign (Optional) Horizontal alignment of the picture, 0: Left, 1: Center, 2: Right. Defaults to 1. +-- @param #number VerticalAlign (Optional) Vertical alignment of the picture, 0: Top, 1: Center, 2: Bottom. Defaults to 1. +-- @param #number Size (Optional) Size of the picture in percent, defaults to 100 +-- @param #number SizeUnits (Optional) Size units, 0 for % of original picture size, and 1 for % of window size. Defaults to 0. function UTILS.ShowPictureToUnit(Unit, FilePath, Duration, ClearView, StartDelay, HorizontalAlign, VerticalAlign, Size, SizeUnits) ClearView = ClearView or false StartDelay = StartDelay or 0 @@ -4948,8 +4982,8 @@ end --- Set the mission briefing for a coalition. -- @param #number Coalition Briefing coalition ID, can be coalition.side.BLUE, coalition.side.RED or coalition.side.NEUTRAL --- @param #string Text Briefing text, can contain newlines, will be converted formatted properly for DCS --- @param #string Picture Picture file path, can be a file in the DEFAULT folder inside the .miz +-- @param #string Text Briefing text, can contain newlines, will be converted formatted properly for DCS. +-- @param #string Picture (Optional) Picture file path, can be a file in the DEFAULT folder inside the .miz. Defaults to "". function UTILS.SetMissionBriefing(Coalition, Text, Picture) Text = Text or "" Text = Text:gsub("\n", "\\n") diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index 26f6558e6..4e51e99e3 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -2164,7 +2164,7 @@ end --- Get number of parking spots at an airbase. Optionally, a specific terminal type can be requested. -- @param #AIRBASE self --- @param #AIRBASE.TerminalType termtype Terminal type of which the number of spots is counted. Default all spots but spawn points on runway. +-- @param #AIRBASE.TerminalType termtype (Optional) Terminal type of which the number of spots is counted. Default all spots but spawn points on runway. -- @return #number Number of parking spots at this airbase. function AIRBASE:GetParkingSpotsNumber(termtype) @@ -2184,7 +2184,7 @@ end --- Get number of free parking spots at an airbase. -- @param #AIRBASE self -- @param #AIRBASE.TerminalType termtype Terminal type. --- @param #boolean allowTOAC If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships. +-- @param #boolean allowTOAC (Optional) If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships. -- @return #number Number of free parking spots at this airbase. function AIRBASE:GetFreeParkingSpotsNumber(termtype, allowTOAC) @@ -2207,7 +2207,7 @@ end --- Get the coordinates of free parking spots at an airbase. -- @param #AIRBASE self -- @param #AIRBASE.TerminalType termtype Terminal type. --- @param #boolean allowTOAC If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships. +-- @param #boolean allowTOAC (Optional) If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships. -- @return #table Table of coordinates of the free parking spots. function AIRBASE:GetFreeParkingSpotsCoordinates(termtype, allowTOAC) @@ -2434,7 +2434,7 @@ end --- Get a table containing the coordinates, terminal index and terminal type of free parking spots at an airbase. -- @param #AIRBASE self -- @param #AIRBASE.TerminalType termtype Terminal type. --- @param #boolean allowTOAC If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships. +-- @param #boolean allowTOAC (Optional) If true, spots are considered free even though TO_AC is true. Default is off which is saver to avoid spawning aircraft on top of each other. Option might be enabled for FARPS and ships. -- @return #table Table free parking spots. Table has the elements ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy". function AIRBASE:GetFreeParkingSpotsTable(termtype, allowTOAC) @@ -2486,7 +2486,7 @@ end --- Place markers of parking spots on the F10 map. -- @param #AIRBASE self -- @param #AIRBASE.TerminalType termtype Terminal type for which marks should be placed. --- @param #boolean mark If false, do not place markers but only give output to DCS.log file. Default true. +-- @param #boolean mark (Optional) If false, do not place markers but only give output to DCS.log file. Default true. function AIRBASE:MarkParkingSpots(termtype, mark) -- Default is true. @@ -3266,7 +3266,7 @@ end --- Set the active runway for landing and takeoff. -- @param #AIRBASE self -- @param #string Name Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction. --- @param #boolean PreferLeft If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right. +-- @param #boolean PreferLeft (Optional) If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right. function AIRBASE:SetActiveRunway(Name, PreferLeft) self:SetActiveRunwayTakeoff(Name, PreferLeft) @@ -3278,7 +3278,7 @@ end --- Set the active runway for landing. -- @param #AIRBASE self -- @param #string Name Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction. --- @param #boolean PreferLeft If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right. +-- @param #boolean PreferLeft (Optional) If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right. -- @return #AIRBASE.Runway The active runway for landing. function AIRBASE:SetActiveRunwayLanding(Name, PreferLeft) @@ -3326,7 +3326,7 @@ end --- Set the active runway for takeoff. -- @param #AIRBASE self -- @param #string Name Name of the runway, e.g. "31" or "02L" or "90R". If not given, the runway is determined from the wind direction. --- @param #boolean PreferLeft If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right. +-- @param #boolean PreferLeft (Optional) If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right. -- @return #AIRBASE.Runway The active runway for landing. function AIRBASE:SetActiveRunwayTakeoff(Name, PreferLeft) @@ -3351,7 +3351,7 @@ end --- Get the runway where aircraft would be taking of or landing into the direction of the wind. -- NOTE that this requires the wind to be non-zero as set in the mission editor. -- @param #AIRBASE self --- @param #boolean PreferLeft If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right. +-- @param #boolean PreferLeft (Optional) If `true`, perfer the left runway. If `false`, prefer the right runway. If `nil` (default), do not care about left or right. -- @return #AIRBASE.Runway Active runway data table. function AIRBASE:GetRunwayIntoWind(PreferLeft) @@ -3407,7 +3407,7 @@ end --- Get name of a given runway, e.g. "31L". -- @param #AIRBASE self --- @param #AIRBASE.Runway Runway The runway. Default is the active runway. +-- @param #AIRBASE.Runway Runway (Optional) The runway. Default is the active runway. -- @param #boolean LongLeftRight If `true`, return "Left" or "Right" instead of "L" or "R". -- @return #string Name of the runway or "XX" if it could not be found. function AIRBASE:GetRunwayName(Runway, LongLeftRight) @@ -3438,7 +3438,7 @@ end --- Function that checks if at leat one unit of a group has been spawned close to a spawn point on the runway. -- @param #AIRBASE self -- @param Wrapper.Group#GROUP group Group to be checked. --- @param #number radius Radius around the spawn point to be checked. Default is 50 m. +-- @param #number radius (Optional) Radius around the spawn point to be checked. Default is 50 m. -- @param #boolean despawn If true, the group is destroyed. -- @return #boolean True if group is within radius around spawn points on runway. function AIRBASE:CheckOnRunWay(group, radius, despawn) diff --git a/Moose Development/Moose/Wrapper/Client.lua b/Moose Development/Moose/Wrapper/Client.lua index cb1a18225..60ffca609 100644 --- a/Moose Development/Moose/Wrapper/Client.lua +++ b/Moose Development/Moose/Wrapper/Client.lua @@ -117,7 +117,7 @@ end -- @param #CLIENT self -- @param #string ClientName Name of the DCS **Unit** as defined within the Mission Editor. -- @param #string ClientBriefing Text that describes the briefing of the mission when a Player logs into the Client. --- @param #boolean Error A flag that indicates whether an error should be raised if the CLIENT cannot be found. By default an error will be raised. +-- @param #boolean Error (Optional) A flag that indicates whether an error should be raised if the CLIENT cannot be found. By default an error will be raised. -- @return #CLIENT -- @usage -- -- Create new Clients. diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 2ea2be027..764c98c06 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -875,7 +875,7 @@ end --- Set callsign of the CONTROLLABLE. See [DCS command setCallsign](https://wiki.hoggitworld.com/view/DCS_command_setCallsign) -- @param #CONTROLLABLE self -- @param DCS#CALLSIGN CallName Number corresponding the the callsign identifier you wish this group to be called. --- @param #number CallNumber The number value the group will be referred to as. Only valid numbers are 1-9. For example Uzi **5**-1. Default 1. +-- @param #number CallNumber (Optional) The number value the group will be referred to as. Only valid numbers are 1-9. For example Uzi **5**-1. Default 1. -- @param #number Delay (Optional) Delay in seconds before the callsign is set. Default is immediately. -- @return #CONTROLLABLE self function CONTROLLABLE:CommandSetCallsign( CallName, CallNumber, Delay ) @@ -953,7 +953,7 @@ end --- Set radio frequency. See [DCS command SetFrequency](https://wiki.hoggitworld.com/view/DCS_command_setFrequency) -- @param #CONTROLLABLE self -- @param #number Frequency Radio frequency in MHz. --- @param #number Modulation Radio modulation. Default `radio.modulation.AM`. +-- @param #number Modulation (Optional) Radio modulation. Default `radio.modulation.AM`. -- @param #number Power (Optional) Power of the Radio in Watts. Defaults to 10. -- @param #number Delay (Optional) Delay in seconds before the frequency is set. Default is immediately. -- @return #CONTROLLABLE self @@ -980,7 +980,7 @@ end --- [AIR] Set radio frequency. See [DCS command SetFrequencyForUnit](https://wiki.hoggitworld.com/view/DCS_command_setFrequencyForUnit) -- @param #CONTROLLABLE self -- @param #number Frequency Radio frequency in MHz. --- @param #number Modulation Radio modulation. Default `radio.modulation.AM`. +-- @param #number Modulation (Optional) Radio modulation. Default `radio.modulation.AM`. -- @param #number Power (Optional) Power of the Radio in Watts. Defaults to 10. -- @param #number UnitID (Optional, if your object is a UNIT) The UNIT ID this is for. -- @param #number Delay (Optional) Delay in seconds before the frequency is set. Default is immediately. @@ -1005,7 +1005,7 @@ end --- [AIR] Set smoke on or off. See [DCS command smoke on off](https://wiki.hoggitworld.com/view/DCS_command_smoke_on_off) -- @param #CONTROLLABLE self --- @param #boolean OnOff Set to true for on and false for off. Defaults to true. +-- @param #boolean OnOff (Optional) Set to true for on and false for off. Defaults to true. -- @param #number Delay (Optional) Delay the command by this many seconds. -- @return #CONTROLLABLE self function CONTROLLABLE:CommandSmokeOnOff(OnOff, Delay) @@ -1065,7 +1065,7 @@ end --- Set EPLRS data link on/off. -- @param #CONTROLLABLE self -- @param #boolean SwitchOnOff If true (or nil) switch EPLRS on. If false switch off. --- @param #number idx Task index. Default 1. +-- @param #number idx (Optional) Task index. Default 1. -- @return #table Task wrapped action. function CONTROLLABLE:TaskEPLRS( SwitchOnOff, idx ) @@ -1099,32 +1099,14 @@ end -- @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 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 DCS#Distance Altitude (optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude. --- @param #boolean AttackQtyLimit (optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackGroup" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks. -- @param #boolean GroupAttack (Optional) If true, attack as group. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit, GroupAttack ) -- self:F2( { self.ControllableName, AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit } ) - - -- AttackGroup = { - -- id = 'AttackGroup', - -- params = { - -- groupId = Group.ID, - -- weaponType = number, - -- expend = enum AI.Task.WeaponExpend, - -- attackQty = number, - -- directionEnabled = boolean, - -- direction = Azimuth, - -- altitudeEnabled = boolean, - -- altitude = Distance, - -- attackQtyLimit = boolean, - -- } - -- } - - local DCSTask = { id = 'AttackGroup', params = { groupId = AttackGroup:GetID(), - weaponType = WeaponType or 1073741822, + weaponType = WeaponType or ENUMS.WeaponFlag.Auto, expend = WeaponExpend or "Auto", attackQtyLimit = AttackQty and true or false, attackQty = AttackQty or 1, @@ -1135,7 +1117,6 @@ function CONTROLLABLE:TaskAttackGroup( AttackGroup, WeaponType, WeaponExpend, At groupAttack = GroupAttack and true or false, }, } - return DCSTask end @@ -1163,7 +1144,7 @@ function CONTROLLABLE:TaskAttackUnit( AttackUnit, GroupAttack, WeaponExpend, Att altitude = Altitude, attackQtyLimit = AttackQty and true or false, attackQty = AttackQty, - weaponType = WeaponType or 1073741822, + weaponType = WeaponType or ENUMS.WeaponFlag.Auto, }, } @@ -1197,7 +1178,7 @@ function CONTROLLABLE:TaskBombing( Vec2, GroupAttack, WeaponExpend, AttackQty, D direction = Direction and math.rad(Direction) or 0, altitudeEnabled = Altitude and true or false, altitude = Altitude or 2000, - weaponType = WeaponType or 1073741822, + weaponType = WeaponType or ENUMS.WeaponFlag.AnyBomb, attackType = Divebomb and "Dive" or nil, }, } @@ -1249,7 +1230,7 @@ end -- @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 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 #number Altitude (Optional) The altitude [meters] from where to attack. Default 30 m. --- @param #number WeaponType (Optional) The WeaponType. Default Auto=1073741822. +-- @param #number WeaponType (Optional) The WeaponType. Default `ENUMS.WeaponFlag.Auto`. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:TaskAttackMapObject( Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType ) @@ -1266,7 +1247,7 @@ function CONTROLLABLE:TaskAttackMapObject( Vec2, GroupAttack, WeaponExpend, Atta direction = Direction and math.rad(Direction) or 0, altitudeEnabled = Altitude and true or false, altitude = Altitude, - weaponType = WeaponType or 1073741822, + weaponType = WeaponType or ENUMS.WeaponFlag.Auto, }, } @@ -1385,7 +1366,7 @@ end -- The controllable has to be an infantry group! -- @param #CONTROLLABLE self -- @param Core.Point#COORDINATE Coordinate Coordinates where AI is expecting to be picked up. --- @param #number Radius Radius in meters. Default 200 m. +-- @param #number Radius (Optional) Radius in meters. Default 200 m. -- @param #string UnitType The unit type name of the carrier, e.g. "UH-1H". Must not be specified. -- @return DCS#Task Embark to transport task. function CONTROLLABLE:TaskEmbarkToTransport( Coordinate, Radius, UnitType ) @@ -1459,8 +1440,8 @@ end --- (AIR) Orbit at a position with at a given altitude and speed. Optionally, a race track pattern can be specified. -- @param #CONTROLLABLE self -- @param Core.Point#COORDINATE Coord Coordinate at which the CONTROLLABLE orbits. Can also be given as a `DCS#Vec3` or `DCS#Vec2` object. --- @param #number Altitude Altitude in meters of the orbit pattern. Default y component of Coord. --- @param #number Speed Speed [m/s] flying the orbit pattern. Default 128 m/s = 250 knots. +-- @param #number Altitude (Optional) Altitude in meters of the orbit pattern. Default y component of Coord. +-- @param #number Speed (Optional) Speed [m/s] flying the orbit pattern. Default 128 m/s = 250 knots. -- @param Core.Point#COORDINATE CoordRaceTrack (Optional) If this coordinate is specified, the CONTROLLABLE will fly a race-track pattern using this and the initial coordinate. -- @return #CONTROLLABLE self function CONTROLLABLE:TaskOrbit( Coord, Altitude, Speed, CoordRaceTrack ) @@ -1530,11 +1511,11 @@ end -- -- @param #CONTROLLABLE self -- @param Wrapper.Airbase#AIRBASE Airbase Airbase to attack. --- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. See [DCS enum weapon flag](https://wiki.hoggitworld.com/view/DCS_enum_weapon_flag). Default 2147485694 = AnyBomb (GuidedBomb + AnyUnguidedBomb). --- @param DCS#AI.Task.WeaponExpend WeaponExpend Enum AI.Task.WeaponExpend that defines how much munitions the AI will expend per attack run. Default "ALL". --- @param #number AttackQty Number of times the group will attack if the target. Default 1. --- @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) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a group and not to a single aircraft. +-- @param #number WeaponType (Optional) Bitmask of weapon types those allowed to use. See [DCS enum weapon flag](https://wiki.hoggitworld.com/view/DCS_enum_weapon_flag). Default 2147485694 = AnyBomb (GuidedBomb + AnyUnguidedBomb). +-- @param DCS#AI.Task.WeaponExpend (Optional) WeaponExpend Enum AI.Task.WeaponExpend that defines how much munitions the AI will expend per attack run. Default "ALL". +-- @param #number AttackQty (Optional) Number of times the group will attack if the target. Default 1. +-- @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) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a group and not to a single aircraft. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:TaskBombingRunway( Airbase, WeaponType, WeaponExpend, AttackQty, Direction, GroupAttack ) @@ -1725,7 +1706,7 @@ end -- @param DCS#Vec3 Vec3 Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around. -- @param #number LastWaypointIndex Detach waypoint of another controllable. Once reached the unit / controllable Escort task is finished. -- @param #number EngagementDistance Maximal distance from escorted controllable to threat in meters. If the threat is already engaged by escort escort will disengage if the distance becomes greater than 1.5 * engagementDistMax. --- @param DCS#AttributeNameArray TargetTypes Array of AttributeName that is contains threat categories allowed to engage. Default {"Air"}. See https://wiki.hoggit.us/view/DCS_enum_attributes +-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of AttributeName that is contains threat categories allowed to engage. Default {"Air"}. See https://wiki.hoggit.us/view/DCS_enum_attributes -- @return DCS#Task The DCS task structure. function CONTROLLABLE:TaskEscort( FollowControllable, Vec3, LastWaypointIndex, EngagementDistance, TargetTypes ) @@ -1765,7 +1746,7 @@ end -- @param #number AmmoCount (optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted). -- @param #number WeaponType (optional) Enum for weapon type ID. This value is only required if you want the group firing to use a specific weapon, for instance using the task on a ship to force it to fire guided missiles at targets within cannon range. See http://wiki.hoggit.us/view/DCS_enum_weapon_flag -- @param #number Altitude (Optional) Altitude in meters. --- @param #number ASL Altitude is above mean sea level. Default is above ground level. +-- @param #number ASL (Optional) Altitude is above mean sea level. Default is above ground level. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount, WeaponType, Altitude, ASL ) @@ -1818,11 +1799,11 @@ end -- It's important to note that depending on the type of unit that is being assigned the task (AIR or GROUND), you must choose the correct type of callsign enumerator. For airborne controllables use CALLSIGN.Aircraft and for ground based use CALLSIGN.JTAC enumerators. -- @param #CONTROLLABLE self -- @param Wrapper.Group#GROUP AttackGroup Target GROUP object. --- @param #number WeaponType Bitmask of weapon types, which are allowed to use. --- @param DCS#AI.Task.Designation Designation (Optional) Designation type. +-- @param #number WeaponType (Optional) Bitmask of weapon types, which are allowed to use. Defaults tp ENUMS.WeaponFlag.AutoDCS. +-- @param DCS#AI.Task.Designation Designation (Optional) Designation type. Defaults to Auto. -- @param #boolean Datalink (Optional) Allows to use datalink to send the target information to attack aircraft. Enabled by default. --- @param #number Frequency Frequency in MHz used to communicate with the FAC. Default 133 MHz. --- @param #number Modulation Modulation of radio for communication. Default 0=AM. +-- @param #number Frequency (Optional) Frequency in MHz used to communicate with the FAC. Default 133 MHz. +-- @param #number Modulation (Optional) Modulation of radio for communication. Default 0=AM. -- @param #number CallsignName Callsign enumerator name of the FAC. (CALLSIGN.Aircraft.{name} for airborne controllables, CALLSIGN.JTACS.{name} for ground units) -- @param #number CallsignNumber Callsign number, e.g. Axeman-**1**. -- @return DCS#Task The DCS task structure. @@ -1848,8 +1829,8 @@ end --- (AIR) Engaging targets of defined types. -- @param #CONTROLLABLE self -- @param DCS#Distance Distance Maximal distance from the target to a route leg. If the target is on a greater distance it will be ignored. --- @param DCS#AttributeNameArray TargetTypes Array of target categories allowed to engage. --- @param #number Priority All enroute tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0. +-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of target categories allowed to engage. Defaults to {"Air"}. +-- @param #number Priority (Optional) All enroute tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:EnRouteTaskEngageTargets( Distance, TargetTypes, Priority ) @@ -1890,7 +1871,7 @@ end --- (AIR) Enroute anti-ship task. -- @param #CONTROLLABLE self --- @param DCS#AttributeNameArray TargetTypes Array of target categories allowed to engage. Default `{"Ships"}`. +-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of target categories allowed to engage. Default `{"Ships"}`. -- @param #number Priority (Optional) All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:EnRouteTaskAntiShip(TargetTypes, Priority) @@ -1911,7 +1892,7 @@ end --- (AIR) Enroute SEAD task. -- @param #CONTROLLABLE self --- @param DCS#AttributeNameArray TargetTypes Array of target categories allowed to engage. Default `{"Air Defence"}`. +-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of target categories allowed to engage. Default `{"Air Defence"}`. -- @param #number Priority (Optional) All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:EnRouteTaskSEAD(TargetTypes, Priority) @@ -1932,7 +1913,7 @@ end --- (AIR) Enroute CAP task. -- @param #CONTROLLABLE self --- @param DCS#AttributeNameArray TargetTypes Array of target categories allowed to engage. Default `{"Air"}`. +-- @param DCS#AttributeNameArray TargetTypes (Optional) Array of target categories allowed to engage. Default `{"Air"}`. -- @param #number Priority (Optional) All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Default 0. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:EnRouteTaskCAP(TargetTypes, Priority) @@ -2105,11 +2086,11 @@ end -- Target designation is set to auto and is dependent on the circumstances. -- See [hoggit](https://wiki.hoggitworld.com/view/DCS_task_fac). -- @param #CONTROLLABLE self --- @param #number Frequency Frequency in MHz. Default 133 MHz. --- @param #number Modulation Radio modulation. Default `radio.modulation.AM`. +-- @param #number Frequency (Optional) Frequency in MHz. Default 133 MHz. +-- @param #number Modulation (Optional) Radio modulation. Default `radio.modulation.AM`. -- @param #number CallsignID CallsignID, e.g. `CALLSIGN.JTAC.Anvil` for ground or `CALLSIGN.Aircraft.Ford` for air. -- @param #number CallsignNumber Callsign first number, e.g. 2 for `Ford-2`. --- @param #number Priority All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. +-- @param #number Priority (Optional) All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first. Defaults to 0. -- @return DCS#Task The DCS task structure. function CONTROLLABLE:EnRouteTaskFAC( Frequency, Modulation, CallsignID, CallsignNumber, Priority ) @@ -2339,8 +2320,8 @@ do -- Patrol methods -- @param #table ZoneList Table of zones. -- @param #number Speed Speed in km/h the group moves at. -- @param #string Formation (Optional) Formation the group should use. - -- @param #number DelayMin Delay in seconds before the group progresses to the next route point. Default 1 sec. - -- @param #number DelayMax Max. delay in seconds. Actual delay is randomly chosen between DelayMin and DelayMax. Default equal to DelayMin. + -- @param #number DelayMin (Optional) Delay in seconds before the group progresses to the next route point. Default 1 sec. + -- @param #number DelayMax (Optional) Max. delay in seconds. Actual delay is randomly chosen between DelayMin and DelayMax. Default equal to DelayMin. -- @return #CONTROLLABLE function CONTROLLABLE:PatrolZones( ZoneList, Speed, Formation, DelayMin, DelayMax ) @@ -2855,7 +2836,7 @@ do -- Route methods -- @param #CONTROLLABLE self -- @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 #number Speed (Optional) The speed in m/s. Default is 5.555 m/s = 20 km/h. -- @param DCS#FORMATION Formation The formation string. function CONTROLLABLE:TaskRouteToZone( Zone, Randomize, Speed, Formation ) self:F2( Zone ) @@ -2915,7 +2896,7 @@ do -- Route methods -- A given formation can be given. -- @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 #number Speed (Optional) The speed in m/s. Default is 5.555 m/s = 20 km/h. -- @param DCS#FORMATION Formation The formation string. function CONTROLLABLE:TaskRouteToVec2( Vec2, Speed, Formation ) @@ -3847,7 +3828,7 @@ end --- Set RTB on bingo fuel. -- @param #CONTROLLABLE self --- @param #boolean RTB true if RTB on bingo fuel (default), false if no RTB on bingo fuel. +-- @param #boolean RTB (Optional) true if RTB on bingo fuel (default), false if no RTB on bingo fuel. -- Warning! When you switch this option off, the airborne group will continue to fly until all fuel has been consumed, and will crash. -- @return #CONTROLLABLE self function CONTROLLABLE:OptionRTBBingoFuel( RTB ) -- R2.2 @@ -3974,7 +3955,7 @@ end --- [Ground] Option that defines the vehicle spacing when in an on road and off road formation. -- @param #CONTROLLABLE self --- @param #number meters Can be zero to 100 meters. Defaults to 50 meters. +-- @param #number meters (Optional) Can be zero to 100 meters. Defaults to 50 meters. -- @return #CONTROLLABLE self function CONTROLLABLE:OptionFormationInterval(meters) self:F2( { self.ControllableName } ) @@ -3995,7 +3976,7 @@ end --- [Air] Defines the usage of Electronic Counter Measures by airborne forces. -- @param #CONTROLLABLE self --- @param #number ECMvalue Can be - 0=Never on, 1=if locked by radar, 2=if detected by radar, 3=always on, defaults to 1 +-- @param #number ECMvalue (Optional) Can be - 0=Never on, 1=if locked by radar, 2=if detected by radar, 3=always on, defaults to 1 -- @return #CONTROLLABLE self function CONTROLLABLE:OptionECM( ECMvalue ) self:F2( { self.ControllableName } ) @@ -4291,7 +4272,7 @@ end --- Defines the range at which a GROUND unit/group is allowed to use its weapons automatically. -- @param #CONTROLLABLE self --- @param #number EngageRange Engage range limit in percent (a number between 0 and 100). Default 100. +-- @param #number EngageRange (Optional) Engage range limit in percent (a number between 0 and 100). Default 100. -- @return #CONTROLLABLE self function CONTROLLABLE:OptionEngageRange( EngageRange ) self:F2( { self.ControllableName } ) @@ -4441,7 +4422,7 @@ end --- [AIR] Set the AI to report contact for certain types of objects. -- @param #CONTROLLABLE self --- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @param #table Objects (Optional) Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) -- @return #CONTROLLABLE self function CONTROLLABLE:SetOptionRadioContact(Objects) self:F2( { self.ControllableName } ) @@ -4455,7 +4436,7 @@ end --- [AIR] Set the AI to report engaging certain types of objects. -- @param #CONTROLLABLE self --- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @param #table Objects (Optional) Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) -- @return #CONTROLLABLE self function CONTROLLABLE:SetOptionRadioEngage(Objects) self:F2( { self.ControllableName } ) @@ -4469,7 +4450,7 @@ end --- [AIR] Set the AI to report killing certain types of objects. -- @param #CONTROLLABLE self --- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @param #table Objects (Optional) Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) -- @return #CONTROLLABLE self function CONTROLLABLE:SetOptionRadioKill(Objects) self:F2( { self.ControllableName } ) @@ -4483,12 +4464,12 @@ end --- (GROUND) Relocate controllable to a random point within a given radius; use e.g.for evasive actions; Note that not all ground controllables can actually drive, also the alarm state of the controllable might stop it from moving. -- @param #CONTROLLABLE self --- @param #number speed Speed of the controllable, default 20 --- @param #number radius Radius of the relocation zone, default 500 --- @param #boolean onroad If true, route on road (less problems with AI way finding), default true --- @param #boolean shortcut If true and onroad is set, take a shorter route - if available - off road, default false --- @param #string formation Formation string as in the mission editor, e.g. "Vee", "Diamond", "Line abreast", etc. Defaults to "Off Road" --- @param #boolean onland (optional) If true, try up to 50 times to get a coordinate on land.SurfaceType.LAND. Note - this descriptor value is not reliably implemented on all maps. +-- @param #number speed (Optional) Speed of the controllable, default 20 +-- @param #number radius (Optional) Radius of the relocation zone, default 500 +-- @param #boolean onroad (Optional) If true, route on road (less problems with AI way finding), default true +-- @param #boolean shortcut (Optional) If true and onroad is set, take a shorter route - if available - off road, default false +-- @param #string formation (Optional) Formation string as in the mission editor, e.g. "Vee", "Diamond", "Line abreast", etc. Defaults to "Off Road" +-- @param #boolean onland (Optional) If true, try up to 50 times to get a coordinate on land.SurfaceType.LAND. Note - this descriptor value is not reliably implemented on all maps. -- @return #CONTROLLABLE self function CONTROLLABLE:RelocateGroundRandomInRadius( speed, radius, onroad, shortcut, formation, onland ) self:F2( { self.ControllableName } ) @@ -5871,8 +5852,8 @@ end --- [GROUND] Create and enable a new IR Marker for the given controllable UNIT or GROUP. -- @param #CONTROLLABLE self --- @param #boolean EnableImmediately (Optionally) If true start up the IR Marker immediately. Else you need to call `myobject:EnableIRMarker()` later on. --- @param #number Runtime (Optionally) Run this IR Marker for the given number of seconds, then stop. Use in conjunction with EnableImmediately. Defaults to 60 seconds. +-- @param #boolean EnableImmediately (Optional) If true start up the IR Marker immediately. Else you need to call `myobject:EnableIRMarker()` later on. +-- @param #number Runtime (Optional) Run this IR Marker for the given number of seconds, then stop. Use in conjunction with EnableImmediately. Defaults to 60 seconds. -- @return #CONTROLLABLE self function CONTROLLABLE:NewIRMarker(EnableImmediately, Runtime) self:T2("NewIRMarker") diff --git a/Moose Development/Moose/Wrapper/DynamicCargo.lua b/Moose Development/Moose/Wrapper/DynamicCargo.lua index 76a874198..d74fc0ec9 100644 --- a/Moose Development/Moose/Wrapper/DynamicCargo.lua +++ b/Moose Development/Moose/Wrapper/DynamicCargo.lua @@ -28,9 +28,9 @@ -- @field #string version. -- @field #string CargoState. -- @field #table DCS#Vec3 LastPosition. --- @field #number Interval Check Interval. 20 secs default. +-- @field #number Interval Check interval. 5 secs default. -- @field #boolean testing --- @field Core.Timer#TIMER timer Timmer to run intervals +-- @field Core.Timer#TIMER timer Compatibility field; updates are handled by one class-wide scheduler. -- @field #string Owner The playername who has created, loaded or unloaded this cargo. Depends on state. -- @extends Wrapper.Positionable#POSITIONABLE @@ -50,7 +50,16 @@ DYNAMICCARGO = { ClassName = "DYNAMICCARGO", verbose = 0, testing = false, - Interval = 10, + Interval = 5, + C130AttachDistance = 10, + C130DetachDistance = 14, + C130AirborneAGL = 8, + C130LandedAGL = 0.5, + C130StabilityEpsilon = 0.05, + C130RequireAirborne = true, + C130OwnerResolveMove2D = 10, + C130OwnerResolveNear2D = 4, + C130OwnerResolveMax3D = 250, } @@ -110,6 +119,10 @@ DYNAMICCARGO.AircraftTypes = { ["CH-47Fbl1"] = "CH-47Fbl1", ["Mi-8MTV2"] = "Mi-8MTV2", ["Mi-8MT"] = "Mi-8MT", + ["UH-1H"] = "UH-1H", + ["Mi-24P"] = "Mi-24P", + ["UH-60L"] = "UH-60L", + ["UH-60L_DAP"] = "UH-60L_DAP", ["C-130J-30"] = "C-130J-30", } @@ -135,17 +148,46 @@ DYNAMICCARGO.AircraftDimensions = { ["length"] = 15, ["ropelength"] = 30, }, + ["UH-1H"] = { + ["width"] = 4, + ["height"] = 4, + ["length"] = 9, + ["ropelength"] = 25, + }, + ["Mi-24P"] = { + ["width"] = 4, + ["height"] = 5, + ["length"] = 11, + ["ropelength"] = 25, + }, + ["UH-60L"] = { + ["width"] = 4, + ["height"] = 5, + ["length"] = 10, + ["ropelength"] = 25, + }, + ["UH-60L_DAP"] = { + ["width"] = 4, + ["height"] = 5, + ["length"] = 10, + ["ropelength"] = 25, + }, ["C-130J-30"] = { ["width"] = 4, ["height"] = 12, ["length"] = 35, ["ropelength"] = 0, + ["attach"] = 10, + ["detach"] = 14, }, } --- DYNAMICCARGO class version. -- @field #string version DYNAMICCARGO.version="0.1.0" +DYNAMICCARGO._TrackedCargo = DYNAMICCARGO._TrackedCargo or {} +DYNAMICCARGO._GlobalTimer = DYNAMICCARGO._GlobalTimer or nil +DYNAMICCARGO._GlobalTimerInterval = DYNAMICCARGO._GlobalTimerInterval or nil ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -170,8 +212,17 @@ function DYNAMICCARGO:Register(CargoName) self.StaticName = CargoName self.LastPosition = self:GetCoordinate() + self._spawnVec3 = self.LastPosition and self.LastPosition:GetVec3() or nil self.CargoState = DYNAMICCARGO.State.NEW + self._attached = false + self._detached = false + self._wasAirborne = false + self._landAglConfirm = nil + self._ownerResolved = false + self._carrierUnitName = nil + self._carrierGroupName = nil + self._carrierTypeName = nil self.Interval = DYNAMICCARGO.Interval or 10 @@ -185,9 +236,10 @@ function DYNAMICCARGO:Register(CargoName) self.lid = string.format("DYNAMICCARGO %s", CargoName) self.Owner = string.match(CargoName,"^(.+)|%d%d:%d%d|PKG%d+") or "None" - - self.timer = TIMER:New(DYNAMICCARGO._UpdatePosition,self) - self.timer:Start(self.Interval,self.Interval) + + -- Keep a compatibility field, while updates are driven by one class-wide scheduler. + self.timer = nil + DYNAMICCARGO._TrackCargo(self) if not _DYNAMICCARGO_HELOS then _DYNAMICCARGO_HELOS = SET_CLIENT:New():FilterAlive():FilterFunction(DYNAMICCARGO._FilterHeloTypes):FilterStart() @@ -267,6 +319,55 @@ function DYNAMICCARGO:IsRemoved() end end +--- Returns true if this cargo is attached to a detected carrier. +-- @param #DYNAMICCARGO self +-- @return #boolean Outcome +function DYNAMICCARGO:IsAttached() + return self._attached == true +end + +--- Returns true if this cargo was detached from a detected carrier. +-- @param #DYNAMICCARGO self +-- @return #boolean Outcome +function DYNAMICCARGO:IsDetached() + return self._detached == true +end + +--- Returns true if this cargo has seen airborne transport in this cycle. +-- @param #DYNAMICCARGO self +-- @return #boolean Outcome +function DYNAMICCARGO:WasAirborneTransport() + return self._wasAirborne == true +end + +--- Returns true if this cargo has reached landed stable confirmation. +-- @param #DYNAMICCARGO self +-- @return #boolean Outcome +function DYNAMICCARGO:IsLandedStable() + return self.CargoState == DYNAMICCARGO.State.UNLOADED and self._detached == true +end + +--- Returns last known carrier unit name. +-- @param #DYNAMICCARGO self +-- @return #string Unit name +function DYNAMICCARGO:GetCarrierUnitName() + return self._carrierUnitName +end + +--- Returns last known carrier type name. +-- @param #DYNAMICCARGO self +-- @return #string Type name +function DYNAMICCARGO:GetCarrierTypeName() + return self._carrierTypeName +end + +--- Returns last known carrier group name. +-- @param #DYNAMICCARGO self +-- @return #string Group name +function DYNAMICCARGO:GetCarrierGroupName() + return self._carrierGroupName +end + --- [CTLD] Get number of crates this DYNAMICCARGO consists of. Always one. -- @param #DYNAMICCARGO self -- @return #number crate number, always one @@ -398,6 +499,372 @@ end -- Private Functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--- [Internal] Check whether an aircraft typename is a C-130J for special handling. +-- @param #DYNAMICCARGO self +-- @param #string TypeName +-- @return #boolean Outcome +function DYNAMICCARGO:_IsC130Type(TypeName) + return TypeName == "C-130J-30" +end + +--- [Internal] Safe AGL calculation helper. +-- @param #DYNAMICCARGO self +-- @param Core.Point#COORDINATE Coord +-- @return #number AGL in meters +function DYNAMICCARGO:_GetAGL(Coord) + if not Coord then return -1 end + return (Coord.y or 0) - Coord:GetLandHeight() +end + +--- [Internal] Resolve player name for a client. +-- @param #DYNAMICCARGO self +-- @param Wrapper.Client#CLIENT Client +-- @return #string Player name +function DYNAMICCARGO:_GetPlayerNameForClient(Client) + if not Client then return self.Owner or "None" end + return Client:GetPlayerName() or _DATABASE:_FindPlayerNameByUnitName(Client:GetName()) or self.Owner or "None" +end + +--- [Internal] Store current carrier identity fields. +-- @param #DYNAMICCARGO self +-- @param Wrapper.Client#CLIENT Client +-- @param #string PlayerName +-- @return #DYNAMICCARGO self +function DYNAMICCARGO:_SetCarrierFromClient(Client, PlayerName) + if not Client then return self end + self._carrierUnitName = Client:GetName() or self._carrierUnitName + self._carrierTypeName = Client:GetTypeName() or self._carrierTypeName + local grp = Client:GetGroup() + if grp then + self._carrierGroupName = grp:GetName() or self._carrierGroupName + end + self.Owner = PlayerName or self:_GetPlayerNameForClient(Client) + return self +end + +--- [Internal] Get scheduler interval for global dynamic cargo updates. +-- @return #number Interval in seconds +function DYNAMICCARGO._GetSchedulerInterval() + return DYNAMICCARGO.Interval or 5 +end + +--- [Internal] Count currently tracked dynamic cargo objects. +-- @return #number Count +function DYNAMICCARGO._CountTracked() + local n = 0 + for _,_ in pairs(DYNAMICCARGO._TrackedCargo or {}) do + n = n + 1 + end + return n +end + +--- [Internal] Stop global scheduler when no tracked cargo remains. +function DYNAMICCARGO._StopGlobalSchedulerIfIdle() + if DYNAMICCARGO._CountTracked() > 0 then + return + end + if DYNAMICCARGO._GlobalTimer and DYNAMICCARGO._GlobalTimer:IsRunning() then + DYNAMICCARGO._GlobalTimer:Stop() + end + DYNAMICCARGO._GlobalTimer = nil + DYNAMICCARGO._GlobalTimerInterval = nil +end + +--- [Internal] Ensure global scheduler is running for tracked cargo updates. +function DYNAMICCARGO._EnsureGlobalScheduler() + local interval = DYNAMICCARGO._GetSchedulerInterval() + if DYNAMICCARGO._GlobalTimer and DYNAMICCARGO._GlobalTimer:IsRunning() then + if DYNAMICCARGO._GlobalTimerInterval == interval then + return + end + DYNAMICCARGO._GlobalTimer:Stop() + DYNAMICCARGO._GlobalTimer = nil + DYNAMICCARGO._GlobalTimerInterval = nil + end + if DYNAMICCARGO._CountTracked() < 1 then + return + end + DYNAMICCARGO._GlobalTimer = TIMER:New(DYNAMICCARGO._UpdateAllTracked) + DYNAMICCARGO._GlobalTimer:Start(interval, interval) + DYNAMICCARGO._GlobalTimerInterval = interval +end + +--- [Internal] Add one dynamic cargo object to global tracking. +-- @param #DYNAMICCARGO Cargo +function DYNAMICCARGO._TrackCargo(Cargo) + if not Cargo or not Cargo.StaticName then + return + end + DYNAMICCARGO._TrackedCargo = DYNAMICCARGO._TrackedCargo or {} + DYNAMICCARGO._TrackedCargo[Cargo.StaticName] = Cargo + DYNAMICCARGO._EnsureGlobalScheduler() +end + +--- [Internal] Remove one dynamic cargo object from global tracking. +-- @param #string CargoName +function DYNAMICCARGO._UntrackCargo(CargoName) + if not CargoName or not DYNAMICCARGO._TrackedCargo then + DYNAMICCARGO._StopGlobalSchedulerIfIdle() + return + end + DYNAMICCARGO._TrackedCargo[CargoName] = nil + DYNAMICCARGO._StopGlobalSchedulerIfIdle() +end + +--- [Internal] Update all tracked dynamic cargo objects in one scheduler tick. +function DYNAMICCARGO._UpdateAllTracked() + local tracked = DYNAMICCARGO._TrackedCargo or {} + local names = {} + for name,_ in pairs(tracked) do + names[#names + 1] = name + end + for _,name in ipairs(names) do + local cargo = tracked[name] + if cargo then + cargo:_UpdatePosition() + end + end + DYNAMICCARGO._StopGlobalSchedulerIfIdle() +end + +--- [Internal] Find tracked client by unit name in current dynamic cargo helo set. +-- @param #DYNAMICCARGO self +-- @param #string UnitName +-- @return Wrapper.Client#CLIENT Client +function DYNAMICCARGO:_FindClientByUnitName(UnitName) + if not UnitName or UnitName == "" or not _DYNAMICCARGO_HELOS then return nil end + for _,_helo in pairs(_DYNAMICCARGO_HELOS:GetAliveSet() or {}) do + local helo = _helo -- Wrapper.Client#CLIENT + if helo and helo:IsAlive() and helo:GetName() == UnitName then + return helo + end + end + return nil +end + +--- [Internal] Get best known carrier client from stored names/owner. +-- @param #DYNAMICCARGO self +-- @return Wrapper.Client#CLIENT Client +function DYNAMICCARGO:_GetKnownCarrierClient() + local client = nil + if self._carrierUnitName then + client = self:_FindClientByUnitName(self._carrierUnitName) + end + if (not client) and self.Owner and self.Owner ~= "None" then + local byPlayer = CLIENT:FindByPlayerName(self.Owner) + if byPlayer and byPlayer:IsAlive() then + client = byPlayer + end + end + return client +end + +--- [Internal] Find nearest live C-130 client. +-- @param #DYNAMICCARGO self +-- @param Core.Point#COORDINATE Pos +-- @param #number Max3D Maximum 3D distance +-- @return Wrapper.Client#CLIENT Client +-- @return #string PlayerName +-- @return #number Dist2D +-- @return #number Dist3D +function DYNAMICCARGO:_FindNearestC130(Pos, Max3D) + if not Pos or not _DYNAMICCARGO_HELOS then return nil, nil, nil, nil end + local bestClient = nil + local bestName = nil + local best2D = math.huge + local best3D = math.huge + local bestOwnerMatch = false + local max3D = Max3D or DYNAMICCARGO.C130OwnerResolveMax3D + local preferredOwner = self.Owner + if preferredOwner == "" or preferredOwner == "None" then + preferredOwner = nil + end + for _,_helo in pairs(_DYNAMICCARGO_HELOS:GetAliveSet() or {}) do + local helo = _helo -- Wrapper.Client#CLIENT + if helo and helo:IsAlive() then + local typename = helo:GetTypeName() + if self:_IsC130Type(typename) then + local hpos = helo:GetCoordinate() + if hpos then + local d3 = hpos:Get3DDistance(Pos) + if d3 <= max3D then + local d2 = hpos:Get2DDistance(Pos) + local pname = self:_GetPlayerNameForClient(helo) + local ownerMatch = preferredOwner and pname and pname == preferredOwner or false + if (ownerMatch and not bestOwnerMatch) or ((ownerMatch == bestOwnerMatch) and d3 < best3D) then + bestClient = helo + bestName = pname + best2D = d2 + best3D = d3 + bestOwnerMatch = ownerMatch + end + end + end + end + end + end + return bestClient, bestName, best2D, best3D +end + +--- [Internal] Resolve/rebind owner to nearest valid C-130 after movement from spawn. +-- @param #DYNAMICCARGO self +-- @param Core.Point#COORDINATE Pos +-- @return Wrapper.Client#CLIENT Client +function DYNAMICCARGO:_ResolveC130Owner(Pos) + if not Pos or not self._spawnVec3 then return nil end + local moved2D = UTILS.VecDist2D(Pos, self._spawnVec3) + if moved2D < (DYNAMICCARGO.C130OwnerResolveMove2D or 10) then + return nil + end + local max3D = DYNAMICCARGO.C130OwnerResolveMax3D or 250 + local known = self:_GetKnownCarrierClient() + if known and known:IsAlive() and self:_IsC130Type(known:GetTypeName()) then + local kpos = known:GetCoordinate() + if kpos and kpos:Get3DDistance(Pos) <= max3D then + self:_SetCarrierFromClient(known) + return known + end + end + local nearest, playerName, d2 = self:_FindNearestC130(Pos, DYNAMICCARGO.C130OwnerResolveMax3D) + if nearest and d2 and d2 <= (DYNAMICCARGO.C130OwnerResolveNear2D or 4) then + self:_SetCarrierFromClient(nearest, playerName) + self._ownerResolved = true + self:T(self.lid.." C130 owner re-resolved to "..tostring(self._carrierUnitName).." / "..tostring(self.Owner)) + return nearest + end + return nil +end + +--- [Internal] Determine whether to run C-130 transport-state handling for this cargo tick. +-- @param #DYNAMICCARGO self +-- @param Core.Point#COORDINATE Pos +-- @return #boolean Outcome +function DYNAMICCARGO:_ShouldUseC130State(Pos) + if self:_IsC130Type(self._carrierTypeName) then + return true + end + local known = self:_GetKnownCarrierClient() + if known and self:_IsC130Type(known:GetTypeName()) then + self:_SetCarrierFromClient(known) + return true + end + if self._attached or self._detached or self._wasAirborne then + return true + end + if self.CargoState == DYNAMICCARGO.State.NEW or self.CargoState == DYNAMICCARGO.State.UNLOADED then + local nearest, _, d2 = self:_FindNearestC130(Pos, DYNAMICCARGO.C130AttachDistance + 50) + if nearest and d2 and d2 <= (DYNAMICCARGO.C130AttachDistance + 5) then + return true + end + end + return false +end + +--- [Internal] C-130-specific transport state update. +-- @param #DYNAMICCARGO self +-- @param Core.Point#COORDINATE Pos +-- @return #DYNAMICCARGO self +function DYNAMICCARGO:_UpdatePositionC130(Pos) + local attachDist = DYNAMICCARGO.C130AttachDistance or 10 + local detachDist = DYNAMICCARGO.C130DetachDistance or 14 + local airborneAgl = DYNAMICCARGO.C130AirborneAGL or 8 + local landedAgl = DYNAMICCARGO.C130LandedAGL or 0.5 + local stableEps = DYNAMICCARGO.C130StabilityEpsilon or 0.05 + local requireAirborne = DYNAMICCARGO.C130RequireAirborne ~= false + + local cargoAgl = self:_GetAGL(Pos) + local carrier = self:_GetKnownCarrierClient() + if carrier and not self:_IsC130Type(carrier:GetTypeName()) then + carrier = nil + end + if not carrier then + carrier = self:_ResolveC130Owner(Pos) + end + + -- Attach detection: grounded C-130 close to cargo. + if (self.CargoState == DYNAMICCARGO.State.NEW or self.CargoState == DYNAMICCARGO.State.UNLOADED) and (not self._attached) then + if not carrier then + local nearest, pname, d2 = self:_FindNearestC130(Pos, DYNAMICCARGO.C130OwnerResolveMax3D) + if nearest and d2 and d2 <= attachDist and not nearest:InAir() then + carrier = nearest + self:_SetCarrierFromClient(nearest, pname) + end + end + if carrier and carrier:IsAlive() then + local hpos = carrier:GetCoordinate() + if hpos and (not carrier:InAir()) and hpos:Get2DDistance(Pos) <= attachDist then + self._attached = true + self._detached = false + self._wasAirborne = false + self._landAglConfirm = nil + self:_SetCarrierFromClient(carrier) + if self.CargoState ~= DYNAMICCARGO.State.LOADED then + self.CargoState = DYNAMICCARGO.State.LOADED + self:T(self.lid.." C130 attach: "..tostring(self.Owner)) + _DATABASE:CreateEventDynamicCargoLoaded(self) + end + end + end + end + + if self.CargoState == DYNAMICCARGO.State.LOADED then + if not carrier then + carrier = self:_ResolveC130Owner(Pos) + end + local carrierInAir = false + local dist2D = math.huge + local carrierAgl = -1 + if carrier and carrier:IsAlive() then + local hpos = carrier:GetCoordinate() + if hpos then + dist2D = hpos:Get2DDistance(Pos) + carrierAgl = self:_GetAGL(hpos) + end + carrierInAir = carrier:InAir() + self:_SetCarrierFromClient(carrier) + end + + if cargoAgl >= airborneAgl or carrierAgl >= airborneAgl then + self._wasAirborne = true + end + + -- Detach only when actually airborne and separated. + if self._attached and carrierInAir and dist2D > detachDist then + self._attached = false + self._detached = true + self._landAglConfirm = nil + self:T(self.lid.." C130 detach at d2="..tostring(UTILS.Round(dist2D,2))) + end + + -- Fallback detach if carrier reference is stale but cargo already transitioned airborne. + if self._attached and (not carrier or not carrier:IsAlive()) and self._wasAirborne and cargoAgl <= airborneAgl then + self._attached = false + self._detached = true + self._landAglConfirm = nil + self:T(self.lid.." C130 detach fallback (carrier stale)") + end + + local canUnload = self._detached and ((not requireAirborne) or self._wasAirborne) + if canUnload then + local moved3D = self.LastPosition and UTILS.VecDist3D(Pos, self.LastPosition) or math.huge + local stable = moved3D <= stableEps + if cargoAgl <= landedAgl and stable then + if self._landAglConfirm then + self.CargoState = DYNAMICCARGO.State.UNLOADED + self:T(self.lid.." C130 landed-stable unload by "..tostring(self.Owner)) + _DATABASE:CreateEventDynamicCargoUnloaded(self) + else + self._landAglConfirm = true + end + else + self._landAglConfirm = nil + end + end + end + + return self +end + --- [Internal] _Get helo hovering intel -- @param #DYNAMICCARGO self -- @param Wrapper.Unit#UNIT Unit The Unit to test @@ -444,35 +911,37 @@ function DYNAMICCARGO:_GetPossibleHeloNearby(pos,loading) local hpos = helo:GetCoordinate() -- TODO Check unloading via sling load? local typename = helo:GetTypeName() - local dimensions = DYNAMICCARGO.AircraftDimensions[typename] - local hovering, height = self:_HeloHovering(helo,dimensions.ropelength) - local helolanded = not helo:InAir() - self:T(self.lid.." InAir: AGL/Hovering: "..hpos.y-hpos:GetLandHeight().."/"..tostring(hovering)) - if hpos and typename and dimensions then - local delta2D = hpos:Get2DDistance(pos) - local delta3D = hpos:Get3DDistance(pos) - if self.testing then - self:T(string.format("Cargo relative position: 2D %dm | 3D %dm",delta2D,delta3D)) - self:T(string.format("Helo dimension: length %dm | width %dm | rope %dm",dimensions.length,dimensions.width,dimensions.ropelength)) - self:T(string.format("Helo hovering: %s at %dm",tostring(hovering),height)) - end - -- unloading from ground - if loading~=true and (delta2D > dimensions.length or delta2D > dimensions.width) and helolanded then -- Theoretically the cargo could still be attached to the sling if landed next to the cargo. But once moved again it would go back into loaded state once lifted again. - success = true - Helo = helo - Playername = name - end - -- unloading from hover/rope - if loading~=true and delta3D > dimensions.ropelength then - success = true - Helo = helo - Playername = name - end - -- loading - if loading == true and ((delta2D < dimensions.length and delta2D < dimensions.width and helolanded) or (delta3D == dimensions.ropelength and helo:InAir())) then -- Loaded via ground or sling - success = true - Helo = helo - Playername = name + if not self:_IsC130Type(typename) then + local dimensions = DYNAMICCARGO.AircraftDimensions[typename] + if hpos and typename and dimensions then + local hovering, height = self:_HeloHovering(helo,dimensions.ropelength) + local helolanded = not helo:InAir() + self:T(self.lid.." InAir: AGL/Hovering: "..hpos.y-hpos:GetLandHeight().."/"..tostring(hovering)) + local delta2D = hpos:Get2DDistance(pos) + local delta3D = hpos:Get3DDistance(pos) + if self.testing then + self:T(string.format("Cargo relative position: 2D %dm | 3D %dm",delta2D,delta3D)) + self:T(string.format("Helo dimension: length %dm | width %dm | rope %dm",dimensions.length,dimensions.width,dimensions.ropelength)) + self:T(string.format("Helo hovering: %s at %dm",tostring(hovering),height)) + end + -- unloading from ground + if loading~=true and (delta2D > dimensions.length or delta2D > dimensions.width) and helolanded then -- Theoretically the cargo could still be attached to the sling if landed next to the cargo. But once moved again it would go back into loaded state once lifted again. + success = true + Helo = helo + Playername = name + end + -- unloading from hover/rope + if loading~=true and delta3D > dimensions.ropelength then + success = true + Helo = helo + Playername = name + end + -- loading + if loading == true and ((delta2D < dimensions.length and delta2D < dimensions.width and helolanded) or (delta3D == dimensions.ropelength and helo:InAir())) then -- Loaded via ground or sling + success = true + Helo = helo + Playername = name + end end end end @@ -490,21 +959,31 @@ function DYNAMICCARGO:_UpdatePosition() self:T(string.format("Cargo position: x=%d, y=%d, z=%d",pos.x,pos.y,pos.z)) self:T(string.format("Last position: x=%d, y=%d, z=%d",self.LastPosition.x,self.LastPosition.y,self.LastPosition.z)) end - if UTILS.Round(UTILS.VecDist3D(pos,self.LastPosition),2) > 0.5 then -- This checks if the cargo has moved more than 0.5m since last check. If so then the cargo is loaded - --------------- - -- LOAD Cargo - --------------- - if self.CargoState == DYNAMICCARGO.State.NEW or self.CargoState == DYNAMICCARGO.State.UNLOADED then - local isloaded, client, playername = self:_GetPossibleHeloNearby(pos,true) - self:T(self.lid.." moved! NEW -> LOADED by "..tostring(playername)) - self.CargoState = DYNAMICCARGO.State.LOADED - self.Owner = playername - _DATABASE:CreateEventDynamicCargoLoaded(self) - end + local moved = UTILS.Round(UTILS.VecDist3D(pos,self.LastPosition),2) > 0.5 + if self:_ShouldUseC130State(pos) then + self:_UpdatePositionC130(pos) + self.LastPosition = pos + elseif moved then -- This checks if the cargo has moved more than 0.5m since last check. If so then the cargo is loaded + --------------- + -- LOAD Cargo + --------------- + if self.CargoState == DYNAMICCARGO.State.NEW or self.CargoState == DYNAMICCARGO.State.UNLOADED then + local isloaded, client, playername = self:_GetPossibleHeloNearby(pos,true) + if isloaded then + self:T(self.lid.." moved! NEW -> LOADED by "..tostring(playername)) + self.CargoState = DYNAMICCARGO.State.LOADED + self.Owner = playername + if client then + self:_SetCarrierFromClient(client, playername) + end + _DATABASE:CreateEventDynamicCargoLoaded(self) + end + end + self.LastPosition = pos --------------- -- UNLOAD Cargo --------------- - -- If the cargo is stationary then we need to end this condition here to check whether it is unloaded or still onboard or still hooked if anyone can hover that precisly + -- If the cargo is stationary then we need to end this condition here to check whether it is unloaded or still onboard or still hooked if anyone can hover that precisly elseif self.CargoState == DYNAMICCARGO.State.LOADED then -- TODO add checker if we are in flight somehow -- ensure not just the helo is moving @@ -518,29 +997,30 @@ function DYNAMICCARGO:_UpdatePosition() local client local playername = self.Owner if count > 0 then - self:T(self.lid.." Possible alive helos: "..count or -1) - isunloaded, client, playername = self:_GetPossibleHeloNearby(pos,false) + self:T(self.lid.." Possible alive helos: "..count or -1) + isunloaded, client, playername = self:_GetPossibleHeloNearby(pos,false) if isunloaded then self:T(self.lid.." moved! LOADED -> UNLOADED by "..tostring(playername)) self.CargoState = DYNAMICCARGO.State.UNLOADED self.Owner = playername + if client then + self:_SetCarrierFromClient(client, playername) + end _DATABASE:CreateEventDynamicCargoUnloaded(self) - end + end end end - self.LastPosition = pos - --end else --------------- -- REMOVED Cargo --------------- - if self.timer and self.timer:IsRunning() then - self.timer:Stop() - self.timer=nil + if self.CargoState ~= DYNAMICCARGO.State.REMOVED then + DYNAMICCARGO._UntrackCargo(self.StaticName) + self.timer=nil + self:T(self.lid.." dead! " ..self.CargoState.."-> REMOVED") + self.CargoState = DYNAMICCARGO.State.REMOVED + _DATABASE:CreateEventDynamicCargoRemoved(self) end - self:T(self.lid.." dead! " ..self.CargoState.."-> REMOVED") - self.CargoState = DYNAMICCARGO.State.REMOVED - _DATABASE:CreateEventDynamicCargoRemoved(self) end return self end diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index e63c84fed..21101fc00 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -604,7 +604,7 @@ end -- See [hoggit documentation](https://wiki.hoggitworld.com/view/DCS_func_hasAttribute). -- @param #GROUP self -- @param #string attribute The name of the attribute the group is supposed to have. Valid attributes can be found in the "db_attributes.lua" file which is located at in "C:\Program Files\Eagle Dynamics\DCS World\Scripts\Database". --- @param #boolean all If true, all units of the group must have the attribute in order to return true. Default is only one unit of a heterogenious group needs to have the attribute. +-- @param #boolean all (Optional) If true, all units of the group must have the attribute in order to return true. Default is only one unit of a heterogenious group needs to have the attribute. -- @return #boolean Group has this attribute. function GROUP:HasAttribute(attribute, all) diff --git a/Moose Development/Moose/Wrapper/Marker.lua b/Moose Development/Moose/Wrapper/Marker.lua index 9d138341c..7fe5a1142 100644 --- a/Moose Development/Moose/Wrapper/Marker.lua +++ b/Moose Development/Moose/Wrapper/Marker.lua @@ -586,7 +586,7 @@ end --- Set text that is displayed in the marker panel. Note this does not show the marker. -- @param #MARKER self --- @param #string Text Marker text. Default is an empty string "". +-- @param #string (Optional) Text Marker text. Default is an empty string "". -- @return #MARKER self function MARKER:SetText( Text ) self.text = Text and tostring( Text ) or "" diff --git a/Moose Development/Moose/Wrapper/Net.lua b/Moose Development/Moose/Wrapper/Net.lua index b04c8fca6..0c10afbcb 100644 --- a/Moose Development/Moose/Wrapper/Net.lua +++ b/Moose Development/Moose/Wrapper/Net.lua @@ -449,7 +449,7 @@ end --- Set block time in seconds. -- @param #NET self --- @param #number Seconds Numnber of seconds this block will last. Defaults to 600. +-- @param #number Seconds (Optional) Numnber of seconds this block will last. Defaults to 600. -- @return #NET self function NET:SetBlockTime(Seconds) self.BlockTime = Seconds or 600 diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua index e17602ca1..23ef64a10 100644 --- a/Moose Development/Moose/Wrapper/Positionable.lua +++ b/Moose Development/Moose/Wrapper/Positionable.lua @@ -449,7 +449,7 @@ end --- Triggers an explosion at the coordinates of the positionable. -- @param #POSITIONABLE self --- @param #number power Power of the explosion in kg TNT. Default 100 kg TNT. +-- @param #number power (Optional) Power of the explosion in kg TNT. Default 100 kg TNT. -- @param #number delay (Optional) Delay of explosion in seconds. -- @return #POSITIONABLE self function POSITIONABLE:Explode(power, delay) @@ -477,9 +477,9 @@ end --- Returns a COORDINATE object, which is offset with respect to the orientation of the POSITIONABLE. -- @param #POSITIONABLE self --- @param #number x Offset in the direction "the nose" of the unit is pointing in meters. Default 0 m. --- @param #number y Offset "above" the unit in meters. Default 0 m. --- @param #number z Offset in the direction "the wing" of the unit is pointing in meters. z>0 starboard, z<0 port. Default 0 m. +-- @param #number x (Optional) Offset in the direction "the nose" of the unit is pointing in meters. Default 0 m. +-- @param #number y (Optional) Offset "above" the unit in meters. Default 0 m. +-- @param #number z(Optional) Offset in the direction "the wing" of the unit is pointing in meters. z>0 starboard, z<0 port. Default 0 m. -- @return Core.Point#COORDINATE The COORDINATE of the offset with respect to the orientation of the POSITIONABLE. function POSITIONABLE:GetOffsetCoordinate( x, y, z ) @@ -518,9 +518,9 @@ end --- Returns a COORDINATE object, which is transformed to be relative to the POSITIONABLE. Inverse of @{#POSITIONABLE.GetOffsetCoordinate}. -- @param #POSITIONABLE self --- @param #number x Offset along the world x-axis in meters. Default 0 m. --- @param #number y Offset along the world y-axis in meters. Default 0 m. --- @param #number z Offset along the world z-axis in meters. Default 0 m. +-- @param #number x (Optional) Offset along the world x-axis in meters. Default 0 m. +-- @param #number y (Optional) Offset along the world y-axis in meters. Default 0 m. +-- @param #number z (Optional) Offset along the world z-axis in meters. Default 0 m. -- @return Core.Point#COORDINATE The relative COORDINATE with respect to the orientation of the POSITIONABLE. function POSITIONABLE:GetRelativeCoordinate( x, y, z ) diff --git a/Moose Development/Moose/Wrapper/Static.lua b/Moose Development/Moose/Wrapper/Static.lua index eb0899a5f..5c7384d16 100644 --- a/Moose Development/Moose/Wrapper/Static.lua +++ b/Moose Development/Moose/Wrapper/Static.lua @@ -246,7 +246,7 @@ end --- Spawn the @{Wrapper.Static} at a specific coordinate and heading. -- @param #STATIC self -- @param Core.Point#COORDINATE Coordinate The coordinate where to spawn the new Static. --- @param #number Heading The heading of the static respawn in degrees. Default is 0 deg. +-- @param #number Heading (Optional) The heading of the static respawn in degrees. Default is 0 deg. -- @param #number Delay Delay in seconds before the static is spawned. function STATIC:SpawnAt(Coordinate, Heading, Delay) diff --git a/Moose Development/Moose/Wrapper/Storage.lua b/Moose Development/Moose/Wrapper/Storage.lua index 5b5c23b3d..a3f7e9387 100644 --- a/Moose Development/Moose/Wrapper/Storage.lua +++ b/Moose Development/Moose/Wrapper/Storage.lua @@ -292,7 +292,7 @@ end --- Set verbosity level. -- @param #STORAGE self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #STORAGE self function STORAGE:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -816,7 +816,7 @@ end -- @param #STORAGE self -- @param #string Path The path to use. Use double backslashes \\\\ on Windows filesystems. -- @param #string Filename The name of the file. --- @param #number Interval The interval, start after this many seconds and repeat every interval seconds. Defaults to 300. +-- @param #number Interval (Optional) The interval, start after this many seconds and repeat every interval seconds. Defaults to 300. -- @param #boolean LoadOnce If LoadOnce is true or nil, we try to load saved storage first. -- @return #STORAGE self function STORAGE:StartAutoSave(Path,Filename,Interval,LoadOnce) diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index 77a2e391d..406026b5c 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -1445,7 +1445,7 @@ end --- Triggers an explosion at the coordinates of the unit. -- @param #UNIT self --- @param #number power Power of the explosion in kg TNT. Default 100 kg TNT. +-- @param #number power (Optional) Power of the explosion in kg TNT. Default 100 kg TNT. -- @param #number delay (Optional) Delay of explosion in seconds. -- @return #UNIT self function UNIT:Explode(power, delay) diff --git a/Moose Development/Moose/Wrapper/Weapon.lua b/Moose Development/Moose/Wrapper/Weapon.lua index 86b4cea03..3c2f7db43 100644 --- a/Moose Development/Moose/Wrapper/Weapon.lua +++ b/Moose Development/Moose/Wrapper/Weapon.lua @@ -259,7 +259,7 @@ end --- Set verbosity level. -- @param #WEAPON self --- @param #number VerbosityLevel Level of output (higher=more). Default 0. +-- @param #number VerbosityLevel (Optional) Level of output (higher=more). Default 0. -- @return #WEAPON self function WEAPON:SetVerbosity(VerbosityLevel) self.verbose=VerbosityLevel or 0 @@ -268,7 +268,7 @@ end --- Set track position time step. -- @param #WEAPON self --- @param #number TimeStep Time step in seconds when the position is updated. Default 0.01 sec ==> 100 evaluations per second. +-- @param #number TimeStep (Optional) Time step in seconds when the position is updated. Default 0.01 sec ==> 100 evaluations per second. -- @return #WEAPON self function WEAPON:SetTimeStepTrack(TimeStep) self.dtTrack=TimeStep or 0.01 @@ -281,7 +281,7 @@ end -- a good result on the impact point. -- It uses the DCS function [getIP](https://wiki.hoggitworld.com/view/DCS_func_getIP). -- @param #WEAPON self --- @param #number Distance Distance in meters. Default is 50 m. Set to 0 to deactivate. +-- @param #number Distance (Optional) Distance in meters. Default is 50 m. Set to 0 to deactivate. -- @return #WEAPON self function WEAPON:SetDistanceInterceptPoint(Distance) self.distIP=Distance or 50 @@ -307,7 +307,7 @@ end --- Put smoke on impact point. This requires that the tracking has been started. -- @param #WEAPON self -- @param #boolean Switch If `true` or nil, impact is smoked. --- @param #number SmokeColor Color of smoke. Default is `SMOKECOLOR.Red`. +-- @param #number SmokeColor (Optional) Color of smoke. Default is `SMOKECOLOR.Red`. -- @return #WEAPON self function WEAPON:SetSmokeImpact(Switch, SmokeColor) @@ -718,7 +718,7 @@ end -- the (approximate) impact point. Of course, the smaller the time step, the better the position can be determined. However, this can hit the performance as many -- calculations per second need to be carried out. -- @param #WEAPON self --- @param #number Delay Delay in seconds before the tracking starts. Default 0.001 sec. +-- @param #number Delay (Optional) Delay in seconds before the tracking starts. Default 0.001 sec. -- @return #WEAPON self function WEAPON:StartTrack(Delay) @@ -904,7 +904,7 @@ end --- Compute estimated intercept/impact point (IP) based on last known position and direction. -- @param #WEAPON self --- @param #number Distance Distance in meters. Default 50 m. +-- @param #number Distance (Optional) Distance in meters. Default 50 m. -- @return DCS#Vec3 Estimated intercept/impact point. Can also return `nil`, if no IP can be determined. function WEAPON:_GetIP(Distance) diff --git a/Moose Setup/Moose.files b/Moose Setup/Moose.files index 99a9b58f9..2e4c57bc5 100644 --- a/Moose Setup/Moose.files +++ b/Moose Setup/Moose.files @@ -98,6 +98,9 @@ Ops/Commander.lua Ops/Chief.lua Ops/CSAR.lua Ops/CTLD.lua +Ops/CTLD_CARGO.lua +Ops/CTLD_Localization.lua +Ops/CTLD_Hercules.lua Ops/Awacs.lua Ops/Operation.lua Ops/FlightControl.lua