mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2026-08-12 04:31:06 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1db8004f3e | |||
| 58731f3d84 | |||
| ce2cb5fad0 | |||
| 71b54491fc | |||
| 7ca6af38fc | |||
| 844144f695 | |||
| f12c67c5e0 | |||
| b5436bd6d2 | |||
| a10de260c7 | |||
| 4d3ae4b5ee | |||
| f6efa0ec58 | |||
| 5452bc7539 |
@@ -0,0 +1,3 @@
|
|||||||
|
*.iml
|
||||||
|
.idea/encodings.xml
|
||||||
|
*.xml
|
||||||
@@ -16,12 +16,8 @@
|
|||||||
- jmontleon - https://github.com/jmontleon
|
- jmontleon - https://github.com/jmontleon
|
||||||
- emilianomolina - https://github.com/emilianomolina
|
- emilianomolina - https://github.com/emilianomolina
|
||||||
|
|
||||||
Version: 1.70 - 25/06/2017
|
Version: 1.73 - 15/04/2018
|
||||||
- Added ability to set maximum group size that can be carried
|
- Allow minimum distance from friendly logistics to be set
|
||||||
- Added new sling load crates
|
|
||||||
- Fixed bug where crates and / or groups would disappear
|
|
||||||
- Fixed bug where count in zone wouldn't work for mission crates
|
|
||||||
- Delayed config of F10 menu and other scheduled functions so they can be overwritten by mission if a user wants
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
ctld = {} -- DONT REMOVE!
|
ctld = {} -- DONT REMOVE!
|
||||||
@@ -49,6 +45,8 @@ ctld.maximumDistanceLogistic = 200 -- max distance from vehicle to logistics to
|
|||||||
ctld.maximumSearchDistance = 4000 -- max distance for troops to search for enemy
|
ctld.maximumSearchDistance = 4000 -- max distance for troops to search for enemy
|
||||||
ctld.maximumMoveDistance = 2000 -- max distance for troops to move from drop point if no enemy is nearby
|
ctld.maximumMoveDistance = 2000 -- max distance for troops to move from drop point if no enemy is nearby
|
||||||
|
|
||||||
|
ctld.minimumDeployDistance = 1000 -- minimum distance from a friendly pickup zone where you can deploy a crate
|
||||||
|
|
||||||
ctld.numberOfTroops = 10 -- default number of troops to load on a transport heli or C-130
|
ctld.numberOfTroops = 10 -- default number of troops to load on a transport heli or C-130
|
||||||
-- also works as maximum size of group that'll fit into a helicopter unless overridden
|
-- also works as maximum size of group that'll fit into a helicopter unless overridden
|
||||||
ctld.enableFastRopeInsertion = true -- allows you to drop troops by fast rope
|
ctld.enableFastRopeInsertion = true -- allows you to drop troops by fast rope
|
||||||
@@ -1581,7 +1579,7 @@ function ctld.spawnCrate(_arguments)
|
|||||||
local _position = _heli:getPosition()
|
local _position = _heli:getPosition()
|
||||||
|
|
||||||
-- check crate spam
|
-- check crate spam
|
||||||
if _heli:getPlayerName() ~= nil and ctld.crateWait[_heli:getPlayerName()] and ctld.crateWait[_heli:getPlayerName()] < timer.getTime() then
|
if _heli:getPlayerName() ~= nil and ctld.crateWait[_heli:getPlayerName()] and ctld.crateWait[_heli:getPlayerName()] > timer.getTime() then
|
||||||
|
|
||||||
ctld.displayMessageToGroup(_heli,"Sorry you must wait "..(ctld.crateWait[_heli:getPlayerName()] - timer.getTime()).. " seconds before you can get another crate", 20)
|
ctld.displayMessageToGroup(_heli,"Sorry you must wait "..(ctld.crateWait[_heli:getPlayerName()] - timer.getTime()).. " seconds before you can get another crate", 20)
|
||||||
return
|
return
|
||||||
@@ -2885,6 +2883,16 @@ function ctld.unpackCrates(_arguments)
|
|||||||
local _crates = ctld.getCratesAndDistance(_heli)
|
local _crates = ctld.getCratesAndDistance(_heli)
|
||||||
local _crate = ctld.getClosestCrate(_heli, _crates)
|
local _crate = ctld.getClosestCrate(_heli, _crates)
|
||||||
|
|
||||||
|
|
||||||
|
if ctld.inLogisticsZone(_heli) == true or ctld.farEnoughFromLogisticZone(_heli) == false then
|
||||||
|
|
||||||
|
ctld.displayMessageToGroup(_heli, "You can't unpack that here! Take it to where it's needed!", 20)
|
||||||
|
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if _crate ~= nil and _crate.dist < 750
|
if _crate ~= nil and _crate.dist < 750
|
||||||
and (_crate.details.unit == "FOB" or _crate.details.unit == "FOB-SMALL") then
|
and (_crate.details.unit == "FOB" or _crate.details.unit == "FOB-SMALL") then
|
||||||
|
|
||||||
@@ -2894,13 +2902,6 @@ function ctld.unpackCrates(_arguments)
|
|||||||
|
|
||||||
elseif _crate ~= nil and _crate.dist < 200 then
|
elseif _crate ~= nil and _crate.dist < 200 then
|
||||||
|
|
||||||
if ctld.inLogisticsZone(_heli) == true then
|
|
||||||
|
|
||||||
ctld.displayMessageToGroup(_heli, "You can't unpack that here! Take it to where it's needed!", 20)
|
|
||||||
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if ctld.forceCrateToBeMoved and ctld.crateMove[_crate.crateUnit:getName()] then
|
if ctld.forceCrateToBeMoved and ctld.crateMove[_crate.crateUnit:getName()] then
|
||||||
ctld.displayMessageToGroup(_heli,"Sorry you must move this crate before you unpack it!", 20)
|
ctld.displayMessageToGroup(_heli,"Sorry you must move this crate before you unpack it!", 20)
|
||||||
return
|
return
|
||||||
@@ -4382,6 +4383,37 @@ function ctld.inLogisticsZone(_heli)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- are far enough from a friendly logistics zone
|
||||||
|
function ctld.farEnoughFromLogisticZone(_heli)
|
||||||
|
|
||||||
|
if ctld.inAir(_heli) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local _heliPoint = _heli:getPoint()
|
||||||
|
|
||||||
|
local _farEnough = true
|
||||||
|
|
||||||
|
for _, _name in pairs(ctld.logisticUnits) do
|
||||||
|
|
||||||
|
local _logistic = StaticObject.getByName(_name)
|
||||||
|
|
||||||
|
if _logistic ~= nil and _logistic:getCoalition() == _heli:getCoalition() then
|
||||||
|
|
||||||
|
--get distance
|
||||||
|
local _dist = ctld.getDistance(_heliPoint, _logistic:getPoint())
|
||||||
|
-- env.info("DIST ".._dist)
|
||||||
|
if _dist <= ctld.minimumDeployDistance then
|
||||||
|
-- env.info("TOO CLOSE ".._dist)
|
||||||
|
_farEnough = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return _farEnough
|
||||||
|
end
|
||||||
|
|
||||||
function ctld.refreshSmoke()
|
function ctld.refreshSmoke()
|
||||||
|
|
||||||
if ctld.disableAllSmoke == true then
|
if ctld.disableAllSmoke == true then
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user