mirror of
https://github.com/iTracerFacer/DCS_MissionDev.git
synced 2025-12-03 04:14:46 +00:00
155 lines
5.2 KiB
Lua
155 lines
5.2 KiB
Lua
--Ops - Office of Military Intelligence.
|
|
--
|
|
--Main Features:
|
|
---Detect and track contacts consistently
|
|
---Detect and track clusters of contacts consistently
|
|
---Once detected and still alive, planes will be tracked 10 minutes, helicopters 20 minutes, ships and trains 1 hour, ground units 2 hours
|
|
-- Docs: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Ops.Intel.html
|
|
|
|
-- Configuration
|
|
local EnableF10Menu = true -- Set to false to disable F10 menu options
|
|
|
|
-- Setup Detection Group
|
|
local msgTime = 15
|
|
Blue_Intel_Message_Setting = false
|
|
|
|
Blue_Intel_DetectionGroup = SET_GROUP:New()
|
|
--Blue_Intel_DetectionGroup:FilterPrefixes( { "BLUE-EWR", "BLUE-RECON" } )
|
|
Blue_Intel_DetectionGroup:FilterCoalitions("blue"):FilterActive(true):FilterStart()
|
|
|
|
|
|
-- Setup the INTEL
|
|
Blue_Intel = INTEL:New(Blue_Intel_DetectionGroup, "blue", "CIA")
|
|
Blue_Intel:SetClusterAnalysis(true, true)
|
|
Blue_Intel:SetClusterRadius(5)
|
|
Blue_Intel:SetVerbosity(2)
|
|
Blue_Intel:__Start(10)
|
|
|
|
-- On After New Contact
|
|
function Blue_Intel:OnAfterNewContact(From, Event, To, Contact)
|
|
local text = string.format("NEW contact %s detected by %s", Contact.groupname, Contact.recce or "unknown")
|
|
|
|
if (Blue_Intel_Message_Setting == true) then
|
|
MESSAGE:New(text, msgTime, "CIA"):ToBlue()
|
|
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.BLUE)
|
|
end
|
|
end
|
|
-- On After New Cluster
|
|
function Blue_Intel:OnAfterNewCluster(From, Event, To, Cluster)
|
|
local text = string.format("NEW cluster #%d of size %d", Cluster.index, Cluster.size)
|
|
|
|
if (Blue_Intel_Message_Setting == true) then
|
|
MESSAGE:New(text, msgTime,"CIA"):ToBlue()
|
|
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.BLUE)
|
|
end
|
|
end
|
|
|
|
function Blue_IntelMessageSettingOn()
|
|
if (Blue_Intel_Message_Setting == true) then
|
|
MESSAGE:New("Setting INTEL messages to ON", msgTime,"CIA"):ToBlue()
|
|
Blue_Intel_Message_Setting = true
|
|
end
|
|
end
|
|
|
|
function Blue_IntelMessageSettingOff()
|
|
if (Blue_Intel_Message_Setting == true) then
|
|
MESSAGE:New("Setting INTEL messages to OFF", msgTime,"CIA"):ToBlue()
|
|
Blue_Intel_Message_Setting = false
|
|
end
|
|
end
|
|
|
|
-- Create F10 Menu (only if enabled)
|
|
if EnableF10Menu then
|
|
-- Use MenuManager if available, otherwise create root menu
|
|
local INTELMenu
|
|
if MenuManager then
|
|
INTELMenu = MenuManager.CreateCoalitionMenu(coalition.side.BLUE, "INTEL HQ")
|
|
else
|
|
INTELMenu = MENU_COALITION:New(coalition.side.BLUE, "INTEL HQ")
|
|
end
|
|
MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Dispaly Messages (ON)", INTELMenu, Blue_IntelMessageSettingOn)
|
|
MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Dispaly Messages (OFF)", INTELMenu, Blue_IntelMessageSettingOff)
|
|
end
|
|
|
|
|
|
|
|
--Ops - Office of Military Intelligence.
|
|
--
|
|
--Main Features:
|
|
---Detect and track contacts consistently
|
|
---Detect and track clusters of contacts consistently
|
|
---Once detected and still alive, planes will be tracked 10 minutes, helicopters 20 minutes, ships and trains 1 hour, ground units 2 hours
|
|
-- Docs: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Ops.Intel.html
|
|
|
|
-- Setup Detection Group
|
|
|
|
Red_Intel_Message_Setting = false
|
|
|
|
Red_Intel_DetectionGroup = SET_GROUP:New()
|
|
--Red_Intel_DetectionGroup:FilterPrefixes( { "RED-EWR", "RED-RECON" } )
|
|
Red_Intel_DetectionGroup:FilterCoalitions("red"):FilterActive(true):FilterStart()
|
|
|
|
|
|
-- Setup the INTEL
|
|
Red_Intel = INTEL:New(Red_Intel_DetectionGroup, "red", "KGB")
|
|
Red_Intel:SetClusterAnalysis(true, true)
|
|
Red_Intel:SetClusterRadius(5)
|
|
Red_Intel:SetVerbosity(2)
|
|
Red_Intel:__Start(10)
|
|
|
|
-- On After New Contact
|
|
function Red_Intel:OnAfterNewContact(From, Event, To, Contact)
|
|
local text = string.format("NEW contact %s detected by %s", Contact.groupname, Contact.recce or "unknown")
|
|
|
|
if (Red_Intel_Message_Setting == true) then
|
|
MESSAGE:New(text, msgTime, "KGB"):ToRed()
|
|
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.RED)
|
|
end
|
|
end
|
|
-- On After New Cluster
|
|
function Red_Intel:OnAfterNewCluster(From, Event, To, Cluster)
|
|
local text = string.format("NEW cluster #%d of size %d", Cluster.index, Cluster.size)
|
|
|
|
if (Red_Intel_Message_Setting == true) then
|
|
MESSAGE:New(text, msgTime,"KGB"):ToRed()
|
|
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.RED)
|
|
end
|
|
end
|
|
|
|
function Red_IntelMessageSettingOn()
|
|
if (Red_Intel_Message_Setting == true) then
|
|
MESSAGE:New("Setting INTEL messages to ON", msgTime,"KGB"):ToRed()
|
|
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.RED)
|
|
Red_Intel_Message_Setting = true
|
|
end
|
|
end
|
|
|
|
function Red_IntelMessageSettingOff()
|
|
if (Red_Intel_Message_Setting == true) then
|
|
MESSAGE:New("Setting INTEL messages to OFF", msgTime,"KGB"):ToRed()
|
|
Red_Intel_Message_Setting = false
|
|
end
|
|
end
|
|
|
|
-- Create F10 Menu (only if enabled)
|
|
if EnableF10Menu then
|
|
-- Use MenuManager if available, otherwise create root menu
|
|
local RedINTELMenu
|
|
if MenuManager then
|
|
RedINTELMenu = MenuManager.CreateCoalitionMenu(coalition.side.RED, "INTEL HQ")
|
|
else
|
|
RedINTELMenu = MENU_COALITION:New(coalition.side.RED, "INTEL HQ")
|
|
end
|
|
MENU_COALITION_COMMAND:New(coalition.side.RED, "Dispaly Messages (ON)", RedINTELMenu, Red_IntelMessageSettingOn)
|
|
MENU_COALITION_COMMAND:New(coalition.side.RED, "Dispaly Messages (OFF)", RedINTELMenu, Red_IntelMessageSettingOff)
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|