Trying to get the dependency on EVENTs solved.
@@ -425,7 +425,7 @@ function EVENT:Init( EventID, EventClass )
|
|||||||
-- Each event has a subtable of EventClasses, ordered by EventPriority.
|
-- Each event has a subtable of EventClasses, ordered by EventPriority.
|
||||||
local EventPriority = EventClass:GetEventPriority()
|
local EventPriority = EventClass:GetEventPriority()
|
||||||
if not self.Events[EventID][EventPriority] then
|
if not self.Events[EventID][EventPriority] then
|
||||||
self.Events[EventID][EventPriority] = setmetatable( {}, { __mode = "k" } )
|
self.Events[EventID][EventPriority] = setmetatable( {}, { __mode = "kv" } )
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.Events[EventID][EventPriority][EventClass] then
|
if not self.Events[EventID][EventPriority][EventClass] then
|
||||||
|
|||||||
@@ -941,45 +941,48 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
DetectedItem.FriendliesNearBy = false
|
DetectedItem.FriendliesNearBy = false
|
||||||
|
|
||||||
local SphereSearch = {
|
if DetectedUnit then
|
||||||
id = world.VolumeType.SPHERE,
|
|
||||||
params = {
|
|
||||||
point = DetectedUnit:GetVec3(),
|
|
||||||
radius = 6000,
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
--- @param Dcs.DCSWrapper.Unit#Unit FoundDCSUnit
|
local SphereSearch = {
|
||||||
-- @param Wrapper.Group#GROUP ReportGroup
|
id = world.VolumeType.SPHERE,
|
||||||
-- @param Set#SET_GROUP ReportSetGroup
|
params = {
|
||||||
local FindNearByFriendlies = function( FoundDCSUnit, ReportGroupData )
|
point = DetectedUnit:GetVec3(),
|
||||||
|
radius = 6000,
|
||||||
|
}
|
||||||
|
|
||||||
local DetectedItem = ReportGroupData.DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem
|
}
|
||||||
local DetectedSet = ReportGroupData.DetectedItem.Set
|
|
||||||
local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
|
|
||||||
local ReportSetGroup = ReportGroupData.ReportSetGroup
|
|
||||||
|
|
||||||
local EnemyCoalition = DetectedUnit:GetCoalition()
|
--- @param Dcs.DCSWrapper.Unit#Unit FoundDCSUnit
|
||||||
|
-- @param Wrapper.Group#GROUP ReportGroup
|
||||||
|
-- @param Set#SET_GROUP ReportSetGroup
|
||||||
|
local FindNearByFriendlies = function( FoundDCSUnit, ReportGroupData )
|
||||||
|
|
||||||
local FoundUnitCoalition = FoundDCSUnit:getCoalition()
|
local DetectedItem = ReportGroupData.DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem
|
||||||
local FoundUnitName = FoundDCSUnit:getName()
|
local DetectedSet = ReportGroupData.DetectedItem.Set
|
||||||
local FoundUnitGroupName = FoundDCSUnit:getGroup():getName()
|
local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
|
||||||
local EnemyUnitName = DetectedUnit:GetName()
|
local ReportSetGroup = ReportGroupData.ReportSetGroup
|
||||||
local FoundUnitInReportSetGroup = ReportSetGroup:FindGroup( FoundUnitGroupName ) ~= nil
|
|
||||||
|
|
||||||
self:T3( { "Friendlies search:", FoundUnitName, FoundUnitCoalition, EnemyUnitName, EnemyCoalition, FoundUnitInReportSetGroup } )
|
local EnemyCoalition = DetectedUnit:GetCoalition()
|
||||||
|
|
||||||
if FoundUnitCoalition ~= EnemyCoalition and FoundUnitInReportSetGroup == false then
|
local FoundUnitCoalition = FoundDCSUnit:getCoalition()
|
||||||
DetectedItem.FriendliesNearBy = true
|
local FoundUnitName = FoundDCSUnit:getName()
|
||||||
return false
|
local FoundUnitGroupName = FoundDCSUnit:getGroup():getName()
|
||||||
end
|
local EnemyUnitName = DetectedUnit:GetName()
|
||||||
|
local FoundUnitInReportSetGroup = ReportSetGroup:FindGroup( FoundUnitGroupName ) ~= nil
|
||||||
|
|
||||||
return true
|
self:T3( { "Friendlies search:", FoundUnitName, FoundUnitCoalition, EnemyUnitName, EnemyCoalition, FoundUnitInReportSetGroup } )
|
||||||
|
|
||||||
|
if FoundUnitCoalition ~= EnemyCoalition and FoundUnitInReportSetGroup == false then
|
||||||
|
DetectedItem.FriendliesNearBy = true
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
world.searchObjects( Object.Category.UNIT, SphereSearch, FindNearByFriendlies, ReportGroupData )
|
||||||
end
|
end
|
||||||
|
|
||||||
world.searchObjects( Object.Category.UNIT, SphereSearch, FindNearByFriendlies, ReportGroupData )
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170317_1239' )
|
env.info( 'Moose Generation Timestamp: 20170317_1402' )
|
||||||
|
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170317_1239' )
|
env.info( 'Moose Generation Timestamp: 20170317_1402' )
|
||||||
|
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ local HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
|||||||
|
|
||||||
local CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
|
local CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
|
||||||
|
|
||||||
local Scoring = SCORING:New( "Detect Demo" )
|
Scoring = SCORING:New( "Detect Demo" )
|
||||||
|
|
||||||
local Mission = MISSION
|
local Mission = MISSION
|
||||||
:New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED )
|
:New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED )
|
||||||
|
|||||||
|
After Width: | Height: | Size: 202 KiB |
|
After Width: | Height: | Size: 231 KiB |
|
After Width: | Height: | Size: 224 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
After Width: | Height: | Size: 195 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 200 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 223 KiB |
|
After Width: | Height: | Size: 209 KiB |
|
After Width: | Height: | Size: 205 KiB |
|
After Width: | Height: | Size: 248 KiB |
|
After Width: | Height: | Size: 225 KiB |
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 251 KiB |