From ba14330281c0223f5f38c79f241919ad2195d0f3 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 2 Apr 2024 13:22:54 +0200 Subject: [PATCH 1/3] Fix for counting alive target units only --- Moose Development/Moose/Tasking/Task_A2G.lua | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Moose Development/Moose/Tasking/Task_A2G.lua b/Moose Development/Moose/Tasking/Task_A2G.lua index 28c01fb15..84bdcf360 100644 --- a/Moose Development/Moose/Tasking/Task_A2G.lua +++ b/Moose Development/Moose/Tasking/Task_A2G.lua @@ -175,19 +175,19 @@ do -- TASK_A2G end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Core.Set#SET_UNIT TargetSetUnit The set of targets. function TASK_A2G:SetTargetSetUnit( TargetSetUnit ) self.TargetSetUnit = TargetSetUnit end - --- @param #TASK_A2G self + -- @param #TASK_A2G self function TASK_A2G:GetPlannedMenuText() return self:GetStateString() .. " - " .. self:GetTaskName() .. " ( " .. self.TargetSetUnit:GetUnitTypesText() .. " )" end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Core.Point#COORDINATE RendezVousCoordinate The Coordinate object referencing to the 2D point where the RendezVous point is located on the map. -- @param #number RendezVousRange The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point. -- @param Wrapper.Unit#UNIT TaskUnit @@ -200,7 +200,7 @@ do -- TASK_A2G ActRouteRendezVous:SetRange( RendezVousRange ) end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Wrapper.Unit#UNIT TaskUnit -- @return Core.Point#COORDINATE The Coordinate object referencing to the 2D point where the RendezVous point is located on the map. -- @return #number The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point. @@ -212,7 +212,7 @@ do -- TASK_A2G return ActRouteRendezVous:GetCoordinate(), ActRouteRendezVous:GetRange() end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Core.Zone#ZONE_BASE RendezVousZone The Zone object where the RendezVous is located on the map. -- @param Wrapper.Unit#UNIT TaskUnit function TASK_A2G:SetRendezVousZone( RendezVousZone, TaskUnit ) @@ -223,7 +223,7 @@ do -- TASK_A2G ActRouteRendezVous:SetZone( RendezVousZone ) end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Wrapper.Unit#UNIT TaskUnit -- @return Core.Zone#ZONE_BASE The Zone object where the RendezVous is located on the map. function TASK_A2G:GetRendezVousZone( TaskUnit ) @@ -234,7 +234,7 @@ do -- TASK_A2G return ActRouteRendezVous:GetZone() end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Core.Point#COORDINATE TargetCoordinate The Coordinate object where the Target is located on the map. -- @param Wrapper.Unit#UNIT TaskUnit function TASK_A2G:SetTargetCoordinate( TargetCoordinate, TaskUnit ) @@ -245,7 +245,7 @@ do -- TASK_A2G ActRouteTarget:SetCoordinate( TargetCoordinate ) end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Wrapper.Unit#UNIT TaskUnit -- @return Core.Point#COORDINATE The Coordinate object where the Target is located on the map. function TASK_A2G:GetTargetCoordinate( TaskUnit ) @@ -256,7 +256,7 @@ do -- TASK_A2G return ActRouteTarget:GetCoordinate() end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Core.Zone#ZONE_BASE TargetZone The Zone object where the Target is located on the map. -- @param Wrapper.Unit#UNIT TaskUnit function TASK_A2G:SetTargetZone( TargetZone, TaskUnit ) @@ -267,7 +267,7 @@ do -- TASK_A2G ActRouteTarget:SetZone( TargetZone ) end - --- @param #TASK_A2G self + -- @param #TASK_A2G self -- @param Wrapper.Unit#UNIT TaskUnit -- @return Core.Zone#ZONE_BASE The Zone object where the Target is located on the map. function TASK_A2G:GetTargetZone( TaskUnit ) @@ -280,7 +280,7 @@ do -- TASK_A2G function TASK_A2G:SetGoalTotal() - self.GoalTotal = self.TargetSetUnit:Count() + self.GoalTotal = self.TargetSetUnit:CountAlive() end function TASK_A2G:GetGoalTotal() @@ -304,14 +304,14 @@ do -- TASK_A2G function TASK_A2G:onafterGoal( TaskUnit, From, Event, To ) local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT - if TargetSetUnit:Count() == 0 then + if TargetSetUnit:CountAlive() == 0 then self:Success() end self:__Goal( -10 ) end - --- @param #TASK_A2G self + -- @param #TASK_A2G self function TASK_A2G:UpdateTaskInfo( DetectedItem ) if self:IsStatePlanned() or self:IsStateAssigned() then @@ -328,7 +328,7 @@ do -- TASK_A2G self.TaskInfo:AddThreat( ThreatText, ThreatLevel, 10, "MOD", true ) if self.Detection then - local DetectedItemsCount = self.TargetSetUnit:Count() + local DetectedItemsCount = self.TargetSetUnit:CountAlive() local ReportTypes = REPORT:New() local TargetTypes = {} for TargetUnitName, TargetUnit in pairs( self.TargetSetUnit:GetSet() ) do @@ -341,7 +341,7 @@ do -- TASK_A2G self.TaskInfo:AddTargetCount( DetectedItemsCount, 11, "O", true ) self.TaskInfo:AddTargets( DetectedItemsCount, ReportTypes:Text( ", " ), 20, "D", true ) else - local DetectedItemsCount = self.TargetSetUnit:Count() + local DetectedItemsCount = self.TargetSetUnit:CountAlive() local DetectedItemsTypes = self.TargetSetUnit:GetTypeNames() self.TaskInfo:AddTargetCount( DetectedItemsCount, 11, "O", true ) self.TaskInfo:AddTargets( DetectedItemsCount, DetectedItemsTypes, 20, "D", true ) From 18fd587ab0a20e10b83d43ec9dff086af8fb7ea6 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 4 Apr 2024 17:22:46 +0200 Subject: [PATCH 2/3] xx --- Moose Development/Moose/Wrapper/Net.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Wrapper/Net.lua b/Moose Development/Moose/Wrapper/Net.lua index 761b6829b..af3863fa8 100644 --- a/Moose Development/Moose/Wrapper/Net.lua +++ b/Moose Development/Moose/Wrapper/Net.lua @@ -723,7 +723,7 @@ end --- Converts a JSON string to a lua value. -- @param #string Json Anything JSON -- @return #table Lua -function NET.Lua2Json(Json) +function NET.Json2Lua(Json) return net.json2lua(Json) end From b9bd8d88a91c34788d9ec146fd85fca82b48c52a Mon Sep 17 00:00:00 2001 From: Niels Vaes Date: Mon, 15 Apr 2024 08:57:28 +0200 Subject: [PATCH 3/3] Adding a new TerminalType (100)that seems to be introduced in the update that brought Muwaffaq Salti. The base has a couple of spots (like 04, 05, 06) that can only accommodate smaller type fixed wing aircraft, like the F-16, but not bigger types like the Warthog of the Strike Eagle. (#2109) Because we weren't checking for this new type, spawning in these particular spots always resulted in an airstart, because `_CheckTerminalType` would always return `false` --- Moose Development/Moose/Wrapper/Airbase.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index c58904917..715f9eabd 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -760,11 +760,13 @@ AIRBASE.Sinai = { -- @field #number OpenMedOrBig 176: Combines OpenMed and OpenBig spots. -- @field #number HelicopterUsable 216: Combines HelicopterOnly, OpenMed and OpenBig. -- @field #number FighterAircraft 244: Combines Shelter. OpenMed and OpenBig spots. So effectively all spots usable by fixed wing aircraft. +-- @field #number SmallSizeFigher 100: Tight spots for smaller type fixed wing aircraft, like the F-16. Example of these spots: 04, 05, 06 on Muwaffaq_Salti. A Viper sized plane can spawn here, but an A-10 or Strike Eagle can't AIRBASE.TerminalType = { Runway=16, HelicopterOnly=40, Shelter=68, OpenMed=72, + SmallSizeFighter=100, OpenBig=104, OpenMedOrBig=176, HelicopterUsable=216, @@ -1841,7 +1843,7 @@ function AIRBASE._CheckTerminalType(Term_Type, termtype) match=true end elseif termtype==AIRBASE.TerminalType.FighterAircraft then - if Term_Type==AIRBASE.TerminalType.OpenMed or Term_Type==AIRBASE.TerminalType.OpenBig or Term_Type==AIRBASE.TerminalType.Shelter then + if Term_Type==AIRBASE.TerminalType.OpenMed or Term_Type==AIRBASE.TerminalType.OpenBig or Term_Type==AIRBASE.TerminalType.Shelter or Term_Type==AIRBASE.TerminalType.SmallSizeFighter then match=true end end