mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Updates
This commit is contained in:
parent
d3ecbac40a
commit
c5236d337e
@ -225,6 +225,7 @@ function AI_ESCORT:New( EscortUnit, EscortGroupSet, EscortName, EscortBriefing )
|
||||
|
||||
self.EscortBriefing = EscortBriefing
|
||||
|
||||
self.Menu = {}
|
||||
|
||||
-- if not EscortBriefing then
|
||||
-- EscortGroup:MessageToClient( EscortGroup:GetCategoryName() .. " '" .. EscortName .. "' (" .. EscortGroup:GetCallsign() .. ") reporting! " ..
|
||||
@ -545,28 +546,64 @@ function AI_ESCORT:MenuFormationBox( XStart, XSpace, YStart, YSpace, ZStart, ZSp
|
||||
end
|
||||
|
||||
|
||||
--- Sets a menu slot to join formation for an escort.
|
||||
-- @param #AI_ESCORT self
|
||||
-- @return #AI_ESCORT
|
||||
function AI_ESCORT:EscortMenuJoinUp( EscortGroup )
|
||||
|
||||
if self.Menu.JoinUp == true then
|
||||
if EscortGroup:IsAir() then
|
||||
local EscortGroupName = EscortGroup:GetName()
|
||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
||||
local EscortMenuJoinUp = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Join Up", EscortMenuReportNavigation, AI_ESCORT._JoinUp, self, EscortGroup )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Defines --- Defines a menu slot to let the escort to join formation.
|
||||
-- This menu will appear under **Formation**.
|
||||
-- @param #AI_ESCORT self
|
||||
-- @return #AI_ESCORT
|
||||
function AI_ESCORT:MenuJoinUp()
|
||||
|
||||
self.Menu.JoinUp = true
|
||||
|
||||
local FlightMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", self.FlightMenu )
|
||||
local FlightMenuJoinUp = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Join Up", FlightMenuReportNavigation, AI_ESCORT._FlightJoinUp, self )
|
||||
|
||||
self.EscortGroupSet:ForSomeGroupAlive(
|
||||
--- @param Core.Group#GROUP EscortGroup
|
||||
function( EscortGroup )
|
||||
if EscortGroup:IsAir() then
|
||||
self:EscortSetMenuJoinUp( EscortGroup )
|
||||
end
|
||||
)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
function AI_ESCORT:EscortMenuHoldAtEscortPosition( EscortGroup )
|
||||
|
||||
for _, HoldAtEscortPosition in pairs( self.Menu.HoldAtEscortPosition ) do
|
||||
if EscortGroup:IsAir() then
|
||||
local EscortGroupName = EscortGroup:GetName()
|
||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
||||
local EscortMenuJoinUp = MENU_GROUP_COMMAND:New( self.PlayerGroup, "Join Up", EscortMenuReportNavigation, AI_ESCORT._JoinUp, self )
|
||||
|
||||
end
|
||||
end
|
||||
local EscortMenuHoldPosition = MENU_GROUP_COMMAND
|
||||
:New(
|
||||
self.PlayerGroup,
|
||||
HoldAtEscortPosition.MenuText,
|
||||
EscortMenuReportNavigation,
|
||||
AI_ESCORT._HoldPosition,
|
||||
self,
|
||||
EscortGroup,
|
||||
EscortGroup,
|
||||
HoldAtEscortPosition.Height,
|
||||
HoldAtEscortPosition.Speed
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
@ -619,28 +656,16 @@ function AI_ESCORT:MenuHoldAtEscortPosition( Height, Speed, MenuTextFormat )
|
||||
Speed
|
||||
)
|
||||
|
||||
self.Menu.HoldAtEscortPosition = self.Menu.HoldAtEscortPosition or {}
|
||||
self.Menu.HoldAtEscortPosition[#self.Menu.HoldAtEscortPosition+1] = {}
|
||||
self.Menu.HoldAtEscortPosition[#self.Menu.HoldAtEscortPosition].Height = Height
|
||||
self.Menu.HoldAtEscortPosition[#self.Menu.HoldAtEscortPosition].Speed = Speed
|
||||
self.Menu.HoldAtEscortPosition[#self.Menu.HoldAtEscortPosition].MenuText = MenuText
|
||||
|
||||
self.EscortGroupSet:ForSomeGroupAlive(
|
||||
--- @param Core.Group#GROUP EscortGroup
|
||||
function( EscortGroup )
|
||||
if EscortGroup:IsAir() then
|
||||
|
||||
local EscortGroupName = EscortGroup:GetName()
|
||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
||||
|
||||
local EscortMenuHoldPosition = MENU_GROUP_COMMAND
|
||||
:New(
|
||||
self.PlayerGroup,
|
||||
MenuText,
|
||||
EscortMenuReportNavigation,
|
||||
AI_ESCORT._HoldPosition,
|
||||
self,
|
||||
EscortGroup,
|
||||
EscortGroup,
|
||||
Height,
|
||||
Speed
|
||||
)
|
||||
end
|
||||
self:EscortMenuHoldAtEscortPosition( EscortGroup )
|
||||
end
|
||||
)
|
||||
|
||||
@ -648,6 +673,33 @@ function AI_ESCORT:MenuHoldAtEscortPosition( Height, Speed, MenuTextFormat )
|
||||
end
|
||||
|
||||
|
||||
function AI_ESCORT:EscortMenuHoldAtLeaderPosition( EscortGroup )
|
||||
|
||||
for _, HoldAtLeaderPosition in pairs( self.Menu.HoldAtLeaderPosition ) do
|
||||
if EscortGroup:IsAir() then
|
||||
|
||||
local EscortGroupName = EscortGroup:GetName()
|
||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
||||
|
||||
local EscortMenuHoldAtLeaderPosition = MENU_GROUP_COMMAND
|
||||
:New(
|
||||
self.PlayerGroup,
|
||||
HoldAtLeaderPosition.MenuText,
|
||||
EscortMenuReportNavigation,
|
||||
AI_ESCORT._HoldPosition,
|
||||
self,
|
||||
self.PlayerGroup,
|
||||
EscortGroup,
|
||||
HoldAtLeaderPosition.Height,
|
||||
HoldAtLeaderPosition.Speed
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Defines a menu slot to let the escort hold at the client position and stay low with a specified height during a specified time in seconds.
|
||||
-- This menu will appear under **Navigation**.
|
||||
-- @param #AI_ESCORT self
|
||||
@ -695,28 +747,16 @@ function AI_ESCORT:MenuHoldAtLeaderPosition( Height, Speed, MenuTextFormat )
|
||||
Speed
|
||||
)
|
||||
|
||||
self.Menu.HoldAtLeaderPosition = self.Menu.HoldAtLeaderPosition or {}
|
||||
self.Menu.HoldAtLeaderPosition[#self.Menu.HoldAtLeaderPosition+1] = {}
|
||||
self.Menu.HoldAtLeaderPosition[#self.Menu.HoldAtLeaderPosition].Height = Height
|
||||
self.Menu.HoldAtLeaderPosition[#self.Menu.HoldAtLeaderPosition].Speed = Speed
|
||||
self.Menu.HoldAtLeaderPosition[#self.Menu.HoldAtLeaderPosition].MenuText = MenuText
|
||||
|
||||
self.EscortGroupSet:ForSomeGroupAlive(
|
||||
--- @param Core.Group#GROUP EscortGroup
|
||||
function( EscortGroup )
|
||||
if EscortGroup:IsAir() then
|
||||
|
||||
local EscortGroupName = EscortGroup:GetName()
|
||||
local EscortMenu = MENU_GROUP:New( self.PlayerGroup, EscortGroupName, self.MainMenu )
|
||||
local EscortMenuReportNavigation = MENU_GROUP:New( self.PlayerGroup, "Navigation", EscortMenu )
|
||||
|
||||
local EscortMenuHoldAtLeaderPosition = MENU_GROUP_COMMAND
|
||||
:New(
|
||||
self.PlayerGroup,
|
||||
MenuText,
|
||||
EscortMenuReportNavigation,
|
||||
AI_ESCORT._HoldPosition,
|
||||
self,
|
||||
self.PlayerGroup,
|
||||
EscortGroup,
|
||||
Height,
|
||||
Speed
|
||||
)
|
||||
end
|
||||
self:EscortMenuHoldAtLeaderPosition( EscortGroup )
|
||||
end
|
||||
)
|
||||
|
||||
@ -1140,7 +1180,7 @@ function AI_ESCORT:_JoinUp( EscortGroup )
|
||||
end
|
||||
|
||||
|
||||
function AI_ESCORT:_FlightJoinUp( EscortGroup )
|
||||
function AI_ESCORT:_FlightJoinUp()
|
||||
|
||||
self.EscortGroupSet:ForSomeGroupAlive(
|
||||
--- @param Core.Group#GROUP EscortGroup
|
||||
@ -1339,7 +1379,7 @@ function AI_ESCORT.___Resume( EscortGroup, self )
|
||||
local PlayerGroup = self.PlayerGroup
|
||||
|
||||
self:JoinFormation( EscortGroup )
|
||||
EscortGroup:MessageTypeToClient( "Destroyed all targets. Rejoining.", MESSAGE.Type.Information, PlayerGroup )
|
||||
EscortGroup:MessageTypeToGroup( "Destroyed all targets. Rejoining.", MESSAGE.Type.Information, PlayerGroup )
|
||||
|
||||
end
|
||||
|
||||
@ -1347,7 +1387,7 @@ end
|
||||
--- @param #AI_ESCORT self
|
||||
-- @param Wrapper.Group#GROUP EscortGroup
|
||||
-- @param #number WayPoint
|
||||
function AI_ESCORT._ResumeMission( EscortGroup, WayPoint )
|
||||
function AI_ESCORT:_ResumeMission( EscortGroup, WayPoint )
|
||||
|
||||
--self.FollowScheduler:Stop( self.FollowSchedule )
|
||||
|
||||
@ -1360,7 +1400,7 @@ function AI_ESCORT._ResumeMission( EscortGroup, WayPoint )
|
||||
|
||||
EscortGroup:SetTask( EscortGroup:TaskRoute( WayPoints ), 1 )
|
||||
|
||||
EscortGroup:MessageTypeToClient( "Resuming mission from waypoint ", MESSAGE.Type.Information, self.PlayerGroup )
|
||||
EscortGroup:MessageTypeToGroup( "Resuming mission from waypoint ", MESSAGE.Type.Information, self.PlayerGroup )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ AI_ESCORT_REQUEST = {
|
||||
-- @param Wrapper.Airbase#AIRBASE EscortAirbase The airbase where escorts will be spawned once requested.
|
||||
-- @param #string EscortName Name of the escort.
|
||||
-- @param #string EscortBriefing A text showing the AI_ESCORT_REQUEST briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown.
|
||||
-- @return #AI_ESCORT_REQUEST self
|
||||
-- @return #AI_ESCORT_REQUEST
|
||||
-- @usage
|
||||
-- EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 )
|
||||
-- EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig )
|
||||
@ -223,10 +223,9 @@ function AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, EscortAirbase, EscortNa
|
||||
end
|
||||
|
||||
--- @param #AI_ESCORT_REQUEST self
|
||||
-- @param Core.Set#SET_GROUP EscortGroupSet
|
||||
function AI_ESCORT_REQUEST:SpawnEscort()
|
||||
|
||||
local EscortGroup = self.EscortSpawn:SpawnAtAirbase( self.EscortAirbase, SPAWN.Takeoff.Cold )
|
||||
local EscortGroup = self.EscortSpawn:SpawnAtAirbase( self.EscortAirbase, SPAWN.Takeoff.Hot )
|
||||
self.EscortGroupSet:AddGroup( EscortGroup )
|
||||
|
||||
EscortGroup:OptionROTVertical()
|
||||
@ -241,11 +240,27 @@ function AI_ESCORT_REQUEST:SpawnEscort()
|
||||
Report:Add( "Joining Up " .. self.EscortGroupSet:GetUnitTypeNames():Text( ", " ) .. " from " .. LeaderEscort:GetCoordinate():ToString( self.EscortUnit ) )
|
||||
|
||||
LeaderEscort:MessageTypeToGroup( Report:Text(), MESSAGE.Type.Information, self.PlayerUnit )
|
||||
if self.SpawnMode == self.__Enum.Mode.Formation then
|
||||
self:FormationTrail( 50, 50, 50 )
|
||||
if self.SpawnMode == self.__Enum.Mode.Formation then
|
||||
self:JoinFormation( EscortGroup )
|
||||
end
|
||||
self:Menus( self.XStart, self.XSpace, self.YStart, self.YSpace, self.ZStart, self.ZSpace, self.ZLevels )
|
||||
|
||||
--self:Menus( self.XStart, self.XSpace, self.YStart, self.YSpace, self.ZStart, self.ZSpace, self.ZLevels )
|
||||
|
||||
self:EscortMenuJoinUp( EscortGroup )
|
||||
|
||||
self:EscortMenuHoldAtEscortPosition( EscortGroup )
|
||||
self:EscortMenuHoldAtLeaderPosition( EscortGroup )
|
||||
|
||||
self:MenuFlare()
|
||||
self:MenuSmoke()
|
||||
|
||||
self:MenuReportTargets( 60 )
|
||||
self:MenuAssistedAttack()
|
||||
self:MenuROE()
|
||||
self:MenuROT()
|
||||
|
||||
self:MenuResumeMission()
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
@ -717,7 +717,6 @@ function AI_FORMATION:onafterFormationLine( FollowGroupSet, From , Event , To, X
|
||||
i = i + 1
|
||||
|
||||
FollowGroup:SetState( FollowGroup, "Formation", Formation )
|
||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
|
||||
end
|
||||
|
||||
return self
|
||||
@ -873,7 +872,6 @@ function AI_FORMATION:onafterFormationCenterWing( FollowGroupSet, From , Event ,
|
||||
FollowGroup:SetState( self, "FormationVec3", Vec3 )
|
||||
i = i + 1
|
||||
FollowGroup:SetState( FollowGroup, "Formation", self.__Enum.Formation.Vic )
|
||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
|
||||
end
|
||||
|
||||
return self
|
||||
@ -934,7 +932,6 @@ function AI_FORMATION:onafterFormationBox( FollowGroupSet, From , Event , To, XS
|
||||
FollowGroup:SetState( self, "FormationVec3", Vec3 )
|
||||
i = i + 1
|
||||
FollowGroup:SetState( FollowGroup, "Formation", self.__Enum.Formation.Box )
|
||||
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
|
||||
end
|
||||
|
||||
return self
|
||||
@ -1026,7 +1023,7 @@ function AI_FORMATION:onenterFollowing( FollowGroupSet ) --R2.1
|
||||
ClientUnit:SetState( self, "CV1", CV2 )
|
||||
end
|
||||
|
||||
FollowGroupSet:ForEachGroup(
|
||||
FollowGroupSet:ForEachGroupAlive(
|
||||
--- @param Wrapper.Group#GROUP FollowGroup
|
||||
-- @param Wrapper.Unit#UNIT ClientUnit
|
||||
function( FollowGroup, Formation, ClientUnit, CT1, CV1, CT2, CV2 )
|
||||
|
||||
@ -1836,56 +1836,23 @@ end
|
||||
|
||||
|
||||
--- Will park a group at an @{Wrapper.Airbase}.
|
||||
-- This method is mostly advisable to be used if you want to simulate parking units at an airbase and be visible.
|
||||
-- Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
|
||||
--
|
||||
-- All groups that are in the spawn collection and that are alive, and not in the air, are parked.
|
||||
--
|
||||
-- The @{Wrapper.Airbase#AIRBASE} object must refer to a valid airbase known in the sim.
|
||||
-- You can use the following enumerations to search for the pre-defined airbases on the current known maps of DCS:
|
||||
--
|
||||
-- * @{Wrapper.Airbase#AIRBASE.Caucasus}: The airbases on the Caucasus map.
|
||||
-- * @{Wrapper.Airbase#AIRBASE.Nevada}: The airbases on the Nevada (NTTR) map.
|
||||
-- * @{Wrapper.Airbase#AIRBASE.Normandy}: The airbases on the Normandy map.
|
||||
--
|
||||
-- Use the method @{Wrapper.Airbase#AIRBASE.FindByName}() to retrieve the airbase object.
|
||||
-- The known AIRBASE objects are automatically imported at mission start by MOOSE.
|
||||
-- Therefore, there isn't any New() constructor defined for AIRBASE objects.
|
||||
--
|
||||
-- Ships and Farps are added within the mission, and are therefore not known.
|
||||
-- For these AIRBASE objects, there isn't an @{Wrapper.Airbase#AIRBASE} enumeration defined.
|
||||
-- You need to provide the **exact name** of the airbase as the parameter to the @{Wrapper.Airbase#AIRBASE.FindByName}() method!
|
||||
--
|
||||
-- @param #SPAWN self
|
||||
-- @param Wrapper.Airbase#AIRBASE SpawnAirbase The @{Wrapper.Airbase} where to spawn the group.
|
||||
-- @param Wrapper.Airbase#AIRBASE.TerminalType TerminalType (optional) The terminal type the aircraft should be spawned at. See @{Wrapper.Airbase#AIRBASE.TerminalType}.
|
||||
-- @param #table Parkingdata (optional) Table holding the coordinates and terminal ids for all units of the group. Spawning will be forced to happen at exactily these spots!
|
||||
-- @return #nil Nothing is returned!
|
||||
-- @usage
|
||||
-- Spawn_Plane = SPAWN:New( "Plane" )
|
||||
-- Spawn_Plane:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Krymsk ) )
|
||||
--
|
||||
-- Spawn_Heli = SPAWN:New( "Heli")
|
||||
--
|
||||
-- Spawn_Heli:ParkAtAirbase( AIRBASE:FindByName( "FARP Cold" ) )
|
||||
--
|
||||
-- Spawn_Heli:ParkAtAirbase( AIRBASE:FindByName( "Carrier" ) )
|
||||
--
|
||||
-- Spawn_Plane:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Krymsk ), AIRBASE.TerminalType.OpenBig )
|
||||
--
|
||||
function SPAWN:ParkAtAirbase( SpawnAirbase, TerminalType, Parkingdata ) -- R2.2, R2.4, R2.5
|
||||
self:F( { self.SpawnTemplatePrefix, SpawnAirbase, TerminalType } )
|
||||
function SPAWN:ParkAircraft( SpawnAirbase, TerminalType, Parkingdata, SpawnIndex )
|
||||
|
||||
self:F( { SpawnIndex = SpawnIndex, SpawnMaxGroups = self.SpawnMaxGroups } )
|
||||
|
||||
-- Get position of airbase.
|
||||
local PointVec3 = SpawnAirbase:GetCoordinate()
|
||||
self:T2(PointVec3)
|
||||
|
||||
-- Set take off type. Default is hot.
|
||||
local Takeoff = SPAWN.Takeoff.Cold
|
||||
|
||||
for SpawnIndex = 1, self.SpawnMaxGroups do
|
||||
|
||||
self:F( { SpawnIndex = SpawnIndex, SpawnMaxGroups = self.SpawnMaxGroups } )
|
||||
|
||||
-- Get group template.
|
||||
local SpawnTemplate = self.SpawnGroups[SpawnIndex].SpawnTemplate
|
||||
|
||||
@ -2195,6 +2162,54 @@ function SPAWN:ParkAtAirbase( SpawnAirbase, TerminalType, Parkingdata ) -- R2.2,
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Will park a group at an @{Wrapper.Airbase}.
|
||||
-- This method is mostly advisable to be used if you want to simulate parking units at an airbase and be visible.
|
||||
-- Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
|
||||
--
|
||||
-- All groups that are in the spawn collection and that are alive, and not in the air, are parked.
|
||||
--
|
||||
-- The @{Wrapper.Airbase#AIRBASE} object must refer to a valid airbase known in the sim.
|
||||
-- You can use the following enumerations to search for the pre-defined airbases on the current known maps of DCS:
|
||||
--
|
||||
-- * @{Wrapper.Airbase#AIRBASE.Caucasus}: The airbases on the Caucasus map.
|
||||
-- * @{Wrapper.Airbase#AIRBASE.Nevada}: The airbases on the Nevada (NTTR) map.
|
||||
-- * @{Wrapper.Airbase#AIRBASE.Normandy}: The airbases on the Normandy map.
|
||||
--
|
||||
-- Use the method @{Wrapper.Airbase#AIRBASE.FindByName}() to retrieve the airbase object.
|
||||
-- The known AIRBASE objects are automatically imported at mission start by MOOSE.
|
||||
-- Therefore, there isn't any New() constructor defined for AIRBASE objects.
|
||||
--
|
||||
-- Ships and Farps are added within the mission, and are therefore not known.
|
||||
-- For these AIRBASE objects, there isn't an @{Wrapper.Airbase#AIRBASE} enumeration defined.
|
||||
-- You need to provide the **exact name** of the airbase as the parameter to the @{Wrapper.Airbase#AIRBASE.FindByName}() method!
|
||||
--
|
||||
-- @param #SPAWN self
|
||||
-- @param Wrapper.Airbase#AIRBASE SpawnAirbase The @{Wrapper.Airbase} where to spawn the group.
|
||||
-- @param Wrapper.Airbase#AIRBASE.TerminalType TerminalType (optional) The terminal type the aircraft should be spawned at. See @{Wrapper.Airbase#AIRBASE.TerminalType}.
|
||||
-- @param #table Parkingdata (optional) Table holding the coordinates and terminal ids for all units of the group. Spawning will be forced to happen at exactily these spots!
|
||||
-- @return #nil Nothing is returned!
|
||||
-- @usage
|
||||
-- Spawn_Plane = SPAWN:New( "Plane" )
|
||||
-- Spawn_Plane:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Krymsk ) )
|
||||
--
|
||||
-- Spawn_Heli = SPAWN:New( "Heli")
|
||||
--
|
||||
-- Spawn_Heli:ParkAtAirbase( AIRBASE:FindByName( "FARP Cold" ) )
|
||||
--
|
||||
-- Spawn_Heli:ParkAtAirbase( AIRBASE:FindByName( "Carrier" ) )
|
||||
--
|
||||
-- Spawn_Plane:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Krymsk ), AIRBASE.TerminalType.OpenBig )
|
||||
--
|
||||
function SPAWN:ParkAtAirbase( SpawnAirbase, TerminalType, Parkingdata ) -- R2.2, R2.4, R2.5
|
||||
self:F( { self.SpawnTemplatePrefix, SpawnAirbase, TerminalType } )
|
||||
|
||||
self:ParkAircraft( SpawnAirbase, TerminalType, Parkingdata, 1 )
|
||||
|
||||
for SpawnIndex = 2, self.SpawnMaxGroups do
|
||||
self:ScheduleOnce( SpawnIndex * 0.1, SPAWN.ParkAircraft, self, SpawnAirbase, TerminalType, Parkingdata, SpawnIndex )
|
||||
end
|
||||
|
||||
self:SetSpawnIndex()
|
||||
|
||||
@ -549,12 +549,15 @@ function AIRBASE:GetParkingSpotsTable(termtype)
|
||||
local spots={}
|
||||
for _,_spot in pairs(parkingdata) do
|
||||
if AIRBASE._CheckTerminalType(_spot.Term_Type, termtype) then
|
||||
self:I({_spot=_spot})
|
||||
local _free=_isfree(_spot)
|
||||
local _coord=COORDINATE:NewFromVec3(_spot.vTerminalPos)
|
||||
table.insert(spots, {Coordinate=_coord, TerminalID=_spot.Term_Index, TerminalType=_spot.Term_Type, TOAC=_spot.TO_AC, Free=_free, TerminalID0=_spot.Term_Index_0, DistToRwy=_spot.fDistToRW})
|
||||
end
|
||||
end
|
||||
|
||||
self:I({ spots = spots } )
|
||||
|
||||
return spots
|
||||
end
|
||||
|
||||
@ -704,6 +707,8 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius,
|
||||
local _spot=parkingspot.Coordinate -- Core.Point#COORDINATE
|
||||
local _termid=parkingspot.TerminalID
|
||||
|
||||
self:I({_termid=_termid})
|
||||
|
||||
if AIRBASE._CheckTerminalType(parkingspot.TerminalType, terminaltype) then
|
||||
|
||||
-- Very safe uses the DCS getParking() info to check if a spot is free. Unfortunately, the function returns free=false until the aircraft has actually taken-off.
|
||||
@ -783,7 +788,7 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius,
|
||||
|
||||
--_spot:MarkToAll(string.format("Parking spot %d free=%s", parkingspot.TerminalID, tostring(not occupied)))
|
||||
if occupied then
|
||||
self:T(string.format("%s: Parking spot id %d occupied.", airport, _termid))
|
||||
self:I(string.format("%s: Parking spot id %d occupied.", airport, _termid))
|
||||
else
|
||||
self:I(string.format("%s: Parking spot id %d free.", airport, _termid))
|
||||
if nvalid<_nspots then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user