mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
FC
- Improved FC
This commit is contained in:
parent
f8e5efc874
commit
ddcc851951
@ -101,6 +101,7 @@ __Moose.Include( 'Scripts/Moose/Ops/Chief.lua' )
|
|||||||
__Moose.Include( 'Scripts/Moose/Ops/Flotilla.lua' )
|
__Moose.Include( 'Scripts/Moose/Ops/Flotilla.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/Ops/Fleet.lua' )
|
__Moose.Include( 'Scripts/Moose/Ops/Fleet.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/Ops/Awacs.lua' )
|
__Moose.Include( 'Scripts/Moose/Ops/Awacs.lua' )
|
||||||
|
__Moose.Include( 'Scripts/Moose/Ops/FlightControl.lua' )
|
||||||
|
|
||||||
__Moose.Include( 'Scripts/Moose/AI/AI_Balancer.lua' )
|
__Moose.Include( 'Scripts/Moose/AI/AI_Balancer.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/AI/AI_Air.lua' )
|
__Moose.Include( 'Scripts/Moose/AI/AI_Air.lua' )
|
||||||
|
|||||||
2676
Moose Development/Moose/Ops/FlightControl.lua
Normal file
2676
Moose Development/Moose/Ops/FlightControl.lua
Normal file
File diff suppressed because it is too large
Load Diff
@ -54,6 +54,7 @@
|
|||||||
-- @field #boolean despawnAfterLanding If `true`, group is despawned after landed at an airbase.
|
-- @field #boolean despawnAfterLanding If `true`, group is despawned after landed at an airbase.
|
||||||
-- @field #boolean despawnAfterHolding If `true`, group is despawned after reaching the holding point.
|
-- @field #boolean despawnAfterHolding If `true`, group is despawned after reaching the holding point.
|
||||||
-- @field #number RTBRecallCount Number that counts RTB calls.
|
-- @field #number RTBRecallCount Number that counts RTB calls.
|
||||||
|
-- @field Ops.FlightControl#FLIGHTCONTROL.HoldingStack stack Holding stack.
|
||||||
--
|
--
|
||||||
-- @extends Ops.OpsGroup#OPSGROUP
|
-- @extends Ops.OpsGroup#OPSGROUP
|
||||||
|
|
||||||
@ -379,7 +380,9 @@ function FLIGHTGROUP:SetFlightControl(flightcontrol)
|
|||||||
self.flightcontrol=flightcontrol
|
self.flightcontrol=flightcontrol
|
||||||
|
|
||||||
-- Add flight to all flights.
|
-- Add flight to all flights.
|
||||||
|
if not flightcontrol:IsFlight(self) then
|
||||||
table.insert(flightcontrol.flights, self)
|
table.insert(flightcontrol.flights, self)
|
||||||
|
end
|
||||||
|
|
||||||
-- Update flight's F10 menu.
|
-- Update flight's F10 menu.
|
||||||
if self.isAI==false then
|
if self.isAI==false then
|
||||||
@ -800,10 +803,12 @@ function FLIGHTGROUP:Status()
|
|||||||
-- Get distance to assigned parking spot.
|
-- Get distance to assigned parking spot.
|
||||||
local dist=element.unit:GetCoordinate():Get2DDistance(element.parking.Coordinate)
|
local dist=element.unit:GetCoordinate():Get2DDistance(element.parking.Coordinate)
|
||||||
|
|
||||||
|
env.info(string.format("FF dist to parking spot %d = %.1f meters", element.parking.TerminalID, dist))
|
||||||
|
|
||||||
-- If distance >10 meters, we consider the unit as taxiing.
|
-- If distance >10 meters, we consider the unit as taxiing.
|
||||||
-- TODO: Check distance threshold! If element is taxiing, the parking spot is free again.
|
-- TODO: Check distance threshold! If element is taxiing, the parking spot is free again.
|
||||||
-- When the next plane is spawned on this spot, collisions should be avoided!
|
-- When the next plane is spawned on this spot, collisions should be avoided!
|
||||||
if dist>10 then
|
if dist>5 then
|
||||||
if element.status==OPSGROUP.ElementStatus.ENGINEON then
|
if element.status==OPSGROUP.ElementStatus.ENGINEON then
|
||||||
self:ElementTaxiing(element)
|
self:ElementTaxiing(element)
|
||||||
end
|
end
|
||||||
@ -1583,8 +1588,18 @@ function FLIGHTGROUP:onafterSpawned(From, Event, To)
|
|||||||
|
|
||||||
env.info("FF Spawned update menu")
|
env.info("FF Spawned update menu")
|
||||||
|
|
||||||
|
-- Set flightcontrol.
|
||||||
|
if self.currbase then
|
||||||
|
local flightcontrol=_DATABASE:GetFlightControl(self.currbase:GetName())
|
||||||
|
if flightcontrol then
|
||||||
|
self:SetFlightControl(flightcontrol)
|
||||||
|
else
|
||||||
-- F10 other menu.
|
-- F10 other menu.
|
||||||
self:_UpdateMenu()
|
self:_UpdateMenu()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:_UpdateMenu()
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1621,6 +1636,8 @@ function FLIGHTGROUP:onafterParking(From, Event, To)
|
|||||||
|
|
||||||
if flightcontrol then
|
if flightcontrol then
|
||||||
|
|
||||||
|
env.info("FF flight control!")
|
||||||
|
|
||||||
-- Set FC for this flight
|
-- Set FC for this flight
|
||||||
self:SetFlightControl(flightcontrol)
|
self:SetFlightControl(flightcontrol)
|
||||||
|
|
||||||
@ -1635,6 +1652,9 @@ function FLIGHTGROUP:onafterParking(From, Event, To)
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
env.info("FF no flight control!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2517,15 +2537,22 @@ function FLIGHTGROUP:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand)
|
|||||||
-- Do we have a flight control?
|
-- Do we have a flight control?
|
||||||
local fc=_DATABASE:GetFlightControl(airbase:GetName())
|
local fc=_DATABASE:GetFlightControl(airbase:GetName())
|
||||||
if fc then
|
if fc then
|
||||||
|
|
||||||
-- Get holding point from flight control.
|
-- Get holding point from flight control.
|
||||||
local HoldingPoint=fc:_GetHoldingpoint(self)
|
local HoldingPoint=fc:_GetHoldingpoint(self)
|
||||||
|
|
||||||
|
if HoldingPoint then
|
||||||
|
|
||||||
|
-- Race track points.
|
||||||
p0=HoldingPoint.pos0
|
p0=HoldingPoint.pos0
|
||||||
p1=HoldingPoint.pos1
|
p1=HoldingPoint.pos1
|
||||||
|
|
||||||
-- Debug marks.
|
-- Debug marks.
|
||||||
if false then
|
if true then
|
||||||
p0:MarkToAll("Holding point P0")
|
p0:MarkToAll(string.format("%s: Holding point P0, alt=%d meters", self:GetName(), p0.y))
|
||||||
p1:MarkToAll("Holding point P1")
|
p1:MarkToAll(string.format("%s: Holding point P1, alt=%d meters", self:GetName(), p0.y))
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Set flightcontrol for this flight.
|
-- Set flightcontrol for this flight.
|
||||||
|
|||||||
@ -205,6 +205,7 @@ OPSGROUP = {
|
|||||||
-- @field DCS#Controller controller The DCS controller of the unit.
|
-- @field DCS#Controller controller The DCS controller of the unit.
|
||||||
-- @field #boolean ai If true, element is AI.
|
-- @field #boolean ai If true, element is AI.
|
||||||
-- @field #string skill Skill level.
|
-- @field #string skill Skill level.
|
||||||
|
-- @field #string playerName Name of player if this is a client.
|
||||||
--
|
--
|
||||||
-- @field Core.Zone#ZONE_POLYGON_BASE zoneBoundingbox Bounding box zone of the element unit.
|
-- @field Core.Zone#ZONE_POLYGON_BASE zoneBoundingbox Bounding box zone of the element unit.
|
||||||
-- @field Core.Zone#ZONE_POLYGON_BASE zoneLoad Loading zone.
|
-- @field Core.Zone#ZONE_POLYGON_BASE zoneLoad Loading zone.
|
||||||
@ -270,6 +271,28 @@ OPSGROUP.ElementStatus={
|
|||||||
DEAD="dead",
|
DEAD="dead",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--- Status of group.
|
||||||
|
-- @type OPSGROUP.GroupStatus
|
||||||
|
-- @field #string INUTERO Not spawned yet or its status is unknown so far.
|
||||||
|
-- @field #string PARKING Parking after spawned on ramp.
|
||||||
|
-- @field #string TAXIING Taxiing after engine startup.
|
||||||
|
-- @field #string AIRBORNE Element is airborne. Either after takeoff or after air start.
|
||||||
|
-- @field #string LANDING Landing.
|
||||||
|
-- @field #string LANDED Landed and is taxiing to its parking spot.
|
||||||
|
-- @field #string ARRIVED Arrived at its parking spot and shut down its engines.
|
||||||
|
-- @field #string DEAD Element is dead after it crashed, pilot ejected or pilot dead events.
|
||||||
|
OPSGROUP.GroupStatus={
|
||||||
|
INUTERO="InUtero",
|
||||||
|
PARKING="Parking",
|
||||||
|
TAXIING="Taxiing",
|
||||||
|
AIRBORNE="Airborne",
|
||||||
|
INBOUND="Inbound",
|
||||||
|
LANDING="Landing",
|
||||||
|
LANDED="Landed",
|
||||||
|
ARRIVED="Arrived",
|
||||||
|
DEAD="Dead",
|
||||||
|
}
|
||||||
|
|
||||||
--- Ops group task status.
|
--- Ops group task status.
|
||||||
-- @type OPSGROUP.TaskStatus
|
-- @type OPSGROUP.TaskStatus
|
||||||
-- @field #string SCHEDULED Task is scheduled.
|
-- @field #string SCHEDULED Task is scheduled.
|
||||||
|
|||||||
@ -96,6 +96,7 @@ Ops/Chief.lua
|
|||||||
Ops/CSAR.lua
|
Ops/CSAR.lua
|
||||||
Ops/CTLD.lua
|
Ops/CTLD.lua
|
||||||
Ops/Awacs.lua
|
Ops/Awacs.lua
|
||||||
|
Ops/FlightControl.lua
|
||||||
|
|
||||||
AI/AI_Balancer.lua
|
AI/AI_Balancer.lua
|
||||||
AI/AI_Air.lua
|
AI/AI_Air.lua
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user