AIBOSS v0.6.3

Recovery Tanker v1.0.0
Rescue Helo v1.0.0
Fixed spawn after engine shutdown bug.
Added new PG airbases.
This commit is contained in:
Frank 2018-12-25 18:55:35 +01:00
parent d8c5ab7eae
commit 8dc5642599
6 changed files with 397 additions and 216 deletions

View File

@ -2637,7 +2637,9 @@ function SPAWN:_OnEngineShutDown( EventData )
if Landed and self.RepeatOnEngineShutDown then
local SpawnGroupIndex = self:GetSpawnIndexFromGroup( SpawnGroup )
self:T( { "EngineShutDown: ", "ReSpawn:", SpawnGroup:GetName(), SpawnGroupIndex } )
self:ReSpawn( SpawnGroupIndex )
--self:ReSpawn( SpawnGroupIndex )
-- Delay respawn by three seconds due to DCS 2.5.4 OB bug https://github.com/FlightControl-Master/MOOSE/issues/1076
SCHEDULER:New(self, self.ReSpawn, {SpawnGroupIndex}, 3)
end
end
end

File diff suppressed because it is too large Load Diff

View File

@ -237,7 +237,7 @@ RECOVERYTANKER = {
--- Class version.
-- @field #string version
RECOVERYTANKER.version="0.9.9"
RECOVERYTANKER.version="1.0.0"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list
@ -301,11 +301,12 @@ function RECOVERYTANKER:New(carrierunit, tankergroupname)
self:SetPatternUpdateHeading()
self:SetPatternUpdateInterval()
--[[
BASE:TraceOnOff(true)
BASE:TraceClass(self.ClassName)
BASE:TraceLevel(1)
]]
-- Debug trace.
if false then
BASE:TraceOnOff(true)
BASE:TraceClass(self.ClassName)
BASE:TraceLevel(1)
end
-----------------------
--- FSM Transitions ---
@ -964,7 +965,9 @@ function RECOVERYTANKER:OnEventEngineShutdown(EventData)
self:T(self.lid..text)
-- Respawn tanker.
self.tanker=group:RespawnAtCurrentAirbase()
--self.tanker=group:RespawnAtCurrentAirbase()
-- Delaying respawn due to DCS bug https://github.com/FlightControl-Master/MOOSE/issues/1076
SCHEDULER:New(nil , group.RespawnAtCurrentAirbase, {group}, 1)
-- Create tanker beacon and activate TACAN.
if self.TACANon then
@ -972,8 +975,8 @@ function RECOVERYTANKER:OnEventEngineShutdown(EventData)
end
-- Initial route.
SCHEDULER:New(self, self._InitRoute, {-self.distStern+UTILS.NMToMeters(3)}, 1)
--self:_InitRoute(-self.distStern+UTILS.NMToMeters(3), 1)
SCHEDULER:New(self, self._InitRoute, {-self.distStern+UTILS.NMToMeters(3)}, 2)
end
end

View File

@ -218,7 +218,7 @@ RESCUEHELO = {
--- Class version.
-- @field #string version
RESCUEHELO.version="0.9.9"
RESCUEHELO.version="1.0.0"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list
@ -269,6 +269,7 @@ function RESCUEHELO:New(carrierunit, helogroupname)
self:SetAltitude()
self:SetOffsetX()
self:SetOffsetZ()
self:SetRespawnOn()
self:SetRescueOn()
self:SetRescueZone()
self:SetRescueHoverSpeed()
@ -279,11 +280,12 @@ function RESCUEHELO:New(carrierunit, helogroupname)
self.rtb=false
self.carrierstop=false
--[[
BASE:TraceOnOff(true)
BASE:TraceClass("RESCUEHELO")
BASE:TraceLevel(1)
]]
-- Debug trace.
if false then
BASE:TraceOnOff(true)
BASE:TraceClass(self.ClassName)
BASE:TraceLevel(1)
end
-----------------------
--- FSM Transitions ---
@ -656,28 +658,35 @@ function RESCUEHELO:OnEventLand(EventData)
self:T(string.format("Rescue helo %s returned from rescue operation.", groupname))
end
end
-- Check if takeoff air or respawn in air is set. Landing event should not happen unless the helo was on a rescue mission.
if self.takeoff==SPAWN.Takeoff.Air or self.respawninair then
if self:IsRescuing() then
self:T(string.format("Rescue helo %s returned from rescue operation.", groupname))
-- Respawn helo at current airbase.
self.helo=group:RespawnAtCurrentAirbase()
else
self:T2(string.format("WARNING: Rescue helo %s landed. This should not happen for Takeoff=Air or respawninair=true unless a rescue operation finished.", groupname))
-- Respawn helo at current airbase anyway.
if self.respawn then
self.helo=group:RespawnAtCurrentAirbase()
end
end
-- Respawn helo at current airbase anyway.
self.helo=group:RespawnAtCurrentAirbase()
else
-- Respawn helo at current airbase.
self.helo=group:RespawnAtCurrentAirbase()
if self.respawn then
self.helo=group:RespawnAtCurrentAirbase()
end
end
@ -782,7 +791,7 @@ function RESCUEHELO:onafterStart(From, Event, To)
local dist=UTILS.NMToMeters(0.2)
-- Coordinate behind the carrier. Altitude at least 100 meters for spawning because it drops down a bit.
local Carrier=self.carrier:GetCoordinate():Translate(dist, hdg):SetAltitude(math.max(140, self.altitude))
local Carrier=self.carrier:GetCoordinate():Translate(dist, hdg):SetAltitude(math.max(100, self.altitude))
-- Orientation of spawned group.
Spawn:InitHeading(hdg)

View File

@ -238,6 +238,8 @@ AIRBASE.Normandy = {
-- * AIRBASE.PersianGulf.Sharjah_Intl
-- * AIRBASE.PersianGulf.Shiraz_International_Airport
-- * AIRBASE.PersianGulf.Kerman_Airport
-- * AIRBASE.PersianGulf.Jiroft_Airport
-- * AIRBASE.PersianGulf.Lavan_Island_Airport
-- @field PersianGulf
AIRBASE.PersianGulf = {
["Fujairah_Intl"] = "Fujairah Intl",
@ -259,6 +261,8 @@ AIRBASE.PersianGulf = {
["Sharjah_Intl"] = "Sharjah Intl",
["Shiraz_International_Airport"] = "Shiraz International Airport",
["Kerman_Airport"] = "Kerman Airport",
["Jiroft_Airport"] = "Jiroft Airport",
["Lavan_Island_Airport"] = "Lavan Island Airport",
}
--- AIRBASE.ParkingSpot ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy".

View File

@ -1609,7 +1609,7 @@ function GROUP:Respawn( Template, Reset )
-- Destroy old group. Dont trigger any dead/crash events since this is a respawn.
self:Destroy(false)
self:E({Template=Template})
self:T({Template=Template})
-- Spawn new group.
_DATABASE:Spawn(Template)