mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-18 21:25:58 +00:00
xx
This commit is contained in:
@@ -2037,7 +2037,7 @@ function AUFTRAG:NewRESCUEHELO(Carrier)
|
|||||||
|
|
||||||
-- Mission options:
|
-- Mission options:
|
||||||
mission.missionTask=ENUMS.MissionTask.NOTHING
|
mission.missionTask=ENUMS.MissionTask.NOTHING
|
||||||
mission.missionFraction=0.5
|
mission.missionFraction=0.9
|
||||||
mission.optionROE=ENUMS.ROE.WeaponHold
|
mission.optionROE=ENUMS.ROE.WeaponHold
|
||||||
mission.optionROT=ENUMS.ROT.NoReaction
|
mission.optionROT=ENUMS.ROT.NoReaction
|
||||||
|
|
||||||
|
|||||||
@@ -4303,13 +4303,24 @@ function OPSGROUP:_UpdateTask(Task, Mission)
|
|||||||
|
|
||||||
if Task.dcstask.id==AUFTRAG.SpecialTask.FORMATION then
|
if Task.dcstask.id==AUFTRAG.SpecialTask.FORMATION then
|
||||||
|
|
||||||
if Mission.Type == AUFTRAG.Type.RESCUEHELO then
|
if Mission.type == AUFTRAG.Type.RESCUEHELO then
|
||||||
|
self:I("**********")
|
||||||
|
self:I("** RESCUEHELO USED")
|
||||||
|
self:I("**********")
|
||||||
local param=Task.dcstask.params
|
local param=Task.dcstask.params
|
||||||
local followUnit=UNIT:FindByName(param.unitname)
|
local followUnit=UNIT:FindByName(param.unitname)
|
||||||
local helogroupname = self:GetGroup():GetName()
|
local helogroupname = self:GetGroup():GetName()
|
||||||
Task.formation = RESCUEHELO:New(followUnit,helogroupname)
|
Task.formation = RESCUEHELO:New(followUnit,helogroupname)
|
||||||
|
Task.formation:SetRespawnOnOff(false)
|
||||||
|
Task.formation.respawninair=false
|
||||||
|
Task.formation:SetTakeoffCold()
|
||||||
|
Task.formation:SetHomeBase(followUnit)
|
||||||
|
Task.formation.helo = self:GetGroup()
|
||||||
-- Start formation FSM.
|
-- Start formation FSM.
|
||||||
Task.formation:Start()
|
Task.formation:Start()
|
||||||
|
if self:IsFlightgroup() then
|
||||||
|
self:SetDespawnAfterLanding()
|
||||||
|
end
|
||||||
else
|
else
|
||||||
|
|
||||||
-- Set of group(s) to follow Mother.
|
-- Set of group(s) to follow Mother.
|
||||||
@@ -4329,7 +4340,7 @@ function OPSGROUP:_UpdateTask(Task, Mission)
|
|||||||
Task.formation:SetFollowTimeInterval(param.dtFollow)
|
Task.formation:SetFollowTimeInterval(param.dtFollow)
|
||||||
|
|
||||||
-- Formation mode.
|
-- Formation mode.
|
||||||
Task.formation:SetFlightModeFormation(self.group)
|
--Task.formation:SetFlightModeFormation(self.group)
|
||||||
|
|
||||||
-- Start formation FSM.
|
-- Start formation FSM.
|
||||||
Task.formation:Start()
|
Task.formation:Start()
|
||||||
@@ -8031,11 +8042,16 @@ function OPSGROUP:onafterDead(From, Event, To)
|
|||||||
-- Get asset.
|
-- Get asset.
|
||||||
local asset=self.legion:GetAssetByName(self.groupname)
|
local asset=self.legion:GetAssetByName(self.groupname)
|
||||||
|
|
||||||
|
if asset then
|
||||||
|
|
||||||
-- Get request.
|
-- Get request.
|
||||||
local request=self.legion:GetRequestByID(asset.rid)
|
local request=self.legion:GetRequestByID(asset.rid)
|
||||||
|
|
||||||
-- Trigger asset dead event.
|
-- Trigger asset dead event.
|
||||||
self.legion:AssetDead(asset, request)
|
self.legion:AssetDead(asset, request)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Stop in 5 sec to give possible respawn attempts a chance.
|
-- Stop in 5 sec to give possible respawn attempts a chance.
|
||||||
@@ -12728,7 +12744,7 @@ end
|
|||||||
-- @return #OPSGROUP self
|
-- @return #OPSGROUP self
|
||||||
function OPSGROUP:SetDefaultCallsign(CallsignName, CallsignNumber)
|
function OPSGROUP:SetDefaultCallsign(CallsignName, CallsignNumber)
|
||||||
|
|
||||||
self:T(self.lid..string.format("Setting Default callsing %s-%s", tostring(CallsignName), tostring(CallsignNumber)))
|
self:T(self.lid..string.format("Setting Default callsign %s-%s", tostring(CallsignName), tostring(CallsignNumber)))
|
||||||
|
|
||||||
self.callsignDefault={} --#OPSGROUP.Callsign
|
self.callsignDefault={} --#OPSGROUP.Callsign
|
||||||
self.callsignDefault.NumberSquad=CallsignName
|
self.callsignDefault.NumberSquad=CallsignName
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ _RESCUEHELOID=0
|
|||||||
|
|
||||||
--- Class version.
|
--- Class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
RESCUEHELO.version="1.1.0"
|
RESCUEHELO.version="1.2.0"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@@ -247,6 +247,7 @@ RESCUEHELO.version="1.1.0"
|
|||||||
-- DONE: Possibility to add already present/spawned aircraft, e.g. for warehouse.
|
-- DONE: Possibility to add already present/spawned aircraft, e.g. for warehouse.
|
||||||
-- DONE: Add rescue event when aircraft crashes.
|
-- DONE: Add rescue event when aircraft crashes.
|
||||||
-- DONE: Make offset input parameter.
|
-- DONE: Make offset input parameter.
|
||||||
|
-- DONE: Make useable for AUFTRAG
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- Constructor
|
-- Constructor
|
||||||
@@ -336,6 +337,9 @@ function RESCUEHELO:New(carrierunit, helogroupname)
|
|||||||
self:AddTransition("*", "Status", "*")
|
self:AddTransition("*", "Status", "*")
|
||||||
self:AddTransition("*", "Stop", "Stopped")
|
self:AddTransition("*", "Stop", "Stopped")
|
||||||
|
|
||||||
|
|
||||||
|
self:I(self.lid.."Started.")
|
||||||
|
|
||||||
|
|
||||||
--- Triggers the FSM event "Start" that starts the rescue helo. Initializes parameters and starts event handlers.
|
--- Triggers the FSM event "Start" that starts the rescue helo. Initializes parameters and starts event handlers.
|
||||||
-- @function [parent=#RESCUEHELO] Start
|
-- @function [parent=#RESCUEHELO] Start
|
||||||
@@ -875,7 +879,8 @@ function RESCUEHELO:onafterStart(From, Event, To)
|
|||||||
local Spawn = GROUP:FindByName(self.helogroupname)
|
local Spawn = GROUP:FindByName(self.helogroupname)
|
||||||
if Spawn and Spawn:IsAlive() then
|
if Spawn and Spawn:IsAlive() then
|
||||||
self.helo=Spawn
|
self.helo=Spawn
|
||||||
UsesAliveGroup = true
|
UsesAliveGroup = true
|
||||||
|
delay = 1
|
||||||
else
|
else
|
||||||
|
|
||||||
-- Spawn helo. We need to introduce an alias in case this class is used twice. This would confuse the spawn routine.
|
-- Spawn helo. We need to introduce an alias in case this class is used twice. This would confuse the spawn routine.
|
||||||
@@ -907,7 +912,7 @@ function RESCUEHELO:onafterStart(From, Event, To)
|
|||||||
-- Start formation in 1 seconds
|
-- Start formation in 1 seconds
|
||||||
delay=1
|
delay=1
|
||||||
|
|
||||||
elseif UsesAliveGroup==false then
|
elseif UsesAliveGroup==false and self.uncontrolledac then
|
||||||
|
|
||||||
-- Check if an uncontrolled helo group was requested.
|
-- Check if an uncontrolled helo group was requested.
|
||||||
if self.uncontrolledac then
|
if self.uncontrolledac then
|
||||||
@@ -927,9 +932,9 @@ function RESCUEHELO:onafterStart(From, Event, To)
|
|||||||
-- No group of that name!
|
-- No group of that name!
|
||||||
self:E(string.format("ERROR: No uncontrolled (alive) rescue helo group with name %s could be found!", self.helogroupname))
|
self:E(string.format("ERROR: No uncontrolled (alive) rescue helo group with name %s could be found!", self.helogroupname))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
elseif UsesAliveGroup==false then
|
||||||
|
|
||||||
-- Spawn at airbase.
|
-- Spawn at airbase.
|
||||||
self.helo=Spawn:SpawnAtAirbase(self.airbase, self.takeoff, nil, AIRBASE.TerminalType.HelicopterUsable)
|
self.helo=Spawn:SpawnAtAirbase(self.airbase, self.takeoff, nil, AIRBASE.TerminalType.HelicopterUsable)
|
||||||
|
|||||||
Reference in New Issue
Block a user