mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'FF/Ops' into FF/OpsDev
This commit is contained in:
commit
f5e8bd0ffc
@ -1368,7 +1368,7 @@ function DATABASE:_EventOnBirth( Event )
|
||||
if PlayerName then
|
||||
|
||||
-- Debug info.
|
||||
self:I(string.format("Player '%s' joint unit '%s' of group '%s'", tostring(PlayerName), tostring(Event.IniDCSUnitName), tostring(Event.IniDCSGroupName)))
|
||||
self:I(string.format("Player '%s' joined unit '%s' of group '%s'", tostring(PlayerName), tostring(Event.IniDCSUnitName), tostring(Event.IniDCSGroupName)))
|
||||
|
||||
-- Add client in case it does not exist already.
|
||||
if not client then
|
||||
|
||||
@ -744,7 +744,7 @@ do -- SETTINGS
|
||||
|
||||
self.PlayerMenu = PlayerMenu
|
||||
|
||||
self:I( string.format( "Setting menu for player %s", tostring( PlayerName ) ) )
|
||||
self:T( string.format( "Setting menu for player %s", tostring( PlayerName ) ) )
|
||||
|
||||
local submenu = MENU_GROUP:New( PlayerGroup, "LL Accuracy", PlayerMenu )
|
||||
MENU_GROUP_COMMAND:New( PlayerGroup, "LL 0 Decimals", submenu, self.MenuGroupLL_DDM_AccuracySystem, self, PlayerUnit, PlayerGroup, PlayerName, 0 )
|
||||
@ -989,7 +989,7 @@ do -- SETTINGS
|
||||
do
|
||||
--- @param #SETTINGS self
|
||||
function SETTINGS:MenuGroupA2GSystem( PlayerUnit, PlayerGroup, PlayerName, A2GSystem )
|
||||
BASE:E( { self, PlayerUnit:GetName(), A2GSystem } )
|
||||
--BASE:E( {PlayerUnit:GetName(), A2GSystem } )
|
||||
self.A2GSystem = A2GSystem
|
||||
MESSAGE:New( string.format( "Settings: A2G format set to %s for player %s.", A2GSystem, PlayerName ), 5 ):ToGroup( PlayerGroup )
|
||||
if _SETTINGS.MenuStatic == false then
|
||||
|
||||
@ -328,6 +328,8 @@ function SPAWN:New( SpawnTemplatePrefix )
|
||||
self.SpawnInitModu = nil -- No special modulation.
|
||||
self.SpawnInitRadio = nil -- No radio comms setting.
|
||||
self.SpawnInitModex = nil
|
||||
self.SpawnInitModexPrefix = nil
|
||||
self.SpawnInitModexPostfix = nil
|
||||
self.SpawnInitAirbase = nil
|
||||
self.TweakedTemplate = false -- Check if the user is using self made template.
|
||||
|
||||
@ -382,6 +384,8 @@ function SPAWN:NewWithAlias( SpawnTemplatePrefix, SpawnAliasPrefix )
|
||||
self.SpawnInitModu = nil -- No special modulation.
|
||||
self.SpawnInitRadio = nil -- No radio communication setting.
|
||||
self.SpawnInitModex = nil
|
||||
self.SpawnInitModexPrefix = nil
|
||||
self.SpawnInitModexPostfix = nil
|
||||
self.SpawnInitAirbase = nil
|
||||
self.TweakedTemplate = false -- Check if the user is using self made template.
|
||||
|
||||
@ -541,6 +545,8 @@ function SPAWN:NewFromTemplate( SpawnTemplate, SpawnTemplatePrefix, SpawnAliasPr
|
||||
self.SpawnInitModu = nil -- No special modulation.
|
||||
self.SpawnInitRadio = nil -- No radio communication setting.
|
||||
self.SpawnInitModex = nil
|
||||
self.SpawnInitModexPrefix = nil
|
||||
self.SpawnInitModexPostfix = nil
|
||||
self.SpawnInitAirbase = nil
|
||||
self.TweakedTemplate = true -- Check if the user is using self made template.
|
||||
self.MooseNameing = true
|
||||
@ -812,12 +818,17 @@ end
|
||||
--- Sets the modex of the first unit of the group. If more units are in the group, the number is increased by one with every unit.
|
||||
-- @param #SPAWN self
|
||||
-- @param #number modex Modex of the first unit.
|
||||
-- @param #string prefix (optional) String to prefix to modex, e.g. for French AdA Modex, eg. -L-102 then "-L-" would be the prefix.
|
||||
-- @param #string postfix (optional) String to postfix to modex, example tbd.
|
||||
-- @return #SPAWN self
|
||||
function SPAWN:InitModex( modex )
|
||||
function SPAWN:InitModex( modex, prefix, postfix )
|
||||
|
||||
if modex then
|
||||
self.SpawnInitModex = tonumber( modex )
|
||||
end
|
||||
|
||||
self.SpawnInitModexPrefix = prefix
|
||||
self.SpawnInitModexPostfix = postfix
|
||||
|
||||
return self
|
||||
end
|
||||
@ -1571,7 +1582,10 @@ function SPAWN:SpawnWithIndex( SpawnIndex, NoBirth )
|
||||
-- Set tail number.
|
||||
if self.SpawnInitModex then
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
SpawnTemplate.units[UnitID].onboard_num = string.format( "%03d", self.SpawnInitModex + (UnitID - 1) )
|
||||
local modexnumber = string.format( "%03d", self.SpawnInitModex + (UnitID - 1) )
|
||||
if self.SpawnInitModexPrefix then modexnumber = self.SpawnInitModexPrefix..modexnumber end
|
||||
if self.SpawnInitModexPostfix then modexnumber = modexnumber..self.SpawnInitModexPostfix end
|
||||
SpawnTemplate.units[UnitID].onboard_num = modexnumber
|
||||
end
|
||||
end
|
||||
|
||||
@ -2178,14 +2192,18 @@ end
|
||||
-- @param #table Spots Table of parking spot IDs. Note that these in general are different from the numbering in the mission editor!
|
||||
-- @param #SPAWN.Takeoff Takeoff (Optional) Takeoff type, i.e. either SPAWN.Takeoff.Cold or SPAWN.Takeoff.Hot. Default is Hot.
|
||||
-- @return Wrapper.Group#GROUP The group that was spawned or nil when nothing was spawned.
|
||||
function SPAWN:SpawnAtParkingSpot( Airbase, Spots, Takeoff ) -- R2.5
|
||||
function SPAWN:SpawnAtParkingSpot( Airbase, Spots, Takeoff )
|
||||
self:F( { Airbase = Airbase, Spots = Spots, Takeoff = Takeoff } )
|
||||
|
||||
|
||||
-- Ensure that Spots parameter is a table.
|
||||
if type( Spots ) ~= "table" then
|
||||
Spots = { Spots }
|
||||
end
|
||||
|
||||
|
||||
if type(Airbase) == "string" then
|
||||
Airbase = AIRBASE:FindByName(Airbase)
|
||||
end
|
||||
|
||||
-- Get template group.
|
||||
local group = GROUP:FindByName( self.SpawnTemplatePrefix )
|
||||
|
||||
|
||||
@ -3483,7 +3483,7 @@ function RAT:Status(message, forID)
|
||||
-- Get group.
|
||||
local group=ratcraft.group --Wrapper.Group#GROUP
|
||||
|
||||
if group and group:IsAlive() then
|
||||
if group and group:IsAlive() and (group:GetCoordinate() or group:GetVec3()) then
|
||||
nalive=nalive+1
|
||||
|
||||
-- Gather some information.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
--- **Functional** - Make SAM sites execute evasive and defensive behaviour when being fired upon.
|
||||
--- **Functional** - Make SAM sites evasive and execute defensive behaviour when being fired upon.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -19,7 +19,7 @@
|
||||
--
|
||||
-- ### Authors: **FlightControl**, **applevangelist**
|
||||
--
|
||||
-- Last Update: Feb 2022
|
||||
-- Last Update: September 2023
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -66,7 +66,7 @@ SEAD = {
|
||||
-- @field Harms
|
||||
SEAD.Harms = {
|
||||
["AGM_88"] = "AGM_88",
|
||||
["AGM_45"] = "AGM_45",
|
||||
--["AGM_45"] = "AGM_45",
|
||||
["AGM_122"] = "AGM_122",
|
||||
["AGM_84"] = "AGM_84",
|
||||
["AGM_45"] = "AGM_45",
|
||||
@ -143,7 +143,7 @@ function SEAD:New( SEADGroupPrefixes, Padding )
|
||||
self:AddTransition("*", "ManageEvasion", "*")
|
||||
self:AddTransition("*", "CalculateHitZone", "*")
|
||||
|
||||
self:I("*** SEAD - Started Version 0.4.3")
|
||||
self:I("*** SEAD - Started Version 0.4.4")
|
||||
return self
|
||||
end
|
||||
|
||||
@ -203,7 +203,7 @@ function SEAD:SwitchEmissions(Switch)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add an object to call back when going evasive.
|
||||
--- Set an object to call back when going evasive.
|
||||
-- @param #SEAD self
|
||||
-- @param #table Object The object to call. Needs to have object functions as follows:
|
||||
-- `:SeadSuppressionPlanned(Group, Name, SuppressionStartTime, SuppressionEndTime)`
|
||||
@ -369,7 +369,7 @@ function SEAD:onafterManageEvasion(From,Event,To,_targetskill,_targetgroup,SEADP
|
||||
local reach = 10
|
||||
if hit then
|
||||
local wpndata = SEAD.HarmData[data]
|
||||
reach = wpndata[1] * 1,1
|
||||
reach = wpndata[1] * 1.1
|
||||
local mach = wpndata[2]
|
||||
wpnspeed = math.floor(mach * 340.29)
|
||||
end
|
||||
@ -405,7 +405,7 @@ function SEAD:onafterManageEvasion(From,Event,To,_targetskill,_targetgroup,SEADP
|
||||
local function SuppressionStop(args)
|
||||
self:T(string.format("*** SEAD - %s Radar On",args[2]))
|
||||
local grp = args[1] -- Wrapper.Group#GROUP
|
||||
local name = args[2] -- #string Group Nam
|
||||
local name = args[2] -- #string Group Name
|
||||
if self.UseEmissionsOnOff then
|
||||
grp:EnableEmission(true)
|
||||
end
|
||||
@ -424,7 +424,7 @@ function SEAD:onafterManageEvasion(From,Event,To,_targetskill,_targetgroup,SEADP
|
||||
if _tti > 600 then delay = _tti - 90 end -- shot from afar, 600 is default shorad ontime
|
||||
|
||||
local SuppressionStartTime = timer.getTime() + delay
|
||||
local SuppressionEndTime = timer.getTime() + _tti + self.Padding
|
||||
local SuppressionEndTime = timer.getTime() + delay + _tti + self.Padding + delay
|
||||
local _targetgroupname = _targetgroup:GetName()
|
||||
if not self.SuppressedGroups[_targetgroupname] then
|
||||
self:T(string.format("*** SEAD - %s | Parameters TTI %ds | Switch-Off in %ds",_targetgroupname,_tti,delay))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -8128,7 +8128,7 @@ function OPSGROUP:_CheckCargoTransport()
|
||||
for _,_cargo in pairs(self.cargoTZC.Cargos) do
|
||||
local cargo=_cargo --Ops.OpsGroup#OPSGROUP.CargoGroup
|
||||
|
||||
if cargo.type==OPSTRANSPORT.CargoType.OPSTRANPORT then
|
||||
if cargo.type==OPSTRANSPORT.CargoType.OPSGROUP then
|
||||
|
||||
-- Check if anyone is still boarding.
|
||||
if cargo.opsgroup and cargo.opsgroup:IsBoarding(self.groupname) then
|
||||
|
||||
@ -406,8 +406,8 @@ function UTILS._OneLineSerialize(tbl)
|
||||
elseif type(val) == 'nil' then -- won't ever happen, right?
|
||||
tbl_str[#tbl_str + 1] = 'nil, '
|
||||
elseif type(val) == 'table' then
|
||||
tbl_str[#tbl_str + 1] = UTILS._OneLineSerialize(val)
|
||||
tbl_str[#tbl_str + 1] = ', ' --I think this is right, I just added it
|
||||
--tbl_str[#tbl_str + 1] = UTILS._OneLineSerialize(val)
|
||||
--tbl_str[#tbl_str + 1] = ', ' --I think this is right, I just added it
|
||||
else
|
||||
--log:warn('Unable to serialize value type $1 at index $2', mist.utils.basicSerialize(type(val)), tostring(ind))
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user