mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OPSTRANSPORT
This commit is contained in:
parent
978be4e383
commit
36669c80da
@ -1474,7 +1474,7 @@ function FLIGHTGROUP:onafterElementTakeoff(From, Event, To, Element, airbase)
|
|||||||
self:_UpdateStatus(Element, OPSGROUP.ElementStatus.TAKEOFF, airbase)
|
self:_UpdateStatus(Element, OPSGROUP.ElementStatus.TAKEOFF, airbase)
|
||||||
|
|
||||||
-- Trigger element airborne event.
|
-- Trigger element airborne event.
|
||||||
self:__ElementAirborne(2, Element)
|
self:__ElementAirborne(0.1, Element)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- On after "ElementAirborne" event.
|
--- On after "ElementAirborne" event.
|
||||||
@ -1749,7 +1749,7 @@ function FLIGHTGROUP:onafterAirborne(From, Event, To)
|
|||||||
self:LandAtAirbase(airbase)
|
self:LandAtAirbase(airbase)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:_CheckGroupDone(1)
|
self:_CheckGroupDone()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:_UpdateMenu()
|
self:_UpdateMenu()
|
||||||
@ -2194,7 +2194,8 @@ function FLIGHTGROUP:_CheckGroupDone(delay)
|
|||||||
-- Send flight to destination.
|
-- Send flight to destination.
|
||||||
if destbase then
|
if destbase then
|
||||||
self:T(self.lid.."Passed Final WP and No current and/or future missions/tasks/transports ==> RTB!")
|
self:T(self.lid.."Passed Final WP and No current and/or future missions/tasks/transports ==> RTB!")
|
||||||
self:__RTB(-3, destbase)
|
--self:RTB(destbase)
|
||||||
|
self:__RTB(-0.1, destbase)
|
||||||
elseif destzone then
|
elseif destzone then
|
||||||
self:T(self.lid.."Passed Final WP and No current and/or future missions/tasks/transports ==> RTZ!")
|
self:T(self.lid.."Passed Final WP and No current and/or future missions/tasks/transports ==> RTZ!")
|
||||||
self:__RTZ(-3, destzone)
|
self:__RTZ(-3, destzone)
|
||||||
@ -2378,6 +2379,9 @@ function FLIGHTGROUP:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand)
|
|||||||
|
|
||||||
-- Holding points.
|
-- Holding points.
|
||||||
local c0=self.group:GetCoordinate()
|
local c0=self.group:GetCoordinate()
|
||||||
|
local zone=airbase:GetZone()
|
||||||
|
env.info("FF landatairbase zone:")
|
||||||
|
self:I({zone=zone})
|
||||||
local p0=airbase:GetZone():GetRandomCoordinate():SetAltitude(UTILS.FeetToMeters(althold))
|
local p0=airbase:GetZone():GetRandomCoordinate():SetAltitude(UTILS.FeetToMeters(althold))
|
||||||
local p1=nil
|
local p1=nil
|
||||||
local wpap=nil
|
local wpap=nil
|
||||||
@ -3075,8 +3079,8 @@ function FLIGHTGROUP:_InitGroup()
|
|||||||
self:I(self.lid..text)
|
self:I(self.lid..text)
|
||||||
end
|
end
|
||||||
|
|
||||||
env.info("DCS Unit BOOM_AND_RECEPTACLE="..tostring(Unit.RefuelingSystem.BOOM_AND_RECEPTACLE))
|
--env.info("DCS Unit BOOM_AND_RECEPTACLE="..tostring(Unit.RefuelingSystem.BOOM_AND_RECEPTACLE))
|
||||||
env.info("DCS Unit PROBE_AND_DROGUE="..tostring(Unit.RefuelingSystem.PROBE_AND_DROGUE))
|
--env.info("DCS Unit PROBE_AND_DROGUE="..tostring(Unit.RefuelingSystem.PROBE_AND_DROGUE))
|
||||||
|
|
||||||
-- Init done.
|
-- Init done.
|
||||||
self.groupinitialized=true
|
self.groupinitialized=true
|
||||||
@ -3711,6 +3715,8 @@ end
|
|||||||
-- @return Wrapper.Airbase#AIRBASE.ParkingSpot Parking spot or nil if no spot is within distance threshold.
|
-- @return Wrapper.Airbase#AIRBASE.ParkingSpot Parking spot or nil if no spot is within distance threshold.
|
||||||
function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase)
|
function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase)
|
||||||
|
|
||||||
|
env.info("FF Get Parking spot for element "..element.name)
|
||||||
|
|
||||||
-- Coordinate of unit landed
|
-- Coordinate of unit landed
|
||||||
local coord=element.unit:GetCoordinate()
|
local coord=element.unit:GetCoordinate()
|
||||||
|
|
||||||
@ -3724,7 +3730,8 @@ function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase)
|
|||||||
if airbase and airbase:IsShip() then
|
if airbase and airbase:IsShip() then
|
||||||
coord.x=0
|
coord.x=0
|
||||||
coord.z=0
|
coord.z=0
|
||||||
maxdist=100
|
maxdist=500 -- 100 meters was not enough, e.g. on the Seawise Giant, where the spot is 139 meters from the "center"
|
||||||
|
env.info("FF Airbase is ship")
|
||||||
end
|
end
|
||||||
|
|
||||||
local spot=nil --Wrapper.Airbase#AIRBASE.ParkingSpot
|
local spot=nil --Wrapper.Airbase#AIRBASE.ParkingSpot
|
||||||
@ -3733,6 +3740,7 @@ function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase)
|
|||||||
for _,_parking in pairs(parking) do
|
for _,_parking in pairs(parking) do
|
||||||
local parking=_parking --Wrapper.Airbase#AIRBASE.ParkingSpot
|
local parking=_parking --Wrapper.Airbase#AIRBASE.ParkingSpot
|
||||||
dist=coord:Get2DDistance(parking.Coordinate)
|
dist=coord:Get2DDistance(parking.Coordinate)
|
||||||
|
env.info(string.format("FF parking %d dist=%.1f", parking.TerminalID, dist))
|
||||||
if dist<distmin then
|
if dist<distmin then
|
||||||
distmin=dist
|
distmin=dist
|
||||||
spot=_parking
|
spot=_parking
|
||||||
|
|||||||
@ -113,6 +113,7 @@
|
|||||||
-- @field #table cargoBay Table containing OPSGROUP loaded into this group.
|
-- @field #table cargoBay Table containing OPSGROUP loaded into this group.
|
||||||
-- @field Ops.OpsTransport#OPSTRANSPORT cargoTransport Current cargo transport assignment.
|
-- @field Ops.OpsTransport#OPSTRANSPORT cargoTransport Current cargo transport assignment.
|
||||||
-- @field #string cargoStatus Cargo status of this group acting as cargo.
|
-- @field #string cargoStatus Cargo status of this group acting as cargo.
|
||||||
|
-- @field #number cargoTransportUID Unique ID of the transport assignment this cargo group is associated with.
|
||||||
-- @field #string carrierStatus Carrier status of this group acting as cargo carrier.
|
-- @field #string carrierStatus Carrier status of this group acting as cargo carrier.
|
||||||
-- @field #number cargocounter Running number of cargo UIDs.
|
-- @field #number cargocounter Running number of cargo UIDs.
|
||||||
-- @field #OPSGROUP.CarrierLoader carrierLoader Carrier loader parameters.
|
-- @field #OPSGROUP.CarrierLoader carrierLoader Carrier loader parameters.
|
||||||
@ -1785,9 +1786,14 @@ end
|
|||||||
|
|
||||||
--- Check if the group is **not** cargo.
|
--- Check if the group is **not** cargo.
|
||||||
-- @param #OPSGROUP self
|
-- @param #OPSGROUP self
|
||||||
|
-- @param #boolean CheckTransport If true or nil, also check if cargo is associated with a transport assignment. If not, we consider it not cargo.
|
||||||
-- @return #boolean If true, group is *not* cargo.
|
-- @return #boolean If true, group is *not* cargo.
|
||||||
function OPSGROUP:IsNotCargo()
|
function OPSGROUP:IsNotCargo(CheckTransport)
|
||||||
return self.cargoStatus==OPSGROUP.CargoStatus.NOTCARGO
|
local notcargo=self.cargoStatus==OPSGROUP.CargoStatus.NOTCARGO
|
||||||
|
if self.cargoTransportUID==nil then
|
||||||
|
notcargo=true
|
||||||
|
end
|
||||||
|
return notcargo
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Check if the group is currently boarding a carrier.
|
--- Check if the group is currently boarding a carrier.
|
||||||
@ -4575,7 +4581,7 @@ function OPSGROUP:onafterElementDead(From, Event, To, Element)
|
|||||||
|
|
||||||
if self:IsCarrier() then
|
if self:IsCarrier() then
|
||||||
if self.cargoTransport then
|
if self.cargoTransport then
|
||||||
self.cargoTransport:CarrierGroupDead()
|
self.cargoTransport:DeadCarrierGroup(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -5349,10 +5355,15 @@ end
|
|||||||
-- @param #boolean Reserved If `true`, reserve space for me.
|
-- @param #boolean Reserved If `true`, reserve space for me.
|
||||||
function OPSGROUP:_SetMyCarrier(CarrierGroup, CarrierElement, Reserved)
|
function OPSGROUP:_SetMyCarrier(CarrierGroup, CarrierElement, Reserved)
|
||||||
|
|
||||||
|
-- Debug info.
|
||||||
|
self:I(self.lid..string.format("Setting My Carrier: %s (%s), reserved=%s", CarrierGroup:GetName(), tostring(CarrierElement.name), tostring(Reserved)))
|
||||||
|
|
||||||
self.mycarrier.group=CarrierGroup
|
self.mycarrier.group=CarrierGroup
|
||||||
self.mycarrier.element=CarrierElement
|
self.mycarrier.element=CarrierElement
|
||||||
self.mycarrier.reserved=Reserved
|
self.mycarrier.reserved=Reserved
|
||||||
|
|
||||||
|
self.cargoTransportUID=CarrierGroup.cargoTransport and CarrierGroup.cargoTransport.uid or nil
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get my carrier group.
|
--- Get my carrier group.
|
||||||
@ -5405,6 +5416,7 @@ function OPSGROUP:_RemoveMyCarrier()
|
|||||||
self.mycarrier.element=nil
|
self.mycarrier.element=nil
|
||||||
self.mycarrier.reserved=nil
|
self.mycarrier.reserved=nil
|
||||||
self.mycarrier={}
|
self.mycarrier={}
|
||||||
|
self.cargoTransportUID=nil
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -5582,9 +5594,9 @@ function OPSGROUP:onafterLoading(From, Event, To)
|
|||||||
-- Check that cargo weight is
|
-- Check that cargo weight is
|
||||||
if self:CanCargo(cargo.opsgroup) and not (cargo.delivered or cargo.opsgroup:IsDead()) then
|
if self:CanCargo(cargo.opsgroup) and not (cargo.delivered or cargo.opsgroup:IsDead()) then
|
||||||
|
|
||||||
-- Check that group is not cargo already and not busy.
|
-- Check that group is NOT cargo and NOT acting as carrier already
|
||||||
-- TODO: Need a better :IsBusy() function or :IsReadyForMission() :IsReadyForBoarding() :IsReadyForTransport()
|
-- TODO: Need a better :IsBusy() function or :IsReadyForMission() :IsReadyForBoarding() :IsReadyForTransport()
|
||||||
if cargo.opsgroup:IsNotCargo() and not (cargo.opsgroup:IsPickingup() or cargo.opsgroup:IsLoading() or cargo.opsgroup:IsTransporting() or cargo.opsgroup:IsUnloading() or cargo.opsgroup:IsLoaded()) then
|
if cargo.opsgroup:IsNotCargo() and not (cargo.opsgroup:IsPickingup() or cargo.opsgroup:IsLoading() or cargo.opsgroup:IsTransporting() or cargo.opsgroup:IsUnloading()) then
|
||||||
|
|
||||||
-- Check if cargo is in embark/pickup zone.
|
-- Check if cargo is in embark/pickup zone.
|
||||||
local inzone=self.cargoTransport.embarkzone:IsCoordinateInZone(cargo.opsgroup:GetCoordinate())
|
local inzone=self.cargoTransport.embarkzone:IsCoordinateInZone(cargo.opsgroup:GetCoordinate())
|
||||||
@ -5640,6 +5652,22 @@ function OPSGROUP:ClearWaypoints()
|
|||||||
self.waypoints={}
|
self.waypoints={}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Transfer cargo from to another carrier.
|
||||||
|
-- @param #OPSGROUP self
|
||||||
|
-- @param #OPSGROUP CargoGroup The cargo group to be transferred.
|
||||||
|
-- @param #OPSGROUP CarrierGroup The new carrier group.
|
||||||
|
-- @param #OPSGROUP.Element CarrierElement The new carrier element.
|
||||||
|
function OPSGROUP:_TransferCargo(CargoGroup, CarrierGroup, CarrierElement)
|
||||||
|
|
||||||
|
-- Debug info.
|
||||||
|
self:I(self.lid..string.format("Transferring cargo %s to new carrier group %s", CargoGroup:GetName(), CarrierGroup:GetName()))
|
||||||
|
|
||||||
|
-- Unload from this and directly load into the other carrier.
|
||||||
|
self:Unload(CargoGroup)
|
||||||
|
CarrierGroup:Load(CargoGroup, CarrierElement)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--- On after "Load" event. Carrier loads a cargo group into ints cargo bay.
|
--- On after "Load" event. Carrier loads a cargo group into ints cargo bay.
|
||||||
-- @param #OPSGROUP self
|
-- @param #OPSGROUP self
|
||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
@ -5690,7 +5718,11 @@ function OPSGROUP:onafterLoad(From, Event, To, CargoGroup, Carrier)
|
|||||||
CargoGroup:Embarked(self, carrier)
|
CargoGroup:Embarked(self, carrier)
|
||||||
|
|
||||||
-- Trigger "Loaded" event for current cargo transport.
|
-- Trigger "Loaded" event for current cargo transport.
|
||||||
|
if self.cargoTransport then
|
||||||
self.cargoTransport:Loaded(CargoGroup, carrier)
|
self.cargoTransport:Loaded(CargoGroup, carrier)
|
||||||
|
else
|
||||||
|
self:E(self.lid..string.format("WARNING: Loaded cargo but no current OPSTRANSPORT assignment!"))
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
self:E(self.lid.."ERROR: Cargo has no carrier on Load event!")
|
self:E(self.lid.."ERROR: Cargo has no carrier on Load event!")
|
||||||
@ -5920,12 +5952,7 @@ function OPSGROUP:onafterUnloading(From, Event, To)
|
|||||||
-- Delivered to another carrier group.
|
-- Delivered to another carrier group.
|
||||||
---
|
---
|
||||||
|
|
||||||
-- Debug info.
|
self:_TransferCargo(cargo.opsgroup, carrierGroup, carrier)
|
||||||
self:I(self.lid..string.format("Transferring cargo %s to new carrier group %s", cargo.opsgroup:GetName(), carrierGroup:GetName()))
|
|
||||||
|
|
||||||
-- Unload from this and directly load into the other carrier.
|
|
||||||
self:Unload(cargo.opsgroup)
|
|
||||||
carrierGroup:Load(cargo.opsgroup, carrier)
|
|
||||||
|
|
||||||
elseif zone and zone:IsInstanceOf("ZONE_AIRBASE") and zone:GetAirbase():IsShip() then
|
elseif zone and zone:IsInstanceOf("ZONE_AIRBASE") and zone:GetAirbase():IsShip() then
|
||||||
|
|
||||||
@ -6240,9 +6267,6 @@ function OPSGROUP:onafterBoard(From, Event, To, CarrierGroup, Carrier)
|
|||||||
-- Set cargo status.
|
-- Set cargo status.
|
||||||
self.cargoStatus=OPSGROUP.CargoStatus.BOARDING
|
self.cargoStatus=OPSGROUP.CargoStatus.BOARDING
|
||||||
|
|
||||||
-- Set carrier. As long as the group is not loaded, we only reserve the cargo space.
|
|
||||||
self:_SetMyCarrier(CarrierGroup, Carrier, true)
|
|
||||||
|
|
||||||
-- Army or Navy group.
|
-- Army or Navy group.
|
||||||
local CarrierIsArmyOrNavy=CarrierGroup:IsArmygroup() or CarrierGroup:IsNavygroup()
|
local CarrierIsArmyOrNavy=CarrierGroup:IsArmygroup() or CarrierGroup:IsNavygroup()
|
||||||
local CargoIsArmyOrNavy=self:IsArmygroup() or self:IsNavygroup()
|
local CargoIsArmyOrNavy=self:IsArmygroup() or self:IsNavygroup()
|
||||||
@ -6279,6 +6303,9 @@ function OPSGROUP:onafterBoard(From, Event, To, CarrierGroup, Carrier)
|
|||||||
self:Cruise()
|
self:Cruise()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Set carrier. As long as the group is not loaded, we only reserve the cargo space.
|
||||||
|
self:_SetMyCarrier(CarrierGroup, Carrier, true)
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -6288,16 +6315,30 @@ function OPSGROUP:onafterBoard(From, Event, To, CarrierGroup, Carrier)
|
|||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:I(self.lid..string.format("Board with direct load to carrier %s", CarrierGroup:GetName()))
|
self:I(self.lid..string.format("Board with direct load to carrier %s", CarrierGroup:GetName()))
|
||||||
|
|
||||||
|
local mycarriergroup=self:_GetMyCarrierGroup()
|
||||||
|
|
||||||
|
-- Unload cargo first.
|
||||||
|
if mycarriergroup then
|
||||||
|
mycarriergroup:Unload(self)
|
||||||
|
end
|
||||||
|
|
||||||
-- Trigger Load event.
|
-- Trigger Load event.
|
||||||
CarrierGroup:Load(self)
|
CarrierGroup:Load(self)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
-- Redo boarding call.
|
||||||
self:T(self.lid.."Carrier not ready for boarding yet ==> repeating boarding call in 10 sec")
|
self:T(self.lid.."Carrier not ready for boarding yet ==> repeating boarding call in 10 sec")
|
||||||
self:__Board(-10, CarrierGroup, Carrier)
|
self:__Board(-10, CarrierGroup, Carrier)
|
||||||
|
|
||||||
|
-- Set carrier. As long as the group is not loaded, we only reserve the cargo space.
|
||||||
|
self:_SetMyCarrier(CarrierGroup, Carrier, true)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -8085,7 +8126,7 @@ function OPSGROUP:_UpdateStatus(element, newstatus, airbase)
|
|||||||
---
|
---
|
||||||
|
|
||||||
if self:_AllSimilarStatus(newstatus) then
|
if self:_AllSimilarStatus(newstatus) then
|
||||||
self:__Airborne(-0.5)
|
self:__Airborne(-0.1)
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif newstatus==OPSGROUP.ElementStatus.LANDED then
|
elseif newstatus==OPSGROUP.ElementStatus.LANDED then
|
||||||
|
|||||||
@ -103,7 +103,7 @@ _OPSTRANSPORTID=0
|
|||||||
|
|
||||||
--- Army Group version.
|
--- Army Group version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
OPSTRANSPORT.version="0.0.6"
|
OPSTRANSPORT.version="0.0.7"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -418,6 +418,23 @@ function OPSTRANSPORT:_GetCarrierNames()
|
|||||||
return names
|
return names
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get (all) cargo @{Ops.OpsGroup#OPSGROUP}s. Optionally, only delivered or undelivered groups can be returned.
|
||||||
|
-- @param #OPSTRANSPORT self
|
||||||
|
-- @param #boolean Delivered If `true`, only delivered groups are returned. If `false` only undelivered groups are returned. If `nil`, all groups are returned.
|
||||||
|
-- @return #table Ops groups.
|
||||||
|
function OPSTRANSPORT:GetCargoOpsGroups(Delivered)
|
||||||
|
|
||||||
|
local opsgroups={}
|
||||||
|
for _,_cargo in pairs(self.cargos) do
|
||||||
|
local cargo=_cargo --Ops.OpsGroup#OPSGROUP.CargoGroup
|
||||||
|
if Delivered==nil or cargo.delivered==Delivered then
|
||||||
|
table.insert(opsgroups, cargo.opsgroup)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return opsgroups
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Set transport start and stop time.
|
--- Set transport start and stop time.
|
||||||
-- @param #OPSTRANSPORT self
|
-- @param #OPSTRANSPORT self
|
||||||
@ -574,8 +591,33 @@ function OPSTRANSPORT:GetCarrierTransportStatus(CarrierGroup)
|
|||||||
return self.carrierTransportStatus[CarrierGroup.groupname]
|
return self.carrierTransportStatus[CarrierGroup.groupname]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get unique ID of the transport assignment.
|
||||||
|
-- @param #OPSTRANSPORT self
|
||||||
|
-- @return #number UID.
|
||||||
|
function OPSTRANSPORT:GetUID()
|
||||||
|
return self.uid
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get number of delivered cargo groups.
|
||||||
|
-- @param #OPSTRANSPORT self
|
||||||
|
-- @return #number Total number of delivered cargo groups.
|
||||||
|
function OPSTRANSPORT:GetNcargoDelivered()
|
||||||
|
return self.Ndelivered
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get number of cargo groups.
|
||||||
|
-- @param #OPSTRANSPORT self
|
||||||
|
-- @return #number Total number of cargo groups.
|
||||||
|
function OPSTRANSPORT:GetNcargoTotal()
|
||||||
|
return self.Ncargo
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get number of carrier groups assigned for this transport.
|
||||||
|
-- @param #OPSTRANSPORT self
|
||||||
|
-- @return #number Total number of carrier groups.
|
||||||
|
function OPSTRANSPORT:GetNcarrier()
|
||||||
|
return self.Ncarrier
|
||||||
|
end
|
||||||
|
|
||||||
--- Check if an OPS group is assigned as carrier for this transport.
|
--- Check if an OPS group is assigned as carrier for this transport.
|
||||||
-- @param #OPSTRANSPORT self
|
-- @param #OPSTRANSPORT self
|
||||||
|
|||||||
@ -534,6 +534,9 @@ function AIRBASE:Register(AirbaseName)
|
|||||||
-- Get descriptors.
|
-- Get descriptors.
|
||||||
self.descriptors=self:GetDesc()
|
self.descriptors=self:GetDesc()
|
||||||
|
|
||||||
|
-- Debug info.
|
||||||
|
--self:I({airbase=AirbaseName, descriptors=self.descriptors})
|
||||||
|
|
||||||
-- Category.
|
-- Category.
|
||||||
self.category=self.descriptors and self.descriptors.category or Airbase.Category.AIRDROME
|
self.category=self.descriptors and self.descriptors.category or Airbase.Category.AIRDROME
|
||||||
|
|
||||||
@ -544,12 +547,21 @@ function AIRBASE:Register(AirbaseName)
|
|||||||
self.isHelipad=true
|
self.isHelipad=true
|
||||||
elseif self.category==Airbase.Category.SHIP then
|
elseif self.category==Airbase.Category.SHIP then
|
||||||
self.isShip=true
|
self.isShip=true
|
||||||
|
-- DCS bug: Oil rigs and gas platforms have category=2 (ship). Also they cannot be retrieved by coalition.getStaticObjects()
|
||||||
|
if self.descriptors.typeName=="Oil rig" or self.descriptors.typeName=="Ga" then
|
||||||
|
self.isHelipad=true
|
||||||
|
self.isShip=false
|
||||||
|
self.category=Airbase.Category.HELIPAD
|
||||||
|
_DATABASE:AddStatic(AirbaseName)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
self:E("ERROR: Unknown airbase category!")
|
self:E("ERROR: Unknown airbase category!")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Init parking spots.
|
||||||
self:_InitParkingSpots()
|
self:_InitParkingSpots()
|
||||||
|
|
||||||
|
-- Get 2D position vector.
|
||||||
local vec2=self:GetVec2()
|
local vec2=self:GetVec2()
|
||||||
|
|
||||||
-- Init coordinate.
|
-- Init coordinate.
|
||||||
|
|||||||
@ -1468,6 +1468,7 @@ do -- Cargo
|
|||||||
["USS_Samuel_Chase"] = 25000, -- Let's say 25 tons for now. Wiki says 33 Higgins boats, which would be 264 tons (can't be right!) and/or 578 troops.
|
["USS_Samuel_Chase"] = 25000, -- Let's say 25 tons for now. Wiki says 33 Higgins boats, which would be 264 tons (can't be right!) and/or 578 troops.
|
||||||
["LST_Mk2"] = 2100000, -- Can carry 2100 tons according to wiki source!
|
["LST_Mk2"] = 2100000, -- Can carry 2100 tons according to wiki source!
|
||||||
["speedboat"] = 500, -- 500 kg ~ 5 persons
|
["speedboat"] = 500, -- 500 kg ~ 5 persons
|
||||||
|
["Seawise_Giant"] =261000000, -- Gross tonnage is 261,000 tonns.
|
||||||
}
|
}
|
||||||
self.__.CargoBayWeightLimit = ( Weights[Desc.typeName] or 50000 )
|
self.__.CargoBayWeightLimit = ( Weights[Desc.typeName] or 50000 )
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user