Merge branch 'develop' into FF/Ops

This commit is contained in:
Frank 2022-10-02 22:10:52 +02:00
commit db469d1b84
17 changed files with 2268 additions and 162 deletions

View File

@ -2970,8 +2970,8 @@ do -- COORDINATE
-- * Uses default settings in COORDINATE. -- * Uses default settings in COORDINATE.
-- * Can be overridden if for a GROUP containing x clients, a menu was selected to override the default. -- * Can be overridden if for a GROUP containing x clients, a menu was selected to override the default.
-- @param #COORDINATE self -- @param #COORDINATE self
-- @param #COORDINATE ReferenceCoord The refrence coordinate. -- @param #COORDINATE ReferenceCoord The reference coordinate.
-- @param #string ReferenceName The refrence name. -- @param #string ReferenceName The reference name.
-- @param Wrapper.Controllable#CONTROLLABLE Controllable -- @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 coordinate Text in the configured coordinate system. -- @return #string The coordinate Text in the configured coordinate system.
@ -2999,6 +2999,39 @@ do -- COORDINATE
end end
--- Provides a coordinate string of the point, based on a coordinate format system:
-- * 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 #COORDINATE ReferenceCoord The reference coordinate.
-- @param #string ReferenceName The reference name.
-- @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.
-- @return #string The coordinate Text in the configured coordinate system.
function COORDINATE:ToStringFromRPShort( ReferenceCoord, ReferenceName, Controllable, Settings )
self:F2( { ReferenceCoord = ReferenceCoord, ReferenceName = ReferenceName } )
local Settings = Settings or ( Controllable and _DATABASE:GetPlayerSettings( Controllable:GetPlayerName() ) ) or _SETTINGS
local IsAir = Controllable and Controllable:IsAirPlane() or false
if IsAir then
local DirectionVec3 = ReferenceCoord:GetDirectionVec3( self )
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
local Distance = self:Get2DDistance( ReferenceCoord )
return self:GetBRText( AngleRadians, Distance, Settings ) .. " from " .. ReferenceName
else
local DirectionVec3 = ReferenceCoord:GetDirectionVec3( self )
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
local Distance = self:Get2DDistance( ReferenceCoord )
return self:GetBRText( AngleRadians, Distance, Settings ) .. " from " .. ReferenceName
end
return nil
end
--- Provides a coordinate string of the point, based on the A2G coordinate format system. --- Provides a coordinate string of the point, based on the A2G coordinate format system.
-- @param #COORDINATE self -- @param #COORDINATE self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable -- @param Wrapper.Controllable#CONTROLLABLE Controllable

View File

@ -813,14 +813,31 @@ do -- SET_BASE
return true return true
end end
--- Decides whether to include the Object. --- Decides whether an object is in the SET
-- @param #SET_BASE self -- @param #SET_BASE self
-- @param #table Object -- @param #table Object
-- @return #SET_BASE self -- @return #SET_BASE self
function SET_BASE:IsInSet( ObjectName ) function SET_BASE:IsInSet( Object )
self:F3( Object ) self:F3( Object )
local outcome = false
local name = Object:GetName()
self:ForEach(
function(object)
if object:GetName() == name then
outcome = true
end
end
)
return outcome
end
return true --- Decides whether an object is **not** in the SET
-- @param #SET_BASE self
-- @param #table Object
-- @return #SET_BASE self
function SET_BASE:IsNotInSet( Object )
self:F3( Object )
return not self:IsInSet(Object)
end end
--- Gets a string with all the object names. --- Gets a string with all the object names.

View File

@ -249,8 +249,10 @@ do
local RecceDcsUnit = self.Recce:GetDCSObject() local RecceDcsUnit = self.Recce:GetDCSObject()
self.SpotIR = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, Target:GetPointVec3():AddY(1):GetVec3() ) local relativespot = self.relstartpos or { x = 0, y = 2, z = 0 }
self.SpotLaser = Spot.createLaser( RecceDcsUnit, { x = 0, y = 2, z = 0 }, Target:GetPointVec3():AddY(1):GetVec3(), LaserCode )
self.SpotIR = Spot.createInfraRed( RecceDcsUnit, relativespot, Target:GetPointVec3():AddY(1):GetVec3() )
self.SpotLaser = Spot.createLaser( RecceDcsUnit, relativespot, Target:GetPointVec3():AddY(1):GetVec3(), LaserCode )
if Duration then if Duration then
self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration ) self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration )
@ -368,4 +370,16 @@ do
return self.Lasing return self.Lasing
end end
--- 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 }
-- @return #SPOT self
-- @usage
-- -- Set lasing position to be the position of the optics of the Gazelle M:
-- myspot:SetRelativeStartPosition({ x = 1.7, y = 1.2, z = 0 })
function SPOT:SetRelativeStartPosition(position)
self.relstartpos = position or { x = 0, y = 2, z = 0 }
return self
end
end end

View File

@ -46,7 +46,7 @@
-- === -- ===
-- --
-- ### Author: **FlightControl** -- ### Author: **FlightControl**
-- ### Contributions: -- ### Contributions: **Applevangelist**, **FunkyFranky**
-- --
-- === -- ===
-- --
@ -910,9 +910,6 @@ function ZONE_RADIUS:GetVec3( Height )
end end
--- Scan the zone for the presence of units of the given ObjectCategories. --- Scan the zone for the presence of units of the given ObjectCategories.
-- Note that **only after** a zone has been scanned, the zone can be evaluated by: -- Note that **only after** a zone has been scanned, the zone can be evaluated by:
-- --
@ -921,7 +918,6 @@ end
-- * @{ZONE_RADIUS.IsSomeInZoneOfCoalition}(): Scan if there is some presence of units in the zone of the given coalition. -- * @{ZONE_RADIUS.IsSomeInZoneOfCoalition}(): Scan if there is some presence of units in the zone of the given coalition.
-- * @{ZONE_RADIUS.IsNoneInZoneOfCoalition}(): Scan if there isn't any presence of units in the zone of an other coalition than the given one. -- * @{ZONE_RADIUS.IsNoneInZoneOfCoalition}(): Scan if there isn't any presence of units in the zone of an other coalition than the given one.
-- * @{ZONE_RADIUS.IsNoneInZone}(): Scan if the zone is empty. -- * @{ZONE_RADIUS.IsNoneInZone}(): Scan if the zone is empty.
-- @{#ZONE_RADIUS.
-- @param #ZONE_RADIUS self -- @param #ZONE_RADIUS self
-- @param ObjectCategories An array of categories of the objects to find in the zone. E.g. `{Object.Category.UNIT}` -- @param ObjectCategories An array of categories of the objects to find in the zone. E.g. `{Object.Category.UNIT}`
-- @param UnitCategories An array of unit categories of the objects to find in the zone. E.g. `{Unit.Category.GROUND_UNIT,Unit.Category.SHIP}` -- @param UnitCategories An array of unit categories of the objects to find in the zone. E.g. `{Unit.Category.GROUND_UNIT,Unit.Category.SHIP}`
@ -1294,13 +1290,13 @@ end
-- @return DCS#Vec2 The random location within the zone. -- @return DCS#Vec2 The random location within the zone.
function ZONE_RADIUS:GetRandomVec2(inner, outer, surfacetypes) function ZONE_RADIUS:GetRandomVec2(inner, outer, surfacetypes)
local Vec2 = self:GetVec2() local Vec2 = self:GetVec2()
local _inner = inner or 0 local _inner = inner or 0
local _outer = outer or self:GetRadius() local _outer = outer or self:GetRadius()
if surfacetypes and type(surfacetypes)~="table" then if surfacetypes and type(surfacetypes)~="table" then
surfacetypes={surfacetypes} surfacetypes={surfacetypes}
end end
local function _getpoint() local function _getpoint()
local point = {} local point = {}
@ -1320,10 +1316,10 @@ function ZONE_RADIUS:GetRandomVec2(inner, outer, surfacetypes)
return false return false
end end
local point=_getpoint() local point=_getpoint()
if surfacetypes then if surfacetypes then
local N=1 ; local Nmax=100 ; local gotit=false local N=1 ; local Nmax=100 ; local gotit=false
while gotit==false and N<=Nmax do while gotit==false and N<=Nmax do
gotit=_checkSurface(point) gotit=_checkSurface(point)
if gotit then if gotit then
@ -1335,7 +1331,7 @@ function ZONE_RADIUS:GetRandomVec2(inner, outer, surfacetypes)
end end
end end
return point return point
end end
--- Returns a @{Core.Point#POINT_VEC2} object reflecting a random 2D location within the zone. --- Returns a @{Core.Point#POINT_VEC2} object reflecting a random 2D location within the zone.
@ -1458,7 +1454,7 @@ function ZONE_RADIUS:GetRandomCoordinateWithoutBuildings(inner,outer,distance,ma
for _,_coord in pairs (buildings) do for _,_coord in pairs (buildings) do
local coord = _coord -- Core.Point#COORDINATE local coord = _coord -- Core.Point#COORDINATE
-- keep >50m dist from buildings -- keep >50m dist from buildings
if coord:Get2DDistance(rcoord) > dist then if coord:Get3DDistance(rcoord) > dist then
found = true found = true
else else
found = false found = false
@ -2385,6 +2381,21 @@ function ZONE_POLYGON:New( ZoneName, ZoneGroup )
return self return self
end end
--- Constructor to create a ZONE_POLYGON instance, taking the zone name and an array of DCS#Vec2, forming a polygon.
-- @param #ZONE_POLYGON self
-- @param #string ZoneName Name of the zone.
-- @param #ZONE_POLYGON_BASE.ListVec2 PointsArray An array of @{DCS#Vec2}, forming a polygon.
-- @return #ZONE_POLYGON self
function ZONE_POLYGON:NewFromPointsArray( ZoneName, PointsArray )
local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( ZoneName, PointsArray ) )
self:F( { ZoneName, self._.Polygon } )
-- Zone objects are added to the _DATABASE and SET_ZONE objects.
_EVENTDISPATCHER:CreateEventNewZone( self )
return self
end
--- Constructor to create a ZONE_POLYGON instance, taking the zone name and the **name** of the @{Wrapper.Group#GROUP} defined within the Mission Editor. --- Constructor to create a ZONE_POLYGON instance, taking the zone name and the **name** of the @{Wrapper.Group#GROUP} defined within the Mission Editor.
-- The @{Wrapper.Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON. -- The @{Wrapper.Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.
@ -2417,6 +2428,296 @@ function ZONE_POLYGON:FindByName( ZoneName )
return ZoneFound return ZoneFound
end end
--- Scan the zone for the presence of units of the given ObjectCategories. Does **not** scan for scenery at the moment.
-- Note that **only after** a zone has been scanned, the zone can be evaluated by:
--
-- * @{ZONE_POLYGON.IsAllInZoneOfCoalition}(): Scan the presence of units in the zone of a coalition.
-- * @{ZONE_POLYGON.IsAllInZoneOfOtherCoalition}(): Scan the presence of units in the zone of an other coalition.
-- * @{ZONE_POLYGON.IsSomeInZoneOfCoalition}(): Scan if there is some presence of units in the zone of the given coalition.
-- * @{ZONE_POLYGON.IsNoneInZoneOfCoalition}(): Scan if there isn't any presence of units in the zone of an other coalition than the given one.
-- * @{ZONE_POLYGON.IsNoneInZone}(): Scan if the zone is empty.
-- @param #ZONE_POLYGON self
-- @param ObjectCategories An array of categories of the objects to find in the zone. E.g. `{Object.Category.UNIT}`
-- @param UnitCategories An array of unit categories of the objects to find in the zone. E.g. `{Unit.Category.GROUND_UNIT,Unit.Category.SHIP}`
-- @usage
-- myzone:Scan({Object.Category.UNIT},{Unit.Category.GROUND_UNIT})
-- local IsAttacked = myzone:IsSomeInZoneOfCoalition( self.Coalition )
function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories )
self.ScanData = {}
self.ScanData.Coalitions = {}
self.ScanData.Scenery = {}
self.ScanData.Units = {}
local function EvaluateZone( ZoneObject )
if ZoneObject then
local ObjectCategory = ZoneObject:getCategory()
if ( ObjectCategory == Object.Category.UNIT and ZoneObject:isExist() and ZoneObject:isActive() ) or (ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then
local CoalitionDCSUnit = ZoneObject:getCoalition()
local Include = false
if not UnitCategories then
-- Anything found is included.
Include = true
else
-- Check if found object is in specified categories.
local CategoryDCSUnit = ZoneObject:getDesc().category
for UnitCategoryID, UnitCategory in pairs( UnitCategories ) do
if UnitCategory == CategoryDCSUnit then
Include = true
break
end
end
end
if Include then
local CoalitionDCSUnit = ZoneObject:getCoalition()
-- This coalition is inside the zone.
self.ScanData.Coalitions[CoalitionDCSUnit] = true
self.ScanData.Units[ZoneObject] = ZoneObject
self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } )
end
end
--[[
-- no scenery possible at the moment
if ObjectCategory == Object.Category.SCENERY then
local SceneryType = ZoneObject:getTypeName()
local SceneryName = ZoneObject:getName()
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( SceneryName, ZoneObject )
self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } )
end
--]]
end
return true
end
-- Search objects.
local inzoneunits = SET_UNIT:New():FilterZones({self}):FilterOnce()
local inzonestatics = SET_STATIC:New():FilterZones({self}):FilterOnce()
inzoneunits:ForEach(
function(unit)
local Unit = unit --Wrapper.Unit#UNIT
local DCS = Unit:GetDCSObject()
EvaluateZone(DCS)
end
)
inzonestatics:ForEach(
function(static)
local Static = static --Wrapper.Static#STATIC
local DCS = Static:GetDCSObject()
EvaluateZone(DCS)
end
)
end
--- Count the number of different coalitions inside the zone.
-- @param #ZONE_POLYGON self
-- @return #table Table of DCS units and DCS statics inside the zone.
function ZONE_POLYGON:GetScannedUnits()
return self.ScanData.Units
end
--- Get a set of scanned units.
-- @param #ZONE_POLYGON self
-- @return Core.Set#SET_UNIT Set of units and statics inside the zone.
function ZONE_POLYGON:GetScannedSetUnit()
local SetUnit = SET_UNIT:New()
if self.ScanData then
for ObjectID, UnitObject in pairs( self.ScanData.Units ) do
local UnitObject = UnitObject -- DCS#Unit
if UnitObject:isExist() then
local FoundUnit = UNIT:FindByName( UnitObject:getName() )
if FoundUnit then
SetUnit:AddUnit( FoundUnit )
else
local FoundStatic = STATIC:FindByName( UnitObject:getName() )
if FoundStatic then
SetUnit:AddUnit( FoundStatic )
end
end
end
end
end
return SetUnit
end
--- Get a set of scanned units.
-- @param #ZONE_POLYGON self
-- @return Core.Set#SET_GROUP Set of groups.
function ZONE_POLYGON:GetScannedSetGroup()
self.ScanSetGroup=self.ScanSetGroup or SET_GROUP:New() --Core.Set#SET_GROUP
self.ScanSetGroup.Set={}
if self.ScanData then
for ObjectID, UnitObject in pairs( self.ScanData.Units ) do
local UnitObject = UnitObject -- DCS#Unit
if UnitObject:isExist() then
local FoundUnit=UNIT:FindByName(UnitObject:getName())
if FoundUnit then
local group=FoundUnit:GetGroup()
self.ScanSetGroup:AddGroup(group)
end
end
end
end
return self.ScanSetGroup
end
--- Count the number of different coalitions inside the zone.
-- @param #ZONE_POLYGON self
-- @return #number Counted coalitions.
function ZONE_POLYGON:CountScannedCoalitions()
local Count = 0
for CoalitionID, Coalition in pairs( self.ScanData.Coalitions ) do
Count = Count + 1
end
return Count
end
--- Check if a certain coalition is inside a scanned zone.
-- @param #ZONE_POLYGON self
-- @param #number Coalition The coalition id, e.g. coalition.side.BLUE.
-- @return #boolean If true, the coalition is inside the zone.
function ZONE_POLYGON:CheckScannedCoalition( Coalition )
if Coalition then
return self.ScanData.Coalitions[Coalition]
end
return nil
end
--- Get Coalitions of the units in the Zone, or Check if there are units of the given Coalition in the Zone.
-- Returns nil if there are none to two Coalitions in the zone!
-- Returns one Coalition if there are only Units of one Coalition in the Zone.
-- Returns the Coalition for the given Coalition if there are units of the Coalition in the Zone.
-- @param #ZONE_POLYGON self
-- @return #table
function ZONE_POLYGON:GetScannedCoalition( Coalition )
if Coalition then
return self.ScanData.Coalitions[Coalition]
else
local Count = 0
local ReturnCoalition = nil
for CoalitionID, Coalition in pairs( self.ScanData.Coalitions ) do
Count = Count + 1
ReturnCoalition = CoalitionID
end
if Count ~= 1 then
ReturnCoalition = nil
end
return ReturnCoalition
end
end
--- Get scanned scenery type (currently not implemented in ZONE_POLYGON)
-- @param #ZONE_POLYGON self
-- @return #table Table of DCS scenery type objects.
function ZONE_POLYGON:GetScannedSceneryType( SceneryType )
return self.ScanData.Scenery[SceneryType]
end
--- Get scanned scenery table (currently not implemented in ZONE_POLYGON)
-- @param #ZONE_POLYGON self
-- @return #table Table of DCS scenery objects.
function ZONE_POLYGON:GetScannedScenery()
return self.ScanData.Scenery
end
--- Is All in Zone of Coalition?
-- Check if only the specifed coalition is inside the zone and noone else.
-- @param #ZONE_POLYGON self
-- @param #number Coalition Coalition ID of the coalition which is checked to be the only one in the zone.
-- @return #boolean True, if **only** that coalition is inside the zone and no one else.
-- @usage
-- self.Zone:Scan()
-- local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )
function ZONE_POLYGON:IsAllInZoneOfCoalition( Coalition )
return self:CountScannedCoalitions() == 1 and self:GetScannedCoalition( Coalition ) == true
end
--- Is All in Zone of Other Coalition?
-- Check if only one coalition is inside the zone and the specified coalition is not the one.
-- You first need to use the @{#ZONE_POLYGON.Scan} method to scan the zone before it can be evaluated!
-- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.
-- @param #ZONE_POLYGON self
-- @param #number Coalition Coalition ID of the coalition which is not supposed to be in the zone.
-- @return #boolean True, if and only if only one coalition is inside the zone and the specified coalition is not it.
-- @usage
-- self.Zone:Scan()
-- local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
function ZONE_POLYGON:IsAllInZoneOfOtherCoalition( Coalition )
return self:CountScannedCoalitions() == 1 and self:GetScannedCoalition( Coalition ) == nil
end
--- Is Some in Zone of Coalition?
-- Check if more than one coaltion is inside the zone and the specifed coalition is one of them.
-- You first need to use the @{#ZONE_POLYGON.Scan} method to scan the zone before it can be evaluated!
-- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.
-- @param #ZONE_POLYGON self
-- @param #number Coalition ID of the coaliton which is checked to be inside the zone.
-- @return #boolean True if more than one coalition is inside the zone and the specified coalition is one of them.
-- @usage
-- self.Zone:Scan()
-- local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
function ZONE_POLYGON:IsSomeInZoneOfCoalition( Coalition )
return self:CountScannedCoalitions() > 1 and self:GetScannedCoalition( Coalition ) == true
end
--- Is None in Zone of Coalition?
-- You first need to use the @{#ZONE_POLYGON.Scan} method to scan the zone before it can be evaluated!
-- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.
-- @param #ZONE_POLYGON self
-- @param Coalition
-- @return #boolean
-- @usage
-- self.Zone:Scan()
-- local IsOccupied = self.Zone:IsNoneInZoneOfCoalition( self.Coalition )
function ZONE_POLYGON:IsNoneInZoneOfCoalition( Coalition )
return self:GetScannedCoalition( Coalition ) == nil
end
--- Is None in Zone?
-- You first need to use the @{#ZONE_POLYGON.Scan} method to scan the zone before it can be evaluated!
-- Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.
-- @param #ZONE_POLYGON self
-- @return #boolean
-- @usage
-- self.Zone:Scan()
-- local IsEmpty = self.Zone:IsNoneInZone()
function ZONE_POLYGON:IsNoneInZone()
return self:CountScannedCoalitions() == 0
end
do -- ZONE_ELASTIC do -- ZONE_ELASTIC
--- @type ZONE_ELASTIC --- @type ZONE_ELASTIC

View File

@ -890,7 +890,7 @@ function AUTOLASE:onafterMonitor(From, Event, To)
if unit and unit:IsAlive() then if unit and unit:IsAlive() then
local threat = unit:GetThreatLevel() local threat = unit:GetThreatLevel()
local coord = unit:GetCoordinate() local coord = unit:GetCoordinate()
if threat > 0 then if threat >= self.minthreatlevel then
local unitname = unit:GetName() local unitname = unit:GetName()
-- prefer radar units -- prefer radar units
if unit:HasAttribute("RADAR_BAND1_FOR_ARM") or unit:HasAttribute("RADAR_BAND2_FOR_ARM") or unit:HasAttribute("Optical Tracker") then if unit:HasAttribute("RADAR_BAND1_FOR_ARM") or unit:HasAttribute("RADAR_BAND2_FOR_ARM") or unit:HasAttribute("Optical Tracker") then

View File

@ -363,7 +363,7 @@ do -- ZONE_CAPTURE_COALITION
--- ZONE_CAPTURE_COALITION Constructor. --- ZONE_CAPTURE_COALITION Constructor.
-- @param #ZONE_CAPTURE_COALITION self -- @param #ZONE_CAPTURE_COALITION self
-- @param Core.Zone#ZONE Zone A @{Zone} object with the goal to be achieved. -- @param Core.Zone#ZONE Zone A @{Zone} object with the goal to be achieved. Alternatively, can be handed as the name of late activated group describing a @{ZONE_POLYGON} with its waypoints.
-- @param DCSCoalition.DCSCoalition#coalition Coalition The initial coalition owning the zone. -- @param DCSCoalition.DCSCoalition#coalition 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 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 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.

View File

@ -8,7 +8,7 @@
-- === -- ===
-- --
-- ### Author: **FlightControl** -- ### Author: **FlightControl**
-- ### Contributions: **funkyfranky** -- ### Contributions: **funkyfranky**, **Applevangelist**
-- --
-- === -- ===
-- --
@ -56,13 +56,18 @@ do -- Zone
--- ZONE_GOAL Constructor. --- ZONE_GOAL Constructor.
-- @param #ZONE_GOAL self -- @param #ZONE_GOAL self
-- @param Core.Zone#ZONE_RADIUS Zone A @{Zone} object with the goal to be achieved. -- @param Core.Zone#ZONE_RADIUS Zone A @{Zone} object with the goal to be achieved. Alternatively, can be handed as the name of late activated group describing a @{ZONE_POLYGON} with its waypoints.
-- @return #ZONE_GOAL -- @return #ZONE_GOAL
function ZONE_GOAL:New( Zone ) function ZONE_GOAL:New( Zone )
local self = BASE:Inherit( self, ZONE_RADIUS:New( Zone:GetName(), Zone:GetVec2(), Zone:GetRadius() ) ) -- #ZONE_GOAL BASE:I({Zone=Zone})
self:F( { Zone = Zone } ) local self = BASE:Inherit( self, BASE:New())
if type(Zone) == "string" then
self = BASE:Inherit( self, ZONE_POLYGON:NewFromGroupName(Zone) )
else
self = BASE:Inherit( self, ZONE_RADIUS:New( Zone:GetName(), Zone:GetVec2(), Zone:GetRadius() ) ) -- #ZONE_GOAL
self:F( { Zone = Zone } )
end
-- Goal object. -- Goal object.
self.Goal = GOAL:New() self.Goal = GOAL:New()

View File

@ -44,3 +44,15 @@ end
if __na then if __na then
BASE:I("Check <DCS install folder>/Scripts/MissionScripting.lua and comment out the lines with sanitizeModule(''). Use at your own risk!)") BASE:I("Check <DCS install folder>/Scripts/MissionScripting.lua and comment out the lines with sanitizeModule(''). Use at your own risk!)")
end end
BASE.ServerName="Unknown"
if lfs and loadfile then
local serverfile=lfs.writedir() .. 'Config/serverSettings.lua'
if UTILS.FileExists(serverfile) then
loadfile(serverfile)()
if cfg and cfg.name then
BASE.ServerName=cfg.name
end
end
BASE.ServerName=BASE.ServerName or "Unknown"
BASE:I("Server Name: "..tostring(BASE.ServerName))
end

View File

@ -104,6 +104,7 @@ __Moose.Include( 'Scripts/Moose/Ops/OpsTransport.lua' )
__Moose.Include( 'Scripts/Moose/Ops/OpsZone.lua' ) __Moose.Include( 'Scripts/Moose/Ops/OpsZone.lua' )
__Moose.Include( 'Scripts/Moose/Ops/Platoon.lua' ) __Moose.Include( 'Scripts/Moose/Ops/Platoon.lua' )
__Moose.Include( 'Scripts/Moose/Ops/PlayerTask.lua' ) __Moose.Include( 'Scripts/Moose/Ops/PlayerTask.lua' )
__Moose.Include( 'Scripts/Moose/Ops/PlayerRecce.lua' )
__Moose.Include( 'Scripts/Moose/Ops/RecoveryTanker.lua' ) __Moose.Include( 'Scripts/Moose/Ops/RecoveryTanker.lua' )
__Moose.Include( 'Scripts/Moose/Ops/RescueHelo.lua' ) __Moose.Include( 'Scripts/Moose/Ops/RescueHelo.lua' )
__Moose.Include( 'Scripts/Moose/Ops/Squadron.lua' ) __Moose.Include( 'Scripts/Moose/Ops/Squadron.lua' )

View File

@ -92,6 +92,7 @@
-- @field Sound.SRS#MSRS msrs Moose SRS object. -- @field Sound.SRS#MSRS msrs Moose SRS object.
-- @field #number dTQueueCheck Time interval to check the radio queue. Default 5 sec or 90 sec if SRS is used. -- @field #number dTQueueCheck Time interval to check the radio queue. Default 5 sec or 90 sec if SRS is used.
-- @field #boolean ReportmBar Report mBar/hpa even if not metric, i.e. for Mirage flights -- @field #boolean ReportmBar Report mBar/hpa even if not metric, i.e. for Mirage flights
-- @field #boolean TransmitOnlyWithPlayers For SRS - If true, only transmit if there are alive Players.
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM
--- *It is a very sad thing that nowadays there is so little useless information.* - Oscar Wilde --- *It is a very sad thing that nowadays there is so little useless information.* - Oscar Wilde
@ -346,6 +347,7 @@ ATIS = {
markerid = nil, markerid = nil,
relHumidity = nil, relHumidity = nil,
ReportmBar = false, ReportmBar = false,
TransmitOnlyWithPlayers = false,
} }
--- NATO alphabet. --- NATO alphabet.
@ -588,7 +590,7 @@ _ATIS = {}
--- ATIS class version. --- ATIS class version.
-- @field #string version -- @field #string version
ATIS.version = "0.9.9" ATIS.version = "0.9.10"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list -- TODO list
@ -780,6 +782,18 @@ function ATIS:SetTowerFrequencies( freqs )
return self return self
end end
--- For SRS - Switch to only transmit if there are players on the server.
-- @param #ATIS self
-- @param #boolean Switch If true, only send SRS if there are alive Players.
-- @return #ATIS self
function ATIS:SetTransmitOnlyWithPlayers(Switch)
self.TransmitOnlyWithPlayers = Switch
if self.msrsQ then
self.msrsQ:SetTransmitOnlyWithPlayers(Switch)
end
return self
end
--- Set active runway for **landing** operations. This can be used if the automatic runway determination via the wind direction gives incorrect results. --- Set active runway for **landing** operations. This can be used if the automatic runway determination via the wind direction gives incorrect results.
-- For example, use this if there are two runways with the same directions. -- For example, use this if there are two runways with the same directions.
-- @param #ATIS self -- @param #ATIS self
@ -1195,6 +1209,7 @@ function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
self.msrs:SetLabel("ATIS") self.msrs:SetLabel("ATIS")
self.msrs:SetGoogle(GoogleKey) self.msrs:SetGoogle(GoogleKey)
self.msrsQ = MSRSQUEUE:New("ATIS") self.msrsQ = MSRSQUEUE:New("ATIS")
self.msrsQ:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
if self.dTQueueCheck<=10 then if self.dTQueueCheck<=10 then
self:SetQueueUpdateTime(90) self:SetQueueUpdateTime(90)
end end

View File

@ -33,6 +33,7 @@
-- * [USS Harry S. Truman](https://en.wikipedia.org/wiki/USS_Harry_S._Truman) (CVN-75) [Super Carrier Module] -- * [USS Harry S. Truman](https://en.wikipedia.org/wiki/USS_Harry_S._Truman) (CVN-75) [Super Carrier Module]
-- * [USS Forrestal](https://en.wikipedia.org/wiki/USS_Forrestal_(CV-59)) (CV-59) [Heatblur Carrier Module] -- * [USS Forrestal](https://en.wikipedia.org/wiki/USS_Forrestal_(CV-59)) (CV-59) [Heatblur Carrier Module]
-- * [HMS Hermes](https://en.wikipedia.org/wiki/HMS_Hermes_(R12)) (R12) [**WIP**] -- * [HMS Hermes](https://en.wikipedia.org/wiki/HMS_Hermes_(R12)) (R12) [**WIP**]
-- * [HMS Invincible](https://en.wikipedia.org/wiki/HMS_Invincible_(R05) (R05) [**WIP**]
-- * [USS Tarawa](https://en.wikipedia.org/wiki/USS_Tarawa_(LHA-1)) (LHA-1) [**WIP**] -- * [USS Tarawa](https://en.wikipedia.org/wiki/USS_Tarawa_(LHA-1)) (LHA-1) [**WIP**]
-- * [USS America](https://en.wikipedia.org/wiki/USS_America_(LHA-6)) (LHA-6) [**WIP**] -- * [USS America](https://en.wikipedia.org/wiki/USS_America_(LHA-6)) (LHA-6) [**WIP**]
-- * [Juan Carlos I](https://en.wikipedia.org/wiki/Spanish_amphibious_assault_ship_Juan_Carlos_I) (L61) [**WIP**] -- * [Juan Carlos I](https://en.wikipedia.org/wiki/Spanish_amphibious_assault_ship_Juan_Carlos_I) (L61) [**WIP**]
@ -115,6 +116,7 @@
-- * [Harrier Ship Landing Mission with Auto LSO!](https://www.youtube.com/watch?v=lqmVvpunk2c) -- * [Harrier Ship Landing Mission with Auto LSO!](https://www.youtube.com/watch?v=lqmVvpunk2c)
-- * [Updated Airboss V/STOL Features USS Tarawa](https://youtu.be/K7I4pU6j718) -- * [Updated Airboss V/STOL Features USS Tarawa](https://youtu.be/K7I4pU6j718)
-- * [Harrier Practice pattern USS America](https://youtu.be/99NigITYmcI) -- * [Harrier Practice pattern USS America](https://youtu.be/99NigITYmcI)
-- * [Harrier CASE III TACAN Approach USS Tarawa](https://www.youtube.com/watch?v=bTgJXZ9Mhdc&t=1s)
-- * [Harrier CASE III TACAN Approach USS Tarawa](https://www.youtube.com/watch?v=wWHag5WpNZ0) -- * [Harrier CASE III TACAN Approach USS Tarawa](https://www.youtube.com/watch?v=wWHag5WpNZ0)
-- --
-- === -- ===
@ -1265,7 +1267,7 @@ AIRBOSS = {
--- Aircraft types capable of landing on carrier (human+AI). --- Aircraft types capable of landing on carrier (human+AI).
-- @type AIRBOSS.AircraftCarrier -- @type AIRBOSS.AircraftCarrier
-- @field #string AV8B AV-8B Night Harrier. Works only with the HMS Hermes, USS Tarawa, USS America, and Juan Carlos I. -- @field #string AV8B AV-8B Night Harrier. Works only with the HMS Hermes, HMS Invincible, USS Tarawa, USS America, and Juan Carlos I.
-- @field #string A4EC A-4E Community mod. -- @field #string A4EC A-4E Community mod.
-- @field #string HORNET F/A-18C Lot 20 Hornet by Eagle Dynamics. -- @field #string HORNET F/A-18C Lot 20 Hornet by Eagle Dynamics.
-- @field #string F14A F-14A by Heatblur. -- @field #string F14A F-14A by Heatblur.
@ -1302,6 +1304,7 @@ AIRBOSS.AircraftCarrier={
-- @field #string FORRESTAL USS Forrestal (CV-59) [Heatblur Carrier Module] -- @field #string FORRESTAL USS Forrestal (CV-59) [Heatblur Carrier Module]
-- @field #string VINSON USS Carl Vinson (CVN-70) [Obsolete] -- @field #string VINSON USS Carl Vinson (CVN-70) [Obsolete]
-- @field #string HERMES HMS Hermes (R12) [V/STOL Carrier] -- @field #string HERMES HMS Hermes (R12) [V/STOL Carrier]
-- @field #string INVINCIBLE HMS Invincible (R05) [V/STOL Carrier]
-- @field #string TARAWA USS Tarawa (LHA-1) [V/STOL Carrier] -- @field #string TARAWA USS Tarawa (LHA-1) [V/STOL Carrier]
-- @field #string AMERICA USS America (LHA-6) [V/STOL Carrier] -- @field #string AMERICA USS America (LHA-6) [V/STOL Carrier]
-- @field #string JCARLOS Juan Carlos I (L61) [V/STOL Carrier] -- @field #string JCARLOS Juan Carlos I (L61) [V/STOL Carrier]
@ -1316,6 +1319,7 @@ AIRBOSS.CarrierType = {
FORRESTAL = "Forrestal", FORRESTAL = "Forrestal",
VINSON = "VINSON", VINSON = "VINSON",
HERMES = "HERMES81", HERMES = "HERMES81",
INVINCIBLE = "hms_invincible",
TARAWA = "LHA_Tarawa", TARAWA = "LHA_Tarawa",
AMERICA = "USS America LHA-6", AMERICA = "USS America LHA-6",
JCARLOS = "L61", JCARLOS = "L61",
@ -1332,6 +1336,7 @@ AIRBOSS.CarrierType = {
-- @field #number wire2 Distance in meters from carrier position to second wire. -- @field #number wire2 Distance in meters from carrier position to second wire.
-- @field #number wire3 Distance in meters from carrier position to third wire. -- @field #number wire3 Distance in meters from carrier position to third wire.
-- @field #number wire4 Distance in meters from carrier position to fourth wire. -- @field #number wire4 Distance in meters from carrier position to fourth wire.
-- @field #number landingdist Distance in meeters to the landing position.
-- @field #number rwylength Length of the landing runway in meters. -- @field #number rwylength Length of the landing runway in meters.
-- @field #number rwywidth Width of the landing runway in meters. -- @field #number rwywidth Width of the landing runway in meters.
-- @field #number totlength Total length of carrier. -- @field #number totlength Total length of carrier.
@ -1731,7 +1736,7 @@ AIRBOSS.MenuF10Root = nil
--- Airboss class version. --- Airboss class version.
-- @field #string version -- @field #string version
AIRBOSS.version = "1.2.1" AIRBOSS.version = "1.3.0"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list -- TODO list
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -1978,7 +1983,7 @@ function AIRBOSS:New( carriername, alias )
-- Init carrier parameters. -- Init carrier parameters.
if self.carriertype == AIRBOSS.CarrierType.STENNIS then if self.carriertype == AIRBOSS.CarrierType.STENNIS then
--self:_InitStennis() -- Stennis parameters were updated to match the other Super Carriers.
self:_InitNimitz() self:_InitNimitz()
elseif self.carriertype == AIRBOSS.CarrierType.ROOSEVELT then elseif self.carriertype == AIRBOSS.CarrierType.ROOSEVELT then
self:_InitNimitz() self:_InitNimitz()
@ -1991,11 +1996,14 @@ function AIRBOSS:New( carriername, alias )
elseif self.carriertype == AIRBOSS.CarrierType.FORRESTAL then elseif self.carriertype == AIRBOSS.CarrierType.FORRESTAL then
self:_InitForrestal() self:_InitForrestal()
elseif self.carriertype == AIRBOSS.CarrierType.VINSON then elseif self.carriertype == AIRBOSS.CarrierType.VINSON then
-- TODO: Carl Vinson parameters. -- Carl Vinson is legacy now.
self:_InitStennis() self:_InitStennis()
elseif self.carriertype == AIRBOSS.CarrierType.HERMES then elseif self.carriertype == AIRBOSS.CarrierType.HERMES then
-- Hermes parameters. -- Hermes parameters.
self:_InitHermes() self:_InitHermes()
elseif self.carriertype == AIRBOSS.CarrierType.INVINCIBLE then
-- Invincible parameters.
self:_InitInvincible()
elseif self.carriertype == AIRBOSS.CarrierType.TARAWA then elseif self.carriertype == AIRBOSS.CarrierType.TARAWA then
-- Tarawa parameters. -- Tarawa parameters.
self:_InitTarawa() self:_InitTarawa()
@ -2006,8 +2014,8 @@ function AIRBOSS:New( carriername, alias )
-- Use Juan Carlos parameters. -- Use Juan Carlos parameters.
self:_InitJcarlos() self:_InitJcarlos()
elseif self.carriertype == AIRBOSS.CarrierType.CANBERRA then elseif self.carriertype == AIRBOSS.CarrierType.CANBERRA then
-- Use Juan Carlos parameters at this stage --TODO Check primary Landing spot. -- Use Juan Carlos parameters at this stage.
self:_InitJcarlos() self:_InitCanberra()
elseif self.carriertype == AIRBOSS.CarrierType.KUZNETSOV then elseif self.carriertype == AIRBOSS.CarrierType.KUZNETSOV then
-- Kusnetsov parameters - maybe... -- Kusnetsov parameters - maybe...
self:_InitStennis() self:_InitStennis()
@ -2098,7 +2106,7 @@ function AIRBOSS:New( carriername, alias )
-- cL:FlareYellow() -- cL:FlareYellow()
-- Carrier specific. -- Carrier specific.
if self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.HERMES or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.TARAWA or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.AMERICA or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.JCARLOS or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.CANBERRA then if self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.INVINCIBLE or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.HERMES or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.TARAWA or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.AMERICA or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.JCARLOS or self.carrier:GetTypeName() ~= AIRBOSS.CarrierType.CANBERRA then
-- Flare wires. -- Flare wires.
local w1 = stern:Translate( self.carrierparam.wire1, FB, true ) local w1 = stern:Translate( self.carrierparam.wire1, FB, true )
@ -2831,7 +2839,7 @@ end
function AIRBOSS:SetGlideslopeErrorThresholds(_max,_min, High, HIGH, Low, LOW) function AIRBOSS:SetGlideslopeErrorThresholds(_max,_min, High, HIGH, Low, LOW)
--Check if V/STOL Carrier --Check if V/STOL Carrier
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
-- allow a larger GSE for V/STOL operations --Pene Testing -- allow a larger GSE for V/STOL operations --Pene Testing
self.gle._max=_max or 0.7 self.gle._max=_max or 0.7
@ -2868,7 +2876,7 @@ end
function AIRBOSS:SetLineupErrorThresholds(_max,_min, Left, LeftMed, LEFT, Right, RightMed, RIGHT) function AIRBOSS:SetLineupErrorThresholds(_max,_min, Left, LeftMed, LEFT, Right, RightMed, RIGHT)
--Check if V/STOL Carrier -- Pene testing --Check if V/STOL Carrier -- Pene testing
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
-- V/STOL Values -- allow a larger LUE for V/STOL operations -- V/STOL Values -- allow a larger LUE for V/STOL operations
self.lue._max=_max or 1.8 self.lue._max=_max or 1.8
@ -3023,7 +3031,6 @@ end
-- @param #AIRBOSS self -- @param #AIRBOSS self
-- @param #number TimeInterval (Optional) Time interval in seconds. Default 1200 sec = 20 min. -- @param #number TimeInterval (Optional) Time interval in seconds. Default 1200 sec = 20 min.
-- @return #AIRBOSS self -- @return #AIRBOSS self
function AIRBOSS:SetBeaconRefresh( TimeInterval ) function AIRBOSS:SetBeaconRefresh( TimeInterval )
self.dTbeacon = TimeInterval or (20 * 60) self.dTbeacon = TimeInterval or (20 * 60)
return self return self
@ -4286,6 +4293,9 @@ function AIRBOSS:_InitStennis()
self.carrierparam.wire3 = 46 + 24 self.carrierparam.wire3 = 46 + 24
self.carrierparam.wire4 = 46 + 35 -- Last wire is strangely one meter closer. self.carrierparam.wire4 = 46 + 35 -- Last wire is strangely one meter closer.
-- Landing distance.
self.carrierparam.landingdist = self.carrierparam.sterndist+self.carrierparam.wire3
-- Platform at 5k. Reduce descent rate to 2000 ft/min to 1200 dirty up level flight. -- Platform at 5k. Reduce descent rate to 2000 ft/min to 1200 dirty up level flight.
self.Platform.name = "Platform 5k" self.Platform.name = "Platform 5k"
self.Platform.Xmin = -UTILS.NMToMeters( 22 ) -- Not more than 22 NM behind the boat. Last check was at 21 NM. self.Platform.Xmin = -UTILS.NMToMeters( 22 ) -- Not more than 22 NM behind the boat. Last check was at 21 NM.
@ -4436,6 +4446,9 @@ function AIRBOSS:_InitNimitz()
self.carrierparam.wire3 = 79 self.carrierparam.wire3 = 79
self.carrierparam.wire4 = 92 self.carrierparam.wire4 = 92
-- Landing distance.
self.carrierparam.landingdist = self.carrierparam.sterndist+self.carrierparam.wire3
end end
--- Init parameters for Forrestal class super carriers. --- Init parameters for Forrestal class super carriers.
@ -4465,6 +4478,9 @@ function AIRBOSS:_InitForrestal()
self.carrierparam.wire3 = 64 -- 62 self.carrierparam.wire3 = 64 -- 62
self.carrierparam.wire4 = 74 -- 72.5 self.carrierparam.wire4 = 74 -- 72.5
-- Landing distance.
self.carrierparam.landingdist = self.carrierparam.sterndist+self.carrierparam.wire3
end end
--- Init parameters for R12 HMS Hermes carrier. --- Init parameters for R12 HMS Hermes carrier.
@ -4494,12 +4510,64 @@ function AIRBOSS:_InitHermes()
self.carrierparam.wire3 = nil self.carrierparam.wire3 = nil
self.carrierparam.wire4 = nil self.carrierparam.wire4 = nil
-- Distance to landing spot.
self.carrierparam.landingspot=69
-- Landing distance.
self.carrierparam.landingdist = self.carrierparam.sterndist+self.carrierparam.landingspot
-- Late break. -- Late break.
self.BreakLate.name = "Late Break" self.BreakLate.name = "Late Break"
self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0. self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0.
self.BreakLate.Xmax = UTILS.NMToMeters( 5 ) -- Not more than 5 NM in front of the boat. Enough for late breaks? self.BreakLate.Xmax = UTILS.NMToMeters( 5 ) -- Not more than 5 NM in front of the boat. Enough for late breaks?
self.BreakLate.Zmin = -UTILS.NMToMeters( 0.25 ) -- Not more than 0.25 NM port. self.BreakLate.Zmin = -UTILS.NMToMeters( 1.6 ) -- Not more than 1.6 NM port.
self.BreakLate.Zmax = UTILS.NMToMeters( 0.5 ) -- Not more than 0.5 NM starboard. self.BreakLate.Zmax = UTILS.NMToMeters( 1 ) -- Not more than 1 NM starboard.
self.BreakLate.LimitXmin = 0 -- Check and next step 0.8 NM port and in front of boat.
self.BreakLate.LimitXmax = nil
self.BreakLate.LimitZmin = -UTILS.NMToMeters( 0.5 ) -- 926 m port, closer than the stennis as abeam is 0.8-1.0 rather than 1.2
self.BreakLate.LimitZmax = nil
end
--- Init parameters for R05 HMS Invincible carrier.
-- @param #AIRBOSS self
function AIRBOSS:_InitInvincible()
-- Init Stennis as default.
self:_InitStennis()
-- Carrier Parameters.
self.carrierparam.sterndist = -105
self.carrierparam.deckheight = 12 -- From model viewer WL0.
-- Total size of the carrier (approx as rectangle).
self.carrierparam.totlength = 228.19
self.carrierparam.totwidthport = 20.5
self.carrierparam.totwidthstarboard = 24.5
-- Landing runway.
self.carrierparam.rwyangle = 0
self.carrierparam.rwylength = 215
self.carrierparam.rwywidth = 13
-- Wires.
self.carrierparam.wire1 = nil
self.carrierparam.wire2 = nil
self.carrierparam.wire3 = nil
self.carrierparam.wire4 = nil
-- Distance to landing spot.
self.carrierparam.landingspot=69
-- Landing distance.
self.carrierparam.landingdist = self.carrierparam.sterndist+self.carrierparam.landingspot
-- Late break.
self.BreakLate.name = "Late Break"
self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0.
self.BreakLate.Xmax = UTILS.NMToMeters( 5 ) -- Not more than 5 NM in front of the boat. Enough for late breaks?
self.BreakLate.Zmin = -UTILS.NMToMeters( 1.6 ) -- Not more than 1.6 NM port.
self.BreakLate.Zmax = UTILS.NMToMeters( 1 ) -- Not more than 1 NM starboard.
self.BreakLate.LimitXmin = 0 -- Check and next step 0.8 NM port and in front of boat. self.BreakLate.LimitXmin = 0 -- Check and next step 0.8 NM port and in front of boat.
self.BreakLate.LimitXmax = nil self.BreakLate.LimitXmax = nil
self.BreakLate.LimitZmin = -UTILS.NMToMeters( 0.5 ) -- 926 m port, closer than the stennis as abeam is 0.8-1.0 rather than 1.2 self.BreakLate.LimitZmin = -UTILS.NMToMeters( 0.5 ) -- 926 m port, closer than the stennis as abeam is 0.8-1.0 rather than 1.2
@ -4534,6 +4602,12 @@ function AIRBOSS:_InitTarawa()
self.carrierparam.wire3 = nil self.carrierparam.wire3 = nil
self.carrierparam.wire4 = nil self.carrierparam.wire4 = nil
-- Distance to landing spot.
self.carrierparam.landingspot=57
-- Landing distance.
self.carrierparam.landingdist = self.carrierparam.sterndist+self.carrierparam.landingspot
-- Late break. -- Late break.
self.BreakLate.name = "Late Break" self.BreakLate.name = "Late Break"
self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0. self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0.
@ -4574,6 +4648,12 @@ function AIRBOSS:_InitAmerica()
self.carrierparam.wire3 = nil self.carrierparam.wire3 = nil
self.carrierparam.wire4 = nil self.carrierparam.wire4 = nil
-- Distance to landing spot.
self.carrierparam.landingspot=59
-- Landing distance.
self.carrierparam.landingdist = self.carrierparam.sterndist+self.carrierparam.landingspot
-- Late break. -- Late break.
self.BreakLate.name = "Late Break" self.BreakLate.name = "Late Break"
self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0. self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0.
@ -4614,6 +4694,12 @@ function AIRBOSS:_InitJcarlos()
self.carrierparam.wire3 = nil self.carrierparam.wire3 = nil
self.carrierparam.wire4 = nil self.carrierparam.wire4 = nil
-- Distance to landing spot.
self.carrierparam.landingspot=89
-- Landing distance.
self.carrierparam.landingdist = self.carrierparam.sterndist+self.carrierparam.landingspot
-- Late break. -- Late break.
self.BreakLate.name = "Late Break" self.BreakLate.name = "Late Break"
self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0. self.BreakLate.Xmin = -UTILS.NMToMeters( 1 ) -- Not more than 1 NM behind the boat. Last check was at 0.
@ -4626,6 +4712,16 @@ function AIRBOSS:_InitJcarlos()
self.BreakLate.LimitZmax = nil self.BreakLate.LimitZmax = nil
end end
--- Init parameters for L02 Canberra carrier.
-- @param #AIRBOSS self
function AIRBOSS:_InitCanberra()
-- Init Juan Carlos as default.
self:_InitJcarlos()
end
--- Init parameters for Marshal Voice overs *Gabriella* by HighwaymanEd. --- Init parameters for Marshal Voice overs *Gabriella* by HighwaymanEd.
-- @param #AIRBOSS self -- @param #AIRBOSS self
-- @param #string mizfolder (Optional) Folder within miz file where the sound files are located. -- @param #string mizfolder (Optional) Folder within miz file where the sound files are located.
@ -5302,7 +5398,6 @@ function AIRBOSS:_GetAircraftParameters( playerData, step )
alt = UTILS.FeetToMeters( 800 ) alt = UTILS.FeetToMeters( 800 )
speed = UTILS.KnotsToMps( 350 ) speed = UTILS.KnotsToMps( 350 )
elseif skyhawk then elseif skyhawk then
alt = UTILS.FeetToMeters( 600 ) alt = UTILS.FeetToMeters( 600 )
speed = UTILS.KnotsToMps( 250 ) speed = UTILS.KnotsToMps( 250 )
elseif goshawk then elseif goshawk then
@ -5396,7 +5491,6 @@ function AIRBOSS:_GetAircraftParameters( playerData, step )
alt = UTILS.FeetToMeters( 300 ) -- ? alt = UTILS.FeetToMeters( 300 ) -- ?
elseif harrier then elseif harrier then
alt=UTILS.FeetToMeters(312)-- 300-325 ft alt=UTILS.FeetToMeters(312)-- 300-325 ft
end end
aoa = aoaac.OnSpeed aoa = aoaac.OnSpeed
@ -6341,7 +6435,7 @@ function AIRBOSS:_GetMarshalAltitude( stack, case )
p2 = Carrier:Translate( UTILS.NMToMeters( 1.5 ), hdg ) p2 = Carrier:Translate( UTILS.NMToMeters( 1.5 ), hdg )
-- Tarawa,LHA,LHD Delta patterns. -- Tarawa,LHA,LHD Delta patterns.
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
-- Pattern is directly overhead the carrier. -- Pattern is directly overhead the carrier.
p1 = Carrier:Translate( UTILS.NMToMeters( 1.0 ), hdg + 90 ) p1 = Carrier:Translate( UTILS.NMToMeters( 1.0 ), hdg + 90 )
@ -8180,7 +8274,7 @@ function AIRBOSS:OnEventLand( EventData )
self:T( self.lid .. text ) self:T( self.lid .. text )
-- Check carrier type. -- Check carrier type.
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
-- Power "Idle". -- Power "Idle".
self:RadioTransmission( self.LSORadio, self.LSOCall.IDLE, false, 1, nil, true ) self:RadioTransmission( self.LSORadio, self.LSOCall.IDLE, false, 1, nil, true )
@ -8215,8 +8309,7 @@ function AIRBOSS:OnEventLand( EventData )
-- AI unit landed -- -- AI unit landed --
-------------------- --------------------
if self.carriertype ~= AIRBOSS.CarrierType.HERMES or self.carriertype ~= AIRBOSS.CarrierType.TARAWA or self.carriertype ~= AIRBOSS.CarrierType.AMERICA or self.carriertype ~= AIRBOSS.CarrierType.JCARLOS or self.carriertype ~= AIRBOSS.CarrierType.CANBERRA then if self.carriertype ~= AIRBOSS.CarrierType.INVINCIBLE or self.carriertype ~= AIRBOSS.CarrierType.HERMES or self.carriertype ~= AIRBOSS.CarrierType.TARAWA or self.carriertype ~= AIRBOSS.CarrierType.AMERICA or self.carriertype ~= AIRBOSS.CarrierType.JCARLOS or self.carriertype ~= AIRBOSS.CarrierType.CANBERRA then
-- Coordinate at landing event -- Coordinate at landing event
local coord = EventData.IniUnit:GetCoordinate() local coord = EventData.IniUnit:GetCoordinate()
@ -9254,7 +9347,7 @@ function AIRBOSS:_CheckForLongDownwind( playerData )
local limit = UTILS.NMToMeters( -1.6 ) local limit = UTILS.NMToMeters( -1.6 )
-- For the tarawa, other LHA and LHD we give a bit more space. -- For the tarawa, other LHA and LHD we give a bit more space.
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
limit = UTILS.NMToMeters( -2.0 ) limit = UTILS.NMToMeters( -2.0 )
end end
@ -9341,8 +9434,7 @@ function AIRBOSS:_Ninety( playerData )
self:_PlayerHint( playerData ) self:_PlayerHint( playerData )
-- Next step: wake. -- Next step: wake.
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
-- Harrier has no wake stop. It stays port of the boat. -- Harrier has no wake stop. It stays port of the boat.
self:_SetPlayerStep( playerData, AIRBOSS.PatternStep.FINAL ) self:_SetPlayerStep( playerData, AIRBOSS.PatternStep.FINAL )
else else
@ -10037,7 +10129,7 @@ function AIRBOSS:_GetSternCoord()
-- local stern=self:GetCoordinate() -- local stern=self:GetCoordinate()
-- Stern coordinate (sterndist<0). --Pene testing Case III -- Stern coordinate (sterndist<0). --Pene testing Case III
if self.carriertype==AIRBOSS.CarrierType.HERMES or self.carriertype==AIRBOSS.CarrierType.TARAWA or self.carriertype==AIRBOSS.CarrierType.AMERICA or self.carriertype==AIRBOSS.CarrierType.JCARLOS or self.carriertype==AIRBOSS.CarrierType.CANBERRA then if self.carriertype==AIRBOSS.CarrierType.INVINCIBLE or self.carriertype==AIRBOSS.CarrierType.HERMES or self.carriertype==AIRBOSS.CarrierType.TARAWA or self.carriertype==AIRBOSS.CarrierType.AMERICA or self.carriertype==AIRBOSS.CarrierType.JCARLOS or self.carriertype==AIRBOSS.CarrierType.CANBERRA then
if case==3 then if case==3 then
-- CASE III V/STOL translation Due over deck approach if needed. -- CASE III V/STOL translation Due over deck approach if needed.
self.sterncoord:Translate(self.carrierparam.sterndist, hdg, true, true):Translate(8, FB-90, true, true) self.sterncoord:Translate(self.carrierparam.sterndist, hdg, true, true):Translate(8, FB-90, true, true)
@ -10087,7 +10179,6 @@ function AIRBOSS:_GetWire( Lcoord, dc )
-- Multiplayer wire correction. -- Multiplayer wire correction.
if self.mpWireCorrection then if self.mpWireCorrection then
d = d - self.mpWireCorrection d = d - self.mpWireCorrection
end end
-- Shift wires from stern to their correct position. -- Shift wires from stern to their correct position.
@ -10679,7 +10770,7 @@ function AIRBOSS:_GetZoneRunwayBox()
return self.zoneRunwaybox return self.zoneRunwaybox
end end
--- Get zone of primary abeam landing position of HMS Hermes, USS Tarawa, USS America and Juan Carlos. Box length 50 meters and width 30 meters. --- Get zone of primary abeam landing position of HMS Hermes, HMS Invincible, USS Tarawa, USS America and Juan Carlos. Box length 50 meters and width 30 meters.
--- Allow for Clear to land call from LSO approaching abeam the landing spot if stable as per NATOPS 00-80T --- Allow for Clear to land call from LSO approaching abeam the landing spot if stable as per NATOPS 00-80T
-- @param #AIRBOSS self -- @param #AIRBOSS self
@ -10784,7 +10875,7 @@ function AIRBOSS:_GetZoneHolding( case, stack )
self.zoneHolding = ZONE_RADIUS:New( "CASE I Holding Zone", Post:GetVec2(), self.marshalradius ) self.zoneHolding = ZONE_RADIUS:New( "CASE I Holding Zone", Post:GetVec2(), self.marshalradius )
-- Delta pattern. -- Delta pattern.
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
self.zoneHolding = ZONE_RADIUS:New( "CASE I Holding Zone", self.carrier:GetVec2(), UTILS.NMToMeters( 5 ) ) self.zoneHolding = ZONE_RADIUS:New( "CASE I Holding Zone", self.carrier:GetVec2(), UTILS.NMToMeters( 5 ) )
end end
@ -10836,7 +10927,7 @@ function AIRBOSS:_GetZoneCommence( case, stack )
-- Three position -- Three position
local Three = self:GetCoordinate():Translate( D, hdg + 275 ) local Three = self:GetCoordinate():Translate( D, hdg + 275 )
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
local Dx = UTILS.NMToMeters( 2.25 ) local Dx = UTILS.NMToMeters( 2.25 )
local Dz = UTILS.NMToMeters( 2.25 ) local Dz = UTILS.NMToMeters( 2.25 )
@ -11126,7 +11217,7 @@ function AIRBOSS:_GetAltCarrier( unit )
return h return h
end end
--- Get optimal landing position of the aircraft. Usually between second and third wire. In case of Tarawa, Canberrra, Juan Carlos and America we take the abeam landing spot 120 ft above and 21 ft abeam the 7.5 position, for the Juan Carlos I and HMS Hermes it is 120 ft above and 21 ft abeam the 5 position. For CASE III it is 120ft directly above the landing spot. --- Get optimal landing position of the aircraft. Usually between second and third wire. In case of Tarawa, Canberrra, Juan Carlos and America we take the abeam landing spot 120 ft above and 21 ft abeam the 7.5 position, for the Juan Carlos I, HMS Invincible, and HMS Hermes and Invincible it is 120 ft above and 21 ft abeam the 5 position. For CASE III it is 120ft directly above the landing spot.
-- @param #AIRBOSS self -- @param #AIRBOSS self
-- @return Core.Point#COORDINATE Optimal landing coordinate. -- @return Core.Point#COORDINATE Optimal landing coordinate.
function AIRBOSS:_GetOptLandingCoordinate() function AIRBOSS:_GetOptLandingCoordinate()
@ -11134,28 +11225,31 @@ function AIRBOSS:_GetOptLandingCoordinate()
-- Start with stern coordiante. -- Start with stern coordiante.
self.landingcoord:UpdateFromCoordinate( self:_GetSternCoord() ) self.landingcoord:UpdateFromCoordinate( self:_GetSternCoord() )
-- Stern coordinate.
-- local stern=self:_GetSternCoord()
-- Final bearing. -- Final bearing.
local FB=self:GetFinalBearing(false) local FB=self:GetFinalBearing(false)
-- Cse
local case=self.case local case=self.case
-- set Case III V/STOL abeam landing spot over deck -- Pene Testing -- set Case III V/STOL abeam landing spot over deck -- Pene Testing
if self.carriertype==AIRBOSS.CarrierType.HERMES or self.carriertype==AIRBOSS.CarrierType.TARAWA or self.carriertype==AIRBOSS.CarrierType.AMERICA or self.carriertype==AIRBOSS.CarrierType.JCARLOS or self.carriertype==AIRBOSS.CarrierType.CANBERRA then if self.carriertype==AIRBOSS.CarrierType.INVINCIBLE or self.carriertype==AIRBOSS.CarrierType.HERMES or self.carriertype==AIRBOSS.CarrierType.TARAWA or self.carriertype==AIRBOSS.CarrierType.AMERICA or self.carriertype==AIRBOSS.CarrierType.JCARLOS or self.carriertype==AIRBOSS.CarrierType.CANBERRA then
if case==3 then if case==3 then
self.landingcoord:UpdateFromCoordinate(self:_GetLandingSpotCoordinate())
-- Altitude 120ft -- is this corect for Case III? -- Landing coordinate.
self.landingcoord:SetAltitude(UTILS.FeetToMeters(120)) self.landingcoord:UpdateFromCoordinate(self:_GetLandingSpotCoordinate())
-- Altitude 120ft -- is this corect for Case III?
self.landingcoord:SetAltitude(UTILS.FeetToMeters(120))
elseif case==2 or case==1 then elseif case==2 or case==1 then
-- Landing 100 ft abeam, 120 ft alt. -- Landing 100 ft abeam, 120 ft alt.
self.landingcoord:UpdateFromCoordinate(self:_GetLandingSpotCoordinate()):Translate(35, FB-90, true, true) self.landingcoord:UpdateFromCoordinate(self:_GetLandingSpotCoordinate()):Translate(35, FB-90, true, true)
--stern=self:_GetLandingSpotCoordinate():Translate(35, FB-90)
-- Alitude 120 ft.
self.landingcoord:SetAltitude(UTILS.FeetToMeters(120))
-- Alitude 120 ft.
self.landingcoord:SetAltitude(UTILS.FeetToMeters(120))
end end
else else
@ -11163,8 +11257,7 @@ function AIRBOSS:_GetOptLandingCoordinate()
-- Ideally we want to land between 2nd and 3rd wire. -- Ideally we want to land between 2nd and 3rd wire.
if self.carrierparam.wire3 then if self.carrierparam.wire3 then
-- We take the position of the 3rd wire to approximately account for the length of the aircraft. -- We take the position of the 3rd wire to approximately account for the length of the aircraft.
local w3 = self.carrierparam.wire3 self.landingcoord:Translate( self.carrierparam.wire3, FB, true, true )
self.landingcoord:Translate( w3, FB, true, true )
end end
-- Add 2 meters to account for aircraft height. -- Add 2 meters to account for aircraft height.
@ -11175,54 +11268,19 @@ function AIRBOSS:_GetOptLandingCoordinate()
return self.landingcoord return self.landingcoord
end end
--- Get landing spot on Tarawa. --- Get landing spot on Tarawa and others.
-- @param #AIRBOSS self -- @param #AIRBOSS self
-- @return Core.Point#COORDINATE Primary landing spot coordinate. -- @return Core.Point#COORDINATE Primary landing spot coordinate.
function AIRBOSS:_GetLandingSpotCoordinate() function AIRBOSS:_GetLandingSpotCoordinate()
-- Start at stern coordinate.
self.landingspotcoord:UpdateFromCoordinate( self:_GetSternCoord() ) self.landingspotcoord:UpdateFromCoordinate( self:_GetSternCoord() )
-- Stern coordinate. -- Landing 100 ft abeam, 100 alt.
-- local stern=self:_GetSternCoord() local hdg = self:GetHeading()
if self.carriertype==AIRBOSS.CarrierType.HERMES then -- Primary landing spot. Different carriers handled via carrier parameter landingspot now.
self.landingspotcoord:Translate( self.carrierparam.landingspot, hdg, true, true ):SetAltitude( self.carrierparam.deckheight )
-- Landing 100 ft abeam, 100 alt.
local hdg = self:GetHeading()
-- Primary landing spot 5
self.landingspotcoord:Translate( 69, hdg, true, true ):SetAltitude( self.carrierparam.deckheight )
elseif self.carriertype == AIRBOSS.CarrierType.TARAWA then
-- Landing 100 ft abeam, 120 alt.
local hdg = self:GetHeading()
-- Primary landing spot 7.5
self.landingspotcoord:Translate( 57, hdg, true, true ):SetAltitude( self.carrierparam.deckheight )
elseif self.carriertype == AIRBOSS.CarrierType.AMERICA then
-- Landing 100 ft abeam, 120 alt.
local hdg = self:GetHeading()
-- Primary landing spot 7.5 a little further forwad on the America
self.landingspotcoord:Translate( 59, hdg, true, true ):SetAltitude( self.carrierparam.deckheight )
elseif self.carriertype == AIRBOSS.CarrierType.JCARLOS then
-- Landing 100 ft abeam, 120 alt.
local hdg = self:GetHeading()
-- Primary landing spot 5.0 -- Done voice for different landing Spots.
self.landingspotcoord:Translate( 89, hdg, true, true ):SetAltitude( self.carrierparam.deckheight )
elseif self.carriertype == AIRBOSS.CarrierType.CANBERRA then
-- Landing 100 ft abeam, 120 alt.
local hdg = self:GetHeading()
-- Primary landing spot 5.0 -- Done voice for different landing Spots.
self.landingspotcoord:Translate( 89, hdg, true, true ):SetAltitude( self.carrierparam.deckheight )
end
return self.landingspotcoord return self.landingspotcoord
end end
@ -11270,8 +11328,8 @@ function AIRBOSS:GetWind( alt, magnetic, coord )
-- Current position of the carrier or input. -- Current position of the carrier or input.
local cv = coord or self:GetCoordinate() local cv = coord or self:GetCoordinate()
-- Wind direction and speed. By default at 50 meters ASL. -- Wind direction and speed. By default at 18 meters ASL.
local Wdir, Wspeed = cv:GetWind( alt or 15 ) local Wdir, Wspeed = cv:GetWind( alt or 18 )
-- Include magnetic declination. -- Include magnetic declination.
if magnetic then if magnetic then
@ -11796,7 +11854,7 @@ function AIRBOSS:_LSOgrade( playerData )
local grade local grade
local points local points
if N == 0 and (TgrooveUnicorn or TgrooveVstolUnicorn) then if N == 0 and (TgrooveUnicorn or TgrooveVstolUnicorn or playerData.case==3) then
-- No deviations, should be REALLY RARE! -- No deviations, should be REALLY RARE!
grade = "_OK_" grade = "_OK_"
points = 5.0 points = 5.0
@ -12133,7 +12191,7 @@ function AIRBOSS:_GS( step, n )
if n == -1 then if n == -1 then
gp = AIRBOSS.GroovePos.IC gp = AIRBOSS.GroovePos.IC
elseif n == 1 then elseif n == 1 then
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
gp = AIRBOSS.GroovePos.AL gp = AIRBOSS.GroovePos.AL
else else
gp = AIRBOSS.GroovePos.IW gp = AIRBOSS.GroovePos.IW
@ -14016,7 +14074,7 @@ function AIRBOSS:_IsCarrierAircraft( unit )
-- Special case for Harrier which can only land on Tarawa, LHA and LHD. -- Special case for Harrier which can only land on Tarawa, LHA and LHD.
if aircrafttype == AIRBOSS.AircraftCarrier.AV8B then if aircrafttype == AIRBOSS.AircraftCarrier.AV8B then
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
return true return true
else else
return false return false
@ -14024,7 +14082,7 @@ function AIRBOSS:_IsCarrierAircraft( unit )
end end
-- Also only Harriers can land on the Tarawa, LHA and LHD. -- Also only Harriers can land on the Tarawa, LHA and LHD.
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
if aircrafttype ~= AIRBOSS.AircraftCarrier.AV8B then if aircrafttype ~= AIRBOSS.AircraftCarrier.AV8B then
return false return false
end end
@ -17472,7 +17530,7 @@ function AIRBOSS:_MarkCaseZones( _unitName, flare )
end end
-- Tarawa, LHA and LHD landing spots. -- Tarawa, LHA and LHD landing spots.
if self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then if self.carriertype == AIRBOSS.CarrierType.INVINCIBLE or self.carriertype == AIRBOSS.CarrierType.HERMES or self.carriertype == AIRBOSS.CarrierType.TARAWA or self.carriertype == AIRBOSS.CarrierType.AMERICA or self.carriertype == AIRBOSS.CarrierType.JCARLOS or self.carriertype == AIRBOSS.CarrierType.CANBERRA then
text = text .. "\n* abeam landing stop with RED flares" text = text .. "\n* abeam landing stop with RED flares"
-- Abeam landing spot zone. -- Abeam landing spot zone.
local ALSPT = self:_GetZoneAbeamLandingSpot() local ALSPT = self:_GetZoneAbeamLandingSpot()
@ -17961,6 +18019,7 @@ function AIRBOSS:onafterLSOGrade(From, Event, To, playerData, grade)
result.carriertype=grade.carriertype result.carriertype=grade.carriertype
result.carriername=grade.carriername result.carriername=grade.carriername
result.carrierrwy=grade.carrierrwy result.carrierrwy=grade.carrierrwy
result.landingdist=self.carrierparam.landingdist
result.theatre=grade.theatre result.theatre=grade.theatre
result.case=playerData.case result.case=playerData.case
result.Tgroove=grade.Tgroove result.Tgroove=grade.Tgroove

View File

@ -27,7 +27,7 @@ do
-- @field #string ClassName Name of this class. -- @field #string ClassName Name of this class.
-- @field #string version Versioning. -- @field #string version Versioning.
-- @field #string lid LID for log entries. -- @field #string lid LID for log entries.
-- @field #number coalition Colition side. -- @field #number coalition Coalition side.
-- @field #string coalitiontxt e.g."blue" -- @field #string coalitiontxt e.g."blue"
-- @field Core.Zone#ZONE OpsZone, -- @field Core.Zone#ZONE OpsZone,
-- @field Core.Zone#ZONE StationZone, -- @field Core.Zone#ZONE StationZone,
@ -497,7 +497,7 @@ do
-- @field #AWACS -- @field #AWACS
AWACS = { AWACS = {
ClassName = "AWACS", -- #string ClassName = "AWACS", -- #string
version = "0.2.43", -- #string version = "0.2.44", -- #string
lid = "", -- #string lid = "", -- #string
coalition = coalition.side.BLUE, -- #number coalition = coalition.side.BLUE, -- #number
coalitiontxt = "blue", -- #string coalitiontxt = "blue", -- #string
@ -1788,10 +1788,10 @@ function AWACS:SetAdditionalZone(Zone, Draw)
self:T(self.lid.."SetAdditionalZone") self:T(self.lid.."SetAdditionalZone")
self.BorderZone = Zone self.BorderZone = Zone
if self.debug then if self.debug then
Zone:DrawZone(-1,{1,0.64,0},1,{1,0.64,0},0.2,1,true) Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true)
MARKER:New(Zone:GetCoordinate(),"Defensive Zone"):ToAll() MARKER:New(Zone:GetCoordinate(),"Defensive Zone"):ToCoalition(self.coalition)
elseif Draw then elseif Draw then
Zone:DrawZone(-1,{1,0.64,0},1,{1,0.64,0},0.2,1,true) Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true)
end end
return self return self
end end
@ -1805,11 +1805,11 @@ function AWACS:SetRejectionZone(Zone,Draw)
self:T(self.lid.."SetRejectionZone") self:T(self.lid.."SetRejectionZone")
self.RejectZone = Zone self.RejectZone = Zone
if Draw then if Draw then
Zone:DrawZone(-1,{1,0.64,0},1,{1,0.64,0},0.2,1,true) Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true)
--MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToAll() --MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToAll()
elseif self.debug then elseif self.debug then
Zone:DrawZone(-1,{1,0.64,0},1,{1,0.64,0},0.2,1,true) Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true)
MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToAll() MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToCoalition(self.coalition)
end end
return self return self
end end
@ -1818,7 +1818,7 @@ end
-- @param #AWACS self -- @param #AWACS self
-- @return #AWACS self -- @return #AWACS self
function AWACS:DrawFEZ() function AWACS:DrawFEZ()
self.OpsZone:DrawZone(-1,{1,0,0},1,{1,0,0},0.2,5,true) self.OpsZone:DrawZone(self.coalition,{1,0,0},1,{1,0,0},0.2,5,true)
return self return self
end end
@ -3780,7 +3780,7 @@ function AWACS:_MoveAnchorStackFromMarker(Name,Coord)
marker:UpdateText(stationtag) marker:UpdateText(stationtag)
station.AnchorMarker = marker station.AnchorMarker = marker
if self.debug then if self.debug then
station.StationZone:DrawZone(-1,{0,0,1},1,{0,0,1},0.2,5,true) station.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true)
end end
self.AnchorStacks:Push(station,Name) self.AnchorStacks:Push(station,Name)
end end
@ -3811,12 +3811,12 @@ function AWACS:_CreateAnchorStackFromMarker(Name,Coord)
--push to AnchorStacks --push to AnchorStacks
if self.debug then if self.debug then
AnchorStackOne.StationZone:DrawZone(-1,{0,0,1},1,{0,0,1},0.2,5,true) AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true)
local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM())
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToAll() AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
else else
local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM())
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToAll() AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
end end
self.AnchorStacks:Push(AnchorStackOne,newname) self.AnchorStacks:Push(AnchorStackOne,newname)
@ -3857,12 +3857,12 @@ function AWACS:_CreateAnchorStack()
--push to AnchorStacks --push to AnchorStacks
if self.debug then if self.debug then
--self.AnchorStacks:Flush() --self.AnchorStacks:Flush()
AnchorStackOne.StationZone:DrawZone(-1,{0,0,1},1,{0,0,1},0.2,5,true) AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true)
local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM())
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToAll() AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
else else
local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM())
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToAll() AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
end end
self.AnchorStacks:Push(AnchorStackOne,newname) self.AnchorStacks:Push(AnchorStackOne,newname)
else else
@ -3885,12 +3885,12 @@ function AWACS:_CreateAnchorStack()
--push to AnchorStacks --push to AnchorStacks
if self.debug then if self.debug then
--self.AnchorStacks:Flush() --self.AnchorStacks:Flush()
AnchorStackOne.StationZone:DrawZone(-1,{0,0,1},1,{0,0,1},0.2,5,true) AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true)
local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM())
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToAll() AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
else else
local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM())
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToAll() AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
end end
self.AnchorStacks:Push(AnchorStackOne,newname) self.AnchorStacks:Push(AnchorStackOne,newname)
end end
@ -4819,12 +4819,12 @@ function AWACS:AddCAPAirWing(AirWing,Zone)
--push to AnchorStacks --push to AnchorStacks
if self.debug then if self.debug then
--self.AnchorStacks:Flush() --self.AnchorStacks:Flush()
AnchorStackOne.StationZone:DrawZone(-1,{0,0,1},1,{0,0,1},0.2,5,true) AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true)
local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM())
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToAll() AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
else else
local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM())
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToAll() AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
end end
self.AnchorStacks:Push(AnchorStackOne,newname) self.AnchorStacks:Push(AnchorStackOne,newname)
AirWing.HasOwnStation = true AirWing.HasOwnStation = true
@ -5601,28 +5601,28 @@ function AWACS:onafterStart(From, Event, To)
local controlzonename = "FEZ-"..self.AOName local controlzonename = "FEZ-"..self.AOName
self.ControlZone = ZONE_RADIUS:New(controlzonename,self.OpsZone:GetVec2(),UTILS.NMToMeters(self.ControlZoneRadius)) self.ControlZone = ZONE_RADIUS:New(controlzonename,self.OpsZone:GetVec2(),UTILS.NMToMeters(self.ControlZoneRadius))
if self.debug then if self.debug then
self.ControlZone:DrawZone(-1,{0,1,0},1,{1,0,0},0.05,3,true) self.ControlZone:DrawZone(self.coalition,{0,1,0},1,{1,0,0},0.05,3,true)
--MARKER:New(self.ControlZone:GetCoordinate(),"Radar Zone"):ToAll() --MARKER:New(self.ControlZone:GetCoordinate(),"Radar Zone"):ToAll()
self.OpsZone:DrawZone(-1,{1,0,0},1,{1,0,0},0.2,5,true) self.OpsZone:DrawZone(self.coalition,{1,0,0},1,{1,0,0},0.2,5,true)
local AOCoordString = self.AOCoordinate:ToStringLLDDM() local AOCoordString = self.AOCoordinate:ToStringLLDDM()
local Rocktag = string.format("FEZ: %s\nBulls Coordinate: %s",self.AOName,AOCoordString) local Rocktag = string.format("FEZ: %s\nBulls Coordinate: %s",self.AOName,AOCoordString)
MARKER:New(self.AOCoordinate,Rocktag):ToAll() MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition)
self.StationZone:DrawZone(-1,{0,0,1},1,{0,0,1},0.2,5,true) self.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true)
local stationtag = string.format("Station: %s\nCoordinate: %s",self.StationZoneName,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",self.StationZoneName,self.StationZone:GetCoordinate():ToStringLLDDM())
if not self.GCI then if not self.GCI then
MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToAll() MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
self.OrbitZone:DrawZone(-1,{0,1,0},1,{0,1,0},0.2,5,true) self.OrbitZone:DrawZone(self.coalition,{0,1,0},1,{0,1,0},0.2,5,true)
MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToAll() MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition)
end end
else else
local AOCoordString = self.AOCoordinate:ToStringLLDDM() local AOCoordString = self.AOCoordinate:ToStringLLDDM()
local Rocktag = string.format("FEZ: %s\nBulls Coordinate: %s",self.AOName,AOCoordString) local Rocktag = string.format("FEZ: %s\nBulls Coordinate: %s",self.AOName,AOCoordString)
MARKER:New(self.AOCoordinate,Rocktag):ToAll() MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition)
if not self.GCI then if not self.GCI then
MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToAll() MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition)
end end
local stationtag = string.format("Station: %s\nCoordinate: %s",self.StationZoneName,self.StationZone:GetCoordinate():ToStringLLDDM()) local stationtag = string.format("Station: %s\nCoordinate: %s",self.StationZoneName,self.StationZone:GetCoordinate():ToStringLLDDM())
MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToAll() MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
end end
if not self.GCI then if not self.GCI then

File diff suppressed because it is too large Load Diff

View File

@ -49,6 +49,7 @@ do
-- @field #table conditionFailure = {}, -- @field #table conditionFailure = {},
-- @field Ops.PlayerTask#PLAYERTASKCONTROLLER TaskController -- @field Ops.PlayerTask#PLAYERTASKCONTROLLER TaskController
-- @field #number timestamp -- @field #number timestamp
-- @field #number lastsmoketime
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM
@ -76,11 +77,12 @@ PLAYERTASK = {
conditionFailure = {}, conditionFailure = {},
TaskController = nil, TaskController = nil,
timestamp = 0, timestamp = 0,
lastsmoketime = 0,
} }
--- PLAYERTASK class version. --- PLAYERTASK class version.
-- @field #string version -- @field #string version
PLAYERTASK.version="0.1.2" PLAYERTASK.version="0.1.3"
--- Generic task condition. --- Generic task condition.
-- @type PLAYERTASK.Condition -- @type PLAYERTASK.Condition
@ -112,6 +114,7 @@ function PLAYERTASK:New(Type, Target, Repeat, Times, TTSType)
self.TaskController = nil -- Ops.PlayerTask#PLAYERTASKCONTROLLER self.TaskController = nil -- Ops.PlayerTask#PLAYERTASKCONTROLLER
self.timestamp = timer.getAbsTime() self.timestamp = timer.getAbsTime()
self.TTSType = TTSType or "close air support" self.TTSType = TTSType or "close air support"
self.lastsmoketime = 0
if Repeat then if Repeat then
self.Repeat = true self.Repeat = true
@ -392,10 +395,13 @@ end
function PLAYERTASK:SmokeTarget(Color) function PLAYERTASK:SmokeTarget(Color)
self:T(self.lid.."SmokeTarget") self:T(self.lid.."SmokeTarget")
local color = Color or SMOKECOLOR.Red local color = Color or SMOKECOLOR.Red
if self.Target then if not self.lastsmoketime then self.lastsmoketime = 0 end
local TDiff = timer.getAbsTime() - self.lastsmoketime
if self.Target and TDiff > 299 then
local coordinate = self.Target:GetCoordinate() local coordinate = self.Target:GetCoordinate()
if coordinate then if coordinate then
coordinate:Smoke(color) coordinate:Smoke(color)
self.lastsmoketime = timer.getAbsTime()
end end
end end
return self return self
@ -754,6 +760,8 @@ do
-- @field #table PlayerFlashMenu -- @field #table PlayerFlashMenu
-- @field #table PlayerJoinMenu -- @field #table PlayerJoinMenu
-- @field #table PlayerInfoMenu -- @field #table PlayerInfoMenu
-- @field #boolean noflaresmokemenu
-- @field #boolean TransmitOnlyWithPlayers
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM
--- ---
@ -1055,6 +1063,8 @@ PLAYERTASKCONTROLLER = {
PlayerFlashMenu = {}, PlayerFlashMenu = {},
PlayerJoinMenu = {}, PlayerJoinMenu = {},
PlayerInfoMenu = {}, PlayerInfoMenu = {},
noflaresmokemenu = false,
TransmitOnlyWithPlayers = true,
} }
--- ---
@ -1213,7 +1223,7 @@ PLAYERTASKCONTROLLER.Messages = {
--- PLAYERTASK class version. --- PLAYERTASK class version.
-- @field #string version -- @field #string version
PLAYERTASKCONTROLLER.version="0.1.36" PLAYERTASKCONTROLLER.version="0.1.38"
--- Constructor --- Constructor
-- @param #PLAYERTASKCONTROLLER self -- @param #PLAYERTASKCONTROLLER self
@ -1268,6 +1278,8 @@ function PLAYERTASKCONTROLLER:New(Name, Coalition, Type, ClientFilter)
self.Keepnumber = false self.Keepnumber = false
self.CallsignTranslations = nil self.CallsignTranslations = nil
self.noflaresmokemenu = false
if ClientFilter then if ClientFilter then
self.ClientSet = SET_CLIENT:New():FilterCoalitions(string.lower(self.CoalitionName)):FilterActive(true):FilterPrefixes(ClientFilter):FilterStart() self.ClientSet = SET_CLIENT:New():FilterCoalitions(string.lower(self.CoalitionName)):FilterActive(true):FilterPrefixes(ClientFilter):FilterStart()
else else
@ -1388,6 +1400,36 @@ function PLAYERTASKCONTROLLER:SetAllowFlashDirection(OnOff)
return self return self
end end
--- [User] Do not show menu entries to smoke or flare targets
-- @param #PLAYERTASKCONTROLLER self
-- @return #PLAYERTASKCONTROLLER self
function PLAYERTASKCONTROLLER:SetDisableSmokeFlareTask()
self:T(self.lid.."SetDisableSmokeFlareTask")
self.noflaresmokemenu = true
return self
end
--- [User] For SRS - Switch to only transmit if there are players on the server.
-- @param #PLAYERTASKCONTROLLER self
-- @param #boolean Switch If true, only send SRS if there are alive Players.
-- @return #PLAYERTASKCONTROLLER self
function PLAYERTASKCONTROLLER:SetTransmitOnlyWithPlayers(Switch)
self.TransmitOnlyWithPlayers = Switch
if self.SRSQueue then
self.SRSQueue:SetTransmitOnlyWithPlayers(Switch)
end
return self
end
--- [User] Show menu entries to smoke or flare targets (on by default!)
-- @param #PLAYERTASKCONTROLLER self
-- @return #PLAYERTASKCONTROLLER self
function PLAYERTASKCONTROLLER:SetEnableSmokeFlareTask()
self:T(self.lid.."SetEnableSmokeFlareTask")
self.noflaresmokemenu = false
return self
end
--- [User] Set callsign options for TTS output. See @{Wrapper.Group#GROUP.GetCustomCallSign}() on how to set customized callsigns. --- [User] Set callsign options for TTS output. See @{Wrapper.Group#GROUP.GetCustomCallSign}() on how to set customized callsigns.
-- @param #PLAYERTASKCONTROLLER self -- @param #PLAYERTASKCONTROLLER self
-- @param #boolean ShortCallsign If true, only call out the major flight number -- @param #boolean ShortCallsign If true, only call out the major flight number
@ -2716,8 +2758,8 @@ function PLAYERTASKCONTROLLER:_BuildMenus(Client,enforced,fromsuccess)
local active = MENU_GROUP_DELAYED:New(group,menuactive,topmenu) local active = MENU_GROUP_DELAYED:New(group,menuactive,topmenu)
local info = MENU_GROUP_COMMAND_DELAYED:New(group,menuinfo,active,self._ActiveTaskInfo,self,group,client) local info = MENU_GROUP_COMMAND_DELAYED:New(group,menuinfo,active,self._ActiveTaskInfo,self,group,client)
local mark = MENU_GROUP_COMMAND_DELAYED:New(group,menumark,active,self._MarkTask,self,group,client) local mark = MENU_GROUP_COMMAND_DELAYED:New(group,menumark,active,self._MarkTask,self,group,client)
if self.Type ~= PLAYERTASKCONTROLLER.Type.A2A then if self.Type ~= PLAYERTASKCONTROLLER.Type.A2A or self.noflaresmokemenu then
-- no smoking/flaring here if A2A -- no smoking/flaring here if A2A or designer has set to false
local smoke = MENU_GROUP_COMMAND_DELAYED:New(group,menusmoke,active,self._SmokeTask,self,group,client) local smoke = MENU_GROUP_COMMAND_DELAYED:New(group,menusmoke,active,self._SmokeTask,self,group,client)
local flare = MENU_GROUP_COMMAND_DELAYED:New(group,menuflare,active,self._FlareTask,self,group,client) local flare = MENU_GROUP_COMMAND_DELAYED:New(group,menuflare,active,self._FlareTask,self,group,client)
end end
@ -3006,6 +3048,7 @@ function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Cultu
self.SRS:SetGoogle(self.PathToGoogleKey) self.SRS:SetGoogle(self.PathToGoogleKey)
end end
self.SRSQueue = MSRSQUEUE:New(self.MenuName or self.Name) self.SRSQueue = MSRSQUEUE:New(self.MenuName or self.Name)
self.SRSQueue:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
return self return self
end end

View File

@ -882,6 +882,8 @@ MSRSQUEUE = {
-- @field #boolean isplaying If true, transmission is currently playing. -- @field #boolean isplaying If true, transmission is currently playing.
-- @field #number Tplay Mission time (abs) in seconds when the transmission should be played. -- @field #number Tplay Mission time (abs) in seconds when the transmission should be played.
-- @field #number interval Interval in seconds before next transmission. -- @field #number interval Interval in seconds before next transmission.
-- @field #boolean TransmitOnlyWithPlayers If true, only transmit if there are alive Players.
-- @field Core.Set#SET_CLIENT PlayerSet PlayerSet created when TransmitOnlyWithPlayers == true
--- Create a new MSRSQUEUE object for a given radio frequency/modulation. --- Create a new MSRSQUEUE object for a given radio frequency/modulation.
-- @param #MSRSQUEUE self -- @param #MSRSQUEUE self
@ -932,6 +934,23 @@ function MSRSQUEUE:AddTransmission(transmission)
return self return self
end end
--- Switch to only transmit if there are players on the server.
-- @param #MSRSQUEUE self
-- @param #boolean Switch If true, only send SRS if there are alive Players.
-- @return #MSRSQUEUE self
function MSRSQUEUE:SetTransmitOnlyWithPlayers(Switch)
self.TransmitOnlyWithPlayers = Switch
if Switch == false or Switch==nil then
if self.PlayerSet then
self.PlayerSet:FilterStop()
end
self.PlayerSet = nil
else
self.PlayerSet = SET_CLIENT:New():FilterStart()
end
return self
end
--- Create a new transmission and add it to the radio queue. --- Create a new transmission and add it to the radio queue.
-- @param #MSRSQUEUE self -- @param #MSRSQUEUE self
-- @param #string text Text to play. -- @param #string text Text to play.
@ -947,6 +966,12 @@ end
-- @return #MSRSQUEUE.Transmission Radio transmission table. -- @return #MSRSQUEUE.Transmission Radio transmission table.
function MSRSQUEUE:NewTransmission(text, duration, msrs, tstart, interval, subgroups, subtitle, subduration, frequency, modulation) function MSRSQUEUE:NewTransmission(text, duration, msrs, tstart, interval, subgroups, subtitle, subduration, frequency, modulation)
if self.TransmitOnlyWithPlayers then
if self.PlayerSet and self.PlayerSet:CountAlive() == 0 then
return self
end
end
-- Sanity checks. -- Sanity checks.
if not text then if not text then
self:E(self.lid.."ERROR: No text specified.") self:E(self.lid.."ERROR: No text specified.")

View File

@ -58,7 +58,7 @@ SOCKET.DataType={
--- SOCKET class version. --- SOCKET class version.
-- @field #string version -- @field #string version
SOCKET.version="0.1.0" SOCKET.version="0.2.0"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list -- TODO list
@ -121,6 +121,10 @@ end
-- @return #SOCKET self -- @return #SOCKET self
function SOCKET:SendTable(Table) function SOCKET:SendTable(Table)
-- Add server name for DCS
Table.server_name=BASE.ServerName or "Unknown"
-- Encode json table.
local json= self.json:encode(Table) local json= self.json:encode(Table)
-- Debug info. -- Debug info.

View File

@ -100,6 +100,7 @@ Ops/Awacs.lua
Ops/Operation.lua Ops/Operation.lua
Ops/FlightControl.lua Ops/FlightControl.lua
Ops/PlayerTask.lua Ops/PlayerTask.lua
Ops/PlayerRecce.lua
AI/AI_Balancer.lua AI/AI_Balancer.lua
AI/AI_Air.lua AI/AI_Air.lua