mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
commit
19a90b7d9d
@ -45,6 +45,7 @@
|
|||||||
-- @field #number talt Interval in seconds between reporting altitude until touchdown. Default 3 sec.
|
-- @field #number talt Interval in seconds between reporting altitude until touchdown. Default 3 sec.
|
||||||
-- @field #boolean chatty Display some messages on events like take-off and touchdown.
|
-- @field #boolean chatty Display some messages on events like take-off and touchdown.
|
||||||
-- @field #boolean eventsmoose If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler.
|
-- @field #boolean eventsmoose If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler.
|
||||||
|
-- @field #boolean reportplayername If true, use playername not callsign on callouts
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
--- Adds some rudimentary ATC functionality via the radio menu.
|
--- Adds some rudimentary ATC functionality via the radio menu.
|
||||||
@ -88,6 +89,7 @@ PSEUDOATC={
|
|||||||
talt=3,
|
talt=3,
|
||||||
chatty=true,
|
chatty=true,
|
||||||
eventsmoose=true,
|
eventsmoose=true,
|
||||||
|
reportplayername = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -98,7 +100,7 @@ PSEUDOATC.id="PseudoATC | "
|
|||||||
|
|
||||||
--- PSEUDOATC version.
|
--- PSEUDOATC version.
|
||||||
-- @field #number version
|
-- @field #number version
|
||||||
PSEUDOATC.version="0.9.2"
|
PSEUDOATC.version="0.9.3"
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -183,6 +185,13 @@ function PSEUDOATC:SetMessageDuration(duration)
|
|||||||
self.mdur=duration or 30
|
self.mdur=duration or 30
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Use player name, not call sign, in callouts
|
||||||
|
-- @param #PSEUDOATC self
|
||||||
|
function PSEUDOATC:SetReportPlayername()
|
||||||
|
self.reportplayername = true
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Set time interval after which the F10 radio menu is refreshed.
|
--- Set time interval after which the F10 radio menu is refreshed.
|
||||||
-- @param #PSEUDOATC self
|
-- @param #PSEUDOATC self
|
||||||
-- @param #number interval Interval in seconds. Default is every 120 sec.
|
-- @param #number interval Interval in seconds. Default is every 120 sec.
|
||||||
@ -485,6 +494,9 @@ function PSEUDOATC:PlayerTakeOff(unit, place)
|
|||||||
-- Bye-Bye message.
|
-- Bye-Bye message.
|
||||||
if place and self.chatty then
|
if place and self.chatty then
|
||||||
local text=string.format("%s, %s, you are airborne. Have a safe trip!", place, CallSign)
|
local text=string.format("%s, %s, you are airborne. Have a safe trip!", place, CallSign)
|
||||||
|
if self.reportplayername then
|
||||||
|
text=string.format("%s, %s, you are airborne. Have a safe trip!", place, PlayerName)
|
||||||
|
end
|
||||||
MESSAGE:New(text, self.mdur):ToGroup(group)
|
MESSAGE:New(text, self.mdur):ToGroup(group)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -844,7 +856,8 @@ function PSEUDOATC:ReportHeight(GID, UID, dt, _clear)
|
|||||||
local position=unit:GetCoordinate()
|
local position=unit:GetCoordinate()
|
||||||
local height=get_AGL(position)
|
local height=get_AGL(position)
|
||||||
local callsign=unit:GetCallsign()
|
local callsign=unit:GetCallsign()
|
||||||
|
local PlayerName=self.group[GID].player[UID].playername
|
||||||
|
|
||||||
-- Settings.
|
-- Settings.
|
||||||
local settings=_DATABASE:GetPlayerSettings(self.group[GID].player[UID].playername) or _SETTINGS --Core.Settings#SETTINGS
|
local settings=_DATABASE:GetPlayerSettings(self.group[GID].player[UID].playername) or _SETTINGS --Core.Settings#SETTINGS
|
||||||
|
|
||||||
@ -856,7 +869,9 @@ function PSEUDOATC:ReportHeight(GID, UID, dt, _clear)
|
|||||||
|
|
||||||
-- Message text.
|
-- Message text.
|
||||||
local _text=string.format("%s, your altitude is %s AGL.", callsign, Hs)
|
local _text=string.format("%s, your altitude is %s AGL.", callsign, Hs)
|
||||||
|
if self.reportplayername then
|
||||||
|
_text=string.format("%s, your altitude is %s AGL.", PlayerName, Hs)
|
||||||
|
end
|
||||||
-- Append flight level.
|
-- Append flight level.
|
||||||
if _clear==false then
|
if _clear==false then
|
||||||
_text=_text..string.format(" FL%03d.", position.y/30.48)
|
_text=_text..string.format(" FL%03d.", position.y/30.48)
|
||||||
|
|||||||
@ -302,8 +302,8 @@
|
|||||||
--
|
--
|
||||||
-- Initial Spawn states is as follows:
|
-- Initial Spawn states is as follows:
|
||||||
-- GROUND: ROE, "Return Fire" Alarm, "Green"
|
-- GROUND: ROE, "Return Fire" Alarm, "Green"
|
||||||
-- AIR: ROE, "Return Fire" Reaction to Threat, "Passive Defense"
|
-- AIR: ROE, "Return Fire" Reaction to Threat, "Passive Defense"
|
||||||
-- NAVAL ROE, "Return Fire" Alarm,"N/A"
|
-- NAVAL ROE, "Return Fire" Alarm,"N/A"
|
||||||
--
|
--
|
||||||
-- A request can be added by the @{#WAREHOUSE.AddRequest}(*warehouse*, *AssetDescriptor*, *AssetDescriptorValue*, *nAsset*, *TransportType*, *nTransport*, *Prio*, *Assignment*) function.
|
-- A request can be added by the @{#WAREHOUSE.AddRequest}(*warehouse*, *AssetDescriptor*, *AssetDescriptorValue*, *nAsset*, *TransportType*, *nTransport*, *Prio*, *Assignment*) function.
|
||||||
-- The parameters are
|
-- The parameters are
|
||||||
|
|||||||
@ -56,6 +56,9 @@
|
|||||||
-- @field #number RTBRecallCount Number that counts RTB calls.
|
-- @field #number RTBRecallCount Number that counts RTB calls.
|
||||||
-- @field Ops.FlightControl#FLIGHTCONTROL.HoldingStack stack Holding stack.
|
-- @field Ops.FlightControl#FLIGHTCONTROL.HoldingStack stack Holding stack.
|
||||||
-- @field #boolean isReadyTO Flight is ready for takeoff. This is for FLIGHTCONTROL.
|
-- @field #boolean isReadyTO Flight is ready for takeoff. This is for FLIGHTCONTROL.
|
||||||
|
-- @field #boolean prohibitAB Disallow (true) or allow (false) AI to use the afterburner.
|
||||||
|
-- @field #boolean jettisonEmptyTanks Allow (true) or disallow (false) AI to jettison empty fuel tanks.
|
||||||
|
-- @field #boolean jettisonWeapons Allow (true) or disallow (false) AI to jettison weapons if in danger.
|
||||||
--
|
--
|
||||||
-- @extends Ops.OpsGroup#OPSGROUP
|
-- @extends Ops.OpsGroup#OPSGROUP
|
||||||
|
|
||||||
@ -145,6 +148,9 @@ FLIGHTGROUP = {
|
|||||||
RTBRecallCount = 0,
|
RTBRecallCount = 0,
|
||||||
playerSettings = {},
|
playerSettings = {},
|
||||||
playerWarnings = {},
|
playerWarnings = {},
|
||||||
|
prohibitAB = false,
|
||||||
|
jettisonEmptyTanks = true,
|
||||||
|
jettisonWeapons = true, -- that's actually a negative option like prohibitAB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -210,7 +216,7 @@ FLIGHTGROUP.Players={}
|
|||||||
|
|
||||||
--- FLIGHTGROUP class version.
|
--- FLIGHTGROUP class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
FLIGHTGROUP.version="0.8.2"
|
FLIGHTGROUP.version="0.8.3"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -410,6 +416,52 @@ function FLIGHTGROUP:SetVTOL()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set if aircraft is **not** allowed to use afterburner.
|
||||||
|
-- @param #FLIGHTGROUP self
|
||||||
|
-- @return #FLIGHTGROUP self
|
||||||
|
function FLIGHTGROUP:SetProhibitAfterburner()
|
||||||
|
self.prohibitAB = true
|
||||||
|
if self:GetGroup():IsAlive() then
|
||||||
|
self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_AB, true)
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Set if aircraft is allowed to use afterburner.
|
||||||
|
-- @param #FLIGHTGROUP self
|
||||||
|
-- @return #FLIGHTGROUP self
|
||||||
|
function FLIGHTGROUP:SetAllowAfterburner()
|
||||||
|
self.prohibitAB = false
|
||||||
|
if self:GetGroup():IsAlive() then
|
||||||
|
self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_AB, false)
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Set if aircraft is allowed to drop empty fuel tanks - set to true to allow, and false to forbid it.
|
||||||
|
-- @param #FLIGHTGROUP self
|
||||||
|
-- @param #boolean Switch true or false
|
||||||
|
-- @return #FLIGHTGROUP self
|
||||||
|
function FLIGHTGROUP:SetJettisonEmptyTanks(Switch)
|
||||||
|
self.jettisonEmptyTanks = Switch
|
||||||
|
if self:GetGroup():IsAlive() then
|
||||||
|
self:GetGroup():SetOption(AI.Option.Air.id.JETT_TANKS_IF_EMPTY, Switch)
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Set if aircraft is allowed to drop weapons to escape danger - set to true to allow, and false to forbid it.
|
||||||
|
-- @param #FLIGHTGROUP self
|
||||||
|
-- @param #boolean Switch true or false
|
||||||
|
-- @return #FLIGHTGROUP self
|
||||||
|
function FLIGHTGROUP:SetJettisonWeapons(Switch)
|
||||||
|
self.jettisonWeapons = not Switch
|
||||||
|
if self:GetGroup():IsAlive() then
|
||||||
|
self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_JETT, not Switch)
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Set if group is ready for taxi/takeoff if controlled by a `FLIGHTCONTROL`.
|
--- Set if group is ready for taxi/takeoff if controlled by a `FLIGHTCONTROL`.
|
||||||
-- @param #FLIGHTGROUP self
|
-- @param #FLIGHTGROUP self
|
||||||
-- @param #boolean ReadyTO If `true`, flight is ready for takeoff.
|
-- @param #boolean ReadyTO If `true`, flight is ready for takeoff.
|
||||||
@ -1759,9 +1811,10 @@ function FLIGHTGROUP:onafterSpawned(From, Event, To)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: make this input.
|
-- TODO: make this input.
|
||||||
self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_JETT, true)
|
self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_JETT, self.jettisonWeapons)
|
||||||
self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_AB, true) -- Does not seem to work. AI still used the after burner.
|
self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_AB, self.prohibitAB) -- Does not seem to work. AI still used the after burner.
|
||||||
self:GetGroup():SetOption(AI.Option.Air.id.RTB_ON_BINGO, false)
|
self:GetGroup():SetOption(AI.Option.Air.id.RTB_ON_BINGO, false)
|
||||||
|
self:GetGroup():SetOption(AI.Option.Air.id.JETT_TANKS_IF_EMPTY, self.jettisonEmptyTanks)
|
||||||
--self.group:SetOption(AI.Option.Air.id.RADAR_USING, AI.Option.Air.val.RADAR_USING.FOR_CONTINUOUS_SEARCH)
|
--self.group:SetOption(AI.Option.Air.id.RADAR_USING, AI.Option.Air.val.RADAR_USING.FOR_CONTINUOUS_SEARCH)
|
||||||
|
|
||||||
-- Update route.
|
-- Update route.
|
||||||
|
|||||||
@ -1416,7 +1416,7 @@ end
|
|||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param Core.Zone#ZONE Zone The zone where to land.
|
-- @param Core.Zone#ZONE Zone The zone where to land.
|
||||||
-- @param #number Duration The duration in seconds to stay on the ground.
|
-- @param #number Duration The duration in seconds to stay on the ground.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return DCS#Task The DCS task structure.
|
||||||
function CONTROLLABLE:TaskLandAtZone( Zone, Duration, RandomPoint )
|
function CONTROLLABLE:TaskLandAtZone( Zone, Duration, RandomPoint )
|
||||||
|
|
||||||
-- Get landing point
|
-- Get landing point
|
||||||
|
|||||||
@ -229,7 +229,7 @@ function UNIT:ReSpawnAt( Coordinate, Heading )
|
|||||||
SpawnGroupTemplate.y = Coordinate.z
|
SpawnGroupTemplate.y = Coordinate.z
|
||||||
|
|
||||||
self:F( #SpawnGroupTemplate.units )
|
self:F( #SpawnGroupTemplate.units )
|
||||||
for UnitID, UnitData in pairs( SpawnGroup:GetUnits() ) do
|
for UnitID, UnitData in pairs( SpawnGroup:GetUnits() or {} ) do
|
||||||
local GroupUnit = UnitData -- #UNIT
|
local GroupUnit = UnitData -- #UNIT
|
||||||
self:F( GroupUnit:GetName() )
|
self:F( GroupUnit:GetName() )
|
||||||
if GroupUnit:IsAlive() then
|
if GroupUnit:IsAlive() then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user