4 Commits

Author SHA1 Message Date
David Pierron
a26c0f6a5d Release 202412.01
**Release 202412.01**

Pulled some code from @atcz, @marcos2221, and @Queton1-1.

Added some features developped internally by the Virtual European Air Force (VEAF) team.

Changelog:
- VEAF: multipart AA Systems / AA crates stacking features
- VEAF: hardened legacy code to make it more resilient (less errors)
- Queton1-1: Allow units to CTLD by aircraft type and not by pilot name
- atcz: Use crate headings to spawn units
- marcos2221: multiple crate capability for mi8 and ch-47
- atcz: added pagination to the radio menus
- atcz: smartly used decimals to facilitate having a lot of units to load in our crates
- atcz: added lots of vehicles to transport
- VEAF: use DCS events to register pilots with CTLD
- VEAF: it's now possible to allow both sling, conventional (DCS, CH-47 only for now) and simulated sling (CTLD) loading at the same time, letting players choose
- VEAF: units capable of conventional loading (CH-47) now have the crates spawned at their 6-o'clock
- moved smoke marker randomly away from the JTAC target
- atcz: updated the soldier type for troops transport
- updated the cargo + troops load report (details the weight)
2024-12-17 17:55:18 +01:00
David Pierron
76a6dca72a updated test mission 2024-12-17 17:54:36 +01:00
David Pierron
55846e3109 hardened the code to avoid a nil value in ctld.setGrpROE 2024-12-17 09:02:41 +01:00
David Pierron
ebf72aaa44 updated test mission 2024-12-10 11:30:48 +01:00
2 changed files with 7 additions and 4 deletions

View File

@@ -5276,12 +5276,13 @@ function ctld.addTransportF10MenuOptions(_unitName)
local status, error = pcall(function()
local _unit = ctld.getTransportUnit(_unitName)
ctld.logTrace("_unit = %s", ctld.p(_unit))
if _unit then
local _unitTypename = _unit:getTypeName()
local _groupId = ctld.getGroupId(_unit)
if _groupId then
ctld.logTrace("_groupId = %s", ctld.p(_groupId))
if ctld.addedTo[tostring(_groupId)] == nil then
local _rootPath = missionCommands.addSubMenuForGroup(_groupId, "CTLD")
@@ -6770,9 +6771,7 @@ function ctld.setGrpROE(_grp, _ROE)
_ROE = AI.Option.Ground.val.ROE.OPEN_FIRE
end
_grp = ctld.getAliveGroup(_grp)
if _grp ~= nil then
if _grp and _grp:isExist() == true and #_grp:getUnits() > 0 then -- check if the group truly exists
local _controller = _grp:getController();
Controller.setOption(_controller, AI.Option.Ground.id.ALARM_STATE, AI.Option.Ground.val.ALARM_STATE.AUTO)
Controller.setOption(_controller, AI.Option.Ground.id.ROE, _ROE)
@@ -7367,6 +7366,7 @@ end
--- Handle world events.
ctld.eventHandler = {}
function ctld.eventHandler:onEvent(event)
ctld.logTrace("ctld.eventHandler:onEvent(), event = %s", ctld.p(event))
if event == nil then
ctld.logError("Event handler was called with a nil event!")
return
@@ -7384,6 +7384,7 @@ function ctld.eventHandler:onEvent(event)
local unitName = nil
if event.initiator ~= nil and event.initiator.getName then
unitName = event.initiator:getName()
ctld.logTrace("unitName = %s", ctld.p(unitName))
end
if not unitName then
ctld.logWarning("no unitname found in event %s", ctld.p(event))
@@ -7404,6 +7405,7 @@ function ctld.eventHandler:onEvent(event)
if ctld.addPlayerAircraftByType then
for _,aircraftType in pairs(ctld.aircraftTypeTable) do
if aircraftType == playerTypeName then
ctld.logTrace("adding by aircraft type, unitName = %s", ctld.p(unitName))
-- add transport unit to the list
table.insert(ctld.transportPilotNames, unitName)
-- add transport radio menu
@@ -7414,6 +7416,7 @@ function ctld.eventHandler:onEvent(event)
else
for _, _unitName in pairs(ctld.transportPilotNames) do
if _unitName == unitName then
ctld.logTrace("adding by transportPilotNames, unitName = %s", ctld.p(unitName))
-- add transport radio menu
ctld.addTransportF10MenuOptions(unitName)
break

Binary file not shown.