mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-13 17:31:41 +00:00
Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b69c197cb | |||
| 295e4500c9 | |||
| 51e12c8aba | |||
| 8bc5c3e568 | |||
| 28a12c6eb3 | |||
| 490c798848 | |||
| c7c1e1218a | |||
| e64e4ae2ae | |||
| 4553acc7f4 | |||
| fc2ea59081 | |||
| dfe4db25ae | |||
| f66c77b027 | |||
| c494bcfed1 | |||
| de3dc95c92 | |||
| d9a6f5daaf | |||
| 6ae155d11b | |||
| 27fa920a8f | |||
| cf65cbf8fc | |||
| 2f229c1d8c | |||
| 847d1e1492 | |||
| 7e07f2b4ea | |||
| d214d115c6 | |||
| fc1059c5d6 | |||
| 14345c3be0 | |||
| 6e09ea7089 | |||
| e0a5727ac5 | |||
| 7587119843 | |||
| a5880b89c1 | |||
| b33890ff03 | |||
| 1be2c92a5c | |||
| 4c8a17fe57 | |||
| 64dea17982 | |||
| b1f86c702d | |||
| 1a9540d0d4 | |||
| 4e3bf9969b | |||
| b31fb7ece3 | |||
| efa08c1280 | |||
| b1b8630d21 | |||
| 4ba81cb8bc | |||
| 36c0297344 | |||
| 6829d75464 | |||
| 4efd71e36a | |||
| fed9174bcb | |||
| 9963c737a3 | |||
| 73d3ed119c | |||
| 23112c9954 | |||
| 23c59d906f | |||
| cc62655ffe | |||
| 401e9d9e8e | |||
| 9b1a3e4894 | |||
| 6c32aa6044 | |||
| edf70e971c | |||
| 7c5af54473 | |||
| 2aa9b91ce5 | |||
| fdc19a6898 | |||
| d3ebf023fb | |||
| d40c559d2d |
@@ -278,7 +278,6 @@ EVENTS = {
|
|||||||
SimulationUnfreeze = world.event.S_EVENT_SIMULATION_UNFREEZE or -1,
|
SimulationUnfreeze = world.event.S_EVENT_SIMULATION_UNFREEZE or -1,
|
||||||
HumanAircraftRepairStart = world.event.S_EVENT_HUMAN_AIRCRAFT_REPAIR_START or -1,
|
HumanAircraftRepairStart = world.event.S_EVENT_HUMAN_AIRCRAFT_REPAIR_START or -1,
|
||||||
HumanAircraftRepairFinish = world.event.S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH or -1,
|
HumanAircraftRepairFinish = world.event.S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH or -1,
|
||||||
GroupChangeOption = world.event.S_EVENT_GROUP_CHANGE_OPTION or -1,
|
|
||||||
-- dynamic cargo
|
-- dynamic cargo
|
||||||
NewDynamicCargo = world.event.S_EVENT_NEW_DYNAMIC_CARGO or -1,
|
NewDynamicCargo = world.event.S_EVENT_NEW_DYNAMIC_CARGO or -1,
|
||||||
DynamicCargoLoaded = world.event.S_EVENT_DYNAMIC_CARGO_LOADED or -1,
|
DynamicCargoLoaded = world.event.S_EVENT_DYNAMIC_CARGO_LOADED or -1,
|
||||||
@@ -292,25 +291,23 @@ EVENTS = {
|
|||||||
--
|
--
|
||||||
-- * A (Object.Category.)UNIT : A UNIT object type is involved in the Event.
|
-- * A (Object.Category.)UNIT : A UNIT object type is involved in the Event.
|
||||||
-- * A (Object.Category.)STATIC : A STATIC object type is involved in the Event.
|
-- * A (Object.Category.)STATIC : A STATIC object type is involved in the Event.
|
||||||
-- * A GROUP : A DCS Group object is involved in the Event.
|
|
||||||
--
|
--
|
||||||
-- @type EVENTDATA
|
-- @type EVENTDATA
|
||||||
-- @field #number id The identifier of the event.
|
-- @field #number id The identifier of the event.
|
||||||
--
|
--
|
||||||
-- @field DCS#Unit initiator (UNIT/STATIC/SCENERY/GROUP) The initiating @{DCS#Unit} or @{DCS#StaticObject}. For `S_EVENT_GROUP_CHANGE_OPTION`, this is a DCS Group.
|
-- @field DCS#Unit initiator (UNIT/STATIC/SCENERY) The initiating @{DCS#Unit} or @{DCS#StaticObject}.
|
||||||
-- @field DCS#Object.Category IniObjectCategory (UNIT/STATIC/SCENERY) The initiator object category ( Object.Category.UNIT or Object.Category.STATIC ).
|
-- @field DCS#Object.Category IniObjectCategory (UNIT/STATIC/SCENERY) The initiator object category ( Object.Category.UNIT or Object.Category.STATIC ).
|
||||||
-- @field DCS#Unit IniDCSUnit (UNIT/STATIC) The initiating @{DCS#Unit} or @{DCS#StaticObject}.
|
-- @field DCS#Unit IniDCSUnit (UNIT/STATIC) The initiating @{DCS#Unit} or @{DCS#StaticObject}.
|
||||||
-- @field #string IniDCSUnitName (UNIT/STATIC) The initiating Unit name.
|
-- @field #string IniDCSUnitName (UNIT/STATIC) The initiating Unit name.
|
||||||
-- @field Wrapper.Unit#UNIT IniUnit (UNIT/STATIC) The initiating MOOSE wrapper @{Wrapper.Unit#UNIT} of the initiator Unit object.
|
-- @field Wrapper.Unit#UNIT IniUnit (UNIT/STATIC) The initiating MOOSE wrapper @{Wrapper.Unit#UNIT} of the initiator Unit object.
|
||||||
-- @field #string IniUnitName (UNIT/STATIC) The initiating UNIT name (same as IniDCSUnitName).
|
-- @field #string IniUnitName (UNIT/STATIC) The initiating UNIT name (same as IniDCSUnitName).
|
||||||
-- @field DCS#Group IniDCSGroup (UNIT/GROUP) The initiating @{DCS#Group}.
|
-- @field DCS#Group IniDCSGroup (UNIT) The initiating {DCSGroup#Group}.
|
||||||
-- @field #string IniDCSGroupName (UNIT/GROUP) The initiating Group name.
|
-- @field #string IniDCSGroupName (UNIT) The initiating Group name.
|
||||||
-- @field Wrapper.Group#GROUP IniGroup (UNIT/GROUP) The initiating MOOSE wrapper @{Wrapper.Group#GROUP} of the initiator Group object.
|
-- @field Wrapper.Group#GROUP IniGroup (UNIT) The initiating MOOSE wrapper @{Wrapper.Group#GROUP} of the initiator Group object.
|
||||||
-- @field #string IniGroupName (UNIT/GROUP) The initiating GROUP name (same as IniDCSGroupName).
|
-- @field #string IniGroupName UNIT) The initiating GROUP name (same as IniDCSGroupName).
|
||||||
-- @field DCS#Group.Category IniGroupCategory (GROUP) The category of the initiating group.
|
|
||||||
-- @field #string IniPlayerName (UNIT) The name of the initiating player in case the Unit is a client or player slot.
|
-- @field #string IniPlayerName (UNIT) The name of the initiating player in case the Unit is a client or player slot.
|
||||||
-- @field #string IniPlayerUCID (UNIT) The UCID of the initiating player in case the Unit is a client or player slot and on a multi-player server.
|
-- @field #string IniPlayerUCID (UNIT) The UCID of the initiating player in case the Unit is a client or player slot and on a multi-player server.
|
||||||
-- @field DCS#coalition.side IniCoalition (UNIT/GROUP) The coalition of the initiator.
|
-- @field DCS#coalition.side IniCoalition (UNIT) The coalition of the initiator.
|
||||||
-- @field DCS#Unit.Category IniCategory (UNIT) The category of the initiator.
|
-- @field DCS#Unit.Category IniCategory (UNIT) The category of the initiator.
|
||||||
-- @field #string IniTypeName (UNIT) The type name of the initiator.
|
-- @field #string IniTypeName (UNIT) The type name of the initiator.
|
||||||
--
|
--
|
||||||
@@ -737,12 +734,6 @@ local _EVENTMETA = {
|
|||||||
Side = "I",
|
Side = "I",
|
||||||
Event = "OnEventHumanAircraftRepairFinish",
|
Event = "OnEventHumanAircraftRepairFinish",
|
||||||
Text = "S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH"
|
Text = "S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH"
|
||||||
},
|
|
||||||
[EVENTS.GroupChangeOption] = {
|
|
||||||
Order = 1,
|
|
||||||
Side = "I",
|
|
||||||
Event = "OnEventGroupChangeOption",
|
|
||||||
Text = "S_EVENT_GROUP_CHANGE_OPTION"
|
|
||||||
},
|
},
|
||||||
-- dynamic cargo
|
-- dynamic cargo
|
||||||
[EVENTS.NewDynamicCargo] = {
|
[EVENTS.NewDynamicCargo] = {
|
||||||
@@ -1243,16 +1234,7 @@ function EVENT:onEvent( Event )
|
|||||||
|
|
||||||
if Event.initiator then
|
if Event.initiator then
|
||||||
|
|
||||||
if Event.id == EVENTS.GroupChangeOption then
|
Event.IniObjectCategory = Object.getCategory(Event.initiator)
|
||||||
Event.IniDCSGroup = Event.initiator
|
|
||||||
Event.IniDCSGroupName = Group.getName(Event.initiator)
|
|
||||||
Event.IniGroupName = Event.IniDCSGroupName
|
|
||||||
Event.IniGroup = GROUP:FindByName(Event.IniDCSGroupName)
|
|
||||||
Event.IniCoalition = Group.getCoalition(Event.initiator)
|
|
||||||
Event.IniGroupCategory = Group.getCategory(Event.initiator)
|
|
||||||
else
|
|
||||||
Event.IniObjectCategory = Object.getCategory(Event.initiator)
|
|
||||||
end
|
|
||||||
|
|
||||||
if Event.IniObjectCategory == Object.Category.STATIC then
|
if Event.IniObjectCategory == Object.Category.STATIC then
|
||||||
---
|
---
|
||||||
@@ -1681,7 +1663,9 @@ function EVENT:onEvent( Event )
|
|||||||
self:T( { EventMeta.Text, Event } )
|
self:T( { EventMeta.Text, Event } )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:E(string.format("WARNING: Could not get EVENTMETA data for event ID=%d! Is this an unknown/new DCS event?", tostring(Event.id)))
|
if Event.id ~= 61 then --- TODO Event 61 is new, but seems to have no real data to be useable, something like option changed.
|
||||||
|
self:E(string.format("WARNING: Could not get EVENTMETA data for event ID=%d! Is this an unknown/new DCS event?", tostring(Event.id)))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Event = nil
|
Event = nil
|
||||||
|
|||||||
@@ -2043,35 +2043,31 @@ do
|
|||||||
-- @param #MANTIS self
|
-- @param #MANTIS self
|
||||||
-- @param #number height
|
-- @param #number height
|
||||||
-- @param Core.Point#COORDINATE SamCoordinate
|
-- @param Core.Point#COORDINATE SamCoordinate
|
||||||
|
-- @param #table contactSnapshot Contact facts captured once for the current check.
|
||||||
-- @return #table set
|
-- @return #table set
|
||||||
function MANTIS:_PreFilterHeight(height,SamCoordinate)
|
function MANTIS:_PreFilterHeight(height,SamCoordinate,contactSnapshot)
|
||||||
self:T(self.lid.."_PreFilterHeight")
|
self:T(self.lid.."_PreFilterHeight")
|
||||||
local set = {}
|
local set = {}
|
||||||
local dlink = self.Detection -- Ops.Intel#INTEL_DLINK
|
for _,contact in pairs(contactSnapshot) do
|
||||||
local detectedgroups = dlink:GetContactTable()
|
|
||||||
for _,_contact in pairs(detectedgroups) do
|
|
||||||
local contact = _contact -- Ops.Intel#INTEL.Contact
|
|
||||||
local grp = contact.group -- Wrapper.Group#GROUP
|
local grp = contact.group -- Wrapper.Group#GROUP
|
||||||
if grp:IsAlive() then
|
local coord = contact.coordinate
|
||||||
local coord = grp:GetCoordinate()
|
local dist = 0
|
||||||
local dist = 0
|
local include = true
|
||||||
local include = true
|
if contact.isGround then include = false end
|
||||||
if grp:IsGround() then include = false end
|
if contact.isShip then include = false end -- MANTIS is anti-air: surface contacts are not engageable targets
|
||||||
if grp:IsShip() then include = false end -- MANTIS is anti-air: surface contacts are not engageable targets
|
if contact.coalition == self.coalition then include = false end
|
||||||
if grp:GetCoalition() == self.coalition then include = false end
|
if coord and SamCoordinate and contact.isHelicopter then
|
||||||
if coord and SamCoordinate and grp:IsHelicopter() then
|
dist = coord:Get2DDistance(SamCoordinate) or 0
|
||||||
dist = coord:Get2DDistance(SamCoordinate) or 0
|
if dist > self.ShoradActDistance then include = false end -- we do not want long range shooting at helos
|
||||||
if dist > self.ShoradActDistance then include = false end -- we do not want long range shooting at helos
|
end
|
||||||
end
|
if self.debug then
|
||||||
if self.debug then
|
local text = "Looking at Group: "..grp:GetName() or "N/A"
|
||||||
local text = "Looking at Group: "..grp:GetName() or "N/A"
|
text = text .. " Include = "..tostring(include)
|
||||||
text = text .. " Include = "..tostring(include)
|
MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.verbose):ToLog()
|
||||||
MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.verbose):ToLog()
|
end
|
||||||
end
|
local grpalt = contact.height
|
||||||
local grpalt = grp:GetHeight(true)
|
if grpalt < height and grpalt > 10 and include == true then
|
||||||
if grpalt < height and grpalt > 10 and include == true then
|
table.insert(set,coord)
|
||||||
table.insert(set,coord)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return set
|
return set
|
||||||
@@ -2084,16 +2080,17 @@ do
|
|||||||
-- @param #number radius Radius to check.
|
-- @param #number radius Radius to check.
|
||||||
-- @param #number height Height to check.
|
-- @param #number height Height to check.
|
||||||
-- @param #boolean dlink Data from DLINK.
|
-- @param #boolean dlink Data from DLINK.
|
||||||
|
-- @param #table contactSnapshot Contact facts captured once for the current check.
|
||||||
-- @return #boolean True if in any zone, else false
|
-- @return #boolean True if in any zone, else false
|
||||||
-- @return #number Distance Target distance in meters or zero when no object is in zone
|
-- @return #number Distance Target distance in meters or zero when no object is in zone
|
||||||
function MANTIS:_CheckObjectInZone(dectset, samcoordinate, radius, height, dlink)
|
function MANTIS:_CheckObjectInZone(dectset, samcoordinate, radius, height, dlink, contactSnapshot)
|
||||||
self:T(self.lid.."_CheckObjectInZone")
|
self:T(self.lid.."_CheckObjectInZone")
|
||||||
-- check if non of the coordinate is in the given defense zone
|
-- check if non of the coordinate is in the given defense zone
|
||||||
local rad = radius or self.checkradius
|
local rad = radius or self.checkradius
|
||||||
local set = dectset
|
local set = dectset
|
||||||
if dlink then
|
if dlink then
|
||||||
-- DEBUG
|
-- DEBUG
|
||||||
set = self:_PreFilterHeight(height,samcoordinate)
|
set = self:_PreFilterHeight(height,samcoordinate,contactSnapshot)
|
||||||
end
|
end
|
||||||
--self.friendlyset -- Core.Set#SET_GROUP
|
--self.friendlyset -- Core.Set#SET_GROUP
|
||||||
if self.checkforfriendlies == true and self.friendlyset == nil then
|
if self.checkforfriendlies == true and self.friendlyset == nil then
|
||||||
@@ -2732,7 +2729,8 @@ do
|
|||||||
group:OptionEngageRange(engagerange) --engagement will be 95% of firing range
|
group:OptionEngageRange(engagerange) --engagement will be 95% of firing range
|
||||||
if (group:IsGround() or group:IsShip()) and group:IsAlive() then
|
if (group:IsGround() or group:IsShip()) and group:IsAlive() then
|
||||||
local grpname = group:GetName()
|
local grpname = group:GetName()
|
||||||
local grpcoord = group:GetCoordinate()
|
local grpcoord = group:GetCoord()
|
||||||
|
if grpcoord then grpcoord.Heading = group:GetHeading() or 0 end
|
||||||
if group:IsShip() and self.NavalPerUnit
|
if group:IsShip() and self.NavalPerUnit
|
||||||
and self:_BuildNavalUnitEntries(group, grpname, SAM_Tbl, SAM_Tbl_lg, SAM_Tbl_md, SAM_Tbl_sh, SAM_Tbl_pt, SEAD_Grps) then
|
and self:_BuildNavalUnitEntries(group, grpname, SAM_Tbl, SAM_Tbl_lg, SAM_Tbl_md, SAM_Tbl_sh, SAM_Tbl_pt, SEAD_Grps) then
|
||||||
self:T(grpname.." handled as per-unit naval group")
|
self:T(grpname.." handled as per-unit naval group")
|
||||||
@@ -2944,10 +2942,11 @@ function MANTIS:SeadAllowSuppression(targetGroup, targetName, attackerGroup, wea
|
|||||||
-- @param #table detset Table of COORDINATES
|
-- @param #table detset Table of COORDINATES
|
||||||
-- @param #boolean dlink Using DLINK
|
-- @param #boolean dlink Using DLINK
|
||||||
-- @param #number limit of SAM sites to go active on a contact
|
-- @param #number limit of SAM sites to go active on a contact
|
||||||
|
-- @param #table contactSnapshot Contact facts captured once for the current check.
|
||||||
-- @return #number instatusred
|
-- @return #number instatusred
|
||||||
-- @return #number instatusgreen
|
-- @return #number instatusgreen
|
||||||
-- @return #number activeshorads
|
-- @return #number activeshorads
|
||||||
function MANTIS:_CheckLoop(samset,detset,dlink,limit)
|
function MANTIS:_CheckLoop(samset,detset,dlink,limit,contactSnapshot)
|
||||||
self:T(self.lid .. "CheckLoop " .. #detset .. " Coordinates")
|
self:T(self.lid .. "CheckLoop " .. #detset .. " Coordinates")
|
||||||
local switchedon = 0
|
local switchedon = 0
|
||||||
local instatusred = 0
|
local instatusred = 0
|
||||||
@@ -2976,7 +2975,7 @@ function MANTIS:SeadAllowSuppression(targetGroup, targetName, attackerGroup, wea
|
|||||||
local samalive = false
|
local samalive = false
|
||||||
if navalparent then samalive = (samunit ~= nil) and samunit:IsAlive() or false
|
if navalparent then samalive = (samunit ~= nil) and samunit:IsAlive() or false
|
||||||
elseif samgroup then samalive = samgroup:IsAlive() or false end
|
elseif samgroup then samalive = samgroup:IsAlive() or false end
|
||||||
local IsInZone, Distance = self:_CheckObjectInZone(detset, samcoordinate, radius, height, dlink)
|
local IsInZone, Distance = self:_CheckObjectInZone(detset, samcoordinate, radius, height, dlink, contactSnapshot)
|
||||||
-- Naval surface wake-up: quiet ships activate when enemy surface combatants
|
-- Naval surface wake-up: quiet ships activate when enemy surface combatants
|
||||||
-- close within the trigger radius. Jamming has precedence and holds them down.
|
-- close within the trigger radius. Jamming has precedence and holds them down.
|
||||||
if (not IsInZone) and self.NavalSurfaceWakeup and self._navalSAMs and self._navalSAMs[name]
|
if (not IsInZone) and self.NavalSurfaceWakeup and self._navalSAMs and self._navalSAMs[name]
|
||||||
@@ -3095,22 +3094,41 @@ function MANTIS:SeadAllowSuppression(targetGroup, targetName, attackerGroup, wea
|
|||||||
self:_RefreshSAMTable()
|
self:_RefreshSAMTable()
|
||||||
end
|
end
|
||||||
self.checkcounter = self.checkcounter + 1
|
self.checkcounter = self.checkcounter + 1
|
||||||
|
local contactSnapshot = nil
|
||||||
|
if dlink then
|
||||||
|
contactSnapshot = {}
|
||||||
|
for _,contact in pairs(detection:GetContactTable()) do
|
||||||
|
local grp = contact.group -- Wrapper.Group#GROUP
|
||||||
|
if grp:IsAlive() then
|
||||||
|
local coord = grp:GetCoord()
|
||||||
|
contactSnapshot[#contactSnapshot + 1] = {
|
||||||
|
group = grp,
|
||||||
|
coordinate = coord,
|
||||||
|
height = grp:GetHeight(true),
|
||||||
|
coalition = grp:GetCoalition(),
|
||||||
|
isGround = grp:IsGround(),
|
||||||
|
isShip = grp:IsShip(),
|
||||||
|
isHelicopter = grp:IsHelicopter(),
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
local instatusred = 0
|
local instatusred = 0
|
||||||
local instatusgreen = 0
|
local instatusgreen = 0
|
||||||
local activeshorads = 0
|
local activeshorads = 0
|
||||||
-- switch SAMs on/off if (n)one of the detected groups is inside their reach
|
-- switch SAMs on/off if (n)one of the detected groups is inside their reach
|
||||||
if self.automode then
|
if self.automode then
|
||||||
local samset = self.SAM_Table_Long -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self.SAM_Table_Long -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
local instatusredl, instatusgreenl, activeshoradsl = self:_CheckLoop(samset,detset,dlink,self.maxlongrange)
|
local instatusredl, instatusgreenl, activeshoradsl = self:_CheckLoop(samset,detset,dlink,self.maxlongrange,contactSnapshot)
|
||||||
local samset = self.SAM_Table_Medium -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self.SAM_Table_Medium -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
local instatusredm, instatusgreenm, activeshoradsm = self:_CheckLoop(samset,detset,dlink,self.maxmidrange)
|
local instatusredm, instatusgreenm, activeshoradsm = self:_CheckLoop(samset,detset,dlink,self.maxmidrange,contactSnapshot)
|
||||||
local samset = self.SAM_Table_Short -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self.SAM_Table_Short -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
local instatusreds, instatusgreens, activeshoradss = self:_CheckLoop(samset,detset,dlink,self.maxshortrange)
|
local instatusreds, instatusgreens, activeshoradss = self:_CheckLoop(samset,detset,dlink,self.maxshortrange,contactSnapshot)
|
||||||
local samset = self.SAM_Table_PointDef -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self.SAM_Table_PointDef -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
local instatusred, instatusgreen, activeshorads = self:_CheckLoop(samset,detset,dlink,self.maxpointdefrange)
|
local instatusred, instatusgreen, activeshorads = self:_CheckLoop(samset,detset,dlink,self.maxpointdefrange,contactSnapshot)
|
||||||
else
|
else
|
||||||
local samset = self:_GetSAMTable() -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
local samset = self:_GetSAMTable() -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||||
local instatusred, instatusgreen, activeshorads = self:_CheckLoop(samset,detset,dlink,self.maxclassic)
|
local instatusred, instatusgreen, activeshorads = self:_CheckLoop(samset,detset,dlink,self.maxclassic,contactSnapshot)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function GetReport()
|
local function GetReport()
|
||||||
@@ -4090,8 +4108,8 @@ function MANTIS:SeadAllowSuppression(targetGroup, targetName, attackerGroup, wea
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- [Internal] Override: _CheckLoop with jammer suppression.
|
--- [Internal] Override: _CheckLoop with jammer suppression.
|
||||||
function MANTIS:_CheckLoop(samset, detset, dlink, limit)
|
function MANTIS:_CheckLoop(samset, detset, dlink, limit, contactSnapshot)
|
||||||
local r, g, s = self:_CheckLoopOriginal(samset, detset, dlink, limit)
|
local r, g, s = self:_CheckLoopOriginal(samset, detset, dlink, limit, contactSnapshot)
|
||||||
if self._jammerEnabled and self._jammedSAMs then
|
if self._jammerEnabled and self._jammedSAMs then
|
||||||
for _, _data in pairs(samset) do
|
for _, _data in pairs(samset) do
|
||||||
local name = _data[1]
|
local name = _data[1]
|
||||||
@@ -4355,4 +4373,4 @@ end
|
|||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
-- MANTIS end
|
-- MANTIS end
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
|
|||||||
@@ -189,13 +189,14 @@ AIRWING = {
|
|||||||
|
|
||||||
--- AIRWING class version.
|
--- AIRWING class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
AIRWING.version="0.9.7"
|
AIRWING.version="0.9.8"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- ToDo list
|
-- ToDo list
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- TODO: Check that airbase has enough parking spots if a request is BIG.
|
-- TODO: Check that airbase has enough parking spots if a request is BIG.
|
||||||
|
-- DONE: Allow groupping parameter for CAP flights
|
||||||
-- DONE: Allow (moving) zones as base for patrol points.
|
-- DONE: Allow (moving) zones as base for patrol points.
|
||||||
-- DONE: Spawn in air ==> Needs WAREHOUSE update.
|
-- DONE: Spawn in air ==> Needs WAREHOUSE update.
|
||||||
-- DONE: Spawn hot.
|
-- DONE: Spawn hot.
|
||||||
@@ -233,6 +234,7 @@ function AIRWING:New(warehousename, airwingname)
|
|||||||
|
|
||||||
-- Defaults:
|
-- Defaults:
|
||||||
self.nflightsCAP=0
|
self.nflightsCAP=0
|
||||||
|
self.nCAPgrouping=1
|
||||||
self.nflightsAWACS=0
|
self.nflightsAWACS=0
|
||||||
self.nflightsRecon=0
|
self.nflightsRecon=0
|
||||||
self.nflightsTANKERboom=0
|
self.nflightsTANKERboom=0
|
||||||
@@ -740,9 +742,11 @@ end
|
|||||||
--- Set number of CAP flights constantly carried out.
|
--- Set number of CAP flights constantly carried out.
|
||||||
-- @param #AIRWING self
|
-- @param #AIRWING self
|
||||||
-- @param #number n (Optional) Number of flights. Default 1.
|
-- @param #number n (Optional) Number of flights. Default 1.
|
||||||
|
-- @param #number grouping (optional) Number of assets per flight. Default 1.
|
||||||
-- @return #AIRWING self
|
-- @return #AIRWING self
|
||||||
function AIRWING:SetNumberCAP(n)
|
function AIRWING:SetNumberCAP(n,grouping)
|
||||||
self.nflightsCAP=n or 1
|
self.nflightsCAP=n or 1
|
||||||
|
self.nCAPgrouping = grouping or 1
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1270,11 +1274,13 @@ function AIRWING:CheckCAP()
|
|||||||
if self.capOptionPatrolRaceTrack then
|
if self.capOptionPatrolRaceTrack then
|
||||||
|
|
||||||
missionCAP=AUFTRAG:NewPATROL_RACETRACK(patrol.coord,altitude,patrol.speed,patrol.heading,patrol.leg, self.capFormation)
|
missionCAP=AUFTRAG:NewPATROL_RACETRACK(patrol.coord,altitude,patrol.speed,patrol.heading,patrol.leg, self.capFormation)
|
||||||
|
missionCAP:SetRequiredAssets(self.nCAPgrouping,self.nCAPgrouping)
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
missionCAP=AUFTRAG:NewGCICAP(patrol.coord, altitude, patrol.speed, patrol.heading, patrol.leg)
|
missionCAP=AUFTRAG:NewGCICAP(patrol.coord, altitude, patrol.speed, patrol.heading, patrol.leg)
|
||||||
|
missionCAP:SetRequiredAssets(self.nCAPgrouping,self.nCAPgrouping)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.capOptionVaryStartTime then
|
if self.capOptionVaryStartTime then
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
-- **Supported Aircraft:**
|
-- **Supported Aircraft:**
|
||||||
--
|
--
|
||||||
-- * [F/A-18C Hornet Lot 20](https://forums.eagle.ru/forumdisplay.php?f=557) (Player & AI)
|
-- * [F/A-18C Hornet Lot 20](https://forums.eagle.ru/forumdisplay.php?f=557) (Player & AI)
|
||||||
-- * [F-14A/B/A Early Tomcat](https://forums.eagle.ru/forumdisplay.php?f=395) (Player & AI)
|
-- * [F-14A/B/B(U)/A Early Tomcat](https://forums.eagle.ru/forumdisplay.php?f=395) (Player & AI)
|
||||||
-- * [A-4E Skyhawk Community Mod](https://forums.eagle.ru/showthread.php?t=224989) (Player & AI)
|
-- * [A-4E Skyhawk Community Mod](https://forums.eagle.ru/showthread.php?t=224989) (Player & AI)
|
||||||
-- * [AV-8B N/A Harrier](https://forums.eagle.ru/forumdisplay.php?f=555) (Player & AI)
|
-- * [AV-8B N/A Harrier](https://forums.eagle.ru/forumdisplay.php?f=555) (Player & AI)
|
||||||
-- * [T-45C Goshawk](https://forum.dcs.world/topic/203816-vnao-t-45-goshawk/) (VNAO mod) (Player & AI)
|
-- * [T-45C Goshawk](https://forum.dcs.world/topic/203816-vnao-t-45-goshawk/) (VNAO mod) (Player & AI)
|
||||||
@@ -1276,6 +1276,7 @@ AIRBOSS = {
|
|||||||
-- @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.
|
||||||
|
-- @field #string F14BU F-14BU by Heatblur.
|
||||||
-- @field #string F14A_Early F-14A-135-GR-Early by Heatblur.
|
-- @field #string F14A_Early F-14A-135-GR-Early by Heatblur.
|
||||||
-- @field #string F14B F-14B by Heatblur.
|
-- @field #string F14B F-14B by Heatblur.
|
||||||
-- @field #string F14A_AI F-14A Tomcat (AI).
|
-- @field #string F14A_AI F-14A Tomcat (AI).
|
||||||
@@ -1297,6 +1298,7 @@ AIRBOSS.AircraftCarrier={
|
|||||||
F14A="F-14A-135-GR",
|
F14A="F-14A-135-GR",
|
||||||
F14A_Early="F-14A-135-GR-Early",
|
F14A_Early="F-14A-135-GR-Early",
|
||||||
F14B="F-14B",
|
F14B="F-14B",
|
||||||
|
F14BU="F-14BU",
|
||||||
F14A_AI="F-14A",
|
F14A_AI="F-14A",
|
||||||
FA18C="F/A-18C",
|
FA18C="F/A-18C",
|
||||||
T45C="T-45",
|
T45C="T-45",
|
||||||
@@ -5508,7 +5510,7 @@ function AIRBOSS:_GetAircraftAoA( playerData )
|
|||||||
local goshawk = playerData.actype == AIRBOSS.AircraftCarrier.T45C
|
local goshawk = playerData.actype == AIRBOSS.AircraftCarrier.T45C
|
||||||
local skyhawk = playerData.actype == AIRBOSS.AircraftCarrier.A4EC
|
local skyhawk = playerData.actype == AIRBOSS.AircraftCarrier.A4EC
|
||||||
local harrier = playerData.actype == AIRBOSS.AircraftCarrier.AV8B
|
local harrier = playerData.actype == AIRBOSS.AircraftCarrier.AV8B
|
||||||
local tomcat = playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B or playerData.actype == AIRBOSS.AircraftCarrier.F14A_Early
|
local tomcat = self:_IsTomcat( playerData.actype )
|
||||||
local corsair = playerData.actype == AIRBOSS.AircraftCarrier.CORSAIR or playerData.actype == AIRBOSS.AircraftCarrier.CORSAIR_CW
|
local corsair = playerData.actype == AIRBOSS.AircraftCarrier.CORSAIR or playerData.actype == AIRBOSS.AircraftCarrier.CORSAIR_CW
|
||||||
|
|
||||||
-- Table with AoA values.
|
-- Table with AoA values.
|
||||||
@@ -5571,6 +5573,18 @@ function AIRBOSS:_GetAircraftAoA( playerData )
|
|||||||
aoa.OnSpeedMin = 9.5
|
aoa.OnSpeedMin = 9.5
|
||||||
aoa.Fast = 8.0
|
aoa.Fast = 8.0
|
||||||
aoa.FAST = 7.5
|
aoa.FAST = 7.5
|
||||||
|
else
|
||||||
|
-- Unknown carrier-capable type: _IsCarrierAircraft() is enum-driven, so a type can
|
||||||
|
-- reach here with no AoA branch. Returning an empty table nil-propagates into
|
||||||
|
-- _GetAircraftParameters() and the AoA waveoff check. Fall back to Hornet values.
|
||||||
|
self:E( self.lid .. string.format( "ERROR: No AoA parameters defined for aircraft type %s! Falling back to F/A-18C values.", tostring( playerData.actype ) ) )
|
||||||
|
aoa.SLOW = 9.8
|
||||||
|
aoa.Slow = 9.3
|
||||||
|
aoa.OnSpeedMax = 8.8
|
||||||
|
aoa.OnSpeed = 8.1
|
||||||
|
aoa.OnSpeedMin = 7.4
|
||||||
|
aoa.Fast = 6.9
|
||||||
|
aoa.FAST = 6.3
|
||||||
end
|
end
|
||||||
|
|
||||||
return aoa
|
return aoa
|
||||||
@@ -5587,7 +5601,7 @@ function AIRBOSS:_AoAUnit2Deg( playerData, aoaunits )
|
|||||||
local degrees = aoaunits
|
local degrees = aoaunits
|
||||||
|
|
||||||
-- Check aircraft type of player.
|
-- Check aircraft type of player.
|
||||||
if playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B or playerData.actype == AIRBOSS.AircraftCarrier.F14A_Early then
|
if self:_IsTomcat( playerData.actype ) then
|
||||||
|
|
||||||
-------------
|
-------------
|
||||||
-- F-14A/B --
|
-- F-14A/B --
|
||||||
@@ -5630,7 +5644,7 @@ function AIRBOSS:_AoADeg2Units( playerData, degrees )
|
|||||||
local aoaunits = degrees
|
local aoaunits = degrees
|
||||||
|
|
||||||
-- Check aircraft type of player.
|
-- Check aircraft type of player.
|
||||||
if playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B or playerData.actype == AIRBOSS.AircraftCarrier.F14A_Early then
|
if self:_IsTomcat( playerData.actype ) then
|
||||||
|
|
||||||
-------------
|
-------------
|
||||||
-- F-14A/B --
|
-- F-14A/B --
|
||||||
@@ -5680,7 +5694,7 @@ function AIRBOSS:_GetAircraftParameters( playerData, step )
|
|||||||
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOF
|
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOF
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.GROWLER
|
or playerData.actype == AIRBOSS.AircraftCarrier.GROWLER
|
||||||
local skyhawk = playerData.actype == AIRBOSS.AircraftCarrier.A4EC
|
local skyhawk = playerData.actype == AIRBOSS.AircraftCarrier.A4EC
|
||||||
local tomcat = playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B
|
local tomcat = self:_IsTomcat( playerData.actype )
|
||||||
local harrier = playerData.actype == AIRBOSS.AircraftCarrier.AV8B
|
local harrier = playerData.actype == AIRBOSS.AircraftCarrier.AV8B
|
||||||
local goshawk = playerData.actype == AIRBOSS.AircraftCarrier.T45C
|
local goshawk = playerData.actype == AIRBOSS.AircraftCarrier.T45C
|
||||||
local corsair = playerData.actype == AIRBOSS.AircraftCarrier.CORSAIR or playerData.actype == AIRBOSS.AircraftCarrier.CORSAIR_CW
|
local corsair = playerData.actype == AIRBOSS.AircraftCarrier.CORSAIR or playerData.actype == AIRBOSS.AircraftCarrier.CORSAIR_CW
|
||||||
@@ -6613,9 +6627,7 @@ function AIRBOSS:_RefuelAI( flight )
|
|||||||
local refuelac=false
|
local refuelac=false
|
||||||
local actype=flight.group:GetTypeName()
|
local actype=flight.group:GetTypeName()
|
||||||
if actype==AIRBOSS.AircraftCarrier.AV8B or
|
if actype==AIRBOSS.AircraftCarrier.AV8B or
|
||||||
actype==AIRBOSS.AircraftCarrier.F14A or
|
self:_IsTomcat( actype, true ) or
|
||||||
actype==AIRBOSS.AircraftCarrier.F14B or
|
|
||||||
actype==AIRBOSS.AircraftCarrier.F14A_AI or
|
|
||||||
actype==AIRBOSS.AircraftCarrier.HORNET or
|
actype==AIRBOSS.AircraftCarrier.HORNET or
|
||||||
actype==AIRBOSS.AircraftCarrier.RHINOE or
|
actype==AIRBOSS.AircraftCarrier.RHINOE or
|
||||||
actype==AIRBOSS.AircraftCarrier.RHINOF or
|
actype==AIRBOSS.AircraftCarrier.RHINOF or
|
||||||
@@ -6725,7 +6737,7 @@ function AIRBOSS:_LandAI( flight )
|
|||||||
Speed = UTILS.KnotsToKmph( 200 )
|
Speed = UTILS.KnotsToKmph( 200 )
|
||||||
elseif flight.actype == AIRBOSS.AircraftCarrier.E2D or flight.actype == AIRBOSS.AircraftCarrier.C2A then
|
elseif flight.actype == AIRBOSS.AircraftCarrier.E2D or flight.actype == AIRBOSS.AircraftCarrier.C2A then
|
||||||
Speed = UTILS.KnotsToKmph( 150 )
|
Speed = UTILS.KnotsToKmph( 150 )
|
||||||
elseif flight.actype == AIRBOSS.AircraftCarrier.F14A_AI or flight.actype == AIRBOSS.AircraftCarrier.F14A or flight.actype == AIRBOSS.AircraftCarrier.F14B then
|
elseif self:_IsTomcat( flight.actype, true ) then
|
||||||
Speed = UTILS.KnotsToKmph( 175 )
|
Speed = UTILS.KnotsToKmph( 175 )
|
||||||
elseif flight.actype == AIRBOSS.AircraftCarrier.S3B or flight.actype == AIRBOSS.AircraftCarrier.S3BTANKER then
|
elseif flight.actype == AIRBOSS.AircraftCarrier.S3B or flight.actype == AIRBOSS.AircraftCarrier.S3BTANKER then
|
||||||
Speed = UTILS.KnotsToKmph( 140 )
|
Speed = UTILS.KnotsToKmph( 140 )
|
||||||
@@ -8200,7 +8212,7 @@ function AIRBOSS:_CheckPlayerStatus()
|
|||||||
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOE
|
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOE
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOF
|
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOF
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.GROWLER
|
or playerData.actype == AIRBOSS.AircraftCarrier.GROWLER
|
||||||
local tomcat = playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B
|
local tomcat = self:_IsTomcat( playerData.actype )
|
||||||
|
|
||||||
-- VNAO Edit - Added wrapped up call to LSO grading Hornet
|
-- VNAO Edit - Added wrapped up call to LSO grading Hornet
|
||||||
if playerData.step==AIRBOSS.PatternStep.WAKE and hornet then-- VNAO Edit - Added
|
if playerData.step==AIRBOSS.PatternStep.WAKE and hornet then-- VNAO Edit - Added
|
||||||
@@ -9455,7 +9467,7 @@ function AIRBOSS:_Initial( playerData )
|
|||||||
|
|
||||||
-- Hook down for students.
|
-- Hook down for students.
|
||||||
if playerData.difficulty == AIRBOSS.Difficulty.EASY and playerData.actype ~= AIRBOSS.AircraftCarrier.AV8B then
|
if playerData.difficulty == AIRBOSS.Difficulty.EASY and playerData.actype ~= AIRBOSS.AircraftCarrier.AV8B then
|
||||||
if playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B then
|
if self:_IsTomcat( playerData.actype ) then
|
||||||
hint = hint .. " - Hook down, SAS on, Wing Sweep 68°!"
|
hint = hint .. " - Hook down, SAS on, Wing Sweep 68°!"
|
||||||
else
|
else
|
||||||
hint = hint .. " - Hook down!"
|
hint = hint .. " - Hook down!"
|
||||||
@@ -9620,8 +9632,7 @@ function AIRBOSS:_DirtyUp( playerData )
|
|||||||
|
|
||||||
-- Radio call "Say/Fly needles". Delayed by 10/15 seconds.
|
-- Radio call "Say/Fly needles". Delayed by 10/15 seconds.
|
||||||
if playerData.actype == AIRBOSS.AircraftCarrier.HORNET
|
if playerData.actype == AIRBOSS.AircraftCarrier.HORNET
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.F14A
|
or self:_IsTomcat( playerData.actype )
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.F14B
|
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOE
|
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOE
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOF
|
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOF
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.GROWLER
|
or playerData.actype == AIRBOSS.AircraftCarrier.GROWLER
|
||||||
@@ -10399,7 +10410,7 @@ function AIRBOSS:_Groove( playerData )
|
|||||||
|
|
||||||
-- Wait until player passed the 0.75 NM distance.
|
-- Wait until player passed the 0.75 NM distance.
|
||||||
local _advice = true
|
local _advice = true
|
||||||
if playerData.TIG0 == nil and playerData.difficulty ~= AIRBOSS.Difficulty.EASY then -- rho>RXX
|
if (playerData.TIG0 == nil or playerData.TIG0 == 0) and playerData.difficulty ~= AIRBOSS.Difficulty.EASY then -- rho>RXX
|
||||||
_advice = false
|
_advice = false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -10815,7 +10826,7 @@ function AIRBOSS:_Trapped( playerData )
|
|||||||
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOF
|
or playerData.actype == AIRBOSS.AircraftCarrier.RHINOF
|
||||||
or playerData.actype == AIRBOSS.AircraftCarrier.GROWLER then
|
or playerData.actype == AIRBOSS.AircraftCarrier.GROWLER then
|
||||||
dcorr = 100
|
dcorr = 100
|
||||||
elseif playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B then
|
elseif self:_IsTomcat( playerData.actype ) then
|
||||||
-- TODO: Check Tomcat.
|
-- TODO: Check Tomcat.
|
||||||
dcorr = 100
|
dcorr = 100
|
||||||
elseif playerData.actype == AIRBOSS.AircraftCarrier.A4EC then
|
elseif playerData.actype == AIRBOSS.AircraftCarrier.A4EC then
|
||||||
@@ -11628,7 +11639,7 @@ function AIRBOSS:_AttitudeMonitor( playerData )
|
|||||||
|
|
||||||
local unitClient = Unit.getByName(unit:GetName()) -- VNAO Edit - Added
|
local unitClient = Unit.getByName(unit:GetName()) -- VNAO Edit - Added
|
||||||
local hornet = playerData.actype == AIRBOSS.AircraftCarrier.HORNET -- VNAO Edit - Added
|
local hornet = playerData.actype == AIRBOSS.AircraftCarrier.HORNET -- VNAO Edit - Added
|
||||||
local tomcat = playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B or playerData.actype == AIRBOSS.AircraftCarrier.F14A_Early -- VNAO Edit - Added
|
local tomcat = self:_IsTomcat( playerData.actype ) -- VNAO Edit - Added
|
||||||
|
|
||||||
if hornet then -- VNAO Edit - Added
|
if hornet then -- VNAO Edit - Added
|
||||||
local nozzlePosL = 0 -- VNAO Edit - Added
|
local nozzlePosL = 0 -- VNAO Edit - Added
|
||||||
@@ -11861,7 +11872,7 @@ function AIRBOSS:_NozzleArgumentLeft( unit ) -- VNAO Edit - Added
|
|||||||
else -- VNAO Edit - Added
|
else -- VNAO Edit - Added
|
||||||
nozzlePosL = 0 -- VNAO Edit - Added
|
nozzlePosL = 0 -- VNAO Edit - Added
|
||||||
end -- VNAO Edit - Added
|
end -- VNAO Edit - Added
|
||||||
elseif typeName == "F-14A-135-GR" or typeName == "F-14B" or typeName == "F-14A-135-GR-Early" then -- VNAO Edit - Added
|
elseif self:_IsTomcat( typeName ) then -- VNAO Edit - Added
|
||||||
nozzlePosL = unitClient:getDrawArgumentValue(434) -- VNAO Edit - Added
|
nozzlePosL = unitClient:getDrawArgumentValue(434) -- VNAO Edit - Added
|
||||||
end -- VNAO Edit - Added
|
end -- VNAO Edit - Added
|
||||||
|
|
||||||
@@ -11886,7 +11897,7 @@ function AIRBOSS:_NozzleArgumentRight( unit ) -- VNAO Edit - Added
|
|||||||
else -- VNAO Edit - Added
|
else -- VNAO Edit - Added
|
||||||
nozzlePosR = 0 -- VNAO Edit - Added
|
nozzlePosR = 0 -- VNAO Edit - Added
|
||||||
end -- VNAO Edit - Added
|
end -- VNAO Edit - Added
|
||||||
elseif typeName == "F-14A-135-GR" or typeName == "F-14B" or typeName == "F-14A-135-GR-Early" then -- VNAO Edit - Added
|
elseif self:_IsTomcat( typeName ) then -- VNAO Edit - Added
|
||||||
nozzlePosR = unitClient:getDrawArgumentValue(433) -- VNAO Edit - Added
|
nozzlePosR = unitClient:getDrawArgumentValue(433) -- VNAO Edit - Added
|
||||||
end -- VNAO Edit - Added
|
end -- VNAO Edit - Added
|
||||||
return nozzlePosR -- VNAO Edit - Added
|
return nozzlePosR -- VNAO Edit - Added
|
||||||
@@ -13149,7 +13160,7 @@ function AIRBOSS:_Flightdata2Text( playerData, groovestep )
|
|||||||
|
|
||||||
|
|
||||||
local hornet = playerData.actype == AIRBOSS.AircraftCarrier.HORNET-- VNAO Edit - Added
|
local hornet = playerData.actype == AIRBOSS.AircraftCarrier.HORNET-- VNAO Edit - Added
|
||||||
local tomcat = playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B-- VNAO Edit - Added
|
local tomcat = self:_IsTomcat( playerData.actype )-- VNAO Edit - Added
|
||||||
|
|
||||||
if hornet then-- VNAO Edit - Added
|
if hornet then-- VNAO Edit - Added
|
||||||
if Lnoz > 0.6 and Rnoz > 0.6 then -- VNAO Edit - Added check them both, it's possilbe there could be a single engine landing and one is in idle perhaps?
|
if Lnoz > 0.6 and Rnoz > 0.6 then -- VNAO Edit - Added check them both, it's possilbe there could be a single engine landing and one is in idle perhaps?
|
||||||
@@ -13665,7 +13676,7 @@ function AIRBOSS:_StepHint( playerData, step )
|
|||||||
|
|
||||||
-- Late break.
|
-- Late break.
|
||||||
if step == AIRBOSS.PatternStep.LATEBREAK then
|
if step == AIRBOSS.PatternStep.LATEBREAK then
|
||||||
if playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B then
|
if self:_IsTomcat( playerData.actype ) then
|
||||||
hint = hint .. "\nWing Sweep 20°, Gear DOWN < 280 KIAS."
|
hint = hint .. "\nWing Sweep 20°, Gear DOWN < 280 KIAS."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -13674,7 +13685,7 @@ function AIRBOSS:_StepHint( playerData, step )
|
|||||||
if step == AIRBOSS.PatternStep.ABEAM then
|
if step == AIRBOSS.PatternStep.ABEAM then
|
||||||
if playerData.actype == AIRBOSS.AircraftCarrier.AV8B then
|
if playerData.actype == AIRBOSS.AircraftCarrier.AV8B then
|
||||||
hint = hint .. "\nNozzles 50°-60°. Antiskid OFF. Lights OFF."
|
hint = hint .. "\nNozzles 50°-60°. Antiskid OFF. Lights OFF."
|
||||||
elseif playerData.actype == AIRBOSS.AircraftCarrier.F14A or playerData.actype == AIRBOSS.AircraftCarrier.F14B then
|
elseif self:_IsTomcat( playerData.actype ) then
|
||||||
hint = hint .. "\nSlats/Flaps EXTENDED < 225 KIAS. DLC SELECTED. Auto Throttle IF DESIRED."
|
hint = hint .. "\nSlats/Flaps EXTENDED < 225 KIAS. DLC SELECTED. Auto Throttle IF DESIRED."
|
||||||
else
|
else
|
||||||
hint = hint .. "\nDirty up! Gear DOWN, flaps DOWN. Check hook down."
|
hint = hint .. "\nDirty up! Gear DOWN, flaps DOWN. Check hook down."
|
||||||
@@ -15109,7 +15120,7 @@ function AIRBOSS:_GetACNickname( actype )
|
|||||||
nickname = "Hawkeye"
|
nickname = "Hawkeye"
|
||||||
elseif actype == AIRBOSS.AircraftCarrier.C2A then
|
elseif actype == AIRBOSS.AircraftCarrier.C2A then
|
||||||
nickname = "Greyhound"
|
nickname = "Greyhound"
|
||||||
elseif actype == AIRBOSS.AircraftCarrier.F14A_AI or actype == AIRBOSS.AircraftCarrier.F14A or actype == AIRBOSS.AircraftCarrier.F14B or actype == AIRBOSS.AircraftCarrier.F14A_Early then
|
elseif self:_IsTomcat( actype, true ) then
|
||||||
nickname = "Tomcat"
|
nickname = "Tomcat"
|
||||||
elseif actype == AIRBOSS.AircraftCarrier.FA18C or actype == AIRBOSS.AircraftCarrier.HORNET then
|
elseif actype == AIRBOSS.AircraftCarrier.FA18C or actype == AIRBOSS.AircraftCarrier.HORNET then
|
||||||
nickname = "Hornet"
|
nickname = "Hornet"
|
||||||
@@ -15246,6 +15257,29 @@ function AIRBOSS:_GetGoodBadScore( playerData )
|
|||||||
return lowscore, badscore
|
return lowscore, badscore
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Check whether an aircraft type name is any F-14 Tomcat variant.
|
||||||
|
-- Central predicate so that adding a new Tomcat variant only requires editing
|
||||||
|
-- this function and the AIRBOSS.AircraftCarrier enum.
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
-- @param #string actype Aircraft type name, e.g. from `unit:GetTypeName()` or `playerData.actype`.
|
||||||
|
-- @param #boolean IncludeAI If true, also match the AI-only F-14A (AIRBOSS.AircraftCarrier.F14A_AI).
|
||||||
|
-- @return #boolean If true, actype is an F-14 variant.
|
||||||
|
function AIRBOSS:_IsTomcat( actype, IncludeAI )
|
||||||
|
|
||||||
|
if actype == AIRBOSS.AircraftCarrier.F14A
|
||||||
|
or actype == AIRBOSS.AircraftCarrier.F14B
|
||||||
|
or actype == AIRBOSS.AircraftCarrier.F14BU
|
||||||
|
or actype == AIRBOSS.AircraftCarrier.F14A_Early then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
if IncludeAI and actype == AIRBOSS.AircraftCarrier.F14A_AI then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
--- Check if aircraft is capable of landing on this aircraft carrier.
|
--- Check if aircraft is capable of landing on this aircraft carrier.
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
-- @param Wrapper.Unit#UNIT unit Aircraft unit. (Will also work with groups as given parameter.)
|
-- @param Wrapper.Unit#UNIT unit Aircraft unit. (Will also work with groups as given parameter.)
|
||||||
@@ -19394,4 +19428,4 @@ function AIRBOSS:onafterLSOGrade(From, Event, To, playerData, grade)
|
|||||||
self.funkmanSocket:SendTable(result)
|
self.funkmanSocket:SendTable(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6466,7 +6466,13 @@ function AUFTRAG:GetDCSMissionTask(MissionGroup)
|
|||||||
-- ESCORT Mission --
|
-- ESCORT Mission --
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
local DCStask=CONTROLLABLE.TaskEscort(nil, self.engageTarget:GetObject(), self.escortVec3, nil, self.engageMaxDistance, self.engageTargetTypes)
|
local FollowGroup=self.engageTarget:GetObject()
|
||||||
|
local DCStask=nil
|
||||||
|
if next(self.engageTargetTypes)==nil then
|
||||||
|
DCStask=FollowGroup:TaskFollow(FollowGroup, self.escortVec3)
|
||||||
|
else
|
||||||
|
DCStask=CONTROLLABLE.TaskEscort(nil, FollowGroup, self.escortVec3, nil, self.engageMaxDistance, self.engageTargetTypes)
|
||||||
|
end
|
||||||
|
|
||||||
table.insert(DCStasks, DCStask)
|
table.insert(DCStasks, DCStask)
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ do
|
|||||||
-- my_ctld.placeCratesAhead = false -- place crates straight ahead of the helicopter, in a random way. If true, crates are more neatly sorted.
|
-- my_ctld.placeCratesAhead = false -- place crates straight ahead of the helicopter, in a random way. If true, crates are more neatly sorted.
|
||||||
-- my_ctld.nobuildinloadzones = true -- forbid players to build stuff in LOAD zones if set to `true`
|
-- my_ctld.nobuildinloadzones = true -- forbid players to build stuff in LOAD zones if set to `true`
|
||||||
-- my_ctld.movecratesbeforebuild = true -- crates must be moved once before they can be build. Set to false for direct builds.
|
-- my_ctld.movecratesbeforebuild = true -- crates must be moved once before they can be build. Set to false for direct builds.
|
||||||
|
-- my_ctld.useaircraftheadingforbuilds = false -- Matches the heading of the spawned groups from a crate build to the aircraft heading when starting the build. Default is false for template heading.
|
||||||
-- my_ctld.surfacetypes = {land.SurfaceType.LAND,land.SurfaceType.ROAD,land.SurfaceType.RUNWAY,land.SurfaceType.SHALLOW_WATER} -- surfaces for loading back objects.
|
-- my_ctld.surfacetypes = {land.SurfaceType.LAND,land.SurfaceType.ROAD,land.SurfaceType.RUNWAY,land.SurfaceType.SHALLOW_WATER} -- surfaces for loading back objects.
|
||||||
-- my_ctld.nobuildmenu = false -- if set to true effectively enforces to have engineers build/repair stuff for you.
|
-- my_ctld.nobuildmenu = false -- if set to true effectively enforces to have engineers build/repair stuff for you.
|
||||||
-- my_ctld.RadioSound = "beacon.ogg" -- -- this sound will be hearable if you tune in the beacon frequency. Add the sound file to your miz.
|
-- my_ctld.RadioSound = "beacon.ogg" -- -- this sound will be hearable if you tune in the beacon frequency. Add the sound file to your miz.
|
||||||
@@ -2037,7 +2038,7 @@ function CTLD:_C130DcAutoRegisterEntry(SetId, Cargo)
|
|||||||
|
|
||||||
local pos = Cargo:GetPositionable()
|
local pos = Cargo:GetPositionable()
|
||||||
local pname = pos and pos.GetName and pos:GetName() or nil
|
local pname = pos and pos.GetName and pos:GetName() or nil
|
||||||
local pcoord = pos and pos.GetCoordinate and pos:GetCoordinate() or nil
|
local pcoord = pos and pos.GetCoord and pos:GetCoord() or nil
|
||||||
local entryId = string.format("%s#%d", SetId, #setData.entries + 1)
|
local entryId = string.format("%s#%d", SetId, #setData.entries + 1)
|
||||||
local entry = {
|
local entry = {
|
||||||
id = entryId,
|
id = entryId,
|
||||||
@@ -2748,16 +2749,14 @@ function CTLD:_EventHandler(EventData)
|
|||||||
loaded = self.Loaded_Cargo[unitname] -- #CTLD.LoadedCargo
|
loaded = self.Loaded_Cargo[unitname] -- #CTLD.LoadedCargo
|
||||||
loaded.Cratesloaded = loaded.Cratesloaded - 1
|
loaded.Cratesloaded = loaded.Cratesloaded - 1
|
||||||
if loaded.Cratesloaded < 0 then loaded.Cratesloaded = 0 end
|
if loaded.Cratesloaded < 0 then loaded.Cratesloaded = 0 end
|
||||||
-- TODO zap cargo from list
|
|
||||||
local Loaded = {}
|
local Loaded = {}
|
||||||
for _,_item in pairs (loaded.Cargo or {}) do
|
for _,_item in pairs (loaded.Cargo or {}) do
|
||||||
self:T(self.lid.."UNLOAD checking: ".._item:GetName())
|
self:T(self.lid.."UNLOAD checking: ".._item:GetName())
|
||||||
self:T(self.lid.."UNLOAD state: ".. tostring(_item:WasDropped()))
|
self:T(self.lid.."UNLOAD state: ".. tostring(_item:WasDropped()))
|
||||||
if _item and _item:GetType() == CTLD_CARGO.Enum.GCLOADABLE and event.IniDynamicCargoName and event.IniDynamicCargoName ~= _item:GetName() and not _item:WasDropped() then
|
local unloadedItem = _item and _item:GetType() == CTLD_CARGO.Enum.GCLOADABLE and event.IniDynamicCargoName and event.IniDynamicCargoName == _item:GetName()
|
||||||
|
if not unloadedItem then
|
||||||
table.insert(Loaded,_item)
|
table.insert(Loaded,_item)
|
||||||
else
|
end
|
||||||
table.insert(Loaded,_item)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
loaded.Cargo = nil
|
loaded.Cargo = nil
|
||||||
loaded.Cargo = Loaded
|
loaded.Cargo = Loaded
|
||||||
@@ -3125,14 +3124,14 @@ end
|
|||||||
function CTLD:_FindRepairNearby(Group, Unit, Repairtype)
|
function CTLD:_FindRepairNearby(Group, Unit, Repairtype)
|
||||||
self:T(self.lid .. " _FindRepairNearby")
|
self:T(self.lid .. " _FindRepairNearby")
|
||||||
--self:T({Group:GetName(),Unit:GetName(),Repairtype})
|
--self:T({Group:GetName(),Unit:GetName(),Repairtype})
|
||||||
local unitcoord = Unit:GetCoordinate()
|
local unitcoord = Unit:GetCoord()
|
||||||
|
|
||||||
-- find nearest group of deployed groups
|
-- find nearest group of deployed groups
|
||||||
local nearestGroup = nil
|
local nearestGroup = nil
|
||||||
local nearestGroupIndex = -1
|
local nearestGroupIndex = -1
|
||||||
local nearestDistance = 10000
|
local nearestDistance = 10000
|
||||||
for k,v in pairs(self.DroppedTroops) do
|
for k,v in pairs(self.DroppedTroops) do
|
||||||
local distance = self:_GetDistance(v:GetCoordinate(),unitcoord)
|
local distance = self:_GetDistance(v:GetCoord(),unitcoord)
|
||||||
local unit = v:GetUnit(1) -- Wrapper.Unit#UNIT
|
local unit = v:GetUnit(1) -- Wrapper.Unit#UNIT
|
||||||
local desc = unit:GetDesc() or nil
|
local desc = unit:GetDesc() or nil
|
||||||
if distance < nearestDistance and distance ~= -1 and not desc.attributes.Infantry then
|
if distance < nearestDistance and distance ~= -1 and not desc.attributes.Infantry then
|
||||||
@@ -3277,7 +3276,7 @@ end
|
|||||||
local capabilities = self:_GetUnitCapabilities(Unit)
|
local capabilities = self:_GetUnitCapabilities(Unit)
|
||||||
local cantroops = capabilities.troops -- #boolean
|
local cantroops = capabilities.troops -- #boolean
|
||||||
local trooplimit = capabilities.trooplimit -- #number
|
local trooplimit = capabilities.trooplimit -- #number
|
||||||
local unitcoord = unit:GetCoordinate()
|
local unitcoord = unit:GetCoord()
|
||||||
|
|
||||||
-- find nearest group of deployed troops
|
-- find nearest group of deployed troops
|
||||||
local nearestGroup = nil
|
local nearestGroup = nil
|
||||||
@@ -3288,7 +3287,7 @@ end
|
|||||||
local distancekeys = {}
|
local distancekeys = {}
|
||||||
local extractdistance = self.CrateDistance * self.ExtractFactor
|
local extractdistance = self.CrateDistance * self.ExtractFactor
|
||||||
for k,v in pairs(self.DroppedTroops) do
|
for k,v in pairs(self.DroppedTroops) do
|
||||||
local distance = self:_GetDistance(v:GetCoordinate(),unitcoord)
|
local distance = self:_GetDistance(v:GetCoord(),unitcoord)
|
||||||
local TNow = timer.getTime()
|
local TNow = timer.getTime()
|
||||||
local vtime = v.ExtractTime or TNow-310
|
local vtime = v.ExtractTime or TNow-310
|
||||||
if distance <= extractdistance and distance ~= -1 and (TNow - vtime > 300) then
|
if distance <= extractdistance and distance ~= -1 and (TNow - vtime > 300) then
|
||||||
@@ -3376,7 +3375,7 @@ end
|
|||||||
self:_UpdateUnitCargoMass(Unit)
|
self:_UpdateUnitCargoMass(Unit)
|
||||||
local groupname = nearestGroup:GetName()
|
local groupname = nearestGroup:GetName()
|
||||||
self:__TroopsExtracted(running,Group, Unit, nearestGroup, groupname)
|
self:__TroopsExtracted(running,Group, Unit, nearestGroup, groupname)
|
||||||
local coord = Unit:GetCoordinate() or Group:GetCoordinate() -- Core.Point#COORDINATE
|
local coord = Unit:GetCoord() or Group:GetCoord() -- Core.Point#COORDINATE
|
||||||
local Point
|
local Point
|
||||||
if coord then
|
if coord then
|
||||||
local heading = unit:GetHeading() or 0
|
local heading = unit:GetHeading() or 0
|
||||||
@@ -3747,16 +3746,16 @@ function CTLD:_C130GetUnits(Group, Unit, Name)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
local coord = Unit:GetCoordinate() or Group:GetCoordinate()
|
local coord = Unit:GetCoord() or Group:GetCoord()
|
||||||
local capabilities = self:_GetUnitCapabilities(Unit)
|
local capabilities = self:_GetUnitCapabilities(Unit)
|
||||||
local innerDist = (capabilities.length and capabilities.length/2) or 15
|
local innerDist = (capabilities.length and capabilities.length/2) or 15
|
||||||
local maxUnitsNearby = self.maxUnitsNearby or 3
|
local maxUnitsNearby = self.maxUnitsNearby or 3
|
||||||
local searchRadius = self.UnitDistance or 90
|
local searchRadius = self.UnitDistance or 90
|
||||||
local checkZone = ZONE_RADIUS:New("CTLD_C130UnitsZone",coord:GetVec2(),searchRadius,false)
|
local checkZone = ZONE_RADIUS:New("CTLD_C130UnitsZone",coord:GetVec2(),searchRadius,false)
|
||||||
local nearGroups = SET_GROUP:New():FilterCoalitions("blue"):FilterZones({checkZone}):FilterOnce()
|
local nearGroups = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterZones({checkZone}):FilterOnce()
|
||||||
local nearbyCount = 0
|
local nearbyCount = 0
|
||||||
for _,gr in pairs(nearGroups.Set) do
|
for _,gr in pairs(nearGroups.Set) do
|
||||||
local gc = gr:GetCoordinate()
|
local gc = gr:GetCoord()
|
||||||
if gc then
|
if gc then
|
||||||
local dist = coord:Get2DDistance(gc)
|
local dist = coord:Get2DDistance(gc)
|
||||||
if dist > innerDist then
|
if dist > innerDist then
|
||||||
@@ -3806,6 +3805,7 @@ function CTLD:_C130GetUnits(Group, Unit, Name)
|
|||||||
if canmove then
|
if canmove then
|
||||||
SPAWN:NewWithAlias(_template,alias)
|
SPAWN:NewWithAlias(_template,alias)
|
||||||
:InitRandomizeUnits(true,10,2)
|
:InitRandomizeUnits(true,10,2)
|
||||||
|
:InitCoalition(self.coalition)
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits, 70)
|
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits, 70)
|
||||||
:InitDelayOff()
|
:InitDelayOff()
|
||||||
:OnSpawnGroup(function(grp,TimeStamp)
|
:OnSpawnGroup(function(grp,TimeStamp)
|
||||||
@@ -3819,6 +3819,7 @@ function CTLD:_C130GetUnits(Group, Unit, Name)
|
|||||||
SPAWN:NewWithAlias(_template,alias)
|
SPAWN:NewWithAlias(_template,alias)
|
||||||
:InitRandomizeUnits(true,10,2)
|
:InitRandomizeUnits(true,10,2)
|
||||||
:InitDelayOff()
|
:InitDelayOff()
|
||||||
|
:InitCoalition(self.coalition)
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits, 70)
|
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits, 70)
|
||||||
:OnSpawnGroup(function(grp,TimeStamp)
|
:OnSpawnGroup(function(grp,TimeStamp)
|
||||||
grp.spawntime = TimeStamp or timer.getTime()
|
grp.spawntime = TimeStamp or timer.getTime()
|
||||||
@@ -3925,7 +3926,7 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack, quiet, suppress
|
|||||||
-- Check cargo location if available
|
-- Check cargo location if available
|
||||||
local location = Cargo:GetLocation()
|
local location = Cargo:GetLocation()
|
||||||
if location then
|
if location then
|
||||||
local unitcoord = Unit:GetCoordinate() or Group:GetCoordinate()
|
local unitcoord = Unit:GetCoord() or Group:GetCoord()
|
||||||
if unitcoord then
|
if unitcoord then
|
||||||
if not location:IsCoordinateInZone(unitcoord) then
|
if not location:IsCoordinateInZone(unitcoord) then
|
||||||
-- no we're not at the right spot
|
-- no we're not at the right spot
|
||||||
@@ -3972,7 +3973,7 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack, quiet, suppress
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- get position and heading of heli
|
-- get position and heading of heli
|
||||||
local position = Unit:GetCoordinate()
|
local position = Unit:GetCoord()
|
||||||
local heading = Unit:GetHeading() + 1
|
local heading = Unit:GetHeading() + 1
|
||||||
local height = Unit:GetHeight()
|
local height = Unit:GetHeight()
|
||||||
local droppedcargo = {}
|
local droppedcargo = {}
|
||||||
@@ -4136,8 +4137,8 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack, quiet, suppress
|
|||||||
if type(ship) == "string" then
|
if type(ship) == "string" then
|
||||||
self:T("Spawning on ship "..ship)
|
self:T("Spawning on ship "..ship)
|
||||||
local Ship = UNIT:FindByName(ship)
|
local Ship = UNIT:FindByName(ship)
|
||||||
local shipcoord = Ship:GetCoordinate()
|
local shipcoord = Ship:GetCoord()
|
||||||
local unitcoord = Unit:GetCoordinate()
|
local unitcoord = Unit:GetCoord()
|
||||||
local dist = shipcoord:Get2DDistance(unitcoord)
|
local dist = shipcoord:Get2DDistance(unitcoord)
|
||||||
dist = dist - (20 + math.random(1, 10))
|
dist = dist - (20 + math.random(1, 10))
|
||||||
local halfwidth = (width or 20) / 2
|
local halfwidth = (width or 20) / 2
|
||||||
@@ -4389,17 +4390,17 @@ end
|
|||||||
function CTLD:_C130RemoveUnitsNearby(_group,_unit)
|
function CTLD:_C130RemoveUnitsNearby(_group,_unit)
|
||||||
self:T(self.lid .. " _C130RemoveUnitsNearby")
|
self:T(self.lid .. " _C130RemoveUnitsNearby")
|
||||||
if not _group or not _unit then return self end
|
if not _group or not _unit then return self end
|
||||||
local location = _group:GetCoordinate()
|
local location = _group:GetCoord()
|
||||||
if not location then return self end
|
if not location then return self end
|
||||||
local capabilities = self:_GetUnitCapabilities(_unit)
|
local capabilities = self:_GetUnitCapabilities(_unit)
|
||||||
local innerDist = (capabilities.length and capabilities.length/2) or 15
|
local innerDist = (capabilities.length and capabilities.length/2) or 15
|
||||||
local finddist = self.PackDistance or (self.CrateDistance or 35)
|
local finddist = self.PackDistance or (self.CrateDistance or 35)
|
||||||
local zone = ZONE_RADIUS:New("CTLD_C130RemoveZone",location:GetVec2(),finddist,false)
|
local zone = ZONE_RADIUS:New("CTLD_C130RemoveZone",location:GetVec2(),finddist,false)
|
||||||
local nearestGroups = SET_GROUP:New():FilterCoalitions("blue"):FilterZones({zone}):FilterOnce()
|
local nearestGroups = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterZones({zone}):FilterOnce()
|
||||||
local removedAny = false
|
local removedAny = false
|
||||||
local removedTable = {}
|
local removedTable = {}
|
||||||
for _, gr in pairs(nearestGroups.Set) do
|
for _, gr in pairs(nearestGroups.Set) do
|
||||||
local gc = gr:GetCoordinate()
|
local gc = gr:GetCoord()
|
||||||
if gc then
|
if gc then
|
||||||
local dist = location:Get2DDistance(gc)
|
local dist = location:Get2DDistance(gc)
|
||||||
if dist > innerDist then
|
if dist > innerDist then
|
||||||
@@ -4533,7 +4534,7 @@ end
|
|||||||
function CTLD:_FindCratesNearby( _group, _unit, _dist, _ignoreweight, ignoretype, ignoreHercInner)
|
function CTLD:_FindCratesNearby( _group, _unit, _dist, _ignoreweight, ignoretype, ignoreHercInner)
|
||||||
self:T(self.lid .. " _FindCratesNearby")
|
self:T(self.lid .. " _FindCratesNearby")
|
||||||
local finddist = _dist
|
local finddist = _dist
|
||||||
local location = _group:GetCoordinate()
|
local location = _group:GetCoord()
|
||||||
local existingcrates = self.Spawned_Cargo -- #table
|
local existingcrates = self.Spawned_Cargo -- #table
|
||||||
-- cycle
|
-- cycle
|
||||||
local index = 0
|
local index = 0
|
||||||
@@ -5159,7 +5160,6 @@ function CTLD:_UnloadTroops(Group, Unit)
|
|||||||
-- unload troops
|
-- unload troops
|
||||||
local name = cargo:GetName() or "none"
|
local name = cargo:GetName() or "none"
|
||||||
local temptable = cargo:GetTemplates() or {}
|
local temptable = cargo:GetTemplates() or {}
|
||||||
local position = Group:GetCoordinate()
|
|
||||||
local zoneradius = self.troopdropzoneradius or 100 -- drop zone radius
|
local zoneradius = self.troopdropzoneradius or 100 -- drop zone radius
|
||||||
local factor = 1
|
local factor = 1
|
||||||
if IsHerc then
|
if IsHerc then
|
||||||
@@ -5196,6 +5196,7 @@ function CTLD:_UnloadTroops(Group, Unit)
|
|||||||
local Positions = self:_GetUnitPositions(randomcoord,rad,heading,_template)
|
local Positions = self:_GetUnitPositions(randomcoord,rad,heading,_template)
|
||||||
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
||||||
:InitDelayOff()
|
:InitDelayOff()
|
||||||
|
:InitCoalition(self.coalition)
|
||||||
:InitSetUnitAbsolutePositions(Positions)
|
:InitSetUnitAbsolutePositions(Positions)
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
||||||
:OnSpawnGroup(function(grp) grp.spawntime = timer.getTime() end)
|
:OnSpawnGroup(function(grp) grp.spawntime = timer.getTime() end)
|
||||||
@@ -5506,8 +5507,8 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop,NotifyGroup)
|
|||||||
local required = Crate:GetCratesNeeded()
|
local required = Crate:GetCratesNeeded()
|
||||||
local template = Crate:GetTemplates()
|
local template = Crate:GetTemplates()
|
||||||
local ctype = Crate:GetType()
|
local ctype = Crate:GetType()
|
||||||
local ccoord = Crate:GetPositionable():GetCoordinate() -- Core.Point#COORDINATE
|
local ccoord = Crate:GetPositionable():GetCoord() -- Core.Point#COORDINATE
|
||||||
local distToUnit=Unit and ccoord:Get2DDistance(Unit:GetCoordinate())or 0
|
local distToUnit=Unit and ccoord:Get2DDistance(Unit:GetCoord())or 0
|
||||||
local isHercDrop=Crate:WasDropped(true)
|
local isHercDrop=Crate:WasDropped(true)
|
||||||
if not isHercDrop and distToUnit>baseDist then
|
if not isHercDrop and distToUnit>baseDist then
|
||||||
elseif self:IsC130J(Unit) and distToUnit<15 then
|
elseif self:IsC130J(Unit) and distToUnit<15 then
|
||||||
@@ -5526,6 +5527,7 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop,NotifyGroup)
|
|||||||
object.Found = 1
|
object.Found = 1
|
||||||
object.Template = template
|
object.Template = template
|
||||||
object.CanBuild = false
|
object.CanBuild = false
|
||||||
|
object.Heading = Unit:GetHeading()
|
||||||
object.Type = ctype -- #CTLD_CARGO.Enum
|
object.Type = ctype -- #CTLD_CARGO.Enum
|
||||||
object.Coord = ccoord:GetVec2()
|
object.Coord = ccoord:GetVec2()
|
||||||
buildables[name] = object
|
buildables[name] = object
|
||||||
@@ -5611,7 +5613,7 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop,NotifyGroup)
|
|||||||
local sep = self.buildPairSeparation or 25
|
local sep = self.buildPairSeparation or 25
|
||||||
local hdg = (Unit:GetHeading()+180)%360
|
local hdg = (Unit:GetHeading()+180)%360
|
||||||
local lat = (hdg+90)%360
|
local lat = (hdg+90)%360
|
||||||
local base = Unit:GetCoordinate():Translate(20,hdg)
|
local base = Unit:GetCoord():Translate(20,hdg)
|
||||||
|
|
||||||
if full == 1 then
|
if full == 1 then
|
||||||
local cratesNow, numberNow = self:_FindCratesNearby(Group,Unit, finddist,true,true, not Engineering)
|
local cratesNow, numberNow = self:_FindCratesNearby(Group,Unit, finddist,true,true, not Engineering)
|
||||||
@@ -5645,7 +5647,7 @@ function CTLD:_BuildCrates(Group, Unit,Engineering,MultiDrop,NotifyGroup)
|
|||||||
self:_RefreshPackMenus(Group,Unit)
|
self:_RefreshPackMenus(Group,Unit)
|
||||||
local off = start + (n-1)*sep
|
local off = start + (n-1)*sep
|
||||||
local coord = base:Translate(off,lat):GetVec2()
|
local coord = base:Translate(off,lat):GetVec2()
|
||||||
local b = { Name=build.Name, Required=build.Required, Template=build.Template, CanBuild=true, Type=build.Type, Coord=coord }
|
local b = { Name=build.Name, Required=build.Required, Template=build.Template, CanBuild=true, Type=build.Type, Coord=coord, Heading=build.Heading }
|
||||||
if self.buildtime and self.buildtime > 0 then
|
if self.buildtime and self.buildtime > 0 then
|
||||||
local buildtimer = TIMER:New(self._BuildObjectFromCrates,self,Group,Unit,b,false,Group:GetCoordinate(),MultiDrop)
|
local buildtimer = TIMER:New(self._BuildObjectFromCrates,self,Group,Unit,b,false,Group:GetCoordinate(),MultiDrop)
|
||||||
buildtimer:Start(self.buildtime)
|
buildtimer:Start(self.buildtime)
|
||||||
@@ -5683,18 +5685,18 @@ end
|
|||||||
-- @return #number Number
|
-- @return #number Number
|
||||||
function CTLD:_FindPackableGroupsNearby(Group, Unit)
|
function CTLD:_FindPackableGroupsNearby(Group, Unit)
|
||||||
self:T(self.lid .. " _FindPackableGroupsNearby")
|
self:T(self.lid .. " _FindPackableGroupsNearby")
|
||||||
local location = Group:GetCoordinate()
|
local location = Group:GetCoord()
|
||||||
if not location then return {}, 0 end
|
if not location then return {}, 0 end
|
||||||
local capabilities = self:_GetUnitCapabilities(Unit)
|
local capabilities = self:_GetUnitCapabilities(Unit)
|
||||||
local innerDist = (capabilities.length and capabilities.length/2) or 15
|
local innerDist = (capabilities.length and capabilities.length/2) or 15
|
||||||
local finddist = self.PackDistance or (self.CrateDistance or 35)
|
local finddist = self.PackDistance or (self.CrateDistance or 35)
|
||||||
local zone = ZONE_RADIUS:New("CTLD_PackableZone", location:GetVec2(), finddist, false)
|
local zone = ZONE_RADIUS:New("CTLD_PackableZone", location:GetVec2(), finddist, false)
|
||||||
local nearestGroups = SET_GROUP:New():FilterCoalitions("blue"):FilterZones({zone}):FilterOnce()
|
local nearestGroups = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterZones({zone}):FilterOnce()
|
||||||
local packable = {}
|
local packable = {}
|
||||||
|
|
||||||
for _, gr in pairs(nearestGroups.Set) do
|
for _, gr in pairs(nearestGroups.Set) do
|
||||||
if gr and gr:GetName() ~= Group:GetName() then
|
if gr and gr:GetName() ~= Group:GetName() then
|
||||||
local gc = gr:GetCoordinate()
|
local gc = gr:GetCoord()
|
||||||
if gc then
|
if gc then
|
||||||
local dist = location:Get2DDistance(gc)
|
local dist = location:Get2DDistance(gc)
|
||||||
if dist > innerDist and dist <= finddist then
|
if dist > innerDist and dist <= finddist then
|
||||||
@@ -5827,12 +5829,12 @@ function CTLD:_LoadPackedCratesByIds(Group, Unit, crateIds, cargoName)
|
|||||||
|
|
||||||
local matchingCrates = {}
|
local matchingCrates = {}
|
||||||
local finddist = self.CrateDistance or 35
|
local finddist = self.CrateDistance or 35
|
||||||
local location = Group:GetCoordinate()
|
local location = Group:GetCoord()
|
||||||
for _, crateObj in pairs(self.Spawned_Cargo or {}) do
|
for _, crateObj in pairs(self.Spawned_Cargo or {}) do
|
||||||
if crateObj and idLookup[crateObj:GetID()] then
|
if crateObj and idLookup[crateObj:GetID()] then
|
||||||
local pos = crateObj:GetPositionable()
|
local pos = crateObj:GetPositionable()
|
||||||
if pos and pos:IsAlive() then
|
if pos and pos:IsAlive() then
|
||||||
local dist = location:Get2DDistance(pos:GetCoordinate())
|
local dist = location:Get2DDistance(pos:GetCoord())
|
||||||
if dist <= finddist then
|
if dist <= finddist then
|
||||||
matchingCrates[#matchingCrates + 1] = crateObj
|
matchingCrates[#matchingCrates + 1] = crateObj
|
||||||
end
|
end
|
||||||
@@ -5942,12 +5944,12 @@ function CTLD:_RemovePackedCratesByIds(Group, Unit, crateIds)
|
|||||||
|
|
||||||
local crates = {}
|
local crates = {}
|
||||||
local finddist = self.CrateDistance or 35
|
local finddist = self.CrateDistance or 35
|
||||||
local location = Group:GetCoordinate()
|
local location = Group:GetCoord()
|
||||||
for _, entry in pairs(self.Spawned_Cargo or {}) do
|
for _, entry in pairs(self.Spawned_Cargo or {}) do
|
||||||
if entry and idLookup[entry:GetID()] then
|
if entry and idLookup[entry:GetID()] then
|
||||||
local pos = entry:GetPositionable()
|
local pos = entry:GetPositionable()
|
||||||
if pos and pos:IsAlive() then
|
if pos and pos:IsAlive() then
|
||||||
local dist = location:Get2DDistance(pos:GetCoordinate())
|
local dist = location:Get2DDistance(pos:GetCoord())
|
||||||
if dist <= finddist then
|
if dist <= finddist then
|
||||||
crates[#crates + 1] = entry
|
crates[#crates + 1] = entry
|
||||||
end
|
end
|
||||||
@@ -6197,24 +6199,24 @@ function CTLD:_BuildObjectFromCrates(Group,Unit,Build,Repair,RepairLocation,Mult
|
|||||||
for _,_template in pairs(temptable) do
|
for _,_template in pairs(temptable) do
|
||||||
self.TroopCounter = self.TroopCounter + 1
|
self.TroopCounter = self.TroopCounter + 1
|
||||||
local alias = string.format("%s-%d", _template, math.random(1,100000))
|
local alias = string.format("%s-%d", _template, math.random(1,100000))
|
||||||
|
local spawn = SPAWN:NewWithAlias(_template,alias)
|
||||||
|
:InitDelayOff()
|
||||||
|
:InitCoalition(self.coalition)
|
||||||
|
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
||||||
|
:OnSpawnGroup(function(grp) grp.spawntime = timer.getTime() end)
|
||||||
if canmove then
|
if canmove then
|
||||||
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
--spawn:InitRandomizeUnits(true,20,2)
|
||||||
--:InitRandomizeUnits(true,20,2)
|
|
||||||
:InitDelayOff()
|
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
|
||||||
:OnSpawnGroup(function(grp) grp.spawntime = timer.getTime() end)
|
|
||||||
:SpawnFromVec2(randomcoord)
|
|
||||||
else -- don't random position of e.g. SAM units build as FOB
|
|
||||||
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias)
|
|
||||||
:InitDelayOff()
|
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
|
||||||
:OnSpawnGroup(function(grp) grp.spawntime = timer.getTime() end)
|
|
||||||
:SpawnFromVec2(randomcoord)
|
|
||||||
end
|
end
|
||||||
|
if Build.Heading and self.useaircraftheadingforbuilds then
|
||||||
|
spawn:InitGroupHeading(Build.Heading)
|
||||||
|
end
|
||||||
|
local spawnedGroup = spawn:SpawnFromVec2(randomcoord)
|
||||||
|
self.DroppedTroops[self.TroopCounter] = spawnedGroup
|
||||||
|
|
||||||
if Repair then
|
if Repair then
|
||||||
self:__CratesRepaired(1,Group,Unit,self.DroppedTroops[self.TroopCounter])
|
self:__CratesRepaired(1,Group,Unit,spawnedGroup)
|
||||||
else
|
else
|
||||||
self:__CratesBuild(1,Group,Unit,self.DroppedTroops[self.TroopCounter])
|
self:__CratesBuild(1,Group,Unit,spawnedGroup)
|
||||||
end
|
end
|
||||||
end -- template loop
|
end -- template loop
|
||||||
|
|
||||||
@@ -6244,14 +6246,11 @@ end
|
|||||||
-- @param Wrapper.Group#GROUP Group The Group to move.
|
-- @param Wrapper.Group#GROUP Group The Group to move.
|
||||||
function CTLD:_MoveGroupToZone(Group)
|
function CTLD:_MoveGroupToZone(Group)
|
||||||
self:T(self.lid .. " _MoveGroupToZone")
|
self:T(self.lid .. " _MoveGroupToZone")
|
||||||
local groupname = Group:GetName() or "none"
|
|
||||||
local groupcoord = Group:GetCoordinate()
|
|
||||||
-- Get closest zone of type
|
-- Get closest zone of type
|
||||||
local outcome, name, zone, distance = self:IsUnitInZone(Group,CTLD.CargoZoneType.MOVE)
|
local outcome, name, zone, distance = self:IsUnitInZone(Group,CTLD.CargoZoneType.MOVE)
|
||||||
self:T({canmove=outcome, name=name, zone=zone, dist=distance,max=self.movetroopsdistance})
|
self:T({canmove=outcome, name=name, zone=zone, dist=distance,max=self.movetroopsdistance})
|
||||||
if (distance <= self.movetroopsdistance) and outcome == true and zone~= nil then
|
if (distance <= self.movetroopsdistance) and outcome == true and zone~= nil then
|
||||||
-- yes, we can ;)
|
-- yes, we can ;)
|
||||||
local groupname = Group:GetName()
|
|
||||||
local zonecoord = zone:GetRandomCoordinate(20,125) -- Core.Point#COORDINATE
|
local zonecoord = zone:GetRandomCoordinate(20,125) -- Core.Point#COORDINATE
|
||||||
local formation = self:_GetVehicleFormation()
|
local formation = self:_GetVehicleFormation()
|
||||||
--local coordinate = zonecoord:GetVec2()
|
--local coordinate = zonecoord:GetVec2()
|
||||||
@@ -7934,6 +7933,7 @@ function CTLD:_UnloadSingleTroopByID(Group, Unit, chunkID, qty)
|
|||||||
local Positions = self:_GetUnitPositions(randomcoord, rad, heading, _template)
|
local Positions = self:_GetUnitPositions(randomcoord, rad, heading, _template)
|
||||||
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template, alias)
|
self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template, alias)
|
||||||
:InitDelayOff()
|
:InitDelayOff()
|
||||||
|
:InitCoalition(self.coalition)
|
||||||
:InitSetUnitAbsolutePositions(Positions)
|
:InitSetUnitAbsolutePositions(Positions)
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
||||||
:OnSpawnGroup(function(grp) grp.spawntime = timer.getTime() end)
|
:OnSpawnGroup(function(grp) grp.spawntime = timer.getTime() end)
|
||||||
@@ -9011,7 +9011,7 @@ function CTLD:IsUnitInZone(Unit,Zonetype)
|
|||||||
local zoneret = nil
|
local zoneret = nil
|
||||||
local zonewret = nil
|
local zonewret = nil
|
||||||
local zonenameret = nil
|
local zonenameret = nil
|
||||||
local unitcoord = Unit:GetCoordinate()
|
local unitcoord = Unit:GetCoord()
|
||||||
if not unitcoord then
|
if not unitcoord then
|
||||||
if Zonetype == CTLD.CargoZoneType.SHIP then
|
if Zonetype == CTLD.CargoZoneType.SHIP then
|
||||||
return false, nil, nil, 1000000, nil
|
return false, nil, nil, 1000000, nil
|
||||||
@@ -9032,7 +9032,7 @@ function CTLD:IsUnitInZone(Unit,Zonetype)
|
|||||||
self:T("Checking Type Ship: "..zonename)
|
self:T("Checking Type Ship: "..zonename)
|
||||||
local ZoneUNIT = UNIT:FindByName(zonename)
|
local ZoneUNIT = UNIT:FindByName(zonename)
|
||||||
if not ZoneUNIT then return false end
|
if not ZoneUNIT then return false end
|
||||||
zonecoord = ZoneUNIT:GetCoordinate()
|
zonecoord = ZoneUNIT:GetCoord()
|
||||||
zoneradius = czone.shiplength
|
zoneradius = czone.shiplength
|
||||||
zonewidth = czone.shipwidth
|
zonewidth = czone.shipwidth
|
||||||
zone = ZONE_UNIT:New( ZoneUNIT:GetName(), ZoneUNIT, zoneradius/2)
|
zone = ZONE_UNIT:New( ZoneUNIT:GetName(), ZoneUNIT, zoneradius/2)
|
||||||
@@ -9081,7 +9081,7 @@ function CTLD:SmokePositionNow(Unit, Flare, SmokeColor)
|
|||||||
end
|
end
|
||||||
local FlareColor = self.FlareColor or FLARECOLOR.Red
|
local FlareColor = self.FlareColor or FLARECOLOR.Red
|
||||||
-- table of #CTLD.CargoZone table
|
-- table of #CTLD.CargoZone table
|
||||||
local unitcoord = Unit:GetCoordinate() -- Core.Point#COORDINATE
|
local unitcoord = Unit:GetCoord() -- Core.Point#COORDINATE
|
||||||
local Group = Unit:GetGroup()
|
local Group = Unit:GetGroup()
|
||||||
if Flare then
|
if Flare then
|
||||||
unitcoord:Flare(FlareColor, 90)
|
unitcoord:Flare(FlareColor, 90)
|
||||||
@@ -9100,7 +9100,7 @@ end
|
|||||||
function CTLD:SmokeZoneNearBy(Unit, Flare)
|
function CTLD:SmokeZoneNearBy(Unit, Flare)
|
||||||
self:T(self.lid .. " SmokeZoneNearBy")
|
self:T(self.lid .. " SmokeZoneNearBy")
|
||||||
-- table of #CTLD.CargoZone table
|
-- table of #CTLD.CargoZone table
|
||||||
local unitcoord = Unit:GetCoordinate()
|
local unitcoord = Unit:GetCoord()
|
||||||
local Group = Unit:GetGroup()
|
local Group = Unit:GetGroup()
|
||||||
local smokedistance = self.smokedistance
|
local smokedistance = self.smokedistance
|
||||||
local smoked = false
|
local smoked = false
|
||||||
@@ -9237,7 +9237,7 @@ end
|
|||||||
-- get speed and height
|
-- get speed and height
|
||||||
local uspeed = Unit:GetVelocityMPS()
|
local uspeed = Unit:GetVelocityMPS()
|
||||||
local uheight = Unit:GetHeight()
|
local uheight = Unit:GetHeight()
|
||||||
local ucoord = Unit:GetCoordinate()
|
local ucoord = Unit:GetCoord()
|
||||||
if not ucoord then
|
if not ucoord then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -9266,7 +9266,7 @@ end
|
|||||||
-- get speed and height
|
-- get speed and height
|
||||||
local uspeed = Unit:GetVelocityMPS()
|
local uspeed = Unit:GetVelocityMPS()
|
||||||
local uheight = Unit:GetHeight()
|
local uheight = Unit:GetHeight()
|
||||||
local ucoord = Unit:GetCoordinate()
|
local ucoord = Unit:GetCoord()
|
||||||
if not ucoord then
|
if not ucoord then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -9358,7 +9358,7 @@ end
|
|||||||
minheight = 5.1 -- herc is 5m AGL on the ground
|
minheight = 5.1 -- herc is 5m AGL on the ground
|
||||||
end
|
end
|
||||||
local uheight = Unit:GetHeight()
|
local uheight = Unit:GetHeight()
|
||||||
local ucoord = Unit:GetCoordinate()
|
local ucoord = Unit:GetCoord()
|
||||||
if not ucoord then
|
if not ucoord then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -10144,6 +10144,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)
|
||||||
|
:InitCoalition(self.coalition)
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
: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)
|
||||||
@@ -10298,6 +10299,7 @@ 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)
|
||||||
|
:InitCoalition(self.coalition)
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
: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)
|
||||||
@@ -10305,6 +10307,7 @@ end
|
|||||||
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()
|
||||||
|
:InitCoalition(self.coalition)
|
||||||
:InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
|
: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)
|
||||||
@@ -10586,7 +10589,7 @@ end
|
|||||||
self:T({From, Event, To})
|
self:T({From, Event, To})
|
||||||
if Unit and Unit:IsPlayer() and self.PlayerTaskQueue then
|
if Unit and Unit:IsPlayer() and self.PlayerTaskQueue then
|
||||||
local playername = Unit:GetPlayerName()
|
local playername = Unit:GetPlayerName()
|
||||||
local dropcoord = Troops:GetCoordinate() or COORDINATE:New(0,0,0)
|
local dropcoord = Troops:GetCoord() or COORDINATE:New(0,0,0)
|
||||||
local dropvec2 = dropcoord:GetVec2()
|
local dropvec2 = dropcoord:GetVec2()
|
||||||
self.PlayerTaskQueue:ForEach(
|
self.PlayerTaskQueue:ForEach(
|
||||||
function (Task)
|
function (Task)
|
||||||
@@ -10643,7 +10646,7 @@ end
|
|||||||
for _,_cargo in pairs(Cargotable) do
|
for _,_cargo in pairs(Cargotable) do
|
||||||
local Vehicle = _cargo.Positionable
|
local Vehicle = _cargo.Positionable
|
||||||
if Vehicle then
|
if Vehicle then
|
||||||
local dropcoord = Vehicle:GetCoordinate() or COORDINATE:New(0,0,0)
|
local dropcoord = Vehicle:GetCoord() or COORDINATE:New(0,0,0)
|
||||||
local dropvec2 = dropcoord:GetVec2()
|
local dropvec2 = dropcoord:GetVec2()
|
||||||
self.PlayerTaskQueue:ForEach(
|
self.PlayerTaskQueue:ForEach(
|
||||||
function (Task)
|
function (Task)
|
||||||
@@ -10708,7 +10711,7 @@ end
|
|||||||
self:T({From, Event, To})
|
self:T({From, Event, To})
|
||||||
if Unit and Unit:IsPlayer() and self.PlayerTaskQueue then
|
if Unit and Unit:IsPlayer() and self.PlayerTaskQueue then
|
||||||
local playername = Unit:GetPlayerName()
|
local playername = Unit:GetPlayerName()
|
||||||
local dropcoord = Vehicle:GetCoordinate() or COORDINATE:New(0,0,0)
|
local dropcoord = Vehicle:GetCoord() or COORDINATE:New(0,0,0)
|
||||||
local dropvec2 = dropcoord:GetVec2()
|
local dropvec2 = dropcoord:GetVec2()
|
||||||
self.PlayerTaskQueue:ForEach(
|
self.PlayerTaskQueue:ForEach(
|
||||||
function (Task)
|
function (Task)
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ EASYGCICAP = {
|
|||||||
|
|
||||||
--- EASYGCICAP class version.
|
--- EASYGCICAP class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
EASYGCICAP.version="0.1.38"
|
EASYGCICAP.version="0.1.39"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
@@ -796,8 +796,9 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
CAP_Wing:SetRespawnAfterDestroyed()
|
CAP_Wing:SetRespawnAfterDestroyed()
|
||||||
|
|
||||||
--- #DONE avoid wings with no CAP points starting CAP anyhow; AirWing uses this to start CAP and creates points when there are none.
|
--- #DONE avoid wings with no CAP points starting CAP anyhow; AirWing uses this to start CAP and creates points when there are none.
|
||||||
if counttable(self.ManagedCP) >0 then
|
local nCapPoints = counttable(self.ManagedCP)
|
||||||
CAP_Wing:SetNumberCAP(self.capgrouping)
|
if nCapPoints >0 then
|
||||||
|
CAP_Wing:SetNumberCAP(nCapPoints,self.capgrouping)
|
||||||
end
|
end
|
||||||
CAP_Wing:SetCapCloseRaceTrack(true)
|
CAP_Wing:SetCapCloseRaceTrack(true)
|
||||||
|
|
||||||
|
|||||||
@@ -2126,6 +2126,56 @@ ENUMS.Storage.weapons.containers.UH60_GAU19_RIGHT = 'weapons.containers.{UH60_GA
|
|||||||
ENUMS.Storage.weapons.containers.UH60_M230_RIGHT = 'weapons.containers.{UH60_M230_RIGHT}'
|
ENUMS.Storage.weapons.containers.UH60_M230_RIGHT = 'weapons.containers.{UH60_M230_RIGHT}'
|
||||||
ENUMS.Storage.weapons.containers.UH60L_M2_GUNNER = 'weapons.containers.{UH60L_M2_GUNNER}'
|
ENUMS.Storage.weapons.containers.UH60L_M2_GUNNER = 'weapons.containers.{UH60L_M2_GUNNER}'
|
||||||
|
|
||||||
|
|
||||||
|
ENUMS.Storage.weapons.adapters.GD_F100_SUU_13 = 'weapons.adapters.GD_F100_SUU-13'
|
||||||
|
ENUMS.Storage.weapons.containers.GPU_5_POD = 'weapons.containers.{GPU_5_POD}'
|
||||||
|
ENUMS.Storage.weapons.bombs.BOLT_117 = 'weapons.bombs.BOLT-117'
|
||||||
|
ENUMS.Storage.weapons.shells.F100_M39_20_TP_T = 'weapons.shells.F100_M39_20_TP_T'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.M_39_F_100 = 'weapons.gunmounts.M-39 F-100'
|
||||||
|
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_275_L = 'weapons.droptanks.GD_F100_TANK_275_L'
|
||||||
|
ENUMS.Storage.weapons.bombs.BLU_4B_R_GROUP_R = 'weapons.bombs.BLU-4B_R_GROUP_R'
|
||||||
|
ENUMS.Storage.weapons.containers.F100_CAMERA_P2 = 'weapons.containers.F100_CAMERA_P2'
|
||||||
|
ENUMS.Storage.weapons.containers.HB_ORD_SUU_7 = 'weapons.containers.HB_ORD_SUU_7'
|
||||||
|
ENUMS.Storage.weapons.adapters.SidewinderPylon = 'weapons.adapters.SidewinderPylon'
|
||||||
|
ENUMS.Storage.weapons.adapters.apu_470 = 'weapons.adapters.apu_470'
|
||||||
|
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_335_R = 'weapons.droptanks.GD_F100_TANK_335_R'
|
||||||
|
ENUMS.Storage.weapons.bombs.BLU_3B_R_GROUP_R = 'weapons.bombs.BLU-3B_R_GROUP_R'
|
||||||
|
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_335_L = 'weapons.droptanks.GD_F100_TANK_335_L'
|
||||||
|
ENUMS.Storage.weapons.adapters.mbdz_u2t = 'weapons.adapters.mbdz_u2t'
|
||||||
|
ENUMS.Storage.weapons.containers.ZellRocket = 'weapons.containers.ZellRocket'
|
||||||
|
ENUMS.Storage.weapons.containers.apu_73 = 'weapons.containers.apu-73'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.GAU_13 = 'weapons.gunmounts.GAU-13'
|
||||||
|
ENUMS.Storage.weapons.shells.F100_M39_20_TP = 'weapons.shells.F100_M39_20_TP'
|
||||||
|
ENUMS.Storage.weapons.shells.F100_M39_20_API = 'weapons.shells.F100_M39_20_API'
|
||||||
|
ENUMS.Storage.weapons.adapters.bdz_umk2b = 'weapons.adapters.bdz_umk2b'
|
||||||
|
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_450 = 'weapons.droptanks.GD_F100_TANK_450'
|
||||||
|
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_275_R = 'weapons.droptanks.GD_F100_TANK_275_R'
|
||||||
|
ENUMS.Storage.weapons.bombs.BLU_18_B_GROUP = 'weapons.bombs.BLU-18/B_GROUP'
|
||||||
|
ENUMS.Storage.weapons.containers.ZELL_Booster = 'weapons.containers.ZELL Booster'
|
||||||
|
ENUMS.Storage.weapons.adapters.apu_60 = 'weapons.adapters.apu_60'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.GPU_5_POD = 'weapons.gunmounts.{GPU_5_POD}'
|
||||||
|
ENUMS.Storage.weapons.containers.F100_CAMERA_KA71A = 'weapons.containers.F100_CAMERA_KA71A'
|
||||||
|
ENUMS.Storage.weapons.bombs.BLU_3_R_GROUP_R = 'weapons.bombs.BLU-3_R_GROUP_R'
|
||||||
|
ENUMS.Storage.weapons.shells.F100_M39_20_HEI = 'weapons.shells.F100_M39_20_HEI'
|
||||||
|
ENUMS.Storage.weapons.droptanks.GD_F100_TANK_200 = 'weapons.droptanks.GD_F100_TANK_200'
|
||||||
|
ENUMS.Storage.weapons.adapters.apu_73 = 'weapons.adapters.apu-73'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.AKAN_NO_TRC = 'weapons.gunmounts.AKAN_NO_TRC'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.AKAN = 'weapons.gunmounts.AKAN'
|
||||||
|
ENUMS.Storage.weapons.shells.F100_M39_20_HEI_T = 'weapons.shells.F100_M39_20_HEI_T'
|
||||||
|
ENUMS.Storage.weapons.shells.F100_M39_20_API_T = 'weapons.shells.F100_M39_20_API_T'
|
||||||
|
ENUMS.Storage.weapons.containers.GD_F100_STRIKE_CAMERA = 'weapons.containers.GD_F100_STRIKE_CAMERA'
|
||||||
|
ENUMS.Storage.weapons.bombs.BLU_49_B = 'weapons.bombs.BLU-49/B'
|
||||||
|
|
||||||
|
ENUMS.Storage.weapons.bombs.GBU_24E = 'weapons.bombs.GBU_24E'
|
||||||
|
ENUMS.Storage.weapons.containers.GD_F100_SUU_13 = 'weapons.containers.GD_F100_SUU-13'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.AKAN = 'weapons.gunmounts.{AKAN}'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.AKAN_NO_TRC = 'weapons.gunmounts.{AKAN_NO_TRC}'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.SUU_23_POD_Wing = 'weapons.gunmounts.{SUU_23_POD_Wing}'
|
||||||
|
ENUMS.Storage.weapons.containers.SUU_23_POD_Wing = 'weapons.containers.{SUU_23_POD_Wing}'
|
||||||
|
ENUMS.Storage.weapons.containers.SUU_23_POD_Centerline = 'weapons.containers.{SUU_23_POD_Centerline}'
|
||||||
|
ENUMS.Storage.weapons.gunmounts.SUU_23_POD_Centerline = 'weapons.gunmounts.{SUU_23_POD_Centerline}'
|
||||||
|
ENUMS.Storage.weapons.containers.HB_F_4E_BRU_42 = 'weapons.containers.HB_F-4E_BRU-42'
|
||||||
|
|
||||||
---
|
---
|
||||||
-- @type ENUMS.FARPType
|
-- @type ENUMS.FARPType
|
||||||
-- @field #string FARP
|
-- @field #string FARP
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ function SCENERY:FindByName(Name, Coordinate, Radius, Role, Zone)
|
|||||||
--BASE:I("Coordinate x = "..Coordinate.x .. " y = "..Coordinate.y.." z = "..Coordinate.z)
|
--BASE:I("Coordinate x = "..Coordinate.x .. " y = "..Coordinate.y.." z = "..Coordinate.z)
|
||||||
|
|
||||||
local findme = self:_FindByName(Name)
|
local findme = self:_FindByName(Name)
|
||||||
if findme then return findme end
|
if findme and findme:GetDCSObject() then return findme end
|
||||||
|
|
||||||
local radius = Radius or 100
|
local radius = Radius or 100
|
||||||
local name = Name or "unknown"
|
local name = Name or "unknown"
|
||||||
@@ -321,8 +321,6 @@ function SCENERY:FindByName(Name, Coordinate, Radius, Role, Zone)
|
|||||||
if Coordinate then
|
if Coordinate then
|
||||||
scenery = SceneryScan(Coordinate, radius, name)
|
scenery = SceneryScan(Coordinate, radius, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not scenery then scenery = SCENERY:Register(Name,nil,Zone) end
|
|
||||||
|
|
||||||
return scenery
|
return scenery
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user