This commit is contained in:
David Pierron
2025-01-31 15:01:22 +01:00
parent 24d1dcdc33
commit 7055c565ac
3 changed files with 80 additions and 70 deletions
+3 -3
View File
@@ -254,7 +254,7 @@ ctld.i18n["fr"]["Drop Orange Smoke"] = "Déposer Fumi Orange"
ctld.i18n["fr"]["Drop Green Smoke"] = "Déposer Fumi Vert" ctld.i18n["fr"]["Drop Green Smoke"] = "Déposer Fumi Vert"
ctld.i18n["fr"]["Drop Beacon"] = "Déposer Fumi Vert" ctld.i18n["fr"]["Drop Beacon"] = "Déposer Fumi Vert"
ctld.i18n["fr"]["Radio Beacons"] = "Déposer Balise" ctld.i18n["fr"]["Radio Beacons"] = "Déposer Balise"
ctld.i18n["fr"]["Remove Closet Beacon"] = "Supprimer Balise +proche" ctld.i18n["fr"]["Remove Closest Beacon"] = "Supprimer Balise +proche"
ctld.i18n["fr"]["JTAC Status"] = "Statut JTAC" ctld.i18n["fr"]["JTAC Status"] = "Statut JTAC"
ctld.i18n["fr"]["DISABLE "] = "DESACTIVE " ctld.i18n["fr"]["DISABLE "] = "DESACTIVE "
ctld.i18n["fr"]["ENABLE "] = "ACTIVE " ctld.i18n["fr"]["ENABLE "] = "ACTIVE "
@@ -521,7 +521,7 @@ ctld.i18n["es"]["Drop Orange Smoke"] = "Soltar humo naranja"
ctld.i18n["es"]["Drop Green Smoke"] = "Soltar humo verde" ctld.i18n["es"]["Drop Green Smoke"] = "Soltar humo verde"
ctld.i18n["es"]["Drop Beacon"] = "Soltar baliza" ctld.i18n["es"]["Drop Beacon"] = "Soltar baliza"
ctld.i18n["es"]["Radio Beacons"] = "Balizas de radio" ctld.i18n["es"]["Radio Beacons"] = "Balizas de radio"
ctld.i18n["es"]["Remove Closet Beacon"] = "Quitar baliza cercana" ctld.i18n["es"]["Remove Closest Beacon"] = "Quitar baliza cercana"
ctld.i18n["es"]["JTAC Status"] = "Estado de JTAC" ctld.i18n["es"]["JTAC Status"] = "Estado de JTAC"
ctld.i18n["es"]["DISABLE "] = "DESHABILITAR " ctld.i18n["es"]["DISABLE "] = "DESHABILITAR "
ctld.i18n["es"]["ENABLE "] = "HABILITAR " ctld.i18n["es"]["ENABLE "] = "HABILITAR "
@@ -771,7 +771,7 @@ ctld.i18n["ko"]["Drop Orange Smoke"] = "주황색 연막 투하"
ctld.i18n["ko"]["Drop Green Smoke"] = "녹색 연막 투하" ctld.i18n["ko"]["Drop Green Smoke"] = "녹색 연막 투하"
ctld.i18n["ko"]["Drop Beacon"] = "비콘 투하" ctld.i18n["ko"]["Drop Beacon"] = "비콘 투하"
ctld.i18n["ko"]["Radio Beacons"] = "라디오 비콘" ctld.i18n["ko"]["Radio Beacons"] = "라디오 비콘"
ctld.i18n["ko"]["Remove Closet Beacon"] = "가까운 비콘 제거" ctld.i18n["ko"]["Remove Closest Beacon"] = "가까운 비콘 제거"
ctld.i18n["ko"]["JTAC Status"] = "JTAC 상태" ctld.i18n["ko"]["JTAC Status"] = "JTAC 상태"
ctld.i18n["ko"]["DISABLE "] = "비활성화 " ctld.i18n["ko"]["DISABLE "] = "비활성화 "
ctld.i18n["ko"]["ENABLE "] = "활성화 " ctld.i18n["ko"]["ENABLE "] = "활성화 "
+75 -67
View File
@@ -305,7 +305,7 @@ ctld.i18n["en"]["Drop Orange Smoke"] = nil
ctld.i18n["en"]["Drop Green Smoke"] = nil ctld.i18n["en"]["Drop Green Smoke"] = nil
ctld.i18n["en"]["Drop Beacon"] = nil ctld.i18n["en"]["Drop Beacon"] = nil
ctld.i18n["en"]["Radio Beacons"] = nil ctld.i18n["en"]["Radio Beacons"] = nil
ctld.i18n["en"]["Remove Closet Beacon"] = nil ctld.i18n["en"]["Remove Closest Beacon"] = nil
ctld.i18n["en"]["JTAC Status"] = nil ctld.i18n["en"]["JTAC Status"] = nil
ctld.i18n["en"]["DISABLE "] = nil ctld.i18n["en"]["DISABLE "] = nil
ctld.i18n["en"]["ENABLE "] = nil ctld.i18n["en"]["ENABLE "] = nil
@@ -5647,7 +5647,7 @@ function ctld.addTransportF10MenuOptions(_unitName)
missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Load Nearby Crate"), _crateCommands, ctld.loadNearbyCrate, _unitName ) missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Load Nearby Crate"), _crateCommands, ctld.loadNearbyCrate, _unitName )
end end
end end
if ctld.loadCrateFromMenu or ctld.hoverPickup then if ctld.loadCrateFromMenu or ctld.hoverPickup then
missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Drop Crate"), _crateCommands, ctld.dropSlingCrate, { _unitName }) missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Drop Crate"), _crateCommands, ctld.dropSlingCrate, { _unitName })
end end
@@ -5672,7 +5672,7 @@ function ctld.addTransportF10MenuOptions(_unitName)
local _radioCommands = missionCommands.addSubMenuForGroup(_groupId, ctld.i18n_translate("Radio Beacons"), _rootPath) local _radioCommands = missionCommands.addSubMenuForGroup(_groupId, ctld.i18n_translate("Radio Beacons"), _rootPath)
missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("List Beacons"), _radioCommands, ctld.listRadioBeacons, { _unitName }) missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("List Beacons"), _radioCommands, ctld.listRadioBeacons, { _unitName })
missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Drop Beacon"), _radioCommands, ctld.dropRadioBeacon, { _unitName }) missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Drop Beacon"), _radioCommands, ctld.dropRadioBeacon, { _unitName })
missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Remove Closet Beacon"), _radioCommands, ctld.removeRadioBeacon, { _unitName }) missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Remove Closest Beacon"), _radioCommands, ctld.removeRadioBeacon, { _unitName })
elseif ctld.deployedRadioBeacons ~= {} then elseif ctld.deployedRadioBeacons ~= {} then
local _radioCommands = missionCommands.addSubMenuForGroup(_groupId, ctld.i18n_translate("Radio Beacons"), _rootPath) local _radioCommands = missionCommands.addSubMenuForGroup(_groupId, ctld.i18n_translate("Radio Beacons"), _rootPath)
missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("List Beacons"), _radioCommands, ctld.listRadioBeacons, { _unitName }) missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("List Beacons"), _radioCommands, ctld.listRadioBeacons, { _unitName })
@@ -7284,12 +7284,11 @@ end
-- examples --------------------------------------------------------- -- examples ---------------------------------------------------------
--ctld.reconRefreshTargetsInLosOnF10Map(Unit.getByName("uh2-1"), 2000, 200) --ctld.reconRefreshTargetsInLosOnF10Map(Unit.getByName("uh2-1"), 2000, 200)
--ctld.reconRemoveTargetsInLosOnF10Map(Unit.getByName("uh2-1")) --ctld.reconRemoveTargetsInLosOnF10Map(Unit.getByName("uh2-1"))
--ctld.reconShowTargetsInLosOnF10Map(Unit.getByName("uh2-1"), 2000, 200) --ctld.reconShowTargetsInLosOnF10Map(Unit.getByName("uh2-1"), 2000, 200)
---------------------------------------------------------------------- ----------------------------------------------------------------------
--if ctld == nil then ctld = {} end --if ctld == nil then ctld = {} end
if ctld.lastMarkId == nil then if ctld.lastMarkId == nil then
ctld.lastMarkId = 0 ctld.lastMarkId = 0
end end
-- ***************** RECON CONFIGURATION ***************** -- ***************** RECON CONFIGURATION *****************
@@ -7298,12 +7297,12 @@ ctld.reconMenuName = ctld.i18n_translate("RECON") --name of the CTLD JTAC
ctld.reconRadioAdded = {} --stores the groups that have had the radio menu added ctld.reconRadioAdded = {} --stores the groups that have had the radio menu added
ctld.reconLosSearchRadius = 2000 -- search radius in meters ctld.reconLosSearchRadius = 2000 -- search radius in meters
ctld.reconLosMarkRadius = 100 -- mark radius dimension in meters ctld.reconLosMarkRadius = 100 -- mark radius dimension in meters
ctld.reconAutoRefreshLosTargetMarks = true -- if true recon LOS marks are automaticaly refreshed on F10 map ctld.reconAutoRefreshLosTargetMarks = true -- if true recon LOS marks are automaticaly refreshed on F10 map
ctld.reconLastScheduleIdAutoRefresh = 0 ctld.reconLastScheduleIdAutoRefresh = 0
---- F10 RECON Menus ------------------------------------------------------------------ ---- F10 RECON Menus ------------------------------------------------------------------
function ctld.addReconRadioCommand(_side) -- _side = 1 or 2 (red or blue) function ctld.addReconRadioCommand(_side) -- _side = 1 or 2 (red or blue)
if ctld.reconF10Menu then if ctld.reconF10Menu then
if _side == 1 or _side == 2 then if _side == 1 or _side == 2 then
local _players = coalition.getPlayers(_side) local _players = coalition.getPlayers(_side)
if _players ~= nil then if _players ~= nil then
@@ -7313,29 +7312,37 @@ function ctld.addReconRadioCommand(_side) -- _side = 1 or 2 (red or blue)
if ctld.reconRadioAdded[tostring(_groupId)] == nil then if ctld.reconRadioAdded[tostring(_groupId)] == nil then
ctld.logDebug("ctld.addReconRadioCommand - adding RECON radio menu for unit [%s]", ctld.p(_playerUnit:getName())) ctld.logDebug("ctld.addReconRadioCommand - adding RECON radio menu for unit [%s]", ctld.p(_playerUnit:getName()))
local RECONpath = missionCommands.addSubMenuForGroup(_groupId, ctld.reconMenuName) local RECONpath = missionCommands.addSubMenuForGroup(_groupId, ctld.reconMenuName)
missionCommands.addCommandForGroup( _groupId, ctld.i18n_translate("Show targets in LOS (refresh)"), RECONpath, missionCommands.addCommandForGroup(_groupId,
ctld.reconRefreshTargetsInLosOnF10Map, { _groupId = _groupId, ctld.i18n_translate("Show targets in LOS (refresh)"), RECONpath,
_playerUnit = _playerUnit, ctld.reconRefreshTargetsInLosOnF10Map, {
_searchRadius = ctld.reconLosSearchRadius, _groupId = _groupId,
_markRadius = ctld.reconLosMarkRadius, _playerUnit = _playerUnit,
_boolRemove = true}) _searchRadius = ctld.reconLosSearchRadius,
_markRadius = ctld.reconLosMarkRadius,
_boolRemove = true
})
missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Hide targets in LOS"), RECONpath, ctld.reconRemoveTargetsInLosOnF10Map, _playerUnit) missionCommands.addCommandForGroup(_groupId, ctld.i18n_translate("Hide targets in LOS"), RECONpath, ctld.reconRemoveTargetsInLosOnF10Map, _playerUnit)
if ctld.reconAutoRefreshLosTargetMarks then if ctld.reconAutoRefreshLosTargetMarks then
local c1 = missionCommands.addCommandForGroup( _groupId, ctld.i18n_translate("STOP autoRefresh targets in LOS"), RECONpath, missionCommands.addCommandForGroup(_groupId,
ctld.reconStopAutorefreshTargetsInLosOnF10Map, _groupId, _playerUnit) ctld.i18n_translate("STOP autoRefresh targets in LOS"), RECONpath,
ctld.reconStopAutorefreshTargetsInLosOnF10Map,
_groupId,
_playerUnit,
ctld.reconLosSearchRadius,
ctld.reconLosMarkRadius,
true)
else else
local c2 = missionCommands.addCommandForGroup( _groupId, ctld.i18n_translate("START autoRefresh targets in LOS"), RECONpath, missionCommands.addCommandForGroup(_groupId,
ctld.reconStartAutorefreshTargetsInLosOnF10Map, ctld.i18n_translate("START autoRefresh targets in LOS"), RECONpath,
_groupId, ctld.reconStartAutorefreshTargetsInLosOnF10Map,
_playerUnit, _groupId,
ctld.reconLosSearchRadius, _playerUnit,
ctld.reconLosMarkRadius, ctld.reconLosSearchRadius,
true ctld.reconLosMarkRadius,
) true
)
end end
ctld.reconRadioAdded[tostring(_groupId)] = timer.getTime() --fetch the time to check for a regular refresh ctld.reconRadioAdded[tostring(_groupId)] = timer.getTime() --fetch the time to check for a regular refresh
else
end end
end end
end end
@@ -7344,50 +7351,51 @@ function ctld.addReconRadioCommand(_side) -- _side = 1 or 2 (red or blue)
end end
end end
-------------------------------------------------------------------- --------------------------------------------------------------------
function ctld.reconStopAutorefreshTargetsInLosOnF10Map(_groupId, _playerUnit) function ctld.reconStopAutorefreshTargetsInLosOnF10Map(_groupId, _playerUnit, _searchRadius, _markRadius, _boolRemove)
ctld.reconAutoRefreshLosTargetMarks = false ctld.reconAutoRefreshLosTargetMarks = false
if ctld.reconLastScheduleIdAutoRefresh ~= 0 then if ctld.reconLastScheduleIdAutoRefresh ~= 0 then
timer.removeFunction(ctld.reconLastScheduleIdAutoRefresh) -- reset last schedule timer.removeFunction(ctld.reconLastScheduleIdAutoRefresh) -- reset last schedule
end end
ctld.reconRemoveTargetsInLosOnF10Map(_playerUnit) ctld.reconRemoveTargetsInLosOnF10Map(_playerUnit)
missionCommands.removeItemForGroup(_groupId, {ctld.reconMenuName, ctld.i18n_translate("STOP autoRefresh targets in LOS")}) missionCommands.removeItemForGroup(_groupId, {ctld.reconMenuName, ctld.i18n_translate("STOP autoRefresh targets in LOS")})
missionCommands.addCommandForGroup( _groupId, ctld.i18n_translate("START autoRefresh targets in LOS"), {ctld.reconMenuName}, missionCommands.addCommandForGroup( _groupId, ctld.i18n_translate("START autoRefresh targets in LOS"), {ctld.reconMenuName},
ctld.reconStartAutorefreshTargetsInLosOnF10Map, ctld.reconStartAutorefreshTargetsInLosOnF10Map,
_groupId, _groupId,
_playerUnit, _playerUnit,
_searchRadius, _searchRadius,
_markRadius, _markRadius,
_boolRemove) _boolRemove)
end end
-------------------------------------------------------------------- --------------------------------------------------------------------
function ctld.reconStartAutorefreshTargetsInLosOnF10Map(_groupId, _playerUnit, _searchRadius, _markRadius, _boolRemove) function ctld.reconStartAutorefreshTargetsInLosOnF10Map(_groupId, _playerUnit, _searchRadius, _markRadius, _boolRemove)
ctld.reconAutoRefreshLosTargetMarks = true ctld.reconAutoRefreshLosTargetMarks = true
ctld.reconRefreshTargetsInLosOnF10Map({ _groupId = _groupId, ctld.reconRefreshTargetsInLosOnF10Map({ _groupId = _groupId,
_playerUnit = _playerUnit, _playerUnit = _playerUnit,
_searchRadius = ctld.reconLosSearchRadius, _searchRadius = _searchRadius or ctld.reconLosSearchRadius,
_markRadius = ctld.reconLosMarkRadius, _markRadius = _markRadius or ctld.reconLosMarkRadius,
_boolRemove = true}, _boolRemove = _boolRemove or true},
timer.getTime()) timer.getTime())
missionCommands.removeItemForGroup( _groupId, {ctld.reconMenuName, ctld.i18n_translate("START autoRefresh targets in LOS")}) missionCommands.removeItemForGroup( _groupId, {ctld.reconMenuName, ctld.i18n_translate("START autoRefresh targets in LOS")})
missionCommands.addCommandForGroup( _groupId, ctld.i18n_translate("STOP autoRefresh targets in LOS"), {ctld.reconMenuName}, missionCommands.addCommandForGroup( _groupId, ctld.i18n_translate("STOP autoRefresh targets in LOS"), {ctld.reconMenuName},
ctld.reconStopAutorefreshTargetsInLosOnF10Map, ctld.reconStopAutorefreshTargetsInLosOnF10Map,
_groupId, _groupId,
_playerUnit) _playerUnit,
_searchRadius,
_markRadius,
_boolRemove)
end end
-------------------------------------------------------------------- --------------------------------------------------------------------
function ctld.reconShowTargetsInLosOnF10Map(_playerUnit, _searchRadius, _markRadius) -- _groupId targeting function ctld.reconShowTargetsInLosOnF10Map(_playerUnit, _searchRadius, _markRadius) -- _groupId targeting
-- _searchRadius and _markRadius in meters -- _searchRadius and _markRadius in meters
if _playerUnit then if _playerUnit then
local TargetsInLOS = {} local TargetsInLOS = {}
local enemyCoa = 1
local enemyColor = "red" local enemyColor = "red"
local color = {1, 0, 0, 0.2} -- red local color = {1, 0, 0, 0.2} -- red
if _playerUnit:getCoalition() == 1 then if _playerUnit:getCoalition() == 1 then
enemyCoa = 2
enemyColor = "blue" enemyColor = "blue"
color = {51/255, 51/255, 1, 0.2} -- blue color = {51/255, 51/255, 1, 0.2} -- blue
end end
@@ -7396,20 +7404,20 @@ function ctld.reconShowTargetsInLosOnF10Map(_playerUnit, _searchRadius, _markRad
local MarkIds = {} local MarkIds = {}
if t then if t then
for i=1, #t do -- for each unit having los on enemies for i=1, #t do -- for each unit having los on enemies
for j=1, #t[i].vis do -- for each enemy unit in los for j=1, #t[i].vis do -- for each enemy unit in los
local targetPoint = t[i].vis[j]:getPoint() -- point of each target on LOS local targetPoint = t[i].vis[j]:getPoint() -- point of each target on LOS
ctld.lastMarkId = ctld.lastMarkId + 1 ctld.lastMarkId = ctld.lastMarkId + 1
trigger.action.circleToAll(_playerUnit:getCoalition(), ctld.lastMarkId, targetPoint, _markRadius , color, color, 1, false, nil) trigger.action.circleToAll(_playerUnit:getCoalition(), ctld.lastMarkId, targetPoint, _markRadius , color, color, 1, false, nil)
MarkIds[#MarkIds+1] = ctld.lastMarkId MarkIds[#MarkIds+1] = ctld.lastMarkId
TargetsInLOS[#TargetsInLOS+1] = {targetObject = t[i].vis[j]:getName(), TargetsInLOS[#TargetsInLOS+1] = { targetObject = t[i].vis[j]:getName(),
targetTypeName = t[i].vis[j]:getTypeName(), targetTypeName = t[i].vis[j]:getTypeName(),
targetPoint = targetPoint} targetPoint = targetPoint}
end end
end end
end end
mist.DBs.humansByName[_playerUnit:getName()].losMarkIds = MarkIds -- store list of marksIds generated and showed on F10 map mist.DBs.humansByName[_playerUnit:getName()].losMarkIds = MarkIds -- store list of marksIds generated and showed on F10 map
return TargetsInLOS return TargetsInLOS
else else
return nil return nil
end end
@@ -7417,33 +7425,33 @@ end
--------------------------------------------------------- ---------------------------------------------------------
function ctld.reconRemoveTargetsInLosOnF10Map(_playerUnit) function ctld.reconRemoveTargetsInLosOnF10Map(_playerUnit)
local unitName = _playerUnit:getName() local unitName = _playerUnit:getName()
if mist.DBs.humansByName[unitName].losMarkIds then if mist.DBs.humansByName[unitName].losMarkIds then
for i=1, #mist.DBs.humansByName[unitName].losMarkIds do -- for each unit having los on enemies for i=1, #mist.DBs.humansByName[unitName].losMarkIds do -- for each unit having los on enemies
trigger.action.removeMark(mist.DBs.humansByName[unitName].losMarkIds[i]) trigger.action.removeMark(mist.DBs.humansByName[unitName].losMarkIds[i])
end end
mist.DBs.humansByName[unitName].losMarkIds = nil mist.DBs.humansByName[unitName].losMarkIds = nil
end end
end end
--------------------------------------------------------- ---------------------------------------------------------
function ctld.reconRefreshTargetsInLosOnF10Map(_params, _t) -- _params._playerUnit targeting function ctld.reconRefreshTargetsInLosOnF10Map(_params, _t) -- _params._playerUnit targeting
-- _params._searchRadius and _params._markRadius in meters -- _params._searchRadius and _params._markRadius in meters
-- _params._boolRemove = true to remove previous marksIds -- _params._boolRemove = true to remove previous marksIds
if _t == nil then _t = timer.getTime() end if _t == nil then _t = timer.getTime() end
if ctld.reconAutoRefreshLosTargetMarks then -- to follow mobile enemy targets if ctld.reconAutoRefreshLosTargetMarks then -- to follow mobile enemy targets
ctld.reconLastScheduleIdAutoRefresh = timer.scheduleFunction(ctld.reconRefreshTargetsInLosOnF10Map, {_groupId = _params._groupId, ctld.reconLastScheduleIdAutoRefresh = timer.scheduleFunction(ctld.reconRefreshTargetsInLosOnF10Map, {_groupId = _params._groupId,
_playerUnit = _params._playerUnit, _playerUnit = _params._playerUnit,
_searchRadius = _params._searchRadius, _searchRadius = _params._searchRadius,
_markRadius = _params._markRadius, _markRadius = _params._markRadius,
_boolRemove = _params._boolRemove _boolRemove = _params._boolRemove
}, },
timer.getTime() + 10) timer.getTime() + 10)
end end
if _params._boolRemove == true then if _params._boolRemove == true then
ctld.reconRemoveTargetsInLosOnF10Map(_params._playerUnit) ctld.reconRemoveTargetsInLosOnF10Map(_params._playerUnit)
end end
return ctld.reconShowTargetsInLosOnF10Map(_params._playerUnit, _params._searchRadius, _params._markRadius) -- returns TargetsInLOS table return ctld.reconShowTargetsInLosOnF10Map(_params._playerUnit, _params._searchRadius, _params._markRadius) -- returns TargetsInLOS table
end end
--- test ------------------------------------------------------ --- test ------------------------------------------------------
+2
View File
@@ -1125,6 +1125,8 @@ ctld.addCallback(function(_args)
end) end)
``` ```
Below is a complete list of all the "actions" plus the data that is sent through. For more information its best to check the CTLD Code to see more details of the arguments.
* `{unit = "Unit that did the action", unloaded = "DCS Troops Group", action = "dropped_troops"}` * `{unit = "Unit that did the action", unloaded = "DCS Troops Group", action = "dropped_troops"}`
* `{unit = "Unit that did the action", unloaded = "DCS Vehicles Group", action = "dropped_vehicles"}` * `{unit = "Unit that did the action", unloaded = "DCS Vehicles Group", action = "dropped_vehicles"}`
* `{unit = "Unit that did the action", unloaded = "List of picked up vehicles", action = "load_vehicles"}` * `{unit = "Unit that did the action", unloaded = "List of picked up vehicles", action = "load_vehicles"}`