added new log line for cap units at airbase
This commit is contained in:
Binary file not shown.
@@ -71,6 +71,7 @@ function CapBase:new(airbaseId, database, logger, capConfig, stageConfig)
|
|||||||
capGroup:AddOnStateUpdatedListener(o)
|
capGroup:AddOnStateUpdatedListener(o)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
logger:info("" .. airbaseId .. "has a total of " .. Spearhead.Util.tableLength(o.groupsByName) .. "cap flights registered")
|
||||||
|
|
||||||
o.SpawnIfApplicable = function(self)
|
o.SpawnIfApplicable = function(self)
|
||||||
self.logger:debug("Check spawns for airbase " .. self.airbaseId )
|
self.logger:debug("Check spawns for airbase " .. self.airbaseId )
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ do -- DB
|
|||||||
|
|
||||||
o.tables.capGroupsOnAirbase[baseId] = {}
|
o.tables.capGroupsOnAirbase[baseId] = {}
|
||||||
local groups = Spearhead.DcsUtil.areGroupsInCustomZone(all_groups,
|
local groups = Spearhead.DcsUtil.areGroupsInCustomZone(all_groups,
|
||||||
{ x = point.x, z = point.z, radius = 6600 })
|
{ x = point.x, z = point.z, radius = 2048 })
|
||||||
for _, groupName in pairs(groups) do
|
for _, groupName in pairs(groups) do
|
||||||
is_group_taken[groupName] = true
|
is_group_taken[groupName] = true
|
||||||
table.insert(o.tables.capGroupsOnAirbase[baseId], groupName)
|
table.insert(o.tables.capGroupsOnAirbase[baseId], groupName)
|
||||||
@@ -314,7 +314,7 @@ do -- DB
|
|||||||
if isAirbaseInZone[tostring(baseId) or "something" ] == true and airbase:getDesc().category == Airbase.Category.AIRDROME then
|
if isAirbaseInZone[tostring(baseId) or "something" ] == true and airbase:getDesc().category == Airbase.Category.AIRDROME then
|
||||||
o.tables.redAirbaseGroupsPerAirbase[baseId] = {}
|
o.tables.redAirbaseGroupsPerAirbase[baseId] = {}
|
||||||
o.tables.blueAirbaseGroupsPerAirbase[baseId] = {}
|
o.tables.blueAirbaseGroupsPerAirbase[baseId] = {}
|
||||||
local groups = Spearhead.DcsUtil.areGroupsInCustomZone(all_groups, { x = point.x, z = point.z, radius = 6600 })
|
local groups = Spearhead.DcsUtil.areGroupsInCustomZone(all_groups, { x = point.x, z = point.z, radius = 2048 })
|
||||||
for _, groupName in pairs(groups) do
|
for _, groupName in pairs(groups) do
|
||||||
|
|
||||||
if Spearhead.DcsUtil.IsGroupStatic(groupName) == true then
|
if Spearhead.DcsUtil.IsGroupStatic(groupName) == true then
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ do --init STAGE DIRECTOR
|
|||||||
end
|
end
|
||||||
|
|
||||||
o.ActivateMissionsIfApplicable = function (self)
|
o.ActivateMissionsIfApplicable = function (self)
|
||||||
local activeCount = 0
|
local activeCount = 0
|
||||||
|
|
||||||
local availableMissions = {}
|
local availableMissions = {}
|
||||||
for _, mission in pairs(self.db.missionsByCode) do
|
for _, mission in pairs(self.db.missionsByCode) do
|
||||||
@@ -216,6 +216,7 @@ do --init STAGE DIRECTOR
|
|||||||
if mission then
|
if mission then
|
||||||
mission:Activate()
|
mission:Activate()
|
||||||
self:AddCommmandsForMissionToAllPlayers(mission)
|
self:AddCommmandsForMissionToAllPlayers(mission)
|
||||||
|
activeCount = activeCount + 1;
|
||||||
end
|
end
|
||||||
availableMissionsCount = availableMissionsCount - 1
|
availableMissionsCount = availableMissionsCount - 1
|
||||||
end
|
end
|
||||||
@@ -283,25 +284,6 @@ do --init STAGE DIRECTOR
|
|||||||
|
|
||||||
timer.scheduleFunction(ActivateBlueAsync, self, timer.getTime() + 3)
|
timer.scheduleFunction(ActivateBlueAsync, self, timer.getTime() + 3)
|
||||||
|
|
||||||
-- for key, farp in pairs(self.db.farps) do
|
|
||||||
-- if farp.helipadnames then
|
|
||||||
-- for _, helipadName in pairs(farp.helipadnames) do
|
|
||||||
-- local helipad = Airbase.getByName(helipadName)
|
|
||||||
-- if helipad then
|
|
||||||
-- logger:debug("Enabling: '" .. helipad:getName() .. "'")
|
|
||||||
-- helipad:setCoalition(2)
|
|
||||||
-- else
|
|
||||||
-- logger:warn(helipadName .. " not found when spawning farps")
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- if farp.group_names then
|
|
||||||
-- for _, groupName in pairs(farp.group_names) do
|
|
||||||
-- Spearhead.DcsUtil.SpawnGroupTemplate(groupName)
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
o.OnStatusRequestReceived = function(self, groupId)
|
o.OnStatusRequestReceived = function(self, groupId)
|
||||||
@@ -427,13 +409,31 @@ do --init STAGE DIRECTOR
|
|||||||
|
|
||||||
o.OnMissionComplete = function(self, mission)
|
o.OnMissionComplete = function(self, mission)
|
||||||
timer.scheduleFunction(removeMissionCommandsDelayed, { self = self, mission = mission}, timer.getTime() + 20)
|
timer.scheduleFunction(removeMissionCommandsDelayed, { self = self, mission = mission}, timer.getTime() + 20)
|
||||||
timer.scheduleFunction(activateMissionsIfApplicableAsync, self, timer.getTime() + 10)
|
|
||||||
|
if(self:IsComplete()) then
|
||||||
|
|
||||||
|
else
|
||||||
|
timer.scheduleFunction(activateMissionsIfApplicableAsync, self, timer.getTime() + 10)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, mission in pairs(o.db.missionsByCode) do
|
for _, mission in pairs(o.db.missionsByCode) do
|
||||||
mission:AddMissionCompleteListener(o)
|
mission:AddMissionCompleteListener(o)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
o.StageCompleteListeners = {}
|
||||||
|
---comment
|
||||||
|
---@param self table
|
||||||
|
---@param StageCompleteListener table a Object with tage
|
||||||
|
o.AddStageCompleteListener = function(self, StageCompleteListener)
|
||||||
|
|
||||||
|
if type(StageCompleteListener) ~= "table" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
table.insert(self.MissionCompleteListeners, StageCompleteListener)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
Spearhead.Events.AddOnStatusRequestReceivedListener(o)
|
Spearhead.Events.AddOnStatusRequestReceivedListener(o)
|
||||||
Spearhead.Events.AddStageNumberChangedListener(o)
|
Spearhead.Events.AddStageNumberChangedListener(o)
|
||||||
return o
|
return o
|
||||||
|
|||||||
Reference in New Issue
Block a user