mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
commit
5a92fb1f65
@ -20,7 +20,7 @@
|
|||||||
--
|
--
|
||||||
-- @module Core.ClientMenu
|
-- @module Core.ClientMenu
|
||||||
-- @image Core_Menu.JPG
|
-- @image Core_Menu.JPG
|
||||||
-- last change: Jan 2025
|
-- last change: Sept 2025
|
||||||
|
|
||||||
-- TODO
|
-- TODO
|
||||||
----------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------
|
||||||
@ -417,7 +417,7 @@ end
|
|||||||
CLIENTMENUMANAGER = {
|
CLIENTMENUMANAGER = {
|
||||||
ClassName = "CLIENTMENUMANAGER",
|
ClassName = "CLIENTMENUMANAGER",
|
||||||
lid = "",
|
lid = "",
|
||||||
version = "0.1.6",
|
version = "0.1.7",
|
||||||
name = nil,
|
name = nil,
|
||||||
clientset = nil,
|
clientset = nil,
|
||||||
menutree = {},
|
menutree = {},
|
||||||
@ -806,6 +806,16 @@ function CLIENTMENUMANAGER:ResetMenuComplete()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Remove the entry and all entries below the given entry from the client's F10 menus.
|
||||||
|
-- @param #CLIENTMENUMANAGER self
|
||||||
|
-- @param #CLIENTMENU Entry The entry to remove
|
||||||
|
-- @param Wrapper.Client#CLIENT Client (optional) If given, make this change only for this client.
|
||||||
|
-- @return #CLIENTMENUMANAGER self
|
||||||
|
function CLIENTMENUMANAGER:DeleteEntry(Entry,Client)
|
||||||
|
self:T(self.lid.."DeleteEntry")
|
||||||
|
return self:DeleteF10Entry(Entry,Client)
|
||||||
|
end
|
||||||
|
|
||||||
--- Remove the entry and all entries below the given entry from the client's F10 menus.
|
--- Remove the entry and all entries below the given entry from the client's F10 menus.
|
||||||
-- @param #CLIENTMENUMANAGER self
|
-- @param #CLIENTMENUMANAGER self
|
||||||
-- @param #CLIENTMENU Entry The entry to remove
|
-- @param #CLIENTMENU Entry The entry to remove
|
||||||
|
|||||||
@ -1508,7 +1508,9 @@ function EVENT:onEvent( Event )
|
|||||||
else
|
else
|
||||||
if Event.place:isExist() and Object.getCategory(Event.place) ~= Object.Category.SCENERY then
|
if Event.place:isExist() and Object.getCategory(Event.place) ~= Object.Category.SCENERY then
|
||||||
Event.Place=AIRBASE:Find(Event.place)
|
Event.Place=AIRBASE:Find(Event.place)
|
||||||
Event.PlaceName=Event.Place:GetName()
|
if Event.Place then
|
||||||
|
Event.PlaceName=Event.Place:GetName()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1054,6 +1054,7 @@ end
|
|||||||
--- NOTE: This is not a spawn randomizer.
|
--- NOTE: This is not a spawn randomizer.
|
||||||
--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area.
|
--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area.
|
||||||
--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit.
|
--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit.
|
||||||
|
-- @param #SPAWN self
|
||||||
-- @param #boolean OnOff Enable/disable the feature.
|
-- @param #boolean OnOff Enable/disable the feature.
|
||||||
-- @param #number MaxRadius (Optional) Max radius to search for valid ground locations in meters. Default is double the max radius of the units.
|
-- @param #number MaxRadius (Optional) Max radius to search for valid ground locations in meters. Default is double the max radius of the units.
|
||||||
-- @param #number Spacing (Optional) Minimum spacing between units in meters. Default is 5% of the search radius or 5 meters, whichever is larger.
|
-- @param #number Spacing (Optional) Minimum spacing between units in meters. Default is 5% of the search radius or 5 meters, whichever is larger.
|
||||||
|
|||||||
@ -378,6 +378,20 @@ function SPAWNSTATIC:InitLinkToUnit(Unit, OffsetX, OffsetY, OffsetAngle)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Uses Disposition and other fallback logic to find a better and valid ground spawn position.
|
||||||
|
--- NOTE: This is not a spawn randomizer.
|
||||||
|
--- It will try to a find clear ground location avoiding trees, water, roads, runways, map scenery, other statics and other units in the area.
|
||||||
|
--- Uses the initial position if it's a valid location.
|
||||||
|
-- @param #SPAWNSTATIC self
|
||||||
|
-- @param #boolean OnOff Enable/disable the feature.
|
||||||
|
-- @param #number MaxRadius (Optional) Max radius to search for a valid ground location in meters. Default is 10 times the max radius of the static.
|
||||||
|
-- @return #SPAWNSTATIC self
|
||||||
|
function SPAWNSTATIC:InitValidateAndRepositionStatic(OnOff, MaxRadius)
|
||||||
|
self.ValidateAndRepositionStatic = OnOff
|
||||||
|
self.ValidateAndRepositionStaticMaxRadius = MaxRadius
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Allows to place a CallFunction hook when a new static spawns.
|
--- Allows to place a CallFunction hook when a new static spawns.
|
||||||
-- The provided method will be called when a new group is spawned, including its given parameters.
|
-- The provided method will be called when a new group is spawned, including its given parameters.
|
||||||
-- The first parameter of the SpawnFunction is the @{Wrapper.Static#STATIC} that was spawned.
|
-- The first parameter of the SpawnFunction is the @{Wrapper.Static#STATIC} that was spawned.
|
||||||
@ -544,6 +558,14 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
|
|||||||
-- Add static to the game.
|
-- Add static to the game.
|
||||||
local Static=nil --DCS#StaticObject
|
local Static=nil --DCS#StaticObject
|
||||||
|
|
||||||
|
if self.ValidateAndRepositionStatic then
|
||||||
|
local validPos = UTILS.ValidateAndRepositionStatic(CountryID, Template.category, Template.type, Template, Template.shape_name, self.ValidateAndRepositionStaticMaxRadius)
|
||||||
|
if validPos then
|
||||||
|
Template.x = validPos.x
|
||||||
|
Template.y = validPos.y
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if self.InitFarp then
|
if self.InitFarp then
|
||||||
|
|
||||||
local TemplateGroup={}
|
local TemplateGroup={}
|
||||||
|
|||||||
@ -1180,15 +1180,13 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories )
|
|||||||
|
|
||||||
local function EvaluateZone( ZoneObject )
|
local function EvaluateZone( ZoneObject )
|
||||||
--if ZoneObject:isExist() then --FF: isExist always returns false for SCENERY objects since DCS 2.2 and still in DCS 2.5
|
--if ZoneObject:isExist() then --FF: isExist always returns false for SCENERY objects since DCS 2.2 and still in DCS 2.5
|
||||||
if ZoneObject then
|
if ZoneObject and self:IsVec3InZone(ZoneObject:getPoint()) then
|
||||||
|
|
||||||
-- Get object category.
|
-- Get object category.
|
||||||
local ObjectCategory = Object.getCategory(ZoneObject)
|
local ObjectCategory = Object.getCategory(ZoneObject)
|
||||||
|
|
||||||
if ( ObjectCategory == Object.Category.UNIT and ZoneObject:isExist() and ZoneObject:isActive() ) or (ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then
|
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
|
local Include = false
|
||||||
if not UnitCategories then
|
if not UnitCategories then
|
||||||
-- Anything found is included.
|
-- Anything found is included.
|
||||||
@ -3308,14 +3306,12 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories )
|
|||||||
|
|
||||||
local function EvaluateZone( ZoneObject )
|
local function EvaluateZone( ZoneObject )
|
||||||
|
|
||||||
if ZoneObject then
|
if ZoneObject and self:IsVec3InZone(ZoneObject:getPoint()) then
|
||||||
|
|
||||||
local ObjectCategory = Object.getCategory(ZoneObject)
|
local ObjectCategory = Object.getCategory(ZoneObject)
|
||||||
|
|
||||||
if ( ObjectCategory == Object.Category.UNIT and ZoneObject:isExist() and ZoneObject:isActive() ) or (ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then
|
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
|
local Include = false
|
||||||
if not UnitCategories then
|
if not UnitCategories then
|
||||||
-- Anything found is included.
|
-- Anything found is included.
|
||||||
@ -3347,7 +3343,7 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories )
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- trying with box search
|
-- trying with box search
|
||||||
if ObjectCategory == Object.Category.SCENERY and self:IsVec3InZone(ZoneObject:getPoint()) then
|
if ObjectCategory == Object.Category.SCENERY then
|
||||||
local SceneryType = ZoneObject:getTypeName()
|
local SceneryType = ZoneObject:getTypeName()
|
||||||
local SceneryName = ZoneObject:getName()
|
local SceneryName = ZoneObject:getName()
|
||||||
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {}
|
||||||
|
|||||||
@ -39,6 +39,8 @@
|
|||||||
-- * [USS America](https://en.wikipedia.org/wiki/USS_America_\(LHA-6\)) (LHA-6)
|
-- * [USS America](https://en.wikipedia.org/wiki/USS_America_\(LHA-6\)) (LHA-6)
|
||||||
-- * [Juan Carlos I](https://en.wikipedia.org/wiki/Spanish_amphibious_assault_ship_Juan_Carlos_I) (L61)
|
-- * [Juan Carlos I](https://en.wikipedia.org/wiki/Spanish_amphibious_assault_ship_Juan_Carlos_I) (L61)
|
||||||
-- * [HMAS Canberra](https://en.wikipedia.org/wiki/HMAS_Canberra_\(L02\)) (L02)
|
-- * [HMAS Canberra](https://en.wikipedia.org/wiki/HMAS_Canberra_\(L02\)) (L02)
|
||||||
|
-- * BONHOMMERICHARD [VWV Mod]
|
||||||
|
-- * ENTERPRISE66 [VWV Mod]
|
||||||
--
|
--
|
||||||
-- **Supported Aircraft:**
|
-- **Supported Aircraft:**
|
||||||
--
|
--
|
||||||
@ -1317,6 +1319,10 @@ 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) [Deprecated!]
|
-- @field #string VINSON USS Carl Vinson (CVN-70) [Deprecated!]
|
||||||
-- @field #string ESSEX Essex class carrier (e.g. USS Yorktown (CV-10)) [Magnitude 3 Carrier Module]
|
-- @field #string ESSEX Essex class carrier (e.g. USS Yorktown (CV-10)) [Magnitude 3 Carrier Module]
|
||||||
|
-- @field #string BONHOMMERICHARD USS Bon Homme Richard carrier [VWV Mod]
|
||||||
|
-- @field #string ESSEXSCB125 Generic Essex class carrier with angled deck (SCB-125 upgrade) [VWV Mod]
|
||||||
|
-- @field #string ENTERPRISE66 USS Enterprise in the 1966 configuration [VWV Mod]
|
||||||
|
-- @field #string ENTERPRISEMODERN USS Enterprise in a modern configuration [Derived VWV Mod]
|
||||||
-- @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 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]
|
||||||
@ -1331,8 +1337,12 @@ AIRBOSS.CarrierType = {
|
|||||||
TRUMAN = "CVN_75",
|
TRUMAN = "CVN_75",
|
||||||
STENNIS = "Stennis",
|
STENNIS = "Stennis",
|
||||||
FORRESTAL = "Forrestal",
|
FORRESTAL = "Forrestal",
|
||||||
|
ENTERPRISE66 = "USS Enterprise 1966",
|
||||||
|
ENTERPRISEMODERN = "cvn-65",
|
||||||
VINSON = "VINSON",
|
VINSON = "VINSON",
|
||||||
ESSEX = "Essex",
|
ESSEX = "Essex",
|
||||||
|
BONHOMMERICHARD = "USS Bon Homme Richard",
|
||||||
|
ESSEXSCB125 = "essex_scb125",
|
||||||
HERMES = "HERMES81",
|
HERMES = "HERMES81",
|
||||||
INVINCIBLE = "hms_invincible",
|
INVINCIBLE = "hms_invincible",
|
||||||
TARAWA = "LHA_Tarawa",
|
TARAWA = "LHA_Tarawa",
|
||||||
@ -1756,7 +1766,7 @@ AIRBOSS.MenuF10Root = nil
|
|||||||
|
|
||||||
--- Airboss class version.
|
--- Airboss class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
AIRBOSS.version = "1.4.1"
|
AIRBOSS.version = "1.4.2"
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -2019,11 +2029,19 @@ function AIRBOSS:New( carriername, alias )
|
|||||||
self:_InitNimitz()
|
self:_InitNimitz()
|
||||||
elseif self.carriertype == AIRBOSS.CarrierType.FORRESTAL then
|
elseif self.carriertype == AIRBOSS.CarrierType.FORRESTAL then
|
||||||
self:_InitForrestal()
|
self:_InitForrestal()
|
||||||
|
elseif self.carriertype == AIRBOSS.CarrierType.ENTERPRISE66 then
|
||||||
|
self:_InitEnterprise()
|
||||||
|
elseif self.carriertype == AIRBOSS.CarrierType.ENTERPRISEMODERN then
|
||||||
|
self:_InitEnterprise()
|
||||||
elseif self.carriertype == AIRBOSS.CarrierType.VINSON then
|
elseif self.carriertype == AIRBOSS.CarrierType.VINSON then
|
||||||
-- Carl Vinson is legacy now.
|
-- Carl Vinson is legacy now.
|
||||||
self:_InitStennis()
|
self:_InitStennis()
|
||||||
elseif self.carriertype == AIRBOSS.CarrierType.ESSEX then
|
elseif self.carriertype == AIRBOSS.CarrierType.ESSEX then
|
||||||
self:_InitEssex()
|
self:_InitEssex()
|
||||||
|
elseif self.carriertype == AIRBOSS.CarrierType.BONHOMMERICHARD then
|
||||||
|
self:_InitBonHommeRichard()
|
||||||
|
elseif self.carriertype == AIRBOSS.CarrierType.ESSEXSCB125 then
|
||||||
|
self:_InitEssexSCB125()
|
||||||
elseif self.carriertype == AIRBOSS.CarrierType.HERMES then
|
elseif self.carriertype == AIRBOSS.CarrierType.HERMES then
|
||||||
-- Hermes parameters.
|
-- Hermes parameters.
|
||||||
self:_InitHermes()
|
self:_InitHermes()
|
||||||
@ -3110,8 +3128,8 @@ function AIRBOSS:EnableSRS(PathToSRS,Port,Culture,Gender,Voice,GoogleCreds,Volum
|
|||||||
self.SRS:SetCulture(Culture or "en-US")
|
self.SRS:SetCulture(Culture or "en-US")
|
||||||
--self.SRS:SetFrequencies(Frequencies)
|
--self.SRS:SetFrequencies(Frequencies)
|
||||||
self.SRS:SetGender(Gender or "male")
|
self.SRS:SetGender(Gender or "male")
|
||||||
self.SRS:SetPath(PathToSRS)
|
--self.SRS:SetPath(PathToSRS)
|
||||||
self.SRS:SetPort(Port or 5002)
|
self.SRS:SetPort(Port or MSRS.port or 5002)
|
||||||
self.SRS:SetLabel(self.AirbossRadio.alias or "AIRBOSS")
|
self.SRS:SetLabel(self.AirbossRadio.alias or "AIRBOSS")
|
||||||
self.SRS:SetCoordinate(self.carrier:GetCoordinate())
|
self.SRS:SetCoordinate(self.carrier:GetCoordinate())
|
||||||
self.SRS:SetVolume(Volume or 1)
|
self.SRS:SetVolume(Volume or 1)
|
||||||
@ -3122,7 +3140,10 @@ function AIRBOSS:EnableSRS(PathToSRS,Port,Culture,Gender,Voice,GoogleCreds,Volum
|
|||||||
if Voice then
|
if Voice then
|
||||||
self.SRS:SetVoice(Voice)
|
self.SRS:SetVoice(Voice)
|
||||||
end
|
end
|
||||||
self.SRS:SetVolume(Volume or 1.0)
|
if (not Voice) and self.SRS and self.SRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||||
|
self.SRS.voice = MSRS.poptions["gcloud"].voice or MSRS.Voices.Google.Standard.en_US_Standard_B
|
||||||
|
end
|
||||||
|
--self.SRS:SetVolume(Volume or 1.0)
|
||||||
-- SRSQUEUE
|
-- SRSQUEUE
|
||||||
self.SRSQ = MSRSQUEUE:New("AIRBOSS")
|
self.SRSQ = MSRSQUEUE:New("AIRBOSS")
|
||||||
self.SRSQ:SetTransmitOnlyWithPlayers(true)
|
self.SRSQ:SetTransmitOnlyWithPlayers(true)
|
||||||
@ -4653,6 +4674,26 @@ function AIRBOSS:_InitForrestal()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Init parameters for Enterprise carrier.
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
function AIRBOSS:_InitEnterprise()
|
||||||
|
-- Using Forrestal as template
|
||||||
|
self:_InitForrestal()
|
||||||
|
|
||||||
|
self.carrierparam.sterndist = -164.30
|
||||||
|
self.carrierparam.deckheight = 19.52
|
||||||
|
|
||||||
|
self.carrierparam.totlength = 335
|
||||||
|
self.carrierparam.rwylength = 223
|
||||||
|
|
||||||
|
-- Wires.
|
||||||
|
self.carrierparam.wire1 = 57.7
|
||||||
|
self.carrierparam.wire2 = 69.6
|
||||||
|
self.carrierparam.wire3 = 79.5
|
||||||
|
self.carrierparam.wire4 = 90.0
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--- Init parameters for Essec class carriers.
|
--- Init parameters for Essec class carriers.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
function AIRBOSS:_InitEssex()
|
function AIRBOSS:_InitEssex()
|
||||||
@ -4698,6 +4739,35 @@ function AIRBOSS:_InitEssex()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Init parameters for CVA-31 Bon Homme Richard carriers.
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
function AIRBOSS:_InitBonHommeRichard()
|
||||||
|
-- Init Essex as default
|
||||||
|
self:_InitEssex()
|
||||||
|
|
||||||
|
self.carrierparam.deckheight = 16.95
|
||||||
|
|
||||||
|
-- Landing runway.
|
||||||
|
-- from BHR EssexRunwayAndRoutes.lua
|
||||||
|
self.carrierparam.rwyangle = -11.4
|
||||||
|
self.carrierparam.rwylength = 97
|
||||||
|
self.carrierparam.rwywidth = 20
|
||||||
|
|
||||||
|
-- Wires.
|
||||||
|
self.carrierparam.wire1 = 40.4 -- Distance from stern to first wire. Original from Frank - 42
|
||||||
|
self.carrierparam.wire2 = 45
|
||||||
|
self.carrierparam.wire3 = 51
|
||||||
|
self.carrierparam.wire4 = 58.1
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Init parameters for Generic Essex SC125 class carriers.
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
function AIRBOSS:_InitEssexSCB125()
|
||||||
|
-- Init Bon Homme Richard as default
|
||||||
|
self:_InitBonHommeRichard()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--- Init parameters for R12 HMS Hermes carrier.
|
--- Init parameters for R12 HMS Hermes carrier.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
function AIRBOSS:_InitHermes()
|
function AIRBOSS:_InitHermes()
|
||||||
|
|||||||
@ -1321,13 +1321,19 @@ end
|
|||||||
-- @param #number Altitude Orbit altitude in feet. Default is y component of `Coordinate`.
|
-- @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 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 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 Leg 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.
|
-- @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
|
-- @return #AUFTRAG self
|
||||||
function AUFTRAG:NewTANKER(Coordinate, Altitude, Speed, Heading, Leg, RefuelSystem)
|
function AUFTRAG:NewTANKER(Coordinate, Altitude, Speed, Heading, Leg, RefuelSystem)
|
||||||
|
|
||||||
|
local mission
|
||||||
|
if Leg == 0 then
|
||||||
|
mission=AUFTRAG:NewORBIT_CIRCLE(Coordinate,Altitude,Speed)
|
||||||
|
else
|
||||||
|
mission=AUFTRAG:NewORBIT_RACETRACK(Coordinate,Altitude,Speed,Heading,Leg)
|
||||||
|
end
|
||||||
-- Create ORBIT first.
|
-- Create ORBIT first.
|
||||||
local mission=AUFTRAG:NewORBIT_RACETRACK(Coordinate, Altitude, Speed, Heading, Leg)
|
--local mission=AUFTRAG:NewORBIT_RACETRACK(Coordinate, Altitude, Speed, Heading, Leg)
|
||||||
|
|
||||||
-- Mission type TANKER.
|
-- Mission type TANKER.
|
||||||
mission.type=AUFTRAG.Type.TANKER
|
mission.type=AUFTRAG.Type.TANKER
|
||||||
|
|||||||
@ -2021,7 +2021,9 @@ function AWACS:SetAdditionalZone(Zone, Draw)
|
|||||||
self.BorderZone = Zone
|
self.BorderZone = Zone
|
||||||
if self.debug then
|
if self.debug then
|
||||||
Zone:DrawZone(self.coalition,{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"):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
MARKER:New(Zone:GetCoordinate(),"Defensive Zone"):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
elseif Draw then
|
elseif Draw then
|
||||||
Zone:DrawZone(self.coalition,{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
|
||||||
@ -2041,7 +2043,9 @@ function AWACS:SetRejectionZone(Zone,Draw)
|
|||||||
--MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToAll()
|
--MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToAll()
|
||||||
elseif self.debug then
|
elseif self.debug then
|
||||||
Zone:DrawZone(self.coalition,{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"):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -4094,10 +4098,14 @@ function AWACS:_CreateAnchorStackFromMarker(Name,Coord)
|
|||||||
if self.debug then
|
if self.debug then
|
||||||
AnchorStackOne.StationZone:DrawZone(self.coalition,{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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.AnchorStacks:Push(AnchorStackOne,newname)
|
self.AnchorStacks:Push(AnchorStackOne,newname)
|
||||||
@ -4140,10 +4148,14 @@ function AWACS:_CreateAnchorStack()
|
|||||||
--self.AnchorStacks:Flush()
|
--self.AnchorStacks:Flush()
|
||||||
AnchorStackOne.StationZone:DrawZone(self.coalition,{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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self.AnchorStacks:Push(AnchorStackOne,newname)
|
self.AnchorStacks:Push(AnchorStackOne,newname)
|
||||||
else
|
else
|
||||||
@ -4167,10 +4179,14 @@ function AWACS:_CreateAnchorStack()
|
|||||||
if self.debug then
|
if self.debug then
|
||||||
AnchorStackOne.StationZone:DrawZone(self.coalition,{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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self.AnchorStacks:Push(AnchorStackOne,newname)
|
self.AnchorStacks:Push(AnchorStackOne,newname)
|
||||||
end
|
end
|
||||||
@ -5102,10 +5118,14 @@ function AWACS:AddCAPAirWing(AirWing,Zone)
|
|||||||
if self.debug then
|
if self.debug then
|
||||||
AnchorStackOne.StationZone:DrawZone(self.coalition,{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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self.AnchorStacks:Push(AnchorStackOne,newname)
|
self.AnchorStacks:Push(AnchorStackOne,newname)
|
||||||
AirWing.HasOwnStation = true
|
AirWing.HasOwnStation = true
|
||||||
@ -5948,23 +5968,35 @@ function AWACS:onafterStart(From, Event, To)
|
|||||||
self.OpsZone:DrawZone(self.coalition,{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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
self.StationZone:DrawZone(self.coalition,{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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
self.OrbitZone:DrawZone(self.coalition,{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"):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
if not self.GCI then
|
if not self.GCI then
|
||||||
MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
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):ToCoalition(self.coalition)
|
if self.AllowMarkers then
|
||||||
|
MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.GCI then
|
if not self.GCI then
|
||||||
|
|||||||
@ -305,6 +305,7 @@ CSAR.AircraftType["Mi-24P"] = 8
|
|||||||
CSAR.AircraftType["Mi-24V"] = 8
|
CSAR.AircraftType["Mi-24V"] = 8
|
||||||
CSAR.AircraftType["Bell-47"] = 2
|
CSAR.AircraftType["Bell-47"] = 2
|
||||||
CSAR.AircraftType["UH-60L"] = 10
|
CSAR.AircraftType["UH-60L"] = 10
|
||||||
|
CSAR.AircraftType["UH-60L_DAP"] = 2
|
||||||
CSAR.AircraftType["AH-64D_BLK_II"] = 2
|
CSAR.AircraftType["AH-64D_BLK_II"] = 2
|
||||||
CSAR.AircraftType["Bronco-OV-10A"] = 2
|
CSAR.AircraftType["Bronco-OV-10A"] = 2
|
||||||
CSAR.AircraftType["MH-60R"] = 10
|
CSAR.AircraftType["MH-60R"] = 10
|
||||||
|
|||||||
@ -1396,6 +1396,7 @@ CTLD.UnitTypeCapabilities = {
|
|||||||
["Hercules"] = {type="Hercules", crates=true, troops=true, cratelimit = 7, trooplimit = 64, length = 25, cargoweightlimit = 19000}, -- 19t cargo, 64 paratroopers.
|
["Hercules"] = {type="Hercules", crates=true, troops=true, cratelimit = 7, trooplimit = 64, length = 25, cargoweightlimit = 19000}, -- 19t cargo, 64 paratroopers.
|
||||||
--Actually it's longer, but the center coord is off-center of the model.
|
--Actually it's longer, but the center coord is off-center of the model.
|
||||||
["UH-60L"] = {type="UH-60L", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
|
["UH-60L"] = {type="UH-60L", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
|
||||||
|
["UH-60L_DAP"] = {type="UH-60L_DAP", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 16, cargoweightlimit = 500}, -- UH-60L DAP is an attack helo but can do limited CSAR and CTLD
|
||||||
["MH-60R"] = {type="MH-60R", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
|
["MH-60R"] = {type="MH-60R", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
|
||||||
["SH-60B"] = {type="SH-60B", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
|
["SH-60B"] = {type="SH-60B", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
|
||||||
["AH-64D_BLK_II"] = {type="AH-64D_BLK_II", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 17, cargoweightlimit = 200}, -- 2 ppl **outside** the helo
|
["AH-64D_BLK_II"] = {type="AH-64D_BLK_II", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 17, cargoweightlimit = 200}, -- 2 ppl **outside** the helo
|
||||||
@ -1417,7 +1418,7 @@ CTLD.FixedWingTypes = {
|
|||||||
|
|
||||||
--- CTLD class version.
|
--- CTLD class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CTLD.version="1.3.37"
|
CTLD.version="1.3.38"
|
||||||
|
|
||||||
--- Instantiate a new CTLD.
|
--- Instantiate a new CTLD.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@ -3328,6 +3329,7 @@ function CTLD:_LoadCratesNearby(Group, Unit)
|
|||||||
self:_RefreshLoadCratesMenu(Group, Unit)
|
self:_RefreshLoadCratesMenu(Group, Unit)
|
||||||
-- clean up real world crates
|
-- clean up real world crates
|
||||||
self:_CleanupTrackedCrates(crateidsloaded)
|
self:_CleanupTrackedCrates(crateidsloaded)
|
||||||
|
self:__CratesPickedUp(1, Group, Unit, loaded.Cargo)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return self
|
return self
|
||||||
@ -6930,6 +6932,7 @@ end
|
|||||||
local alias = string.format("%s-%d", _template, math.random(1,100000))
|
local alias = string.format("%s-%d", _template, math.random(1,100000))
|
||||||
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
||||||
:InitRandomizeUnits(randompositions,20,2)
|
:InitRandomizeUnits(randompositions,20,2)
|
||||||
|
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
||||||
:InitDelayOff()
|
:InitDelayOff()
|
||||||
:OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp)
|
:OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp)
|
||||||
:SpawnFromVec2(randomcoord)
|
:SpawnFromVec2(randomcoord)
|
||||||
@ -7083,12 +7086,14 @@ end
|
|||||||
if canmove then
|
if canmove then
|
||||||
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
||||||
:InitRandomizeUnits(true,20,2)
|
:InitRandomizeUnits(true,20,2)
|
||||||
|
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
||||||
:InitDelayOff()
|
:InitDelayOff()
|
||||||
:OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp)
|
:OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp)
|
||||||
:SpawnFromVec2(randomcoord)
|
:SpawnFromVec2(randomcoord)
|
||||||
else -- don't random position of e.g. SAM units build as FOB
|
else -- don't random position of e.g. SAM units build as FOB
|
||||||
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
||||||
:InitDelayOff()
|
:InitDelayOff()
|
||||||
|
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
||||||
:OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp)
|
:OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp)
|
||||||
:SpawnFromVec2(randomcoord)
|
:SpawnFromVec2(randomcoord)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -88,7 +88,7 @@ COHORT = {
|
|||||||
|
|
||||||
--- COHORT class version.
|
--- COHORT class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
COHORT.version="0.3.6"
|
COHORT.version="0.3.7"
|
||||||
|
|
||||||
--- Global variable to store the unique(!) cohort names
|
--- Global variable to store the unique(!) cohort names
|
||||||
_COHORTNAMES={}
|
_COHORTNAMES={}
|
||||||
@ -100,6 +100,7 @@ _COHORTNAMES={}
|
|||||||
-- DONE: Create FLOTILLA class.
|
-- DONE: Create FLOTILLA class.
|
||||||
-- DONE: Added check for properties.
|
-- DONE: Added check for properties.
|
||||||
-- DONE: Make general so that PLATOON and SQUADRON can inherit this class.
|
-- DONE: Make general so that PLATOON and SQUADRON can inherit this class.
|
||||||
|
-- DONE: Better setting of call signs.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- Constructor
|
-- Constructor
|
||||||
@ -515,10 +516,12 @@ end
|
|||||||
-- @param #COHORT self
|
-- @param #COHORT self
|
||||||
-- @param #number Callsign Callsign from CALLSIGN.Aircraft, e.g. "Chevy" for CALLSIGN.Aircraft.CHEVY.
|
-- @param #number Callsign Callsign from CALLSIGN.Aircraft, e.g. "Chevy" for CALLSIGN.Aircraft.CHEVY.
|
||||||
-- @param #number Index Callsign index, Chevy-**1**.
|
-- @param #number Index Callsign index, Chevy-**1**.
|
||||||
|
-- @param #string CallsignString (optional) Set this for tasks like TANKER, AWACS or KIOWA and the like, which have special names. E.g. "Darkstar" or "Roughneck".
|
||||||
-- @return #COHORT self
|
-- @return #COHORT self
|
||||||
function COHORT:SetCallsign(Callsign, Index)
|
function COHORT:SetCallsign(Callsign, Index, CallsignString)
|
||||||
self.callsignName=Callsign
|
self.callsignName=Callsign
|
||||||
self.callsignIndex=Index
|
self.callsignIndex=Index
|
||||||
|
self.callsignClearName=CallsignString
|
||||||
self.callsign={}
|
self.callsign={}
|
||||||
self.callsign.NumberSquad=Callsign
|
self.callsign.NumberSquad=Callsign
|
||||||
self.callsign.NumberGroup=Index
|
self.callsign.NumberGroup=Index
|
||||||
@ -679,7 +682,16 @@ end
|
|||||||
function COHORT:GetCallsign(Asset)
|
function COHORT:GetCallsign(Asset)
|
||||||
|
|
||||||
if self.callsignName then
|
if self.callsignName then
|
||||||
|
--[[
|
||||||
|
["callsign"] =
|
||||||
|
{
|
||||||
|
[2] = 1,
|
||||||
|
["name"] = "Darkstar11",
|
||||||
|
[3] = 1,
|
||||||
|
[1] = 5,
|
||||||
|
[4] = "Darkstar11",
|
||||||
|
}, -- end of ["callsign"]
|
||||||
|
]]
|
||||||
Asset.callsign={}
|
Asset.callsign={}
|
||||||
|
|
||||||
for i=1,Asset.nunits do
|
for i=1,Asset.nunits do
|
||||||
@ -695,12 +707,16 @@ function COHORT:GetCallsign(Asset)
|
|||||||
else
|
else
|
||||||
self.callsigncounter=self.callsigncounter+1
|
self.callsigncounter=self.callsigncounter+1
|
||||||
end
|
end
|
||||||
|
callsign["name"] = self.callsignClearName or UTILS.GetCallsignName(self.callsignName) or "None"
|
||||||
|
callsign["name"] = string.format("%s%d%d",callsign["name"],callsign[2],callsign[3])
|
||||||
|
callsign[4] = callsign["name"]
|
||||||
|
|
||||||
Asset.callsign[i]=callsign
|
Asset.callsign[i]=callsign
|
||||||
|
|
||||||
self:T3({callsign=callsign})
|
self:T3({callsign=callsign})
|
||||||
|
|
||||||
--TODO: there is also a table entry .name, which is a string.
|
--DONE: there is also a table entry .name, which is a string.
|
||||||
|
--UTILS.PrintTableToLog(callsign)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,6 +79,7 @@
|
|||||||
-- @field #number FuelLowThreshold
|
-- @field #number FuelLowThreshold
|
||||||
-- @field #number FuelCriticalThreshold
|
-- @field #number FuelCriticalThreshold
|
||||||
-- @field #boolean showpatrolpointmarks
|
-- @field #boolean showpatrolpointmarks
|
||||||
|
-- @field #table EngageTargetTypes
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown.
|
--- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown.
|
||||||
@ -237,6 +238,7 @@ EASYGCICAP = {
|
|||||||
FuelLowThreshold = 25,
|
FuelLowThreshold = 25,
|
||||||
FuelCriticalThreshold = 10,
|
FuelCriticalThreshold = 10,
|
||||||
showpatrolpointmarks = false,
|
showpatrolpointmarks = false,
|
||||||
|
EngageTargetTypes = {"Air"},
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Internal Squadron data type
|
--- Internal Squadron data type
|
||||||
@ -273,7 +275,7 @@ EASYGCICAP = {
|
|||||||
|
|
||||||
--- EASYGCICAP class version.
|
--- EASYGCICAP class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
EASYGCICAP.version="0.1.27"
|
EASYGCICAP.version="0.1.30"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -330,6 +332,7 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName)
|
|||||||
self.FuelLowThreshold = 25
|
self.FuelLowThreshold = 25
|
||||||
self.FuelCriticalThreshold = 10
|
self.FuelCriticalThreshold = 10
|
||||||
self.showpatrolpointmarks = false
|
self.showpatrolpointmarks = false
|
||||||
|
self.EngageTargetTypes = {"Air"}
|
||||||
|
|
||||||
-- Set some string id for output to DCS.log file.
|
-- Set some string id for output to DCS.log file.
|
||||||
self.lid=string.format("EASYGCICAP %s | ", self.alias)
|
self.lid=string.format("EASYGCICAP %s | ", self.alias)
|
||||||
@ -608,6 +611,17 @@ function EASYGCICAP:SetCapStartTimeVariation(Start, End)
|
|||||||
return self
|
return self
|
||||||
end
|
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"},
|
||||||
|
-- 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)
|
||||||
|
self.EngageTargetTypes = types or {"Air"}
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Add an AirWing to the manager
|
--- Add an AirWing to the manager
|
||||||
-- @param #EASYGCICAP self
|
-- @param #EASYGCICAP self
|
||||||
-- @param #string Airbasename
|
-- @param #string Airbasename
|
||||||
@ -706,6 +720,7 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
local NoGoZoneSet = self.NoGoZoneSet
|
local NoGoZoneSet = self.NoGoZoneSet
|
||||||
local FuelLow = self.FuelLowThreshold or 25
|
local FuelLow = self.FuelLowThreshold or 25
|
||||||
local FuelCritical = self.FuelCriticalThreshold or 10
|
local FuelCritical = self.FuelCriticalThreshold or 10
|
||||||
|
local EngageTypes = self.EngageTargetTypes or {"Air"}
|
||||||
|
|
||||||
function CAP_Wing:onbeforeFlightOnMission(From, Event, To, Flightgroup, Mission)
|
function CAP_Wing:onbeforeFlightOnMission(From, Event, To, Flightgroup, Mission)
|
||||||
local flightgroup = Flightgroup -- Ops.FlightGroup#FLIGHTGROUP
|
local flightgroup = Flightgroup -- Ops.FlightGroup#FLIGHTGROUP
|
||||||
@ -720,7 +735,7 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
flightgroup:GetGroup():SetOptionLandingOverheadBreak()
|
flightgroup:GetGroup():SetOptionLandingOverheadBreak()
|
||||||
if Mission.type ~= AUFTRAG.Type.TANKER and Mission.type ~= AUFTRAG.Type.AWACS and Mission.type ~= AUFTRAG.Type.RECON then
|
if Mission.type ~= AUFTRAG.Type.TANKER and Mission.type ~= AUFTRAG.Type.AWACS and Mission.type ~= AUFTRAG.Type.RECON then
|
||||||
flightgroup:SetDetection(true)
|
flightgroup:SetDetection(true)
|
||||||
flightgroup:SetEngageDetectedOn(engagerange,{"Air"},GoZoneSet,NoGoZoneSet)
|
flightgroup:SetEngageDetectedOn(engagerange,EngageTypes,GoZoneSet,NoGoZoneSet)
|
||||||
flightgroup:SetOutOfAAMRTB()
|
flightgroup:SetOutOfAAMRTB()
|
||||||
flightgroup:SetFuelLowRTB(true)
|
flightgroup:SetFuelLowRTB(true)
|
||||||
flightgroup:SetFuelLowThreshold(FuelLow)
|
flightgroup:SetFuelLowThreshold(FuelLow)
|
||||||
@ -1209,7 +1224,9 @@ function EASYGCICAP:_AddTankerSquadron(TemplateName, SquadName, AirbaseName, Air
|
|||||||
Squadron_One:SetSkill(Skill or AI.Skill.AVERAGE)
|
Squadron_One:SetSkill(Skill or AI.Skill.AVERAGE)
|
||||||
Squadron_One:SetMissionRange(self.missionrange)
|
Squadron_One:SetMissionRange(self.missionrange)
|
||||||
Squadron_One:SetRadio(Frequency,Modulation)
|
Squadron_One:SetRadio(Frequency,Modulation)
|
||||||
Squadron_One:AddTacanChannel(TACAN,TACAN)
|
if TACAN then
|
||||||
|
Squadron_One:AddTacanChannel(TACAN,TACAN)
|
||||||
|
end
|
||||||
|
|
||||||
local wing = self.wings[AirbaseName][1] -- Ops.Airwing#AIRWING
|
local wing = self.wings[AirbaseName][1] -- Ops.Airwing#AIRWING
|
||||||
|
|
||||||
|
|||||||
@ -1823,6 +1823,7 @@ function LEGION:_CreateFlightGroup(asset)
|
|||||||
---
|
---
|
||||||
|
|
||||||
opsgroup=ARMYGROUP:New(asset.spawngroupname)
|
opsgroup=ARMYGROUP:New(asset.spawngroupname)
|
||||||
|
opsgroup:SetValidateAndRepositionGroundUnits(self.ValidateAndRepositionGroundUnits)
|
||||||
|
|
||||||
elseif self:IsFleet() then
|
elseif self:IsFleet() then
|
||||||
|
|
||||||
|
|||||||
@ -7847,8 +7847,13 @@ function OPSGROUP:_Spawn(Delay, Template)
|
|||||||
-- Debug output.
|
-- Debug output.
|
||||||
self:T2({Template=Template})
|
self:T2({Template=Template})
|
||||||
|
|
||||||
|
if self:IsArmygroup() and self.ValidateAndRepositionGroundUnits then
|
||||||
|
UTILS.ValidateAndRepositionGroundUnits(Template.units)
|
||||||
|
end
|
||||||
|
|
||||||
-- Spawn new group.
|
-- Spawn new group.
|
||||||
self.group=_DATABASE:Spawn(Template)
|
self.group=_DATABASE:Spawn(Template)
|
||||||
|
self.group:SetValidateAndRepositionGroundUnits(self.ValidateAndRepositionGroundUnits)
|
||||||
--local countryID=self.group:GetCountry()
|
--local countryID=self.group:GetCountry()
|
||||||
--local categoryID=self.group:GetCategory()
|
--local categoryID=self.group:GetCategory()
|
||||||
--local dcsgroup=coalition.addGroup(countryID, categoryID, Template)
|
--local dcsgroup=coalition.addGroup(countryID, categoryID, Template)
|
||||||
@ -13955,6 +13960,15 @@ function OPSGROUP:_GetDetectedTarget()
|
|||||||
return targetgroup, targetdist
|
return targetgroup, targetdist
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- This function uses Disposition and other fallback logic to find better ground positions for ground units.
|
||||||
|
--- NOTE: This is not a spawn randomizer.
|
||||||
|
--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table.
|
||||||
|
--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit.
|
||||||
|
--- Uses UTILS.ValidateAndRepositionGroundUnits.
|
||||||
|
-- @param #boolean Enabled Enable/disable the feature.
|
||||||
|
function OPSGROUP:SetValidateAndRepositionGroundUnits(Enabled)
|
||||||
|
self.ValidateAndRepositionGroundUnits = Enabled
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -98,7 +98,7 @@ PLAYERTASK = {
|
|||||||
|
|
||||||
--- PLAYERTASK class version.
|
--- PLAYERTASK class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
PLAYERTASK.version="0.1.27"
|
PLAYERTASK.version="0.1.28"
|
||||||
|
|
||||||
--- Generic task condition.
|
--- Generic task condition.
|
||||||
-- @type PLAYERTASK.Condition
|
-- @type PLAYERTASK.Condition
|
||||||
@ -387,6 +387,14 @@ function PLAYERTASK:_CheckCaptureOpsZoneSuccess(OpsZone, CaptureSquadGroupNamePr
|
|||||||
return OpsZone:GetOwner() == Coalition and isClientInZone and isCaptureGroupInZone
|
return OpsZone:GetOwner() == Coalition and isClientInZone and isCaptureGroupInZone
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [User] Override this function in order to implement custom logic if a player can join a task or not.
|
||||||
|
-- @param #PLAYERTASK self
|
||||||
|
-- @param Wrapper.Group#GROUP Group
|
||||||
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
|
-- @return #boolean Outcome True if player can join the task, false if not
|
||||||
|
function PLAYERTASK:CanJoinTask(Group, Client)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
--- [Internal] Add a PLAYERTASKCONTROLLER for this task
|
--- [Internal] Add a PLAYERTASKCONTROLLER for this task
|
||||||
-- @param #PLAYERTASK self
|
-- @param #PLAYERTASK self
|
||||||
@ -1227,7 +1235,10 @@ function PLAYERTASK:onafterFailed(From, Event, To)
|
|||||||
self.TargetMarker:Remove()
|
self.TargetMarker:Remove()
|
||||||
end
|
end
|
||||||
self.FinalState = "Failed"
|
self.FinalState = "Failed"
|
||||||
self:__Done(-1)
|
if self.TaskController then
|
||||||
|
self.TaskController:__TaskFailed(-1,self)
|
||||||
|
end
|
||||||
|
self:__Done(-1.5)
|
||||||
end
|
end
|
||||||
if self.TaskController.Scoring then
|
if self.TaskController.Scoring then
|
||||||
local clients,count = self:GetClientObjects()
|
local clients,count = self:GetClientObjects()
|
||||||
@ -3530,6 +3541,16 @@ function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask,Silent,TaskFilter)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- [User] Override this function in order to implement custom logic if a player can join a task or not.
|
||||||
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
|
-- @param Ops.PlayerTask#PLAYERTASK Task
|
||||||
|
-- @param Wrapper.Group#GROUP Group
|
||||||
|
-- @param Wrapper.Client#CLIENT Client
|
||||||
|
-- @return #boolean Outcome True if player can join the task, false if not
|
||||||
|
function PLAYERTASKCONTROLLER:CanJoinTask(Task, Group, Client)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
--- [Internal] Join a player to a task
|
--- [Internal] Join a player to a task
|
||||||
-- @param #PLAYERTASKCONTROLLER self
|
-- @param #PLAYERTASKCONTROLLER self
|
||||||
-- @param Ops.PlayerTask#PLAYERTASK Task
|
-- @param Ops.PlayerTask#PLAYERTASK Task
|
||||||
@ -3540,6 +3561,15 @@ end
|
|||||||
function PLAYERTASKCONTROLLER:_JoinTask(Task, Force, Group, Client)
|
function PLAYERTASKCONTROLLER:_JoinTask(Task, Force, Group, Client)
|
||||||
self:T({Force, Group, Client})
|
self:T({Force, Group, Client})
|
||||||
self:T(self.lid.."_JoinTask")
|
self:T(self.lid.."_JoinTask")
|
||||||
|
|
||||||
|
if not self:CanJoinTask(Task, Group, Client) then
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
if not Task:CanJoinTask(Group, Client) then
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
local force = false
|
local force = false
|
||||||
if type(Force) == "boolean" then
|
if type(Force) == "boolean" then
|
||||||
force = Force
|
force = Force
|
||||||
|
|||||||
@ -1586,12 +1586,12 @@ function UTILS.HdgDiff(h1, h2)
|
|||||||
return math.abs(delta)
|
return math.abs(delta)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns the heading from one vec3 to another vec3.
|
--- Returns the heading from one vec2/vec3 to another vec2/vec3.
|
||||||
-- @param DCS#Vec3 a From vec3.
|
-- @param DCS#Vec3 a From Vec2 or Vec3.
|
||||||
-- @param DCS#Vec3 b To vec3.
|
-- @param DCS#Vec3 b To Vec2 or Vec3.
|
||||||
-- @return #number Heading in degrees.
|
-- @return #number Heading in degrees.
|
||||||
function UTILS.HdgTo(a, b)
|
function UTILS.HdgTo(a, b)
|
||||||
local dz=b.z-a.z
|
local dz=(b.z or b.y) - (a.z or a.y)
|
||||||
local dx=b.x-a.x
|
local dx=b.x-a.x
|
||||||
local heading=math.deg(math.atan2(dz, dx))
|
local heading=math.deg(math.atan2(dz, dx))
|
||||||
if heading < 0 then
|
if heading < 0 then
|
||||||
@ -4981,3 +4981,51 @@ function UTILS.ValidateAndRepositionGroundUnits(Positions, Anchor, MaxRadius, Sp
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- This function uses Disposition and other fallback logic to find better ground positions for statics.
|
||||||
|
--- NOTE: This is not a spawn randomizer.
|
||||||
|
--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table.
|
||||||
|
--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit.
|
||||||
|
-- @param #table Positions A table of DCS#Vec2 or DCS#Vec3, can be a units table from the group template.
|
||||||
|
-- @param DCS#Vec2 Position DCS#Vec2 or DCS#Vec3 initial spawn location.
|
||||||
|
-- @param #number MaxRadius (Optional) Max radius to search for valid ground locations in meters. Default is double the max radius of the static.
|
||||||
|
-- @return DCS#Vec2 Initial Position if it's valid, else a valid spawn position. nil if no valid position found.
|
||||||
|
function UTILS.ValidateAndRepositionStatic(Country, Category, Type, Position, ShapeName, MaxRadius)
|
||||||
|
local coord = COORDINATE:NewFromVec2(Position)
|
||||||
|
local st = SPAWNSTATIC:NewFromType(Type, Category, Country)
|
||||||
|
if ShapeName then
|
||||||
|
st:InitShape(ShapeName)
|
||||||
|
end
|
||||||
|
local sName = "s-"..timer.getTime().."-"..math.random(1,10000)
|
||||||
|
local tempStatic = st:SpawnFromCoordinate(coord, 0, sName)
|
||||||
|
if tempStatic then
|
||||||
|
local sRadius = tempStatic:GetBoundingRadius(2) or 3
|
||||||
|
tempStatic:Destroy()
|
||||||
|
sRadius = sRadius * 0.5
|
||||||
|
MaxRadius = MaxRadius or math.max(sRadius * 10, 100)
|
||||||
|
local positions = UTILS.GetSimpleZones(coord:GetVec3(), MaxRadius, sRadius, 20)
|
||||||
|
if positions and #positions > 0 then
|
||||||
|
local closestSpot
|
||||||
|
local closestDist = math.huge
|
||||||
|
for _, spot in pairs(positions) do -- Disposition sometimes returns points on roads, hence this filter.
|
||||||
|
if land.getSurfaceType(spot) == land.SurfaceType.LAND then
|
||||||
|
local dist = UTILS.VecDist2D(Position, spot)
|
||||||
|
if dist < closestDist then
|
||||||
|
closestDist = dist
|
||||||
|
closestSpot = spot
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if closestSpot then
|
||||||
|
if closestDist >= sRadius then
|
||||||
|
return closestSpot
|
||||||
|
else
|
||||||
|
return Position
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|||||||
@ -703,55 +703,56 @@ AIRBASE.SouthAtlantic={
|
|||||||
|
|
||||||
--- Airbases of the Sinai map:
|
--- Airbases of the Sinai map:
|
||||||
--
|
--
|
||||||
-- * AIRBASE.Sinai.Abu_Rudeis
|
-- * AIRBASE.SinaiMap.Abu_Rudeis
|
||||||
-- * AIRBASE.Sinai.Abu_Suwayr
|
-- * AIRBASE.SinaiMap.Abu_Suwayr
|
||||||
-- * AIRBASE.Sinai.Al_Bahr_al_Ahmar
|
-- * AIRBASE.SinaiMap.Al_Bahr_al_Ahmar
|
||||||
-- * AIRBASE.Sinai.Al_Ismailiyah
|
-- * AIRBASE.SinaiMap.Al_Ismailiyah
|
||||||
-- * AIRBASE.Sinai.Al_Khatatbah
|
-- * AIRBASE.SinaiMap.Al_Khatatbah
|
||||||
-- * AIRBASE.Sinai.Al_Mansurah
|
-- * AIRBASE.SinaiMap.Al_Mansurah
|
||||||
-- * AIRBASE.Sinai.Al_Rahmaniyah_Air_Base
|
-- * AIRBASE.SinaiMap.Al_Rahmaniyah_Air_Base
|
||||||
-- * AIRBASE.Sinai.As_Salihiyah
|
-- * AIRBASE.SinaiMap.As_Salihiyah
|
||||||
-- * AIRBASE.Sinai.AzZaqaziq
|
-- * AIRBASE.SinaiMap.AzZaqaziq
|
||||||
-- * AIRBASE.Sinai.Baluza
|
-- * AIRBASE.SinaiMap.Baluza
|
||||||
-- * AIRBASE.Sinai.Ben_Gurion
|
-- * AIRBASE.SinaiMap.Ben_Gurion
|
||||||
-- * AIRBASE.Sinai.Beni_Suef
|
-- * AIRBASE.SinaiMap.Beni_Suef
|
||||||
-- * AIRBASE.Sinai.Bilbeis_Air_Base
|
-- * AIRBASE.SinaiMap.Bilbeis_Air_Base
|
||||||
-- * AIRBASE.Sinai.Bir_Hasanah
|
-- * AIRBASE.SinaiMap.Bir_Hasanah
|
||||||
-- * AIRBASE.Sinai.Birma_Air_Base
|
-- * AIRBASE.SinaiMap.Birma_Air_Base
|
||||||
-- * AIRBASE.Sinai.Borg_El_Arab_International_Airport
|
-- * AIRBASE.SinaiMap.Borg_El_Arab_International_Airport
|
||||||
-- * AIRBASE.Sinai.Cairo_International_Airport
|
-- * AIRBASE.SinaiMap.Cairo_International_Airport
|
||||||
-- * AIRBASE.Sinai.Cairo_West
|
-- * AIRBASE.SinaiMap.Cairo_West
|
||||||
-- * AIRBASE.Sinai.Difarsuwar_Airfield
|
-- * AIRBASE.SinaiMap.Damascus_Intl
|
||||||
-- * AIRBASE.Sinai.El_Arish
|
-- * AIRBASE.SinaiMap.Difarsuwar_Airfield
|
||||||
-- * AIRBASE.Sinai.El_Gora
|
-- * AIRBASE.SinaiMap.El_Arish
|
||||||
-- * AIRBASE.Sinai.El_Minya
|
-- * AIRBASE.SinaiMap.El_Gora
|
||||||
-- * AIRBASE.Sinai.Fayed
|
-- * AIRBASE.SinaiMap.El_Minya
|
||||||
-- * AIRBASE.Sinai.Gebel_El_Basur_Air_Base
|
-- * AIRBASE.SinaiMap.Fayed
|
||||||
-- * AIRBASE.Sinai.Hatzerim
|
-- * AIRBASE.SinaiMap.Gebel_El_Basur_Air_Base
|
||||||
-- * AIRBASE.Sinai.Hatzor
|
-- * AIRBASE.SinaiMap.Hatzerim
|
||||||
-- * AIRBASE.Sinai.Hurghada_International_Airport
|
-- * AIRBASE.SinaiMap.Hatzor
|
||||||
-- * AIRBASE.Sinai.Inshas_Airbase
|
-- * AIRBASE.SinaiMap.Hurghada_International_Airport
|
||||||
-- * AIRBASE.Sinai.Jiyanklis_Air_Base
|
-- * AIRBASE.SinaiMap.Inshas_Airbase
|
||||||
-- * AIRBASE.Sinai.Kedem
|
-- * AIRBASE.SinaiMap.Jiyanklis_Air_Base
|
||||||
-- * AIRBASE.Sinai.Kibrit_Air_Base
|
-- * AIRBASE.SinaiMap.Kedem
|
||||||
-- * AIRBASE.Sinai.Kom_Awshim
|
-- * AIRBASE.SinaiMap.Kibrit_Air_Base
|
||||||
-- * AIRBASE.Sinai.Melez
|
-- * AIRBASE.SinaiMap.Kom_Awshim
|
||||||
-- * AIRBASE.Sinai.Mezzeh_Air_Base
|
-- * AIRBASE.SinaiMap.Melez
|
||||||
-- * AIRBASE.Sinai.Nevatim
|
-- * AIRBASE.SinaiMap.Mezzeh_Air_Base
|
||||||
-- * AIRBASE.Sinai.Ovda
|
-- * AIRBASE.SinaiMap.Nevatim
|
||||||
-- * AIRBASE.Sinai.Palmachim
|
-- * AIRBASE.SinaiMap.Ovda
|
||||||
-- * AIRBASE.Sinai.Quwaysina
|
-- * AIRBASE.SinaiMap.Palmachim
|
||||||
-- * AIRBASE.Sinai.Rafic_Hariri_Intl
|
-- * AIRBASE.SinaiMap.Quwaysina
|
||||||
-- * AIRBASE.Sinai.Ramat_David
|
-- * AIRBASE.SinaiMap.Rafic_Hariri_Intl
|
||||||
-- * AIRBASE.Sinai.Ramon_Airbase
|
-- * AIRBASE.SinaiMap.Ramat_David
|
||||||
-- * AIRBASE.Sinai.Ramon_International_Airport
|
-- * AIRBASE.SinaiMap.Ramon_Airbase
|
||||||
-- * AIRBASE.Sinai.Sde_Dov
|
-- * AIRBASE.SinaiMap.Ramon_International_Airport
|
||||||
-- * AIRBASE.Sinai.Sharm_El_Sheikh_International_Airport
|
-- * AIRBASE.SinaiMap.Sde_Dov
|
||||||
-- * AIRBASE.Sinai.St_Catherine
|
-- * AIRBASE.SinaiMap.Sharm_El_Sheikh_International_Airport
|
||||||
-- * AIRBASE.Sinai.Tabuk
|
-- * AIRBASE.SinaiMap.St_Catherine
|
||||||
-- * AIRBASE.Sinai.Tel_Nof
|
-- * AIRBASE.SinaiMap.Tabuk
|
||||||
-- * AIRBASE.Sinai.Wadi_Abu_Rish
|
-- * AIRBASE.SinaiMap.Tel_Nof
|
||||||
-- * AIRBASE.Sinai.Wadi_al_Jandali
|
-- * AIRBASE.SinaiMap.Wadi_Abu_Rish
|
||||||
|
-- * AIRBASE.SinaiMap.Wadi_al_Jandali
|
||||||
--
|
--
|
||||||
-- @field Sinai
|
-- @field Sinai
|
||||||
AIRBASE.Sinai = {
|
AIRBASE.Sinai = {
|
||||||
@ -773,6 +774,7 @@ AIRBASE.Sinai = {
|
|||||||
["Borg_El_Arab_International_Airport"] = "Borg El Arab International Airport",
|
["Borg_El_Arab_International_Airport"] = "Borg El Arab International Airport",
|
||||||
["Cairo_International_Airport"] = "Cairo International Airport",
|
["Cairo_International_Airport"] = "Cairo International Airport",
|
||||||
["Cairo_West"] = "Cairo West",
|
["Cairo_West"] = "Cairo West",
|
||||||
|
["Damascus_Intl"] = "Damascus Intl",
|
||||||
["Difarsuwar_Airfield"] = "Difarsuwar Airfield",
|
["Difarsuwar_Airfield"] = "Difarsuwar Airfield",
|
||||||
["El_Arish"] = "El Arish",
|
["El_Arish"] = "El Arish",
|
||||||
["El_Gora"] = "El Gora",
|
["El_Gora"] = "El Gora",
|
||||||
@ -931,37 +933,51 @@ AIRBASE.Afghanistan = {
|
|||||||
|
|
||||||
--- Airbases of the Iraq map
|
--- Airbases of the Iraq map
|
||||||
--
|
--
|
||||||
-- * AIRBASE.Iraq.Baghdad_International_Airport
|
|
||||||
-- * AIRBASE.Iraq.Sulaimaniyah_International_Airport
|
|
||||||
-- * AIRBASE.Iraq.Al_Sahra_Airport
|
|
||||||
-- * AIRBASE.Iraq.Erbil_International_Airpor
|
|
||||||
-- * AIRBASE.Iraq.Al_Taji_Airport
|
|
||||||
-- * AIRBASE.Iraq.Al_Asad_Airbase
|
-- * AIRBASE.Iraq.Al_Asad_Airbase
|
||||||
|
-- * AIRBASE.Iraq.Al_Kut_Airbase
|
||||||
|
-- * AIRBASE.Iraq.Al_Sahra_Airport
|
||||||
-- * AIRBASE.Iraq.Al_Salam_Airbase
|
-- * AIRBASE.Iraq.Al_Salam_Airbase
|
||||||
-- * AIRBASE.Iraq.Balad_Airbase
|
-- * AIRBASE.Iraq.Al_Taji_Airport
|
||||||
-- * AIRBASE.Iraq.Kirkuk_International_Airport
|
|
||||||
-- * AIRBASE.Iraq.Bashur_Airport
|
|
||||||
-- * AIRBASE.Iraq.Al_Taquddum_Airport
|
-- * AIRBASE.Iraq.Al_Taquddum_Airport
|
||||||
-- * AIRBASE.Iraq.Qayyarah_Airfield_West
|
-- * AIRBASE.Iraq.Baghdad_International_Airport
|
||||||
|
-- * AIRBASE.Iraq.Balad_Airbase
|
||||||
|
-- * AIRBASE.Iraq.Bashur_Airport
|
||||||
|
-- * AIRBASE.Iraq.Erbil_International_Airport
|
||||||
|
-- * AIRBASE.Iraq.Sulaimaniyah_International_Airport
|
||||||
|
-- * AIRBASE.Iraq.H2_Airbase
|
||||||
|
-- * AIRBASE.Iraq.H3_Main_Airbase
|
||||||
|
-- * AIRBASE.Iraq.H3_Northwest_Airbase
|
||||||
|
-- * AIRBASE.Iraq.H3_Southwest_Airbase
|
||||||
-- * AIRBASE.Iraq.K1_Base
|
-- * AIRBASE.Iraq.K1_Base
|
||||||
|
-- * AIRBASE.Iraq.Kirkuk_International_Airport
|
||||||
|
-- * AIRBASE.Iraq.Mosul_International_Airport
|
||||||
|
-- * AIRBASE.Iraq.Qayyarah_Airfield_West
|
||||||
|
-- * AIRBASE.Iraq.Sulaimaniyah_International_Airport
|
||||||
--
|
--
|
||||||
-- @field Iraq
|
-- @field Iraq
|
||||||
AIRBASE.Iraq = {
|
AIRBASE.Iraq = {
|
||||||
["Baghdad_International_Airport"] = "Baghdad International Airport",
|
|
||||||
["Sulaimaniyah_International_Airport"] = "Sulaimaniyah International Airport",
|
|
||||||
["Al_Sahra_Airport"] = "Al-Sahra Airport",
|
|
||||||
["Erbil_International_Airport"] = "Erbil International Airport",
|
|
||||||
["Al_Taji_Airport"] = "Al-Taji Airport",
|
|
||||||
["Al_Asad_Airbase"] = "Al-Asad Airbase",
|
["Al_Asad_Airbase"] = "Al-Asad Airbase",
|
||||||
|
["Al_Kut_Airport"] = "Al-Kut Airport",
|
||||||
|
["Al_Sahra_Airport"] = "Al-Sahra Airport",
|
||||||
["Al_Salam_Airbase"] = "Al-Salam Airbase",
|
["Al_Salam_Airbase"] = "Al-Salam Airbase",
|
||||||
["Balad_Airbase"] = "Balad Airbase",
|
["Al_Taji_Airport"] = "Al-Taji Airport",
|
||||||
["Kirkuk_International_Airport"] = "Kirkuk International Airport",
|
|
||||||
["Bashur_Airport"] = "Bashur Airport",
|
|
||||||
["Al_Taquddum_Airport"] = "Al-Taquddum Airport",
|
["Al_Taquddum_Airport"] = "Al-Taquddum Airport",
|
||||||
["Qayyarah_Airfield_West"] = "Qayyarah Airfield West",
|
["Baghdad_International_Airport"] = "Baghdad International Airport",
|
||||||
|
["Balad_Airbase"] = "Balad Airbase",
|
||||||
|
["Bashur_Airport"] = "Bashur Airport",
|
||||||
|
["Erbil_International_Airport"] = "Erbil International Airport",
|
||||||
|
["H2_Airbase"] = "H-2 Airbase",
|
||||||
|
["H3_Main_Airbase"] = "H-3 Main Airbase",
|
||||||
|
["H3_Northwest_Airbase"] = "H-3 Northwest Airbase",
|
||||||
|
["H3_Southwest_Airbase"] = "H-3 Southwest Airbase",
|
||||||
["K1_Base"] = "K1 Base",
|
["K1_Base"] = "K1 Base",
|
||||||
|
["Kirkuk_International_Airport"] = "Kirkuk International Airport",
|
||||||
|
["Mosul_International_Airport"] = "Mosul International Airport",
|
||||||
|
["Qayyarah_Airfield_West"] = "Qayyarah Airfield West",
|
||||||
|
["Sulaimaniyah_International_Airport"] = "Sulaimaniyah International Airport",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
--- Airbases of the Germany Cold War map
|
--- Airbases of the Germany Cold War map
|
||||||
-- * AIRBASE.GermanyCW.Airracing_Frankfurt
|
-- * AIRBASE.GermanyCW.Airracing_Frankfurt
|
||||||
-- * AIRBASE.GermanyCW.Airracing_Frankfurt
|
-- * AIRBASE.GermanyCW.Airracing_Frankfurt
|
||||||
|
|||||||
@ -231,6 +231,7 @@ GROUP.Attribute = {
|
|||||||
GROUND_AAA="Ground_AAA",
|
GROUND_AAA="Ground_AAA",
|
||||||
GROUND_SAM="Ground_SAM",
|
GROUND_SAM="Ground_SAM",
|
||||||
GROUND_SHORAD="Ground_SHORAD",
|
GROUND_SHORAD="Ground_SHORAD",
|
||||||
|
GROUND_BALLISTICMISSILE="Ground_BallisticMissile",
|
||||||
GROUND_OTHER="Ground_OtherGround",
|
GROUND_OTHER="Ground_OtherGround",
|
||||||
NAVAL_AIRCRAFTCARRIER="Naval_AircraftCarrier",
|
NAVAL_AIRCRAFTCARRIER="Naval_AircraftCarrier",
|
||||||
NAVAL_WARSHIP="Naval_WarShip",
|
NAVAL_WARSHIP="Naval_WarShip",
|
||||||
@ -2231,6 +2232,10 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
|
|
||||||
--UTILS.PrintTableToLog(Template)
|
--UTILS.PrintTableToLog(Template)
|
||||||
|
|
||||||
|
if self.ValidateAndRepositionGroundUnits then
|
||||||
|
UTILS.ValidateAndRepositionGroundUnits(Template.units)
|
||||||
|
end
|
||||||
|
|
||||||
-- Spawn new group.
|
-- Spawn new group.
|
||||||
self:ScheduleOnce(0.1,_DATABASE.Spawn,_DATABASE,Template)
|
self:ScheduleOnce(0.1,_DATABASE.Spawn,_DATABASE,Template)
|
||||||
--_DATABASE:Spawn(Template)
|
--_DATABASE:Spawn(Template)
|
||||||
@ -2639,6 +2644,8 @@ function GROUP:GetAttribute()
|
|||||||
local artillery=self:HasAttribute("Artillery")
|
local artillery=self:HasAttribute("Artillery")
|
||||||
local tank=self:HasAttribute("Old Tanks") or self:HasAttribute("Modern Tanks") or self:HasAttribute("Tanks")
|
local tank=self:HasAttribute("Old Tanks") or self:HasAttribute("Modern Tanks") or self:HasAttribute("Tanks")
|
||||||
local aaa=self:HasAttribute("AAA") and (not self:HasAttribute("SAM elements"))
|
local aaa=self:HasAttribute("AAA") and (not self:HasAttribute("SAM elements"))
|
||||||
|
local ballisticMissile=artillery and self:HasAttribute("SS_missile")
|
||||||
|
local shorad=self:HasAttribute("SR SAM")
|
||||||
local ewr=self:HasAttribute("EWR")
|
local ewr=self:HasAttribute("EWR")
|
||||||
local ifv=self:HasAttribute("IFV")
|
local ifv=self:HasAttribute("IFV")
|
||||||
local sam=self:HasAttribute("SAM elements") or self:HasAttribute("Optical Tracker")
|
local sam=self:HasAttribute("SAM elements") or self:HasAttribute("Optical Tracker")
|
||||||
@ -2680,6 +2687,8 @@ function GROUP:GetAttribute()
|
|||||||
attribute=GROUP.Attribute.GROUND_SAM
|
attribute=GROUP.Attribute.GROUND_SAM
|
||||||
elseif aaa then
|
elseif aaa then
|
||||||
attribute=GROUP.Attribute.GROUND_AAA
|
attribute=GROUP.Attribute.GROUND_AAA
|
||||||
|
elseif artillery and ballisticMissile then
|
||||||
|
attribute=GROUP.Attribute.GROUND_BALLISTICMISSILE
|
||||||
elseif artillery then
|
elseif artillery then
|
||||||
attribute=GROUP.Attribute.GROUND_ARTILLERY
|
attribute=GROUP.Attribute.GROUND_ARTILLERY
|
||||||
elseif tank then
|
elseif tank then
|
||||||
@ -3192,3 +3201,60 @@ function GROUP:IsAAA()
|
|||||||
end
|
end
|
||||||
return isAAA
|
return isAAA
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- This function uses Disposition and other fallback logic to find better ground positions for ground units.
|
||||||
|
--- NOTE: This is not a spawn randomizer.
|
||||||
|
--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table.
|
||||||
|
--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit.
|
||||||
|
--- Uses UTILS.ValidateAndRepositionGroundUnits.
|
||||||
|
-- @param #GROUP self
|
||||||
|
-- @param #boolean Enabled Enable/disable the feature.
|
||||||
|
function GROUP:SetValidateAndRepositionGroundUnits(Enabled)
|
||||||
|
self.ValidateAndRepositionGroundUnits = Enabled
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Get the bounding box of the group combining UNIT:GetBoundingBox() units.
|
||||||
|
-- @param #GROUP self
|
||||||
|
-- @return DCS#Box3 The bounding box of the GROUP.
|
||||||
|
-- @return #nil The GROUP does not have any alive units.
|
||||||
|
function GROUP:GetBoundingBox()
|
||||||
|
local bbox = { min = { x = math.huge, y = math.huge, z = math.huge },
|
||||||
|
max = { x = -math.huge, y = -math.huge, z = -math.huge }
|
||||||
|
}
|
||||||
|
|
||||||
|
local Units = self:GetUnits() or {}
|
||||||
|
if #Units == 0 then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, unit in pairs(Units) do
|
||||||
|
if unit and unit:IsAlive() then
|
||||||
|
local ubox = unit:GetBoundingBox()
|
||||||
|
|
||||||
|
if ubox then
|
||||||
|
if ubox.min.x < bbox.min.x then
|
||||||
|
bbox.min.x = ubox.min.x
|
||||||
|
end
|
||||||
|
if ubox.min.y < bbox.min.y then
|
||||||
|
bbox.min.y = ubox.min.y
|
||||||
|
end
|
||||||
|
if ubox.min.z < bbox.min.z then
|
||||||
|
bbox.min.z = ubox.min.z
|
||||||
|
end
|
||||||
|
|
||||||
|
if ubox.max.x > bbox.max.x then
|
||||||
|
bbox.max.x = ubox.max.x
|
||||||
|
end
|
||||||
|
if ubox.max.y > bbox.max.y then
|
||||||
|
bbox.max.y = ubox.max.y
|
||||||
|
end
|
||||||
|
if ubox.max.z > bbox.max.z then
|
||||||
|
bbox.max.z = ubox.max.z
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return bbox
|
||||||
|
end
|
||||||
|
|||||||
@ -753,7 +753,7 @@ function STORAGE:LoadFromFile(Path,Filename)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:E("File for Liquids could not be found: "..tostring(Path).."\\"..tostring(Filename"_Liquids.csv"))
|
self:E("File for Liquids could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Liquids.csv")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -773,7 +773,7 @@ function STORAGE:LoadFromFile(Path,Filename)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:E("File for Aircraft could not be found: "..tostring(Path).."\\"..tostring(Filename"_Aircraft.csv"))
|
self:E("File for Aircraft could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Aircraft.csv")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -805,7 +805,7 @@ function STORAGE:LoadFromFile(Path,Filename)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:E("File for Weapons could not be found: "..tostring(Path).."\\"..tostring(Filename"_Weapons.csv"))
|
self:E("File for Weapons could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Weapons.csv")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -377,6 +377,10 @@ function UNIT:ReSpawnAt(Coordinate, Heading)
|
|||||||
|
|
||||||
--self:T( SpawnGroupTemplate )
|
--self:T( SpawnGroupTemplate )
|
||||||
|
|
||||||
|
if self.ValidateAndRepositionGroundUnits then
|
||||||
|
UTILS.ValidateAndRepositionGroundUnits(SpawnGroupTemplate.units)
|
||||||
|
end
|
||||||
|
|
||||||
_DATABASE:Spawn(SpawnGroupTemplate)
|
_DATABASE:Spawn(SpawnGroupTemplate)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1938,3 +1942,14 @@ end
|
|||||||
function UNIT:SetCarrierIlluminationMode(Mode)
|
function UNIT:SetCarrierIlluminationMode(Mode)
|
||||||
UTILS.SetCarrierIlluminationMode(self:GetID(), Mode)
|
UTILS.SetCarrierIlluminationMode(self:GetID(), Mode)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- This function uses Disposition and other fallback logic to find better ground positions for ground units.
|
||||||
|
--- NOTE: This is not a spawn randomizer.
|
||||||
|
--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table.
|
||||||
|
--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit.
|
||||||
|
--- Uses UTILS.ValidateAndRepositionGroundUnits.
|
||||||
|
-- @param #UNIT self
|
||||||
|
-- @param #boolean Enabled Enable/disable the feature.
|
||||||
|
function UNIT:SetValidateAndRepositionGroundUnits(Enabled)
|
||||||
|
self.ValidateAndRepositionGroundUnits = Enabled
|
||||||
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user