mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
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:
@@ -2637,7 +2637,9 @@ function SPAWN:_OnEngineShutDown( EventData )
|
|||||||
if Landed and self.RepeatOnEngineShutDown then
|
if Landed and self.RepeatOnEngineShutDown then
|
||||||
local SpawnGroupIndex = self:GetSpawnIndexFromGroup( SpawnGroup )
|
local SpawnGroupIndex = self:GetSpawnIndexFromGroup( SpawnGroup )
|
||||||
self:T( { "EngineShutDown: ", "ReSpawn:", SpawnGroup:GetName(), SpawnGroupIndex } )
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -237,7 +237,7 @@ RECOVERYTANKER = {
|
|||||||
|
|
||||||
--- Class version.
|
--- Class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
RECOVERYTANKER.version="0.9.9"
|
RECOVERYTANKER.version="1.0.0"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@@ -301,11 +301,12 @@ function RECOVERYTANKER:New(carrierunit, tankergroupname)
|
|||||||
self:SetPatternUpdateHeading()
|
self:SetPatternUpdateHeading()
|
||||||
self:SetPatternUpdateInterval()
|
self:SetPatternUpdateInterval()
|
||||||
|
|
||||||
--[[
|
-- Debug trace.
|
||||||
|
if false then
|
||||||
BASE:TraceOnOff(true)
|
BASE:TraceOnOff(true)
|
||||||
BASE:TraceClass(self.ClassName)
|
BASE:TraceClass(self.ClassName)
|
||||||
BASE:TraceLevel(1)
|
BASE:TraceLevel(1)
|
||||||
]]
|
end
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
--- FSM Transitions ---
|
--- FSM Transitions ---
|
||||||
@@ -964,7 +965,9 @@ function RECOVERYTANKER:OnEventEngineShutdown(EventData)
|
|||||||
self:T(self.lid..text)
|
self:T(self.lid..text)
|
||||||
|
|
||||||
-- Respawn tanker.
|
-- 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.
|
-- Create tanker beacon and activate TACAN.
|
||||||
if self.TACANon then
|
if self.TACANon then
|
||||||
@@ -972,8 +975,8 @@ function RECOVERYTANKER:OnEventEngineShutdown(EventData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Initial route.
|
-- Initial route.
|
||||||
SCHEDULER:New(self, self._InitRoute, {-self.distStern+UTILS.NMToMeters(3)}, 1)
|
SCHEDULER:New(self, self._InitRoute, {-self.distStern+UTILS.NMToMeters(3)}, 2)
|
||||||
--self:_InitRoute(-self.distStern+UTILS.NMToMeters(3), 1)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ RESCUEHELO = {
|
|||||||
|
|
||||||
--- Class version.
|
--- Class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
RESCUEHELO.version="0.9.9"
|
RESCUEHELO.version="1.0.0"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@@ -269,6 +269,7 @@ function RESCUEHELO:New(carrierunit, helogroupname)
|
|||||||
self:SetAltitude()
|
self:SetAltitude()
|
||||||
self:SetOffsetX()
|
self:SetOffsetX()
|
||||||
self:SetOffsetZ()
|
self:SetOffsetZ()
|
||||||
|
self:SetRespawnOn()
|
||||||
self:SetRescueOn()
|
self:SetRescueOn()
|
||||||
self:SetRescueZone()
|
self:SetRescueZone()
|
||||||
self:SetRescueHoverSpeed()
|
self:SetRescueHoverSpeed()
|
||||||
@@ -279,11 +280,12 @@ function RESCUEHELO:New(carrierunit, helogroupname)
|
|||||||
self.rtb=false
|
self.rtb=false
|
||||||
self.carrierstop=false
|
self.carrierstop=false
|
||||||
|
|
||||||
--[[
|
-- Debug trace.
|
||||||
|
if false then
|
||||||
BASE:TraceOnOff(true)
|
BASE:TraceOnOff(true)
|
||||||
BASE:TraceClass("RESCUEHELO")
|
BASE:TraceClass(self.ClassName)
|
||||||
BASE:TraceLevel(1)
|
BASE:TraceLevel(1)
|
||||||
]]
|
end
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
--- FSM Transitions ---
|
--- FSM Transitions ---
|
||||||
@@ -658,26 +660,33 @@ function RESCUEHELO:OnEventLand(EventData)
|
|||||||
|
|
||||||
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.takeoff==SPAWN.Takeoff.Air or self.respawninair then
|
||||||
|
|
||||||
if self:IsRescuing() then
|
if self:IsRescuing() then
|
||||||
|
|
||||||
self:T(string.format("Rescue helo %s returned from rescue operation.", groupname))
|
self:T(string.format("Rescue helo %s returned from rescue operation.", groupname))
|
||||||
|
|
||||||
|
-- Respawn helo at current airbase.
|
||||||
|
self.helo=group:RespawnAtCurrentAirbase()
|
||||||
|
|
||||||
else
|
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))
|
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.
|
end
|
||||||
self.helo=group:RespawnAtCurrentAirbase()
|
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
-- Respawn helo at current airbase.
|
-- Respawn helo at current airbase.
|
||||||
|
if self.respawn then
|
||||||
self.helo=group:RespawnAtCurrentAirbase()
|
self.helo=group:RespawnAtCurrentAirbase()
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -782,7 +791,7 @@ function RESCUEHELO:onafterStart(From, Event, To)
|
|||||||
local dist=UTILS.NMToMeters(0.2)
|
local dist=UTILS.NMToMeters(0.2)
|
||||||
|
|
||||||
-- Coordinate behind the carrier. Altitude at least 100 meters for spawning because it drops down a bit.
|
-- 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.
|
-- Orientation of spawned group.
|
||||||
Spawn:InitHeading(hdg)
|
Spawn:InitHeading(hdg)
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ AIRBASE.Normandy = {
|
|||||||
-- * AIRBASE.PersianGulf.Sharjah_Intl
|
-- * AIRBASE.PersianGulf.Sharjah_Intl
|
||||||
-- * AIRBASE.PersianGulf.Shiraz_International_Airport
|
-- * AIRBASE.PersianGulf.Shiraz_International_Airport
|
||||||
-- * AIRBASE.PersianGulf.Kerman_Airport
|
-- * AIRBASE.PersianGulf.Kerman_Airport
|
||||||
|
-- * AIRBASE.PersianGulf.Jiroft_Airport
|
||||||
|
-- * AIRBASE.PersianGulf.Lavan_Island_Airport
|
||||||
-- @field PersianGulf
|
-- @field PersianGulf
|
||||||
AIRBASE.PersianGulf = {
|
AIRBASE.PersianGulf = {
|
||||||
["Fujairah_Intl"] = "Fujairah Intl",
|
["Fujairah_Intl"] = "Fujairah Intl",
|
||||||
@@ -259,6 +261,8 @@ AIRBASE.PersianGulf = {
|
|||||||
["Sharjah_Intl"] = "Sharjah Intl",
|
["Sharjah_Intl"] = "Sharjah Intl",
|
||||||
["Shiraz_International_Airport"] = "Shiraz International Airport",
|
["Shiraz_International_Airport"] = "Shiraz International Airport",
|
||||||
["Kerman_Airport"] = "Kerman Airport",
|
["Kerman_Airport"] = "Kerman Airport",
|
||||||
|
["Jiroft_Airport"] = "Jiroft Airport",
|
||||||
|
["Lavan_Island_Airport"] = "Lavan Island Airport",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- AIRBASE.ParkingSpot ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy".
|
--- AIRBASE.ParkingSpot ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy".
|
||||||
|
|||||||
@@ -1609,7 +1609,7 @@ function GROUP:Respawn( Template, Reset )
|
|||||||
-- Destroy old group. Dont trigger any dead/crash events since this is a respawn.
|
-- Destroy old group. Dont trigger any dead/crash events since this is a respawn.
|
||||||
self:Destroy(false)
|
self:Destroy(false)
|
||||||
|
|
||||||
self:E({Template=Template})
|
self:T({Template=Template})
|
||||||
|
|
||||||
-- Spawn new group.
|
-- Spawn new group.
|
||||||
_DATABASE:Spawn(Template)
|
_DATABASE:Spawn(Template)
|
||||||
|
|||||||
Reference in New Issue
Block a user