Buildable (#36)
- Buildable missions now working. - FARPS and BLUESAM zones are now buildable. - Secondary Logistics missions are created as buildables become available. - Logistic missions can be "marked" with a MAP marker. - Supplies can only be picked up in a SUPPLYHUB zone. - SUPPLYHUB zones are active once their parents are active. A supplyhub parent can be oneof: FARP, AIRBASE, STAGE. - Required supplies for a zone can be configured in kilos. - Crates can be picked up with 1000 or 2000 kilo per crate. - Max load for a helicopter is set based on public data. - TO COME: Sling load options
This commit is contained in:
@@ -206,6 +206,22 @@ do -- INIT UTIL
|
||||
return false
|
||||
end
|
||||
|
||||
---@param point Vec2
|
||||
---@param zone SpearheadTriggerZone
|
||||
function UTIL.is2dPointInZone(point, zone)
|
||||
if zone.zone_type == "Polygon" and zone.verts then
|
||||
if UTIL.IsPointInPolygon(zone.verts, point.x, point.y) == true then
|
||||
return true
|
||||
end
|
||||
else
|
||||
if (((point.x - zone.location.x) ^ 2 + (point.y - zone.location.y) ^ 2) ^ 0.5 <= zone.radius) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
---comment
|
||||
---@param points Array<Vec2> points
|
||||
---@return Array<Vec2> hullPoints
|
||||
@@ -974,6 +990,27 @@ do -- INIT DCS_UTIL
|
||||
return drawID
|
||||
end
|
||||
|
||||
|
||||
local _markID = 200
|
||||
|
||||
---@param groupID number
|
||||
---@param text string
|
||||
---@param location Vec3
|
||||
---@return number markID
|
||||
function DCS_UTIL.AddMarkToGroup(groupID, text, location)
|
||||
|
||||
_markID = _markID + 1
|
||||
trigger.action.markToGroup(_markID, text, location, groupID, true, nil)
|
||||
return _markID
|
||||
end
|
||||
|
||||
---@param markId number
|
||||
function DCS_UTIL.RemoveMark(markId)
|
||||
if markId ~= nil then
|
||||
trigger.action.removeMark(markId)
|
||||
end
|
||||
end
|
||||
|
||||
---comment
|
||||
---@param drawID number
|
||||
---@param lineColor DrawColor
|
||||
@@ -1092,6 +1129,19 @@ do -- INIT DCS_UTIL
|
||||
end
|
||||
end
|
||||
|
||||
---@param unitID number
|
||||
---@return Unit?
|
||||
function DCS_UTIL.GetPLayerUnitByID(unitID)
|
||||
for i = 0, 2 do
|
||||
local players = coalition.getPlayers(i)
|
||||
for key, unit in pairs(players) do
|
||||
if unit and unit:getID() == unitID then
|
||||
return unit
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
DCS_UTIL.__INIT();
|
||||
end
|
||||
Spearhead.DcsUtil = DCS_UTIL
|
||||
|
||||
Reference in New Issue
Block a user