diff --git a/Moose Development/Moose/Core/Event.lua b/Moose Development/Moose/Core/Event.lua index 9c64d9b9f..0a0733e0a 100644 --- a/Moose Development/Moose/Core/Event.lua +++ b/Moose Development/Moose/Core/Event.lua @@ -425,7 +425,7 @@ function EVENT:Init( EventID, EventClass ) -- Each event has a subtable of EventClasses, ordered by EventPriority. local EventPriority = EventClass:GetEventPriority() if not self.Events[EventID][EventPriority] then - self.Events[EventID][EventPriority] = setmetatable( {}, { __mode = "k" } ) + self.Events[EventID][EventPriority] = setmetatable( {}, { __mode = "kv" } ) end if not self.Events[EventID][EventPriority][EventClass] then diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua index 5975416be..1a722ddde 100644 --- a/Moose Development/Moose/Functional/Detection.lua +++ b/Moose Development/Moose/Functional/Detection.lua @@ -940,46 +940,49 @@ do -- DETECTION_BASE local DetectedUnit = DetectedSet:GetFirst() DetectedItem.FriendliesNearBy = false + + if DetectedUnit then - local SphereSearch = { - id = world.VolumeType.SPHERE, - params = { - point = DetectedUnit:GetVec3(), - radius = 6000, - } - } - - --- @param Dcs.DCSWrapper.Unit#Unit FoundDCSUnit - -- @param Wrapper.Group#GROUP ReportGroup - -- @param Set#SET_GROUP ReportSetGroup - local FindNearByFriendlies = function( FoundDCSUnit, ReportGroupData ) + local SphereSearch = { + id = world.VolumeType.SPHERE, + params = { + 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() - - local FoundUnitCoalition = FoundDCSUnit:getCoalition() - local FoundUnitName = FoundDCSUnit:getName() - local FoundUnitGroupName = FoundDCSUnit:getGroup():getName() - local EnemyUnitName = DetectedUnit:GetName() - local FoundUnitInReportSetGroup = ReportSetGroup:FindGroup( FoundUnitGroupName ) ~= nil - - 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 + } + + --- @param Dcs.DCSWrapper.Unit#Unit FoundDCSUnit + -- @param Wrapper.Group#GROUP ReportGroup + -- @param Set#SET_GROUP ReportSetGroup + local FindNearByFriendlies = function( FoundDCSUnit, ReportGroupData ) + + 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 - world.searchObjects( Object.Category.UNIT, SphereSearch, FindNearByFriendlies, ReportGroupData ) - + local EnemyCoalition = DetectedUnit:GetCoalition() + + local FoundUnitCoalition = FoundDCSUnit:getCoalition() + local FoundUnitName = FoundDCSUnit:getName() + local FoundUnitGroupName = FoundDCSUnit:getGroup():getName() + local EnemyUnitName = DetectedUnit:GetName() + local FoundUnitInReportSetGroup = ReportSetGroup:FindGroup( FoundUnitGroupName ) ~= nil + + 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 end diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua index 0768235fb..7810d4dc7 100644 --- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua +++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20170317_1239' ) +env.info( 'Moose Generation Timestamp: 20170317_1402' ) local base = _G diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 0768235fb..7810d4dc7 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20170317_1239' ) +env.info( 'Moose Generation Timestamp: 20170317_1402' ) local base = _G diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua b/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua index b2579a793..3fedee289 100644 --- a/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua +++ b/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua @@ -18,7 +18,7 @@ local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) -local Scoring = SCORING:New( "Detect Demo" ) +Scoring = SCORING:New( "Detect Demo" ) local Mission = MISSION :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.miz index 27c916120..dd414fad6 100644 Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.miz and b/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.miz differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia1.JPG b/docs/Presentations/TASK_DISPATCHER/Dia1.JPG new file mode 100644 index 000000000..2501578e9 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia1.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia10.JPG b/docs/Presentations/TASK_DISPATCHER/Dia10.JPG new file mode 100644 index 000000000..55f545f95 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia10.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia11.JPG b/docs/Presentations/TASK_DISPATCHER/Dia11.JPG new file mode 100644 index 000000000..37f538608 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia11.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia12.JPG b/docs/Presentations/TASK_DISPATCHER/Dia12.JPG new file mode 100644 index 000000000..d69f65f24 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia12.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia13.JPG b/docs/Presentations/TASK_DISPATCHER/Dia13.JPG new file mode 100644 index 000000000..4c4e25a5a Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia13.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia14.JPG b/docs/Presentations/TASK_DISPATCHER/Dia14.JPG new file mode 100644 index 000000000..99f45e145 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia14.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia15.JPG b/docs/Presentations/TASK_DISPATCHER/Dia15.JPG new file mode 100644 index 000000000..09a00e4eb Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia15.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia16.JPG b/docs/Presentations/TASK_DISPATCHER/Dia16.JPG new file mode 100644 index 000000000..c74c69956 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia16.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia17.JPG b/docs/Presentations/TASK_DISPATCHER/Dia17.JPG new file mode 100644 index 000000000..ab23e55da Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia17.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia18.JPG b/docs/Presentations/TASK_DISPATCHER/Dia18.JPG new file mode 100644 index 000000000..9ad40904a Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia18.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia2.JPG b/docs/Presentations/TASK_DISPATCHER/Dia2.JPG new file mode 100644 index 000000000..edfc790e5 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia2.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia3.JPG b/docs/Presentations/TASK_DISPATCHER/Dia3.JPG new file mode 100644 index 000000000..2e129761a Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia3.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia4.JPG b/docs/Presentations/TASK_DISPATCHER/Dia4.JPG new file mode 100644 index 000000000..6adebc4f2 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia4.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia5.JPG b/docs/Presentations/TASK_DISPATCHER/Dia5.JPG new file mode 100644 index 000000000..057a68877 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia5.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia6.JPG b/docs/Presentations/TASK_DISPATCHER/Dia6.JPG new file mode 100644 index 000000000..9387e30e8 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia6.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia7.JPG b/docs/Presentations/TASK_DISPATCHER/Dia7.JPG new file mode 100644 index 000000000..66adb011f Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia7.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia8.JPG b/docs/Presentations/TASK_DISPATCHER/Dia8.JPG new file mode 100644 index 000000000..cf0b93e30 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia8.JPG differ diff --git a/docs/Presentations/TASK_DISPATCHER/Dia9.JPG b/docs/Presentations/TASK_DISPATCHER/Dia9.JPG new file mode 100644 index 000000000..49335ef21 Binary files /dev/null and b/docs/Presentations/TASK_DISPATCHER/Dia9.JPG differ