mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2025-08-15 06:17:22 +00:00
Pickup Zones Modified
Added option to activate / deactivate zone during mission Added coalition to zones so the other team can't pick up from your zone. UNTESTED - Written while at work
This commit is contained in:
parent
c83443e854
commit
06f38347bc
141
CTLD.lua
141
CTLD.lua
@ -21,6 +21,10 @@
|
||||
- Report status via F10 Radio
|
||||
- Report status every 5 minutes or when targets first appear
|
||||
- Report vague status like 5 armoured vehicles, soldiers and support trucks ??
|
||||
|
||||
Steggles TODO:
|
||||
- Test logic on smoke refresh
|
||||
- Test logic on inPickupZone coalition and active check
|
||||
|
||||
]]
|
||||
|
||||
@ -103,18 +107,18 @@ ctld.JTAC_lock = "all" -- "vehicle" OR "troop" OR "all" forces JTAC to only lock
|
||||
-- You can add number as a third option to limit the number of soldier or vehicle groups that can be loaded from a zone.
|
||||
-- Dropping back a group at a limited zone will add one more to the limit
|
||||
|
||||
|
||||
--pickupZones = { "name", "smoke", "limit (-1 unlimited)", "active (yes/no), "side (1/2)"}
|
||||
ctld.pickupZones = {
|
||||
{ "pickzone1", "blue" },
|
||||
{ "pickzone2", "blue" },
|
||||
{ "pickzone3", "none" },
|
||||
{ "pickzone4", "none" },
|
||||
{ "pickzone5", "none" },
|
||||
{ "pickzone6", "none" },
|
||||
{ "pickzone7", "none" },
|
||||
{ "pickzone8", "none" },
|
||||
{ "pickzone9", "none", 5 }, -- limits pickup zone 9 to 5 groups of soldiers or vehicles
|
||||
{ "pickzone10", "none", 10 }, -- limits pickup zone 10 to 10 groups of soldiers or vehicles
|
||||
{ "pickzone1", "blue", -1, "yes", 1 }, --unlimited pickups, active on mission start, red side only
|
||||
{ "pickzone2", "blue", -1, "yes", 2 }, --unlimited pickups, active on mission start, blue side only
|
||||
{ "pickzone3", "none", -1, "no", 1 }, --unlimited pickups, not active on mission start, red side only
|
||||
{ "pickzone4", "none", -1, "yes", 1 },
|
||||
{ "pickzone5", "none", -1, "yes", 1 },
|
||||
{ "pickzone6", "none", -1, "yes", 1 },
|
||||
{ "pickzone7", "none", -1, "yes", 1 },
|
||||
{ "pickzone8", "none", -1, "yes", 1 },
|
||||
{ "pickzone9", "none", 5, "yes", 1 }, -- limits pickup zone 9 to 5 groups of soldiers or vehicles, only red can pick up
|
||||
{ "pickzone10", "none", 10, "yes", 2 }, -- limits pickup zone 10 to 10 groups of soldiers or vehicles, only blue can pick up
|
||||
}
|
||||
|
||||
ctld.dropOffZones = {
|
||||
@ -3074,7 +3078,10 @@ function ctld.inPickupZone(_heli)
|
||||
local _dist = ctld.getDistance(_heliPoint, _triggerZone.point)
|
||||
|
||||
if _dist <= _triggerZone.radius then
|
||||
return {inZone = true,limit = _zoneDetails[3],index=_i}
|
||||
local _heliCoalition = _heli:getCoalition()
|
||||
if _zoneDetails[4] == 1 and _zoneDetails[5] == _heliCoalition then
|
||||
return {inZone = true,limit = _zoneDetails[3],index=_i}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -3180,7 +3187,7 @@ function ctld.refreshSmoke()
|
||||
|
||||
local _triggerZone = trigger.misc.getZone(_zoneDetails[1])
|
||||
|
||||
if _triggerZone ~= nil and _zoneDetails[2] >= 0 then
|
||||
if _triggerZone ~= nil and _zoneDetails[2] >= 0 and _zoneDetails[4] == 1 then
|
||||
|
||||
-- Trigger smoke markers
|
||||
|
||||
@ -4261,6 +4268,74 @@ function ctld.getPositionString(_unit)
|
||||
end
|
||||
|
||||
|
||||
------------------------Steggles Functions-----------------------
|
||||
function ctld.activatePickupZone(_zoneName)
|
||||
local _triggerZone = trigger.misc.getZone(_zoneName) -- trigger to use as reference position
|
||||
|
||||
if _triggerZone == nil then
|
||||
trigger.action.outText("CTLD.lua ERROR: Cant find zone called " .. _zoneName, 10)
|
||||
return
|
||||
end
|
||||
|
||||
for _, _zoneDetails in pairs(ctld.pickupZones) do
|
||||
|
||||
if _triggerZone = trigger.misc.getZone(_zoneDetails[1]) then
|
||||
|
||||
--smoke could get messy if designer keeps calling this on an active zone, check its not active first
|
||||
if _zoneDetails[4] == 1 then
|
||||
trigger.action.outText("CTLD.lua ERROR: Pickup Zone already active: " .. _zoneName, 10)
|
||||
return
|
||||
end
|
||||
|
||||
_zoneDetails[4] = 1 --activate zone
|
||||
|
||||
if ctld.disableAllSmoke == true then --smoke disabled
|
||||
return
|
||||
end
|
||||
|
||||
if _zoneDetails[2] >= 0 then
|
||||
|
||||
-- Trigger smoke marker
|
||||
-- This will cause an overlapping smoke marker on next refreshsmoke call
|
||||
-- but will only happen once
|
||||
local _pos2 = { x = _triggerZone.point.x, y = _triggerZone.point.z }
|
||||
local _alt = land.getHeight(_pos2)
|
||||
local _pos3 = { x = _pos2.x, y = _alt, z = _pos2.y }
|
||||
|
||||
trigger.action.smoke(_pos3, _zoneDetails[2])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function ctld.deactivatePickupZone(_zoneName)
|
||||
|
||||
local _triggerZone = trigger.misc.getZone(_zoneName) -- trigger to use as reference position
|
||||
|
||||
if _triggerZone == nil then
|
||||
trigger.action.outText("CTLD.lua ERROR: Cant find zone called " .. _zoneName, 10)
|
||||
return
|
||||
end
|
||||
|
||||
for _, _zoneDetails in pairs(ctld.pickupZones) do
|
||||
|
||||
if _triggerZone = trigger.misc.getZone(_zoneDetails[1]) then
|
||||
|
||||
if _zoneDetails[4] == 0 then --this really needed??
|
||||
trigger.action.outText("CTLD.lua ERROR: Pickup Zone already deactiveated: " .. _zoneName, 10)
|
||||
return
|
||||
end
|
||||
|
||||
_zoneDetails[4] = 0 --deactivate zone
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- ***************** SETUP SCRIPT ****************
|
||||
|
||||
assert(mist ~= nil, "\n\n** HEY MISSION-DESIGNER! **\n\nMiST has not been loaded!\n\nMake sure MiST 3.6 or higher is running\n*before* running this script!\n")
|
||||
@ -4345,27 +4420,33 @@ for _, _zone in pairs(ctld.pickupZones) do
|
||||
|
||||
local _zoneName = _zone[1]
|
||||
local _zoneColor = _zone[2]
|
||||
|
||||
if _zoneColor == "green" then
|
||||
_zone[2] = trigger.smokeColor.Green
|
||||
elseif _zoneColor == "red" then
|
||||
_zone[2] = trigger.smokeColor.Red
|
||||
elseif _zoneColor == "white" then
|
||||
_zone[2] = trigger.smokeColor.White
|
||||
elseif _zoneColor == "orange" then
|
||||
_zone[2] = trigger.smokeColor.Orange
|
||||
elseif _zoneColor == "blue" then
|
||||
_zone[2] = trigger.smokeColor.Blue
|
||||
else
|
||||
_zone[2] = -1 -- no smoke colour
|
||||
end
|
||||
local _zoneActive = _zone[4]
|
||||
|
||||
if _zoneColor == "green" then
|
||||
_zone[2] = trigger.smokeColor.Green
|
||||
elseif _zoneColor == "red" then
|
||||
_zone[2] = trigger.smokeColor.Red
|
||||
elseif _zoneColor == "white" then
|
||||
_zone[2] = trigger.smokeColor.White
|
||||
elseif _zoneColor == "orange" then
|
||||
_zone[2] = trigger.smokeColor.Orange
|
||||
elseif _zoneColor == "blue" then
|
||||
_zone[2] = trigger.smokeColor.Blue
|
||||
else
|
||||
_zone[2] = -1 -- no smoke colour
|
||||
end
|
||||
|
||||
-- add in counter for troops or units
|
||||
if _zone[3] == nil then
|
||||
if _zone[3] == -1 then
|
||||
_zone[3] = 10000;
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- change active to 1 / 0
|
||||
if _zoneActive == "yes" then
|
||||
_zone[4] = 1
|
||||
else
|
||||
_zone[4] = 0
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user