From f8f4bac77eb45ad549993fe91b14e5afb5a939bc Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 13 Sep 2023 16:03:05 +0200 Subject: [PATCH 1/6] Intellisense docu fixes --- Moose Development/Moose/Core/Base.lua | 1 + Moose Development/Moose/Core/Database.lua | 1 + Moose Development/Moose/Core/Spawn.lua | 1 + Moose Development/Moose/Functional/Escort.lua | 2 +- Moose Development/Moose/Functional/MissileTrainer.lua | 1 + Moose Development/Moose/Functional/Movement.lua | 1 + Moose Development/Moose/Utilities/Utils.lua | 3 ++- 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Core/Base.lua b/Moose Development/Moose/Core/Base.lua index 868e54c00..ce3675189 100644 --- a/Moose Development/Moose/Core/Base.lua +++ b/Moose Development/Moose/Core/Base.lua @@ -34,6 +34,7 @@ local _TraceClassMethod = {} local _ClassID = 0 +--- -- @type BASE -- @field ClassName The name of the class. -- @field ClassID The ID number of the class. diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index 280682d80..3409c799f 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -32,6 +32,7 @@ -- @image Core_Database.JPG +--- -- @type DATABASE -- @field #string ClassName Name of the class. -- @field #table Templates Templates: Units, Groups, Statics, ClientsByName, ClientsByID. diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index db5f915a1..f74302e35 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -286,6 +286,7 @@ SPAWN.Takeoff = { Cold = 4, } +--- -- @type SPAWN.SpawnZoneTable -- @list SpawnZone diff --git a/Moose Development/Moose/Functional/Escort.lua b/Moose Development/Moose/Functional/Escort.lua index 6ae9d694f..d0c470d3f 100644 --- a/Moose Development/Moose/Functional/Escort.lua +++ b/Moose Development/Moose/Functional/Escort.lua @@ -108,7 +108,7 @@ -- @image Escorting.JPG - +--- -- @type ESCORT -- @extends Core.Base#BASE -- @field Wrapper.Client#CLIENT EscortClient diff --git a/Moose Development/Moose/Functional/MissileTrainer.lua b/Moose Development/Moose/Functional/MissileTrainer.lua index 8514f6f86..8442e90c0 100644 --- a/Moose Development/Moose/Functional/MissileTrainer.lua +++ b/Moose Development/Moose/Functional/MissileTrainer.lua @@ -68,6 +68,7 @@ -- @image Missile_Trainer.JPG +--- -- @type MISSILETRAINER -- @field Core.Set#SET_CLIENT DBClients -- @extends Core.Base#BASE diff --git a/Moose Development/Moose/Functional/Movement.lua b/Moose Development/Moose/Functional/Movement.lua index b2afe18a8..2ffc7a396 100644 --- a/Moose Development/Moose/Functional/Movement.lua +++ b/Moose Development/Moose/Functional/Movement.lua @@ -10,6 +10,7 @@ -- @module Functional.Movement -- @image MOOSE.JPG +--- -- @type MOVEMENT -- @extends Core.Base#BASE diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index 2e37f9ad0..7e21a576a 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -12,7 +12,7 @@ -- @module Utilities.Utils -- @image MOOSE.JPG - +--- -- @type SMOKECOLOR -- @field Green -- @field Red @@ -22,6 +22,7 @@ SMOKECOLOR = trigger.smokeColor -- #SMOKECOLOR +--- -- @type FLARECOLOR -- @field Green -- @field Red From 674fef554d5889eac6453a7bd9ecda08260bdb83 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 13 Sep 2023 16:03:32 +0200 Subject: [PATCH 2/6] Intellisense docu fixes --- Moose Development/Moose/Core/Base.lua | 1 + Moose Development/Moose/Core/Database.lua | 2 +- Moose Development/Moose/Core/Spawn.lua | 1 + Moose Development/Moose/Functional/Escort.lua | 2 +- Moose Development/Moose/Functional/MissileTrainer.lua | 2 +- Moose Development/Moose/Functional/Movement.lua | 1 + Moose Development/Moose/Utilities/Utils.lua | 3 ++- 7 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Core/Base.lua b/Moose Development/Moose/Core/Base.lua index 868e54c00..ce3675189 100644 --- a/Moose Development/Moose/Core/Base.lua +++ b/Moose Development/Moose/Core/Base.lua @@ -34,6 +34,7 @@ local _TraceClassMethod = {} local _ClassID = 0 +--- -- @type BASE -- @field ClassName The name of the class. -- @field ClassID The ID number of the class. diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index 280682d80..8ab8ed17d 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -31,7 +31,7 @@ -- @module Core.Database -- @image Core_Database.JPG - +--- -- @type DATABASE -- @field #string ClassName Name of the class. -- @field #table Templates Templates: Units, Groups, Statics, ClientsByName, ClientsByID. diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index db5f915a1..f74302e35 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -286,6 +286,7 @@ SPAWN.Takeoff = { Cold = 4, } +--- -- @type SPAWN.SpawnZoneTable -- @list SpawnZone diff --git a/Moose Development/Moose/Functional/Escort.lua b/Moose Development/Moose/Functional/Escort.lua index 6ae9d694f..d0c470d3f 100644 --- a/Moose Development/Moose/Functional/Escort.lua +++ b/Moose Development/Moose/Functional/Escort.lua @@ -108,7 +108,7 @@ -- @image Escorting.JPG - +--- -- @type ESCORT -- @extends Core.Base#BASE -- @field Wrapper.Client#CLIENT EscortClient diff --git a/Moose Development/Moose/Functional/MissileTrainer.lua b/Moose Development/Moose/Functional/MissileTrainer.lua index 8514f6f86..2551ac825 100644 --- a/Moose Development/Moose/Functional/MissileTrainer.lua +++ b/Moose Development/Moose/Functional/MissileTrainer.lua @@ -67,7 +67,7 @@ -- @module Functional.MissileTrainer -- @image Missile_Trainer.JPG - +--- -- @type MISSILETRAINER -- @field Core.Set#SET_CLIENT DBClients -- @extends Core.Base#BASE diff --git a/Moose Development/Moose/Functional/Movement.lua b/Moose Development/Moose/Functional/Movement.lua index b2afe18a8..2ffc7a396 100644 --- a/Moose Development/Moose/Functional/Movement.lua +++ b/Moose Development/Moose/Functional/Movement.lua @@ -10,6 +10,7 @@ -- @module Functional.Movement -- @image MOOSE.JPG +--- -- @type MOVEMENT -- @extends Core.Base#BASE diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index 2e37f9ad0..7e21a576a 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -12,7 +12,7 @@ -- @module Utilities.Utils -- @image MOOSE.JPG - +--- -- @type SMOKECOLOR -- @field Green -- @field Red @@ -22,6 +22,7 @@ SMOKECOLOR = trigger.smokeColor -- #SMOKECOLOR +--- -- @type FLARECOLOR -- @field Green -- @field Red From bc16970d965774fca390c5be8424280f2372525c Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 14 Sep 2023 12:36:15 +0200 Subject: [PATCH 3/6] #SET_CLIENT * Small fix for FilterCallsign string search --- Moose Development/Moose/Core/Set.lua | 86 ++++++++++++++-------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index 60236095d..bf98911ef 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -860,8 +860,10 @@ do -- SET_BASE self:F3( Object ) local outcome = false local name = Object:GetName() + --self:I("SET_BASE: Objectname = "..name) self:ForEach( function(object) + --self:I("SET_BASE: In set objectname = "..object:GetName()) if object:GetName() == name then outcome = true end @@ -4028,8 +4030,8 @@ do -- SET_CLIENT Countries = nil, ClientPrefixes = nil, Zones = nil, - Playernames = nil, - Callsigns = nil, + Playernames = nil, + Callsigns = nil, }, FilterMeta = { Coalitions = { @@ -4330,7 +4332,6 @@ do -- SET_CLIENT function SET_CLIENT:FilterStart() if _DATABASE then - self:_FilterStart() self:HandleEvent( EVENTS.Birth, self._EventOnBirth ) self:HandleEvent( EVENTS.Dead, self._EventOnDeadOrCrash ) self:HandleEvent( EVENTS.Crash, self._EventOnDeadOrCrash ) @@ -4339,6 +4340,7 @@ do -- SET_CLIENT local timing = self.ZoneTimerInterval or 30 self.ZoneTimer:Start(timing,timing) end + self:_FilterStart() end return self @@ -4546,45 +4548,45 @@ do -- SET_CLIENT MClientInclude = MClientInclude and MClientPrefix end - if self.Filter.Zones then - local MClientZone = false - for ZoneName, Zone in pairs( self.Filter.Zones ) do - self:T3( "Zone:", ZoneName ) - local unit = MClient:GetClientGroupUnit() - if unit and unit:IsInZone(Zone) then - MClientZone = true - end - end - MClientInclude = MClientInclude and MClientZone - end - - if self.Filter.Playernames then - local MClientPlayername = false - local playername = MClient:GetPlayerName() or "Unknown" - --self:T(playername) - for _,_Playername in pairs(self.Filter.Playernames) do - if playername and string.find(playername,_Playername) then - MClientPlayername = true - end - end - self:T( { "Evaluated Playername", MClientPlayername } ) - MClientInclude = MClientInclude and MClientPlayername - end - - if self.Filter.Callsigns then - local MClientCallsigns = false - local callsign = MClient:GetCallsign() - --self:T(callsign) - for _,_Callsign in pairs(self.Filter.Callsigns) do - if callsign and string.find(callsign,_Callsign) then - MClientCallsigns = true - end - end - self:T( { "Evaluated Callsign", MClientCallsigns } ) - MClientInclude = MClientInclude and MClientCallsigns - end - - end + if self.Filter.Zones then + local MClientZone = false + for ZoneName, Zone in pairs( self.Filter.Zones ) do + self:T3( "Zone:", ZoneName ) + local unit = MClient:GetClientGroupUnit() + if unit and unit:IsInZone(Zone) then + MClientZone = true + end + end + MClientInclude = MClientInclude and MClientZone + end + + if self.Filter.Playernames then + local MClientPlayername = false + local playername = MClient:GetPlayerName() or "Unknown" + --self:T(playername) + for _,_Playername in pairs(self.Filter.Playernames) do + if playername and string.find(playername,_Playername) then + MClientPlayername = true + end + end + self:T( { "Evaluated Playername", MClientPlayername } ) + MClientInclude = MClientInclude and MClientPlayername + end + + if self.Filter.Callsigns then + local MClientCallsigns = false + local callsign = MClient:GetCallsign() + --self:I(callsign) + for _,_Callsign in pairs(self.Filter.Callsigns) do + if callsign and string.find(callsign,_Callsign,1,true) then + MClientCallsigns = true + end + end + self:T( { "Evaluated Callsign", MClientCallsigns } ) + MClientInclude = MClientInclude and MClientCallsigns + end + + end self:T2( MClientInclude ) return MClientInclude end From 5e36425058b7f0404ed314c3e6e6d07d6a845b4a Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 14 Sep 2023 12:36:51 +0200 Subject: [PATCH 4/6] #PLAYERTASKCONTROLLER * Fix a problem that sometimes the object event is called prior to the SET_CLIENT event for players joining, leading to false negatives on specifically filtered SET_CLIENT objects --- Moose Development/Moose/Ops/PlayerTask.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 190bc8976..15c2581ff 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -98,7 +98,7 @@ PLAYERTASK = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASK.version="0.1.19" +PLAYERTASK.version="0.1.20" --- Generic task condition. -- @type PLAYERTASK.Condition @@ -2195,7 +2195,8 @@ function PLAYERTASKCONTROLLER:_EventHandler(EventData) end elseif EventData.id == EVENTS.PlayerEnterAircraft and EventData.IniCoalition == self.Coalition then if EventData.IniPlayerName and EventData.IniGroup then - if self.IsClientSet and self.ClientSet:IsNotInSet(CLIENT:FindByName(EventData.IniUnitName)) then + --if self.IsClientSet and self.ClientSet:IsNotInSet(CLIENT:FindByName(EventData.IniUnitName)) then + if self.IsClientSet and (not self.ClientSet:IsIncludeObject(CLIENT:FindByName(EventData.IniUnitName))) then self:T(self.lid.."Client not in SET: "..EventData.IniPlayerName) return self end @@ -4063,7 +4064,8 @@ function PLAYERTASKCONTROLLER:onafterStart(From, Event, To) self:HandleEvent(EVENTS.Ejection, self._EventHandler) self:HandleEvent(EVENTS.Crash, self._EventHandler) self:HandleEvent(EVENTS.PilotDead, self._EventHandler) - self:HandleEvent(EVENTS.PlayerEnterAircraft, self._EventHandler) + self:HandleEvent(EVENTS.PlayerEnterAircraft, self._EventHandler) + self:SetEventPriority(5) return self end From 5e20874dcaf44cf0a24b5877fe0b5a5452e83ece Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 15 Sep 2023 09:11:32 +0200 Subject: [PATCH 5/6] #Startup * Re-instate suppression of error box. --- Moose Development/Moose/Utilities/Enums.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Moose Development/Moose/Utilities/Enums.lua b/Moose Development/Moose/Utilities/Enums.lua index fc4e1d955..9c8ad5150 100644 --- a/Moose Development/Moose/Utilities/Enums.lua +++ b/Moose Development/Moose/Utilities/Enums.lua @@ -26,6 +26,10 @@ -- @field #ENUMS ENUMS = {} +--- Suppress the error box +env.setErrorMessageBoxEnabled( false ) + + --- Rules of Engagement. -- @type ENUMS.ROE -- @field #number WeaponFree [AIR] AI will engage any enemy group it detects. Target prioritization is based based on the threat of the target. From 6a05789db5190ca268d06643c9547c950cc10691 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 17 Sep 2023 16:13:28 +0200 Subject: [PATCH 6/6] Update Controllable.lua - Fixed wrong id of task`EnrouteTaskEngageGroup` - Fixed wrong id of task `EnrouteTaskFAC_EngageGroup` --- .../Moose/Wrapper/Controllable.lua | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 1ba36453a..4012528ca 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -1790,24 +1790,8 @@ end -- @return DCS#Task The DCS task structure. function CONTROLLABLE:EnRouteTaskEngageGroup( AttackGroup, Priority, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit ) - -- EngageControllable = { - -- id = 'EngageControllable ', - -- params = { - -- groupId = Group.ID, - -- weaponType = number, - -- expend = enum AI.Task.WeaponExpend, - -- attackQty = number, - -- directionEnabled = boolean, - -- direction = Azimuth, - -- altitudeEnabled = boolean, - -- altitude = Distance, - -- attackQtyLimit = boolean, - -- priority = number, - -- } - -- } - local DCSTask = { - id = 'EngageControllable', + id = 'EngageGroup', params = { groupId = AttackGroup:GetID(), weaponType = WeaponType, @@ -1923,7 +1907,7 @@ end function CONTROLLABLE:EnRouteTaskFAC_EngageGroup( AttackGroup, Priority, WeaponType, Designation, Datalink, Frequency, Modulation, CallsignID, CallsignNumber ) local DCSTask = { - id = 'FAC_EngageControllable', + id = 'FAC_EngageGroup', params = { groupId = AttackGroup:GetID(), weaponType = WeaponType or "Auto",