mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2026-08-12 16:17:04 +00:00
Compare commits
184 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e59bc50e6c | |||
| c12c0b242d | |||
| 659268d3f5 | |||
| c9270a0fd2 | |||
| def40f440c | |||
| 417c57f97c | |||
| dec5bf02b4 | |||
| 68693300dc | |||
| f7f603c486 | |||
| 290950a16b | |||
| 041a9ab6af | |||
| 8d73c966db | |||
| af3e4fab17 | |||
| 97e7c72144 | |||
| 65336fdab8 | |||
| 61db3e9f93 | |||
| a1da0ea1c4 | |||
| 782940265d | |||
| b5cd8929f3 | |||
| 1826d28a86 | |||
| 359bf1418d | |||
| e3424c6af5 | |||
| 1ac3b3f8a9 | |||
| e13e630830 | |||
| 7bfed7ef55 | |||
| 8bfaba399f | |||
| 4dada3d24d | |||
| 74b40fe3cb | |||
| aa8bc78b27 | |||
| 7286a6a010 | |||
| c8bb41648c | |||
| 08635622b0 | |||
| 42e8549649 | |||
| 5c48a9d756 | |||
| f3983c6a90 | |||
| 1c66408127 | |||
| 3ac2b3b22c | |||
| c576268d87 | |||
| 35f52d543a | |||
| c608d00d15 | |||
| d2789f554a | |||
| fcef6a66d1 | |||
| dd71451194 | |||
| 807e81e389 | |||
| 33d8810ebb | |||
| 87e8a31f31 | |||
| e4a0fff931 | |||
| ca5bf76c78 | |||
| f8659c5de6 | |||
| 9a0cc8eeee | |||
| a706890cb6 | |||
| 815684dd77 | |||
| 0ccb2ba7bb | |||
| 1e471df264 | |||
| cc8b916870 | |||
| cd62d0c60a | |||
| a35e023752 | |||
| f71e7f3213 | |||
| a468faefec | |||
| 99f2c7aec0 | |||
| 7db8e2d772 | |||
| 026099bd12 | |||
| 82a330e61a | |||
| b3470250e4 | |||
| bbde4ae62b | |||
| 540a316754 | |||
| 574217d931 | |||
| 1fce52088d | |||
| 4d704a489e | |||
| da80f9ea06 | |||
| 93260908c4 | |||
| 3c261e8dc2 | |||
| 7b7eb62bf0 | |||
| 951ee37903 | |||
| 3a7ab50834 | |||
| 9a69d4b52c | |||
| 0345d16150 | |||
| d071fba20f | |||
| 1a32ce6b57 | |||
| 85275ad84b | |||
| 819ba2de53 | |||
| 8f34ad3902 | |||
| 16f366d039 | |||
| 2524320096 | |||
| e6b8c9ba14 | |||
| a5b47503be | |||
| aaa25dcd41 | |||
| e834dd1395 | |||
| 774e499759 | |||
| 0a1f4de471 | |||
| f9cd8b8b51 | |||
| 3eef8d9a5d | |||
| e1b9e1d7d8 | |||
| ca976f4387 | |||
| 91f74b73ed | |||
| f8df243043 | |||
| 29b19d5262 | |||
| 48aca9d488 | |||
| 12741d0532 | |||
| 6df583b9f1 | |||
| ca99c58f98 | |||
| 879272a2e8 | |||
| 267156e04e | |||
| 6fa12ca46f | |||
| eb22f5dc67 | |||
| 601805abb0 | |||
| e0e4279f20 | |||
| 9023c571ba | |||
| 72aab26e43 | |||
| aef146a6d8 | |||
| d8db662dc5 | |||
| e4f13f98b1 | |||
| c1aba95b6f | |||
| d50bcfccd9 | |||
| f0f095e274 | |||
| 69f04dfd57 | |||
| 546f3feaae | |||
| 23e83bf53a | |||
| ee07423588 | |||
| 96d801c342 | |||
| b1818d9fb3 | |||
| 2bc6e76516 | |||
| 61a1fd42ee | |||
| 954a6b0fad | |||
| 159915a6ac | |||
| d029e2479b | |||
| 251467fee4 | |||
| f3a9b44388 | |||
| f0adb72c49 | |||
| ecc47bb247 | |||
| 0c74729837 | |||
| ef1d3d57e5 | |||
| b69f20eb6b | |||
| d80a70c0ee | |||
| 80fe5d59b0 | |||
| 3eaa08b74e | |||
| f83365ec63 | |||
| 0b3b1ea1f8 | |||
| 888d949234 | |||
| 75c9d0bf68 | |||
| 7517eaf188 | |||
| 1181fcfff7 | |||
| 9def2f1a3a | |||
| 9c25240c43 | |||
| 8a17ff52aa | |||
| d125cdbe80 | |||
| 8dcaa3e0bb | |||
| baf1231141 | |||
| d1d9b55769 | |||
| ff06dcecf7 | |||
| dcdf6438a1 | |||
| 4d0062dee3 | |||
| c618f4b282 | |||
| b390d5dabf | |||
| f4b81fd101 | |||
| 78aa8a010e | |||
| 6996769cec | |||
| 0d9c01283c | |||
| fa1553a83e | |||
| 4db3c71728 | |||
| 0180cf33d2 | |||
| c51a3d80ca | |||
| 9eb4fc66b5 | |||
| 8f2a335609 | |||
| c5bae34ed1 | |||
| 6fc9f146ae | |||
| b6232d3c15 | |||
| 111fd73b94 | |||
| 61d9e206b2 | |||
| 08ebd7e82d | |||
| f152f58a97 | |||
| 38e86bead3 | |||
| b0d8f8b5c7 | |||
| a58efad985 | |||
| 0793d3bda5 | |||
| c397bad107 | |||
| 791ee4e63e | |||
| 5aa37c52a4 | |||
| fb26645996 | |||
| 3a3bcaf568 | |||
| fb804b4a22 | |||
| 665bdddbdd | |||
| 6beaedb79a | |||
| 9c2f982d03 |
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"Lua.diagnostics.globals": [
|
||||
"ctld"
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
--[[
|
||||
--[[ ! IMPORTANT : You must must use the version of MIST supplied in the CTLD pack to correctly manage dynamic spwans
|
||||
|
||||
Combat Troop and Logistics Drop
|
||||
|
||||
Allows Huey, Mi-8 and C130 to transport troops internally and Helicopters to transport Logistic / Vehicle units to the field via sling-loads
|
||||
@@ -40,7 +41,7 @@ end
|
||||
ctld.Id = "CTLD - "
|
||||
|
||||
--- Version.
|
||||
ctld.Version = "1.5.0"
|
||||
ctld.Version = "1.6.0-alpha"
|
||||
|
||||
-- To add debugging messages to dcs.log, change the following log levels to `true`; `Debug` is less detailed than `Trace`
|
||||
ctld.Debug = false
|
||||
@@ -491,8 +492,8 @@ ctld.JTAC_LIMIT_RED = 10 -- max number of JTAC Crates for the RED Si
|
||||
ctld.JTAC_LIMIT_BLUE = 10 -- max number of JTAC Crates for the BLUE Side
|
||||
ctld.JTAC_dropEnabled = true -- allow JTAC Crate spawn from F10 menu
|
||||
ctld.JTAC_maxDistance = 10000 -- How far a JTAC can "see" in meters (with Line of Sight)
|
||||
ctld.JTAC_smokeOn_RED = true -- enables marking of target with smoke for RED forces
|
||||
ctld.JTAC_smokeOn_BLUE = true -- enables marking of target with smoke for BLUE forces
|
||||
ctld.JTAC_smokeOn_RED = false -- enables marking of target with smoke for RED forces
|
||||
ctld.JTAC_smokeOn_BLUE = false -- enables marking of target with smoke for BLUE forces
|
||||
ctld.JTAC_smokeColour_RED = 4 -- RED side smoke colour -- Green = 0 , Red = 1, White = 2, Orange = 3, Blue = 4
|
||||
ctld.JTAC_smokeColour_BLUE = 1 -- BLUE side smoke colour -- Green = 0 , Red = 1, White = 2, Orange = 3, Blue = 4
|
||||
ctld.JTAC_smokeMarginOfError = 50 -- error that the JTAC is allowed to make when popping a smoke (in meters)
|
||||
@@ -817,7 +818,9 @@ ctld.vehicleTransportEnabled = {
|
||||
-- We will also use this to make modifications to the menu and other checks and messages
|
||||
ctld.dynamicCargoUnits = {
|
||||
"CH-47Fbl1",
|
||||
--"UH-1H",
|
||||
"UH-1H",
|
||||
"Mi-8MT",
|
||||
"Mi-24P",
|
||||
}
|
||||
|
||||
-- ************** Maximum Units SETUP for UNITS ******************
|
||||
@@ -888,6 +891,7 @@ ctld.internalCargoLimits = {
|
||||
-- Remove the -- below to turn on options
|
||||
["Mi-8MT"] = 2,
|
||||
["CH-47Fbl1"] = 8,
|
||||
["UH-1H"] = 3, -- to remove after debug
|
||||
}
|
||||
|
||||
|
||||
@@ -1998,11 +2002,13 @@ function ctld.getNearbyUnits(_point, _radius, _coalition)
|
||||
local unitsByDistance = {}
|
||||
local cpt = 1
|
||||
local _units = {}
|
||||
local _unitList = mist.DBs.unitsByName
|
||||
for _unitName, _unit in pairs(mist.DBs.unitsByName) do
|
||||
for _unitName, _ in pairs(mist.DBs.unitsByName) do
|
||||
local u = Unit.getByName(_unitName)
|
||||
if u and u:isExist() and (_coalition == 4 or u:getCoalition() == _coalition) then
|
||||
--local _dist = ctld.getDistance(u:getPoint(), _point)
|
||||
local e = (u and u:isExist()) or false
|
||||
-- pcall is needed because getCoalition() fails if the unit is an object without coalition (like a smoke effect)
|
||||
local c = nil
|
||||
pcall(function() c = (u and e and u:getCoalition()) or nil end)
|
||||
if u and e and (_coalition == 4 or c == _coalition) then
|
||||
local _dist = mist.utils.get2DDist(u:getPoint(), _point)
|
||||
if _dist <= _radius then
|
||||
unitsByDistance[cpt] = {id =cpt, dist = _dist, unit = _unitName, typeName = u:getTypeName()}
|
||||
@@ -2616,9 +2622,18 @@ function ctld.spawnCrate(_arguments, bypassCrateWaitTime)
|
||||
-- add to move table
|
||||
ctld.crateMove[_name] = _name
|
||||
|
||||
local refPoint = _heli:getPoint()
|
||||
local refLat, refLon = coord.LOtoLL(refPoint)
|
||||
local unitPos = _heli:getPosition()
|
||||
local refHeading = math.deg(math.atan2(unitPos.x.z, unitPos.x.x))
|
||||
|
||||
local destLat, destLon, destAlt = coord.LOtoLL(_point)
|
||||
|
||||
local relativePos, forma = ctld.tools.getRelativeBearing(refLat, refLon, refHeading, destLat, destLon, 'clock')
|
||||
|
||||
ctld.displayMessageToGroup(_heli,
|
||||
ctld.i18n_translate("A %1 crate weighing %2 kg has been brought out and is at your %3 o'clock ",
|
||||
_crateType.desc, _crateType.weight, _position), 20)
|
||||
_crateType.desc, _crateType.weight, relativePos), 20)
|
||||
else
|
||||
env.info("Couldn't find crate item to spawn")
|
||||
end
|
||||
@@ -4221,8 +4236,7 @@ function ctld.dropSlingCrate(_args)
|
||||
_position = "6"
|
||||
end
|
||||
ctld.displayMessageToGroup(_heli,
|
||||
ctld.i18n_translate("%1 crate has been safely unhooked and is at your %2 o'clock", _crate.desc,
|
||||
_position), 10)
|
||||
ctld.i18n_translate("%1 crate has been safely unhooked and is at your %2 o'clock", _crate.desc, _position), 10)
|
||||
elseif _heightDiff > 7.5 and _heightDiff <= 40.0 then
|
||||
ctld.displayMessageToGroup(_heli,
|
||||
ctld.i18n_translate("%1 crate has been safely dropped below you", _crate.desc), 10)
|
||||
@@ -5864,7 +5878,6 @@ end
|
||||
-- Adds menuitem to a human unit
|
||||
function ctld.addTransportF10MenuOptions(_unitName)
|
||||
ctld.logDebug("ctld.addTransportF10MenuOptions(_unitName=[%s])", ctld.p(_unitName))
|
||||
local status, error = pcall(function()
|
||||
local _unit = ctld.getTransportUnit(_unitName)
|
||||
ctld.logTrace("_unit = %s", ctld.p(_unit))
|
||||
|
||||
@@ -6063,10 +6076,6 @@ function ctld.addTransportF10MenuOptions(_unitName)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
if (not status) then
|
||||
ctld.logError(string.format("Error adding f10 to transport: %s", error))
|
||||
end
|
||||
end
|
||||
|
||||
--******************************************************************************************************
|
||||
@@ -7887,27 +7896,57 @@ function ctld.adjustRoute(_initialRouteTable, _firstWpOfNewRoute) -- create a r
|
||||
|
||||
-- apply offset (_firstWpOfNewRoute) to SwitchWaypoint tasks
|
||||
local lastWpAsAlreadySwitchWaypoint = false
|
||||
for idx = 1, #adjustedRoute do
|
||||
for j=1, #adjustedRoute[idx].task.params.tasks do
|
||||
if adjustedRoute[idx].task.params.tasks[j].id ~= "ControlledTask" then
|
||||
if adjustedRoute[idx].task.params.tasks[j].params.action.id == "SwitchWaypoint" then
|
||||
local goToWaypointIndex = adjustedRoute[idx].task.params.tasks[j].params.action.params.goToWaypointIndex
|
||||
adjustedRoute[idx].task.params.tasks[j].params.action.params.fromWaypointIndex = idx
|
||||
adjustedRoute[idx].task.params.tasks[j].params.action.params.goToWaypointIndex = mappingWP[goToWaypointIndex]
|
||||
if idx == #adjustedRoute then
|
||||
for idx2 = 1, #adjustedRoute do
|
||||
if #adjustedRoute[idx2] and
|
||||
#adjustedRoute[idx2].task and
|
||||
#adjustedRoute[idx2].task.params and
|
||||
#adjustedRoute[idx2].task.params.tasks then
|
||||
|
||||
for j=1, #adjustedRoute[idx2].task.params.tasks do
|
||||
if adjustedRoute[idx2].task.params.tasks[j].id and
|
||||
adjustedRoute[idx2].task.params.tasks[j].id ~= "ControlledTask" then
|
||||
|
||||
if adjustedRoute[idx2].task.params.tasks[j].params and
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.action and
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.action.id and
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.action.id == "SwitchWaypoint" then
|
||||
|
||||
if adjustedRoute[idx2].task.params.tasks[j].params.action.params then
|
||||
|
||||
local goToWaypointIndex = adjustedRoute[idx2].task.params.tasks[j].params.action.params.goToWaypointIndex
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.action.params.fromWaypointIndex = idx2
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.action.params.goToWaypointIndex = mappingWP[goToWaypointIndex]
|
||||
if idx2 == #adjustedRoute then
|
||||
lastWpAsAlreadySwitchWaypoint = true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
else -- for "ControlledTask"
|
||||
if adjustedRoute[idx].task.params.tasks[j].params.task.params.action.id == "SwitchWaypoint" then
|
||||
local goToWaypointIndex = adjustedRoute[idx].task.params.tasks[j].params.task.params.action.params.goToWaypointIndex
|
||||
adjustedRoute[idx].task.params.tasks[j].params.task.params.action.params.fromWaypointIndex = idx
|
||||
adjustedRoute[idx].task.params.tasks[j].params.task.params.action.params.goToWaypointIndex = mappingWP[goToWaypointIndex]
|
||||
if idx == #adjustedRoute then
|
||||
if adjustedRoute[idx2].task.params.tasks[j].params and
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.task and
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.task.params and
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.task.params.action and
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.task.params.action.id and
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.task.params.action.id == "SwitchWaypoint" then
|
||||
|
||||
if adjustedRoute[idx2].task.params.tasks[j].params.task.params.action.params then
|
||||
|
||||
local goToWaypointIndex = adjustedRoute[idx2].task.params.tasks[j].params.task.params.action.params.goToWaypointIndex
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.task.params.action.params.fromWaypointIndex = idx2
|
||||
adjustedRoute[idx2].task.params.tasks[j].params.task.params.action.params.goToWaypointIndex = mappingWP[goToWaypointIndex]
|
||||
if idx2 == #adjustedRoute then
|
||||
lastWpAsAlreadySwitchWaypoint = true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
if lastWpAsAlreadySwitchWaypoint == false then
|
||||
@@ -7957,7 +7996,7 @@ ctld.reconMenuName = ctld.i18n_translate("RECON") --name of the
|
||||
ctld.reconRadioAdded = {} --stores the groups that have had the radio menu added
|
||||
ctld.reconLosSearchRadius = 2000 -- search radius 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 = false -- if true recon LOS marks are automaticaly refreshed on F10 map
|
||||
ctld.reconLastScheduleIdAutoRefresh = 0
|
||||
|
||||
---- F10 RECON Menus ------------------------------------------------------------------
|
||||
@@ -8465,7 +8504,7 @@ end
|
||||
--- Handle world events.
|
||||
ctld.eventHandler = {}
|
||||
function ctld.eventHandler:onEvent(event)
|
||||
ctld.logTrace("ctld.eventHandler:onEvent()")
|
||||
--ctld.logTrace("ctld.eventHandler:onEvent()")
|
||||
if event == nil then
|
||||
ctld.logError("Event handler was called with a nil event!")
|
||||
return
|
||||
@@ -8478,7 +8517,7 @@ function ctld.eventHandler:onEvent(event)
|
||||
elseif event.id == world.event.S_EVENT_BIRTH then
|
||||
eventName = "S_EVENT_BIRTH"
|
||||
else
|
||||
ctld.logTrace("Ignoring event %s", ctld.p(event))
|
||||
--ctld.logTrace("Ignoring event %s", ctld.p(event))
|
||||
return
|
||||
end
|
||||
ctld.logDebug("caught event %s: %s", ctld.p(eventName), ctld.p(event))
|
||||
@@ -8513,7 +8552,7 @@ function ctld.eventHandler:onEvent(event)
|
||||
for _, aircraftType in pairs(ctld.aircraftTypeTable) do
|
||||
if aircraftType == playerTypeName then
|
||||
ctld.logTrace("adding by aircraft type, unitName = %s", ctld.p(unitName))
|
||||
if ctld.isValueInIpairTable(ctld.transportPilotNames, unitName) == false then
|
||||
if ctld.tools.isValueInIpairTable(ctld.transportPilotNames, unitName) == false then
|
||||
table.insert(ctld.transportPilotNames, unitName) -- add transport unit to the list
|
||||
end
|
||||
if ctld.addedTo[tostring(_groupId)] == nil then -- only if menu not already set up
|
||||
@@ -8591,7 +8630,8 @@ function ctld.RandomReal(mini, maxi)
|
||||
end
|
||||
|
||||
-- Tools
|
||||
function ctld.isValueInIpairTable(tab, value)
|
||||
ctld.tools = {}
|
||||
function ctld.tools.isValueInIpairTable(tab, value)
|
||||
for i, v in ipairs(tab) do
|
||||
if v == value then
|
||||
return true -- La valeur existe
|
||||
@@ -8599,6 +8639,58 @@ function ctld.isValueInIpairTable(tab, value)
|
||||
end
|
||||
return false -- La valeur n'existe pas
|
||||
end
|
||||
------------------------------------------------------------------------------------
|
||||
--- Calculates the orientation of an end point relative to a reference point.
|
||||
--- The calculation takes into account the current orientation of the reference point.
|
||||
---
|
||||
--- @param refLat number Latitude of the reference point in degrees.
|
||||
--- @param refLon number Longitude of the reference point in degrees.
|
||||
--- @param refHeading number Current orientation of the reference point in degrees (0 = North, 90 = East).
|
||||
--- @param destLat number Latitude of the arrival point in degrees.
|
||||
--- @param destLon number Longitude of the arrival point in degrees.
|
||||
--- @param resultFormat string The desired output format: "radian", "degree" or "clock".
|
||||
--- @return number The relative orientation in the specified resultFormat.
|
||||
function ctld.tools.getRelativeBearing(refLat, refLon, refHeading, destLat, destLon, resultFormat)
|
||||
-- Converting degrees to radians for geometric calculations
|
||||
local radrefLat = math.rad(refLat)
|
||||
local raddestLat = math.rad(destLat)
|
||||
local radrefLon = math.rad(refLon)
|
||||
local raddestLon = math.rad(destLon)
|
||||
local radrefHeading = math.rad(refHeading)
|
||||
|
||||
-- Calculating the longitude difference between the two points
|
||||
local deltaLon = raddestLon - radrefLon
|
||||
|
||||
-- Using the great circle formula for azimuth (bearing)
|
||||
-- This formula is based on spherical trigonometry and uses atan2
|
||||
-- to correctly handle all quadrants.
|
||||
local y = math.sin(deltaLon) * math.cos(raddestLat)
|
||||
local x = math.cos(radrefLat) * math.sin(raddestLat) - math.sin(radrefLat) * math.cos(raddestLat) * math.cos(deltaLon)
|
||||
local absoluteBearingRad = math.atan2(y, x)
|
||||
|
||||
-- Calculate relative orientation by subtracting the reference refHeading
|
||||
local relativeBearingRad = absoluteBearingRad - radrefHeading
|
||||
|
||||
-- Normalizes the angle to be in the range [-pi, pi]
|
||||
-- This ensures a consistent angle, whether positive or negative.
|
||||
local normalizedRad = (relativeBearingRad + math.pi) % (2 * math.pi) - math.pi
|
||||
|
||||
-- Returns the value in the requested resultFormat
|
||||
if resultFormat == "radian" then
|
||||
return normalizedRad, resultFormat
|
||||
elseif resultFormat == "clock" then
|
||||
-- Convert to clock position (12h = front, 3h = right, 6h = back, etc..)
|
||||
local bearingDeg = math.deg(normalizedRad)
|
||||
local clockPosition = ((bearingDeg + 360) % 360) / 30
|
||||
clockPosition = clockPosition >= 0 and math.floor(clockPosition + 0.5) or math.ceil(clockPosition - 0.5), resultFormat -- rounded clockPosition
|
||||
if clockPosition == 0 then clockPosition = 12 end
|
||||
return clockPosition, resultFormat
|
||||
else -- By default, the resultFormat is "degree"
|
||||
resultFormat = "degree"
|
||||
local bearingDeg = math.deg(normalizedRad)
|
||||
return (bearingDeg + 360) % 360, resultFormat
|
||||
end
|
||||
end
|
||||
|
||||
--- Enable/Disable error boxes displayed on screen.
|
||||
env.setErrorMessageBoxEnabled(false)
|
||||
|
||||
@@ -11,6 +11,8 @@ It's open-source and free as in free beer (you don't have to pay to use it), and
|
||||
|
||||
We're always looking for help, please reach out to [Zip on Discord](https://discordapp.com/users/421317390807203850) if you want to participate in maintenance or development.
|
||||
|
||||
And if you'd like to support our work, you can [buy me a coffee](https://coff.ee/veaf_zip)!
|
||||
|
||||
## Contents
|
||||
|
||||
This script is a rewrite of some of the functionality of the original Complete Combat Troop Transport Script (CTTS) by Geloxo (http://forums.eagle.ru/showthread.php?t=108523), as well as adding new features.
|
||||
@@ -130,7 +132,7 @@ Optionaly, you can disable the STTS (text to speech over SRS) feature (4).
|
||||
![dynamic_loading]
|
||||
|
||||
### Script Setup
|
||||
**This script requires MIST version 4.0.57 or above: https://github.com/mrSkortch/MissionScriptingTools**
|
||||
🔴IMPORTANT: This script requires MIST supplied in the CTLD zipped pack to correctly manage dynamic spwans.
|
||||
|
||||
First make sure MIST is loaded, either as an Initialization Script for the mission or the first DO SCRIPT with a "TIME MORE" of 1. "TIME MORE" means run the actions after X seconds into the mission.
|
||||
|
||||
@@ -865,10 +867,11 @@ For example, if the laser code is *1688*, the frequency will be *40.40Mhz*.
|
||||
JTAC frequency is available through the "JTAC Status" radio menu
|
||||
|
||||
#### Jtac-automatic-orbiting-over-lased-target
|
||||
By setting parameter ctld.enableAutoOrbitingFlyingJtacOnTarget = true, a script
|
||||
dedicated script puts in orbit each flying JTAC over his detected target.
|
||||
Associated with CTLD/JTAC functions, you can assign a fly route to the JTAC drone,
|
||||
this one follow it, and start orbiting when he detects a target.
|
||||
|
||||
By setting parameter ctld.enableAutoOrbitingFlyingJtacOnTarget = true, a script dedicated script puts in orbit each flying JTAC over his detected target.
|
||||
|
||||
Associated with CTLD/JTAC functions, you can assign a fly route to the JTAC drone, this one follow it, and start orbiting when he detects a target.
|
||||
|
||||
As soon as it don't detect a target, it restart following its initial route at the nearest waypoint
|
||||
|
||||
# In Game
|
||||
@@ -927,11 +930,13 @@ ctld.JTAC_WEIGHT = 15 -- kg
|
||||
```
|
||||
## Limit troop Loading
|
||||
The number of Infantries units in mission can be limited by setting the table below :
|
||||
ctld.nbLimitSpwanedTroops = {0, 0} -- {redLimitInfantryCount, blueLimitInfantryCount}
|
||||
|
||||
`ctld.nbLimitSpawnedTroops = {0, 0} -- {redLimitInfantryCount, blueLimitInfantryCount}`
|
||||
|
||||
When this cumulative number of troops is reached for a coalition, no more troops can be loaded onboard, and a message is sent to player.
|
||||
|
||||
If ctld.nbLimitSpwanedTroops = {0, 0} (both values at 0) the limit control is disabled.
|
||||
If set to `ctld.nbLimitSpawnedTroops = {0, 0}` (both values at 0) the limit control is disabled. This is the default.
|
||||
|
||||
If either value is non-zero, limit control becomes active for both coalitions.
|
||||
|
||||
## Cargo Spawning and Sling Loading
|
||||
@@ -1024,13 +1029,14 @@ Rearming:
|
||||
You can also repair a partially destroyed HAWK / BUK or KUB system by dropping a repair crate next to it and unpacking. A repair crate will also re-arm the system.
|
||||
|
||||
## Crate Repacking
|
||||
|
||||
The F10 menu allows you to repack units having associated crate types in the "ctld.spawnableCrates" table.
|
||||
|
||||
Simply land near the unit you wish to repack and select it from the list presented by the "CTLD//Vehicle/FOB transport...//Repack Vehicles" menu.
|
||||
The defined radius of vehicles detection is specified by the parameter
|
||||
|
||||
ctld.maximumDistanceRepackableUnitsSearch = 200 -- max distance from transportUnit to search force repackable units in meters
|
||||
The defined radius of vehicles detection is specified by the parameter `ctld.maximumDistanceRepackableUnitsSearch` (default 200 meters).
|
||||
|
||||
WARNING: Due to technical reasons related to the refresh time of the F10 menus, there may be inconsistencies between the type of vehicles requested and those provided. It is recommended to wait 5 to 10 seconds without moving after landing and opening the F10 menu for a packaging order.
|
||||
*WARNING*: Due to technical reasons related to the refresh time of the F10 menus, there may be inconsistencies between the type of vehicles requested and those provided. It is recommended to wait 5 to 10 seconds without moving after landing and opening the F10 menu for a packaging order.
|
||||
|
||||
## Forward Operating Base (FOB) Construction
|
||||
FOBs can be built by loading special FOB crates from a **Logistics** unit into a C-130 or other large aircraft configured in the script. To load the crate use the F10 - Troop Commands Menu. The idea behind FOBs is to make player vs player missions even more dynamic as these can be deployed in most locations. Once destroyed the FOB can no longer be used.
|
||||
|
||||
@@ -35,7 +35,7 @@ mist = {}
|
||||
-- don't change these
|
||||
mist.majorVersion = 4
|
||||
mist.minorVersion = 5
|
||||
mist.build = "128-DYNSLOTS-01"
|
||||
mist.build = "128-DYNSLOTS-02"
|
||||
|
||||
-- forward declaration of log shorthand
|
||||
local log
|
||||
@@ -826,11 +826,11 @@ do -- the main scope
|
||||
if zone.verticies then
|
||||
local offset = {}
|
||||
for i = 1, #zone.verticies do
|
||||
table.insert(offset, {dist = mist.utils.get2DDist(uRef.point, zone.verticies[i]), heading = mist.getHeadingPoints(uRef.point, zone.verticies[i]) + uRef.heading})
|
||||
table.insert(offset, {dist = mist.utils.get2DDist(uRef.point, zone.verticies[i]), heading = mist.utils.getHeadingPoints(uRef.point, zone.verticies[i]) + uRef.heading})
|
||||
end
|
||||
zone.offset = offset
|
||||
else
|
||||
zone.offset = {dist = mist.utils.get2DDist(uRef.point, zone.point), heading = mist.getHeadingPoints(uRef.point, zone.point) + uRef.heading}
|
||||
zone.offset = {dist = mist.utils.get2DDist(uRef.point, zone.point), heading = mist.utils.getHeadingPoints(uRef.point, zone.point) + uRef.heading}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user