mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Merge pull request #1189 from FlightControl-Master/FF/Develop
Ff/develop
This commit is contained in:
commit
db7ec60c86
@ -695,7 +695,7 @@ ARTY.id="ARTY | "
|
|||||||
|
|
||||||
--- Arty script version.
|
--- Arty script version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
ARTY.version="1.1.2"
|
ARTY.version="1.1.3"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -2474,9 +2474,10 @@ function ARTY:_OnEventMarkChange(Event)
|
|||||||
if Event.text~=nil and Event.text:lower():find("arty") then
|
if Event.text~=nil and Event.text:lower():find("arty") then
|
||||||
|
|
||||||
-- Convert (wrong x-->z, z-->x) vec3
|
-- Convert (wrong x-->z, z-->x) vec3
|
||||||
-- TODO: This needs to be "fixed", once DCS gives the correct numbers for x and z.
|
-- DONE: This needs to be "fixed", once DCS gives the correct numbers for x and z.
|
||||||
-- local vec3={y=Event.pos.y, x=Event.pos.x, z=Event.pos.z}
|
-- Was fixed in DCS 2.5.5.34644!
|
||||||
local vec3={y=Event.pos.y, x=Event.pos.z, z=Event.pos.x}
|
local vec3={y=Event.pos.y, x=Event.pos.x, z=Event.pos.z}
|
||||||
|
--local vec3={y=Event.pos.y, x=Event.pos.z, z=Event.pos.x}
|
||||||
|
|
||||||
-- Get coordinate from vec3.
|
-- Get coordinate from vec3.
|
||||||
local _coord=COORDINATE:NewFromVec3(vec3)
|
local _coord=COORDINATE:NewFromVec3(vec3)
|
||||||
|
|||||||
@ -1749,7 +1749,7 @@ _WAREHOUSEDB = {
|
|||||||
|
|
||||||
--- Warehouse class version.
|
--- Warehouse class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
WAREHOUSE.version="0.9.5"
|
WAREHOUSE.version="0.9.6"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO: Warehouse todo list.
|
-- TODO: Warehouse todo list.
|
||||||
@ -5030,11 +5030,6 @@ function WAREHOUSE:onafterDestroyed(From, Event, To)
|
|||||||
self.stock[k]=nil
|
self.stock[k]=nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--self.queue=nil
|
|
||||||
--self.queue={}
|
|
||||||
|
|
||||||
--self.stock=nil
|
|
||||||
--self.stock={}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -5814,11 +5809,9 @@ end
|
|||||||
-- @param Wrapper.Group#GROUP group The group that arrived.
|
-- @param Wrapper.Group#GROUP group The group that arrived.
|
||||||
function WAREHOUSE:_Arrived(group)
|
function WAREHOUSE:_Arrived(group)
|
||||||
self:_DebugMessage(string.format("Group %s arrived!", tostring(group:GetName())))
|
self:_DebugMessage(string.format("Group %s arrived!", tostring(group:GetName())))
|
||||||
--self:E(string.format("Group %s arrived!", tostring(group:GetName())))
|
|
||||||
|
|
||||||
if group then
|
if group then
|
||||||
--Trigger "Arrived event.
|
--Trigger "Arrived event.
|
||||||
--group:SmokeBlue()
|
|
||||||
self:__Arrived(1, group)
|
self:__Arrived(1, group)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -5830,14 +5823,10 @@ end
|
|||||||
-- @param #number n Waypoint passed.
|
-- @param #number n Waypoint passed.
|
||||||
-- @param #number N Final waypoint.
|
-- @param #number N Final waypoint.
|
||||||
function WAREHOUSE:_PassingWaypoint(group,n,N)
|
function WAREHOUSE:_PassingWaypoint(group,n,N)
|
||||||
self:T(string.format("Group %s passing waypoint %d of %d!", tostring(group:GetName()), n, N))
|
self:T(self.wid..string.format("Group %s passing waypoint %d of %d!", tostring(group:GetName()), n, N))
|
||||||
|
|
||||||
if group then
|
|
||||||
--group:SmokeGreen()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
-- Final waypoint reached.
|
||||||
if n==N then
|
if n==N then
|
||||||
--group:SmokeBlue()
|
|
||||||
self:__Arrived(1, group)
|
self:__Arrived(1, group)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1683,7 +1683,7 @@ AIRBOSS.MenuF10Root=nil
|
|||||||
|
|
||||||
--- Airboss class version.
|
--- Airboss class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
AIRBOSS.version="1.0.6"
|
AIRBOSS.version="1.0.7"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -2068,6 +2068,7 @@ function AIRBOSS:New(carriername, alias)
|
|||||||
self:AddTransition("*", "Status", "*") -- Update status of players and queues.
|
self:AddTransition("*", "Status", "*") -- Update status of players and queues.
|
||||||
self:AddTransition("*", "RecoveryCase", "*") -- Switch to another case recovery.
|
self:AddTransition("*", "RecoveryCase", "*") -- Switch to another case recovery.
|
||||||
self:AddTransition("*", "PassingWaypoint", "*") -- Carrier is passing a waypoint.
|
self:AddTransition("*", "PassingWaypoint", "*") -- Carrier is passing a waypoint.
|
||||||
|
self:AddTransition("*", "LSOGrade", "*") -- LSO grade.
|
||||||
self:AddTransition("*", "Save", "*") -- Save player scores to file.
|
self:AddTransition("*", "Save", "*") -- Save player scores to file.
|
||||||
self:AddTransition("*", "Stop", "Stopped") -- Stop AIRBOSS FMS.
|
self:AddTransition("*", "Stop", "Stopped") -- Stop AIRBOSS FMS.
|
||||||
|
|
||||||
@ -2241,6 +2242,29 @@ function AIRBOSS:New(carriername, alias)
|
|||||||
-- @param #string filename (Optional) File name. Default is AIRBOSS-*ALIAS*_LSOgrades.csv.
|
-- @param #string filename (Optional) File name. Default is AIRBOSS-*ALIAS*_LSOgrades.csv.
|
||||||
|
|
||||||
|
|
||||||
|
--- Triggers the FSM event "LSOGrade". Called when the LSO grades a player
|
||||||
|
-- @function [parent=#AIRBOSS] LSOGrade
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
-- @param #AIRBOSS.PlayerData playerData Player Data.
|
||||||
|
-- @param #AIRBOSS.LSOgrade grade LSO grade.
|
||||||
|
|
||||||
|
--- Triggers the FSM event "LSOGrade". Delayed called when the LSO grades a player.
|
||||||
|
-- @function [parent=#AIRBOSS] __LSOGrade
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
-- @param #number delay Delay in seconds.
|
||||||
|
-- @param #AIRBOSS.PlayerData playerData Player Data.
|
||||||
|
-- @param #AIRBOSS.LSOgrade grade LSO grade.
|
||||||
|
|
||||||
|
--- On after "LSOGrade" user function. Called when the carrier passes a waypoint of its route.
|
||||||
|
-- @function [parent=#AIRBOSS] OnAfterLSOGrade
|
||||||
|
-- @param #AIRBOSS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
-- @param #AIRBOSS.PlayerData playerData Player Data.
|
||||||
|
-- @param #AIRBOSS.LSOgrade grade LSO grade.
|
||||||
|
|
||||||
|
|
||||||
--- Triggers the FSM event "Stop" that stops the airboss. Event handlers are stopped.
|
--- Triggers the FSM event "Stop" that stops the airboss. Event handlers are stopped.
|
||||||
-- @function [parent=#AIRBOSS] Stop
|
-- @function [parent=#AIRBOSS] Stop
|
||||||
-- @param #AIRBOSS self
|
-- @param #AIRBOSS self
|
||||||
@ -5949,7 +5973,7 @@ function AIRBOSS:_ScanCarrierZone()
|
|||||||
local awacs2marshal = isawacs and self.awacs:IsReturning() and self.awacs.airbase:GetName()==self.airbase:GetName() and knownflight.flag==-100 and self.awacs.recovery==true
|
local awacs2marshal = isawacs and self.awacs:IsReturning() and self.awacs.airbase:GetName()==self.airbase:GetName() and knownflight.flag==-100 and self.awacs.recovery==true
|
||||||
|
|
||||||
-- Put flight into Marshal.
|
-- Put flight into Marshal.
|
||||||
local putintomarshal=closein>UTILS.NMToMeters(5) and knownflight.flag==-100 and iscarriersquad and istanker==false and isawacs==false
|
local putintomarshal=closein>UTILS.NMToMeters(5) and knownflight.flag==-100 and iscarriersquad and (not istanker) and (not isawacs)
|
||||||
|
|
||||||
-- Send AI flight to marshal stack if group closes in more than 5 and has initial flag value.
|
-- Send AI flight to marshal stack if group closes in more than 5 and has initial flag value.
|
||||||
if putintomarshal or tanker2marshal or awacs2marshal then
|
if putintomarshal or tanker2marshal or awacs2marshal then
|
||||||
@ -9945,14 +9969,8 @@ function AIRBOSS:_CheckFoulDeck(playerData)
|
|||||||
-- Assume no check necessary.
|
-- Assume no check necessary.
|
||||||
local check=false
|
local check=false
|
||||||
|
|
||||||
-- Case I/II: Check is done, when AC is at the wake according to NATOPS. At the wake we switch to final.
|
-- CVN: Check at IM and IC.
|
||||||
if playerData.case<3 and playerData.step==AIRBOSS.PatternStep.FINAL then
|
if playerData.step==AIRBOSS.PatternStep.GROOVE_IM or
|
||||||
check=true
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Case III: Check is done at 3/4 NM according to NATOPS.
|
|
||||||
if playerData.step==AIRBOSS.PatternStep.GROOVE_XX or
|
|
||||||
playerData.step==AIRBOSS.PatternStep.GROOVE_IM or
|
|
||||||
playerData.step==AIRBOSS.PatternStep.GROOVE_IC then
|
playerData.step==AIRBOSS.PatternStep.GROOVE_IC then
|
||||||
check=true
|
check=true
|
||||||
end
|
end
|
||||||
@ -12718,6 +12736,9 @@ function AIRBOSS:_Debrief(playerData)
|
|||||||
-- Add LSO grade to player grades table.
|
-- Add LSO grade to player grades table.
|
||||||
table.insert(self.playerscores[playerData.name], mygrade)
|
table.insert(self.playerscores[playerData.name], mygrade)
|
||||||
|
|
||||||
|
-- Trigger grading event.
|
||||||
|
self:LSOGrade(playerData, mygrade)
|
||||||
|
|
||||||
-- LSO grade: (OK) 3.0 PT - LURIM
|
-- LSO grade: (OK) 3.0 PT - LURIM
|
||||||
local text=string.format("%s %.1f PT - %s", grade, Points, analysis)
|
local text=string.format("%s %.1f PT - %s", grade, Points, analysis)
|
||||||
if Points==-1 then
|
if Points==-1 then
|
||||||
|
|||||||
@ -418,6 +418,13 @@ function RECOVERYTANKER:New(carrierunit, tankergroupname)
|
|||||||
-- @param #RECOVERYTANKER self
|
-- @param #RECOVERYTANKER self
|
||||||
-- @param #number delay Delay in seconds.
|
-- @param #number delay Delay in seconds.
|
||||||
|
|
||||||
|
--- On after "Start" event function. Called when FSM is started.
|
||||||
|
-- @function [parent=#RECOVERYTANKER] OnAfterStart
|
||||||
|
-- @param #RECOVERYTANKER self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
|
||||||
|
|
||||||
--- Triggers the FSM event "RefuelStart" when the tanker starts refueling another aircraft.
|
--- Triggers the FSM event "RefuelStart" when the tanker starts refueling another aircraft.
|
||||||
-- @function [parent=#RECOVERYTANKER] RefuelStart
|
-- @function [parent=#RECOVERYTANKER] RefuelStart
|
||||||
|
|||||||
@ -346,6 +346,12 @@ function RESCUEHELO:New(carrierunit, helogroupname)
|
|||||||
-- @param #RESCUEHELO self
|
-- @param #RESCUEHELO self
|
||||||
-- @param #number delay Delay in seconds.
|
-- @param #number delay Delay in seconds.
|
||||||
|
|
||||||
|
--- On after "Start" event function. Called when FSM is started.
|
||||||
|
-- @function [parent=#RESCUEHELO] OnAfterStart
|
||||||
|
-- @param #RECOVERYTANKER self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
|
||||||
--- Triggers the FSM event "Rescue" that sends the helo on a rescue mission to a specifc coordinate.
|
--- Triggers the FSM event "Rescue" that sends the helo on a rescue mission to a specifc coordinate.
|
||||||
-- @function [parent=#RESCUEHELO] Rescue
|
-- @function [parent=#RESCUEHELO] Rescue
|
||||||
|
|||||||
@ -361,6 +361,26 @@ function AIRBASE:FindByName( AirbaseName )
|
|||||||
return AirbaseFound
|
return AirbaseFound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Find a AIRBASE in the _DATABASE by its ID.
|
||||||
|
-- @param #AIRBASE self
|
||||||
|
-- @param #number id Airbase ID.
|
||||||
|
-- @return #AIRBASE self
|
||||||
|
function AIRBASE:FindByID(id)
|
||||||
|
|
||||||
|
for name,_airbase in pairs(_DATABASE.AIRBASES) do
|
||||||
|
local airbase=_airbase --#AIRBASE
|
||||||
|
|
||||||
|
local aid=tonumber(airbase:GetID())
|
||||||
|
|
||||||
|
if aid==id then
|
||||||
|
return airbase
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
--- Get the DCS object of an airbase
|
--- Get the DCS object of an airbase
|
||||||
-- @param #AIRBASE self
|
-- @param #AIRBASE self
|
||||||
-- @return DCS#Airbase DCS airbase object.
|
-- @return DCS#Airbase DCS airbase object.
|
||||||
@ -604,7 +624,7 @@ function AIRBASE:GetParkingSpotData(TerminalID)
|
|||||||
|
|
||||||
for _,_spot in pairs(parkingdata) do
|
for _,_spot in pairs(parkingdata) do
|
||||||
local spot=_spot --#AIRBASE.ParkingSpot
|
local spot=_spot --#AIRBASE.ParkingSpot
|
||||||
self:E({TerminalID=spot.TerminalID,TerminalType=spot.TerminalType})
|
self:T({TerminalID=spot.TerminalID,TerminalType=spot.TerminalType})
|
||||||
if TerminalID==spot.TerminalID then
|
if TerminalID==spot.TerminalID then
|
||||||
return spot
|
return spot
|
||||||
end
|
end
|
||||||
|
|||||||
@ -136,6 +136,7 @@ function STATIC:Destroy( GenerateEvent )
|
|||||||
end
|
end
|
||||||
|
|
||||||
DCSObject:destroy()
|
DCSObject:destroy()
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user