From 781d421e1c5c5cf4fbf9024f26b27c7832930e29 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 16 Nov 2021 15:48:00 +0100 Subject: [PATCH 01/14] slightly changes message --- Moose Development/Moose/Ops/CSAR.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/CSAR.lua b/Moose Development/Moose/Ops/CSAR.lua index d566ea394..ca643da08 100644 --- a/Moose Development/Moose/Ops/CSAR.lua +++ b/Moose Development/Moose/Ops/CSAR.lua @@ -247,7 +247,7 @@ CSAR.AircraftType["Bell-47"] = 2 --- CSAR class version. -- @field #string version -CSAR.version="0.1.12r3" +CSAR.version="0.1.12r4" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- ToDo list @@ -1122,9 +1122,9 @@ function CSAR:_CheckWoundedGroupStatus(heliname,woundedgroupname) local dist = UTILS.MetersToNM(self.autosmokedistance) disttext = string.format("%.0fnm",dist) end - self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. I hear you! Damn, that thing is loud!\nI'll pop a smoke when you are %s away.\nLand or hover by the smoke.", _heliName, _pilotName, disttext), self.messageTime,false,true) + self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. I hear you! Finally, that is music in my ears!\nI'll pop a smoke when you are %s away.\nLand or hover by the smoke.", _heliName, _pilotName, disttext), self.messageTime,false,true) else - self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. I hear you! Damn, that thing is loud!\nRequest a flare or smoke if you need.", _heliName, _pilotName), self.messageTime,false,true) + self:_DisplayMessageToSAR(_heliUnit, string.format("%s: %s. I hear you! Finally, that is music in my ears!\nRequest a flare or smoke if you need.", _heliName, _pilotName), self.messageTime,false,true) end --mark as shown for THIS heli and THIS group self.heliVisibleMessage[_lookupKeyHeli] = true From f2fb7d43d06bdf1d27a6aaa9ae18172960436434 Mon Sep 17 00:00:00 2001 From: dogjutsu Date: Tue, 16 Nov 2021 12:45:14 -0800 Subject: [PATCH 02/14] Fixed some typos of forms of the word 'strategy'. --- Moose Development/Moose/Ops/Chief.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Moose Development/Moose/Ops/Chief.lua b/Moose Development/Moose/Ops/Chief.lua index b449dc95c..7912a24c1 100644 --- a/Moose Development/Moose/Ops/Chief.lua +++ b/Moose Development/Moose/Ops/Chief.lua @@ -5,7 +5,7 @@ -- * Automatic target engagement based on detection network -- * Define multiple border, conflict and attack zones -- * Define strategic "capture" zones --- * Set stragegy of chief from passive to agressive +-- * Set strategy of chief from passive to agressive -- * Manual target engagement via AUFTRAG and TARGET classes -- * Add AIRWINGS, BRIGADES and FLEETS as resources -- * Seamless air-to-air, air-to-ground, ground-to-ground dispatching @@ -101,7 +101,7 @@ -- -- # Strategic (Capture) Zones -- --- Strategically important zones, which should be captured can be added via the @{#CHIEF.AddStrateticZone}() function. +-- Strategically important zones, which should be captured can be added via the @{#CHIEF.AddStrategicZone}() function. -- -- If the zone is currently owned by another coalition and enemy ground troops are present in the zone, a CAS mission is lauchned. -- @@ -316,7 +316,7 @@ function CHIEF:New(Coalition, AgentSet, Alias) -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. - -- @param #string Strategy New stragegy. + -- @param #string Strategy New strategy. --- Triggers the FSM event "MissionAssign". @@ -587,11 +587,11 @@ function CHIEF:GetDefcon(Defcon) return self.Defcon end ---- Set stragegy. +--- Set strategy. -- @param #CHIEF self --- @param #string Strategy Strategy. See @{#CHIEF.Stragegy}, e.g. `CHIEF.Strategy.DEFENSIVE` (default). +-- @param #string Strategy Strategy. See @{#CHIEF.strategy}, e.g. `CHIEF.Strategy.DEFENSIVE` (default). -- @return #CHIEF self -function CHIEF:SetStragety(Strategy) +function CHIEF:SetStrategy(Strategy) -- Trigger event if Strategy changed. if Strategy~=self.strategy then @@ -767,7 +767,7 @@ end -- @param #number Priority Priority. -- @param #number Importance Importance. -- @return #CHIEF self -function CHIEF:AddStrateticZone(OpsZone, Priority, Importance) +function CHIEF:AddStrategicZone(OpsZone, Priority, Importance) local stratzone={} --#CHIEF.StrategicZone @@ -2062,7 +2062,7 @@ end --- Recruit assets for a given OPS zone. -- @param #CHIEF self --- @param #CHIEF.StrategicZone StratZone The stratetic zone. +-- @param #CHIEF.StrategicZone StratZone The strategic zone. -- @param #string MissionType Mission Type. -- @param #number NassetsMin Min number of required assets. -- @param #number NassetsMax Max number of required assets. From 1fc1016148f9421ce5838fc1c3855d84c95f80b6 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Wed, 17 Nov 2021 16:42:58 +0100 Subject: [PATCH 03/14] Update Auftrag.lua Added missionSpeed to Orbit --- Moose Development/Moose/Ops/Auftrag.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 96da3ce35..9c26d8ab4 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -923,6 +923,7 @@ function AUFTRAG:NewORBIT(Coordinate, Altitude, Speed, Heading, Leg) mission:_TargetFromObject(Coordinate) mission.orbitSpeed = UTILS.KnotsToMps(Speed or 350) + mission.missionSpeed = UTILS.KnotsToMps(Speed or 350) if Heading and Leg then mission.orbitHeading=Heading From 8c8cae1e274c47d736baa6acde161bbc3b5eaf77 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 18 Nov 2021 10:58:13 +0100 Subject: [PATCH 04/14] AUFTRAG - wrong speed conversion lines 925/295 corrected to KnotsToKmph --- Moose Development/Moose/Ops/Auftrag.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 9c26d8ab4..dee9a86c4 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -922,8 +922,8 @@ function AUFTRAG:NewORBIT(Coordinate, Altitude, Speed, Heading, Leg) mission:_TargetFromObject(Coordinate) - mission.orbitSpeed = UTILS.KnotsToMps(Speed or 350) - mission.missionSpeed = UTILS.KnotsToMps(Speed or 350) + mission.orbitSpeed = UTILS.KnotsToKmph(Speed or 350) + mission.missionSpeed = UTILS.KnotsToKmph(Speed or 350) if Heading and Leg then mission.orbitHeading=Heading From 16c5307fc20b299d8d3395fd7429169c2caf5fa8 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 18 Nov 2021 10:58:42 +0100 Subject: [PATCH 05/14] COMMANDER - Zone parameter doc not correctly mentioned in Luadocs --- Moose Development/Moose/Ops/Commander.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/Commander.lua b/Moose Development/Moose/Ops/Commander.lua index ef785f6eb..ad61ca2e2 100644 --- a/Moose Development/Moose/Ops/Commander.lua +++ b/Moose Development/Moose/Ops/Commander.lua @@ -517,7 +517,7 @@ end --- Add a CAP zone. -- @param #COMMANDER self --- @param Core.Zone#ZONE CapZone Zone. +-- @param Core.Zone#ZONE Zone CapZone Zone. -- @param #number Altitude Orbit altitude in feet. Default is 12,0000 feet. -- @param #number Speed Orbit speed in KIAS. Default 350 kts. -- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). @@ -542,7 +542,7 @@ end --- Add a GCICAP zone. -- @param #COMMANDER self --- @param Core.Zone#ZONE CapZone Zone. +-- @param Core.Zone#ZONE Zone CapZone Zone. -- @param #number Altitude Orbit altitude in feet. Default is 12,0000 feet. -- @param #number Speed Orbit speed in KIAS. Default 350 kts. -- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). From eab28abc86e5cb01aca5a8d8666305ea7e8eb2c6 Mon Sep 17 00:00:00 2001 From: Ismael Date: Fri, 19 Nov 2021 01:11:49 +0100 Subject: [PATCH 06/14] Subject: Add Player and AI Inbound radio calls to better inmersion in Airboss #16311 This commit enhances Airboss class functionality to provide with the inbound calls both from Players requesting marshal and AI sent to marshal: - "Marshal, [MODEX], marking mom's [BEARING] for [DISTANCE], angels [HEIGHT], state [FUEL_STATE] Two new boolean fields have been added to Airboss class to trigger or not the inbound calls: - inRadioCall - inRadioCallAI These fields can be modified trough methods: - AIRBOSS:SetInboundMessagesPlayer(false) - AIRBOSS:SetInboundMessagesAI(false) Note. At the moment both methods initialize to "false" at Airboss:NEW, so in case you want to have this functionality activated, you need to call the methods with (true) when initializing your Airboss class. This enhacement of the Airboss class requires 5 new sound files (.ogg) to be included to folder "\Airboss Soundfiles" in your .miz file: - PILOT-Angels.ogg - PILOT-For.ogg - PILOT-MarkingMoms.ogg - PILOT-Marshal.ogg - PILOT-State.ogg To get them, please refer to the SOUNDS MOOSE repository or the discord channel. Where they will be available. --- Moose Development/Moose/Ops/Airboss.lua | 126 +++++++++++++++++++++++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index becd99218..d9afeb81f 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -1201,6 +1201,8 @@ AIRBOSS = { NmaxSection = nil, NmaxStack = nil, handleai = nil, + inbRadioCall = nil, + inbRadioCallAI = nil, tanker = nil, Corientation = nil, Corientlast = nil, @@ -1900,6 +1902,12 @@ function AIRBOSS:New(carriername, alias) -- Set AI handling On. self:SetHandleAION() + -- No Inbound messages from Player by default + self:SetInboundMessagesPlayer(false) + + -- No Inbound messages from AI by default + self:SetInboundMessagesAI(false) + -- Airboss is a nice guy. self:SetAirbossNiceGuy() @@ -3215,6 +3223,24 @@ function AIRBOSS:SetHandleAION() return self end +--- Will simulate the inbound call from the player when requesteing marshal +-- @param #AIRBOSS self +-- @param #AIRBOSS status Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON) +-- @return #AIRBOSS self +function AIRBOSS:SetInboundMessagesPlayer(status) + self.inbRadioCall=status + return self +end + +--- Will simulate the inbound call from the AI when sending to marshal (as if they have called for it) +-- @param #AIRBOSS self +-- @param #AIRBOSS status Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON) +-- @return #AIRBOSS self +function AIRBOSS:SetInboundMessagesAI(status) + self.inbRadioCallAI=status + return self +end + --- Do not handle AI aircraft. -- @param #AIRBOSS self -- @return #AIRBOSS self @@ -5299,6 +5325,41 @@ function AIRBOSS:_InitVoiceOvers() subtitle="", duration=1.95, }, + MARSHAL={ + file="PILOT-Marshal", + suffix="ogg", + loud=false, + subtitle="", + duration=0.50, + }, + MARKINGMOMS={ + file="PILOT-MarkingMoms", + suffix="ogg", + loud=false, + subtitle="", + duration=0.90, + }, + FOR={ + file="PILOT-For", + suffix="ogg", + loud=false, + subtitle="", + duration=0.29, + }, + ANGELS={ + file="PILOT-Angels", + suffix="ogg", + loud=false, + subtitle="", + duration=0.50, + }, + STATE={ + file="PILOT-State", + suffix="ogg", + loud=false, + subtitle="", + duration=0.40, + }, } ------------------- @@ -6545,6 +6606,11 @@ function AIRBOSS:_MarshalAI(flight, nstack, respawn) -- Check if flight is already in Marshal queue. if not self:_InQueue(self.Qmarshal,flight.group) then + -- Simulate inbound call + if self.inbRadioCallAI then + local leader = flight.group:GetUnits()[1] + self:_MarshallInboundCall(leader, flight.onboard) + end -- Add group to marshal stack queue. self:_AddMarshalGroup(flight, nstack) end @@ -15722,6 +15788,60 @@ function AIRBOSS:_Number2Radio(radio, number, delay, interval, pilotcall) return wait end +--- Aircraft request marshal (Inbound call). +-- @param #AIRBOSS self +-- @return Wrapper.Unit#UNIT Unit of player or nil. +-- @param #string modex Tail number. +function AIRBOSS:_MarshallInboundCall(unit, modex) + + -- Calculate + local vectorCarrier = self:GetCoordinate():GetDirectionVec3(unit:GetCoordinate()) + local bearing = UTILS.Round(unit:GetCoordinate():GetAngleDegrees( vectorCarrier ), 0) + local distance = UTILS.Round(UTILS.MetersToNM(unit:GetCoordinate():Get2DDistance(self:GetCoordinate())),0) + local angels = UTILS.Round(UTILS.MetersToFeet(unit:GetHeight()/1000),0) + local state = UTILS.Round(self:_GetFuelState(unit)/1000,1) + + -- Pilot: "Marshall, [modex], marking mom's [bearing] for [distance], angels [XX], state [X.X]" + local text=string.format("Marshal, %s, marking mom's %d for %d, angels %d, state %.1f", modex, bearing, distance, angels, state) + -- Debug message. + self:I(self.lid..text) + + -- Fuel state. + local FS=UTILS.Split(string.format("%.1f", state), ".") + + -- Create new call to display complete subtitle. + local inboundcall=self:_NewRadioCall(self.MarshalCall.CLICK, unit.UnitName:upper() , text, self.Tmessage, nil, unit.UnitName:upper()) + + -- CLICK! + self:RadioTransmission(self.MarshalRadio, inboundcall) + -- Marshal .. + self:RadioTransmission(self.MarshalRadio, self.PilotCall.MARSHAL, nil, nil, nil, nil, true) + -- Modex.. + self:_Number2Radio(self.MarshalRadio, modex, nil, nil, true) + -- Marking Mom's, + self:RadioTransmission(self.MarshalRadio, self.PilotCall.MARKINGMOMS, nil, nil, nil, nil, true) + -- Bearing .. + self:_Number2Radio(self.MarshalRadio, tostring(bearing), nil, nil, true) + -- For .. + self:RadioTransmission(self.MarshalRadio, self.PilotCall.FOR, nil, nil, nil, nil, true) + -- Distance .. + self:_Number2Radio(self.MarshalRadio, tostring(distance), nil, nil, true) + -- Angels .. + self:RadioTransmission(self.MarshalRadio, self.PilotCall.ANGELS, nil, nil, nil, nil, true) + -- Angels Number .. + self:_Number2Radio(self.MarshalRadio, tostring(angels), nil, nil, true) + -- State .. + self:RadioTransmission(self.MarshalRadio, self.PilotCall.STATE, nil, nil, nil, nil, true) + -- X.. + self:_Number2Radio(self.MarshalRadio, FS[1], nil, nil, true) + -- Point.. + self:RadioTransmission(self.MarshalRadio, self.PilotCall.POINT, nil, nil, nil, nil, true) + -- Y. + self:_Number2Radio(self.MarshalRadio, FS[2], nil, nil, true) + -- CLICK! + self:RadioTransmission(self.MarshalRadio, self.MarshalRadio.CLICK, nil, nil, nil, nil, true) + +end --- AI aircraft calls the ball. -- @param #AIRBOSS self @@ -16478,7 +16598,11 @@ function AIRBOSS:_RequestMarshal(_unitName) -- Get player unit and name. local _unit, _playername = self:_GetPlayerUnitAndName(_unitName) - + + if self.inbRadioCall then + self:_MarshallInboundCall(_unit, "202") + end + -- Check if we have a unit which is a player. if _unit and _playername then local playerData=self.players[_playername] --#AIRBOSS.PlayerData From ee85b0e05758c51563eb62e654abb454fa1c3c19 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Fri, 19 Nov 2021 14:20:53 +0100 Subject: [PATCH 07/14] OpsZone -Mission Table Added functionality to admin missions attached to an OpsZone (for CHIEF) --- Moose Development/Moose/Ops/OpsZone.lua | 70 ++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/OpsZone.lua b/Moose Development/Moose/Ops/OpsZone.lua index fee913378..ca25cb291 100644 --- a/Moose Development/Moose/Ops/OpsZone.lua +++ b/Moose Development/Moose/Ops/OpsZone.lua @@ -39,6 +39,7 @@ -- @field Wrapper.Marker#MARKER marker Marker on the F10 map. -- @field #string markerText Text shown in the maker. -- @field #table chiefs Chiefs that monitor this zone. +-- @field #table Missions Missions that are attached to this OpsZone -- @extends Core.Fsm#FSM --- Be surprised! @@ -61,8 +62,14 @@ OPSZONE = { Nblu = 0, Nnut = 0, chiefs = {}, + Missions = {}, } +--- OPSZONE.MISSION +-- @type OPSZONE.MISSION +-- @field #number Coalition Coalition +-- @field #string Type Type of mission +-- @field Ops.Auftrag#AUFTRAG Mission The actual attached mission --- OPSZONE class version. -- @field #string version @@ -74,7 +81,7 @@ OPSZONE.version="0.2.0" -- TODO: Pause/unpause evaluations. -- TODO: Capture time, i.e. time how long a single coalition has to be inside the zone to capture it. --- TODO: Can neutrals capture? No, since they are _neutral_! +-- DONE: Can neutrals capture? No, since they are _neutral_! -- TODO: Differentiate between ground attack and boming by air or arty. -- DONE: Capture airbases. -- DONE: Can statics capture or hold a zone? No, unless explicitly requested by mission designer. @@ -133,6 +140,7 @@ function OPSZONE:New(Zone, CoalitionOwner) self.zone=Zone self.zoneName=Zone:GetName() self.zoneRadius=Zone:GetRadius() + self.Missions = {} -- Current and previous owners. self.ownerCurrent=CoalitionOwner or coalition.side.NEUTRAL @@ -713,7 +721,8 @@ function OPSZONE:onenterAttacked(From, Event, To) -- Draw zone. self.zone:DrawZone(nil, color, 1.0, color, 0.5) end - + + self:_CleanMissionTable() end --- On enter "Empty" event. @@ -1198,6 +1207,63 @@ function OPSZONE:_AddChief(Chief) end +--- Add an entry to the OpsZone mission table +-- @param #OPSZONE self +-- @param #number Coalition Coalition of type e.g. coalition.side.NEUTRAL +-- @param #string Type Type of mission, e.g. AUFTRAG.Type.CAS +-- @param Ops.Auftrag#AUFTRAG Auftrag The Auftrag itself +-- @return #OPSZONE self +function OPSZONE:_AddMission(Coalition,Type,Auftrag) + + -- Add a mission + local entry = {} -- #OPSZONE.MISSION + entry.Coalition = Coalition or coalition.side.NEUTRAL + entry.Type = Type or "" + entry.Mission = Auftrag or nil + + table.insert(self.Missions,entry) + + return self +end + +--- Get the OpsZone mission table. #table of #OPSZONE.MISSION entries +-- @param #OPSZONE self +-- @return #table Missions +function OPSZONE:_GetMissions() + return self.Missions +end + +--- Add an entry to the OpsZone mission table +-- @param #OPSZONE self +-- @param #number Coalition Coalition of type e.g. coalition.side.NEUTRAL +-- @param #string Type Type of mission, e.g. AUFTRAG.Type.CAS +-- @return #table Missions Table of Ops.Auftrag#AUFTRAG entries +function OPSZONE:_FindMissions(Coalition,Type) + -- search the table + local foundmissions = {} + for _,_entry in pairs(self.Missions) do + local entry = _entry -- #OPSZONE.MISSION + if entry.Coalition == Coalition and entry.Type == Type and entry.Mission and entry.Mission:IsNotOver() then + table.insert(foundmissions,entry.Mission) + end + end + return foundmissions +end + +--- Housekeeping +-- @param #OPSZONE self +-- @return #OPSZONE self +function OPSZONE:_CleanMissionTable() + local missions = {} + for _,_entry in pairs(self.Missions) do + local entry = _entry -- #OPSZONE.MISSION + if entry.Mission and entry.Mission:IsNotOver() then + table.insert(missions,entry) + end + end + self.Missions = missions + return self +end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- From f37abc69ea59fcf68b5d7e5a9f410a63ea4b1bfc Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Fri, 19 Nov 2021 14:29:18 +0100 Subject: [PATCH 08/14] Update OpsZone.lua --- Moose Development/Moose/Ops/OpsZone.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/OpsZone.lua b/Moose Development/Moose/Ops/OpsZone.lua index ca25cb291..5674c6467 100644 --- a/Moose Development/Moose/Ops/OpsZone.lua +++ b/Moose Development/Moose/Ops/OpsZone.lua @@ -1232,22 +1232,24 @@ end function OPSZONE:_GetMissions() return self.Missions end - --- Add an entry to the OpsZone mission table -- @param #OPSZONE self -- @param #number Coalition Coalition of type e.g. coalition.side.NEUTRAL -- @param #string Type Type of mission, e.g. AUFTRAG.Type.CAS +-- @return #boolean found True if we have that kind of mission, else false -- @return #table Missions Table of Ops.Auftrag#AUFTRAG entries function OPSZONE:_FindMissions(Coalition,Type) -- search the table local foundmissions = {} + local found = false for _,_entry in pairs(self.Missions) do local entry = _entry -- #OPSZONE.MISSION if entry.Coalition == Coalition and entry.Type == Type and entry.Mission and entry.Mission:IsNotOver() then table.insert(foundmissions,entry.Mission) + found = true end end - return foundmissions + return found, foundmissions end --- Housekeeping From 397ab77105d3b516c31c229523dd07c018a07f54 Mon Sep 17 00:00:00 2001 From: Ismael Date: Fri, 19 Nov 2021 15:31:49 +0100 Subject: [PATCH 09/14] This pull request enhances Airboss class functionality to provide with the 1) Inbound calls both from Players requesting marshal and AI sent to marshal: "Marshal, [MODEX], marking mom's [BEARING] for [DISTANCE], angels [HEIGHT], state [FUEL_STATE] 2) Commencing call and voiceover (both AI and Players) For that, two boolean fields have been added to Airboss class to trigger or not extra voice overs: xtVoiceOvers xtVoiceOversAI These fields can be modified trough methods: AIRBOSS:SetExtraVoiceOvers(true/false) AIRBOSS:SetExtraVoiceOversAI(true/false) Note. At the moment both methods initialize to "false" at Airboss:NEW, so in case you want to have this functionality activated, you need to call the methods with (true) when initializing your Airboss class. The new methods in charge of creating the radio calls are AIRBOSS:_MarshalAI: for AI flights send to marshal AIRBOSS:_RequestMarshal: for player flighs requesting marshal from F10 menu 2) AIRBOSS:_CommencingCall(unit, modex), which is called from AIRBOSS:_ClearForLanding: for AI flights cleared for landing AIRBOSS:_RequestCommence: for player flights requesting commencing from F10 menu (disregarding if the player call is right or not) This enhacement of the Airboss class requires 5 new sound files (.ogg) to be included to folder "\Airboss Soundfiles" in your .miz file: PILOT-Angels.ogg PILOT-For.ogg PILOT-MarkingMoms.ogg PILOT-Marshal.ogg PILOT-State.ogg PILOT-Commencing.ogg --- Moose Development/Moose/Ops/Airboss.lua | 88 ++++++++++++++++++------- 1 file changed, 66 insertions(+), 22 deletions(-) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index d9afeb81f..d720e8803 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -1201,8 +1201,8 @@ AIRBOSS = { NmaxSection = nil, NmaxStack = nil, handleai = nil, - inbRadioCall = nil, - inbRadioCallAI = nil, + xtVoiceOvers = nil, + xtVoiceOversAI = nil, tanker = nil, Corientation = nil, Corientlast = nil, @@ -1902,11 +1902,11 @@ function AIRBOSS:New(carriername, alias) -- Set AI handling On. self:SetHandleAION() - -- No Inbound messages from Player by default - self:SetInboundMessagesPlayer(false) + -- No extra voiceover/calls from player by default + self:SetExtraVoiceOvers(false) - -- No Inbound messages from AI by default - self:SetInboundMessagesAI(false) + -- No extra voiceover/calls from AI by default + self:SetExtraVoiceOversAI(false) -- Airboss is a nice guy. self:SetAirbossNiceGuy() @@ -3223,21 +3223,21 @@ function AIRBOSS:SetHandleAION() return self end ---- Will simulate the inbound call from the player when requesteing marshal +--- Will play the inbound calls, commencing, initial, etc. from the player when requesteing marshal -- @param #AIRBOSS self -- @param #AIRBOSS status Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON) -- @return #AIRBOSS self -function AIRBOSS:SetInboundMessagesPlayer(status) - self.inbRadioCall=status +function AIRBOSS:SetExtraVoiceOvers(status) + self.xtVoiceOvers=status return self end ---- Will simulate the inbound call from the AI when sending to marshal (as if they have called for it) +--- Will simulate the inbound call, commencing, initial, etc from the AI when requested by Airboss -- @param #AIRBOSS self -- @param #AIRBOSS status Boolean to activate (true) / deactivate (false) the radio inbound calls (default is ON) -- @return #AIRBOSS self -function AIRBOSS:SetInboundMessagesAI(status) - self.inbRadioCallAI=status +function AIRBOSS:SetExtraVoiceOversAI(status) + self.xtVoiceOversAI=status return self end @@ -5359,7 +5359,14 @@ function AIRBOSS:_InitVoiceOvers() loud=false, subtitle="", duration=0.40, - }, + }, + COMMENCING={ + file="PILOT-Commencing", + suffix="ogg", + loud=false, + subtitle="", + duration=0.45, + }, } ------------------- @@ -6235,6 +6242,12 @@ function AIRBOSS:_ClearForLanding(flight) -- Cleared for Case X recovery. self:_MarshalCallClearedForRecovery(flight.onboard, flight.case) + -- Voice over of the commencing simulated call from AI + if self.xtVoiceOversAI then + local leader = flight.group:GetUnits()[1] + self:_CommencingCall(leader, flight.onboard) + end + else -- Cleared for Case X recovery. @@ -6607,7 +6620,7 @@ function AIRBOSS:_MarshalAI(flight, nstack, respawn) -- Check if flight is already in Marshal queue. if not self:_InQueue(self.Qmarshal,flight.group) then -- Simulate inbound call - if self.inbRadioCallAI then + if self.xtVoiceOversAI then local leader = flight.group:GetUnits()[1] self:_MarshallInboundCall(leader, flight.onboard) end @@ -15788,7 +15801,7 @@ function AIRBOSS:_Number2Radio(radio, number, delay, interval, pilotcall) return wait end ---- Aircraft request marshal (Inbound call). +--- Aircraft request marshal (Inbound call both for players and AI). -- @param #AIRBOSS self -- @return Wrapper.Unit#UNIT Unit of player or nil. -- @param #string modex Tail number. @@ -15843,6 +15856,31 @@ function AIRBOSS:_MarshallInboundCall(unit, modex) end +--- Aircraft commencing call (both for players and AI). +-- @param #AIRBOSS self +-- @return Wrapper.Unit#UNIT Unit of player or nil. +-- @param #string modex Tail number. +function AIRBOSS:_CommencingCall(unit, modex) + + -- Pilot: "[modex], commencing" + local text=string.format("%s, commencing", modex) + -- Debug message. + self:I(self.lid..text) + + -- Create new call to display complete subtitle. + local commencingCall=self:_NewRadioCall(self.MarshalCall.CLICK, unit.UnitName:upper() , text, self.Tmessage, nil, unit.UnitName:upper()) + + -- Click + self:RadioTransmission(self.MarshalRadio, commencingCall) + -- Modex.. + self:_Number2Radio(self.MarshalRadio, modex, nil, nil, true) + -- Commencing + self:RadioTransmission(self.MarshalRadio, self.PilotCall.COMMENCING, nil, nil, nil, nil, true) + -- CLICK! + self:RadioTransmission(self.MarshalRadio, self.MarshalRadio.CLICK, nil, nil, nil, nil, true) + +end + --- AI aircraft calls the ball. -- @param #AIRBOSS self -- @param #string modex Tail number. @@ -16598,17 +16636,18 @@ function AIRBOSS:_RequestMarshal(_unitName) -- Get player unit and name. local _unit, _playername = self:_GetPlayerUnitAndName(_unitName) - - if self.inbRadioCall then - self:_MarshallInboundCall(_unit, "202") - end - + -- Check if we have a unit which is a player. if _unit and _playername then local playerData=self.players[_playername] --#AIRBOSS.PlayerData if playerData then + -- Voice over of inbound call (regardless of airboss rejecting it or not) + if self.xtVoiceOvers then + self:_MarshallInboundCall(_unit, playerData.onboard) + end + -- Check if player is in CCA local inCCA=playerData.unit:IsInZone(self.zoneCCA) @@ -16850,13 +16889,18 @@ function AIRBOSS:_RequestCommence(_unitName) -- Get player unit and name. local _unit, _playername = self:_GetPlayerUnitAndName(_unitName) - + -- Check if we have a unit which is a player. if _unit and _playername then local playerData=self.players[_playername] --#AIRBOSS.PlayerData if playerData then - + + -- Voice over of Commencing call (regardless of Airboss will rejected or not) + if self.xtVoiceOvers then + self:_CommencingCall(_unit, playerData.onboard) + end + -- Check if unit is in CCA. local text="" local cleared=false From abb3a2dbd2717fb362a4d3b0bb3e56a68baed4ee Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Fri, 19 Nov 2021 16:03:25 +0100 Subject: [PATCH 10/14] CHIEF - Updates Added alignment to OpsZone Mission table. Added ARTY. Added Tanks for patrol --- Moose Development/Moose/Ops/Chief.lua | 77 ++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 12 deletions(-) diff --git a/Moose Development/Moose/Ops/Chief.lua b/Moose Development/Moose/Ops/Chief.lua index 7912a24c1..9fd69ae8d 100644 --- a/Moose Development/Moose/Ops/Chief.lua +++ b/Moose Development/Moose/Ops/Chief.lua @@ -174,6 +174,8 @@ CHIEF.Strategy = { -- @field #number importance Importance -- @field Ops.Auftrag#AUFTRAG missionPatrol Patrol mission. -- @field Ops.Auftrag#AUFTRAG missionCAS CAS mission. +-- @field Ops.Auftrag#AUFTRAG missionPatrol Patrol mission. +-- @field Ops.Auftrag#AUFTRAG missionARTY Artillery mission. --- CHIEF class version. @@ -1675,9 +1677,14 @@ function CHIEF:CheckOpsZoneQueue() if ownercoalition~=self.coalition and (stratzone.importance==nil or stratzone.importance<=vip) then -- Has a patrol mission? - local hasMissionPatrol=stratzone.missionPatrol and stratzone.missionPatrol:IsNotOver() or false + --local hasMissionPatrol=stratzone.missionPatrol and stratzone.missionPatrol:IsNotOver() or false + local hasMissionPatrol=stratzone.opszone:_FindMissions(self.coalition,AUFTRAG.Type.PATROLZONE) -- Has a CAS mission? - local hasMissionCAS=stratzone.missionCAS and stratzone.missionCAS:IsNotOver() or false + --local hasMissionCAS=stratzone.missionCAS and stratzone.missionCAS:IsNotOver() or false + local hasMissionCAS=stratzone.opszone:_FindMissions(self.coalition,AUFTRAG.Type.CAS) + -- Has a ARTY mission? + --local hasMissionARTY=stratzone.missionARTY and stratzone.missionARTY:IsNotOver() or false + local hasMissionARTY=stratzone.opszone:_FindMissions(self.coalition,AUFTRAG.Type.ARTY) -- Debug info. self:T(self.lid..string.format("Zone %s [%s] is owned by coalition %d", stratzone.opszone.zone:GetName(), stratzone.opszone:GetState(), ownercoalition)) @@ -1696,7 +1703,7 @@ function CHIEF:CheckOpsZoneQueue() self:T3(self.lid..string.format("Zone is empty ==> Recruit Patrol zone infantry assets")) -- Recruit ground assets that - local recruited=self:RecruitAssetsForZone(stratzone, AUFTRAG.Type.ONGUARD, 1, 3, {Group.Category.GROUND}, {GROUP.Attribute.GROUND_INFANTRY}) + local recruited=self:RecruitAssetsForZone(stratzone, AUFTRAG.Type.ONGUARD, 1, 3, {Group.Category.GROUND}, {GROUP.Attribute.GROUND_INFANTRY, GROUP.Attribute.GROUND_TANK}) -- Debug info. self:T(self.lid..string.format("Zone is empty ==> Recruit Patrol zone infantry assets=%s", tostring(recruited))) @@ -1724,6 +1731,19 @@ function CHIEF:CheckOpsZoneQueue() self:T(self.lid..string.format("Zone is NOT empty ==> Recruit CAS assets=%s", tostring(recruited))) end + if not hasMissionARTY then + + -- Debug message. + self:T3(self.lid..string.format("Zone is NOT empty ==> Recruit ARTY assets")) + + + -- Recruite CAS assets. + local recruited=self:RecruitAssetsForZone(stratzone, AUFTRAG.Type.ARTY, 1, 1) + + -- Debug message. + self:T(self.lid..string.format("Zone is NOT empty ==> Recruit ARTY assets=%s", tostring(recruited))) + + end end @@ -1738,15 +1758,20 @@ function CHIEF:CheckOpsZoneQueue() local ownercoalition=stratzone.opszone:GetOwner() -- Has a patrol mission? - local hasMissionPatrol=stratzone.missionPatrol and stratzone.missionPatrol:IsNotOver() or false + --local hasMissionPatrol=stratzone.missionPatrol and stratzone.missionPatrol:IsNotOver() or false + local hasMissionPATROL=stratzone.opszone:_FindMissions(self.coalition,AUFTRAG.Type.PATROLZONE) -- Has a CAS mission? - local hasMissionCAS=stratzone.missionCAS and stratzone.missionCAS:IsNotOver() or false + --local hasMissionCAS=stratzone.missionCAS and stratzone.missionCAS:IsNotOver() or false + local hasMissionCAS, CASMissions = stratzone.opszone:_FindMissions(self.coalition,AUFTRAG.Type.CAS) if ownercoalition==self.coalition and stratzone.opszone:IsEmpty() and hasMissionCAS then -- Cancel CAS mission if zone is ours and no enemies are present. -- TODO: Might want to check if we still have CAS capable assets in stock?! - stratzone.missionCAS:Cancel() + --stratzone.missionCAS:Cancel() + for _,_auftrag in pairs(CASMissions) do + _auftrag:Cancel() + end end @@ -2036,7 +2061,7 @@ function CHIEF:RecruitAssetsForTarget(Target, MissionType, NassetsMin, NassetsMa for _,_legion in pairs(self.commander.legions) do local legion=_legion --Ops.Legion#LEGION - -- Check that runway is operational. + -- Check that runway is operational.d local Runway=legion:IsAirwing() and legion:IsRunwayOperational() or true if legion:IsRunning() and Runway then @@ -2151,7 +2176,8 @@ function CHIEF:RecruitAssetsForZone(StratZone, MissionType, NassetsMin, NassetsM -- Attach mission to ops zone. -- TODO: Need a better way! - StratZone.missionPatrol=mission + --StratZone.missionPatrol=mission + StratZone.opszone:_AddMission(self.coalition,MissionType,mission) return true else @@ -2162,8 +2188,34 @@ function CHIEF:RecruitAssetsForZone(StratZone, MissionType, NassetsMin, NassetsM elseif MissionType==AUFTRAG.Type.CAS then -- Create Patrol zone mission. - local mission=AUFTRAG:NewPATROLZONE(StratZone.opszone.zone) + local caszone = StratZone.opszone.zone + local coord = caszone:GetCoordinate() + local height = UTILS.MetersToFeet(coord:GetLandHeight())+2000 + local mission=AUFTRAG:NewPATROLZONE(caszone) mission:SetEngageDetected(25, {"Ground Units", "Light armed ships", "Helicopters"}) + mission:SetWeaponExpend(AI.Task.WeaponExpend.ALL) + + -- Add assets to mission. + for _,asset in pairs(assets) do + mission:AddAsset(asset) + end + + -- Assign mission to legions. + self:MissionAssign(mission, legions) + + -- Attach mission to ops zone. + -- TODO: Need a better way! + --StratZone.missionCAS=mission + StratZone.opszone:_AddMission(self.coalition,MissionType,mission) + + return true + elseif MissionType==AUFTRAG.Type.ARTY then + + -- Create ARTY zone mission. + local TargetZone = StratZone.opszone.zone + local Target = TargetZone:GetCoordinate() + local Radius = TargetZone:GetRadius() + local mission=AUFTRAG:NewARTY(Target,120,Radius) -- Add assets to mission. for _,asset in pairs(assets) do @@ -2175,8 +2227,9 @@ function CHIEF:RecruitAssetsForZone(StratZone, MissionType, NassetsMin, NassetsM -- Attach mission to ops zone. -- TODO: Need a better way! - StratZone.missionCAS=mission - + --StratZone.missionARTY=mission + StratZone.opszone:_AddMission(self.coalition,MissionType,mission) + return true end @@ -2187,4 +2240,4 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- From c610c4cba9651a9e93f57a57cdd4128cb1e5ff11 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Sat, 20 Nov 2021 17:08:20 +0100 Subject: [PATCH 11/14] Update Chief.lua Added some improvements to threat calculation --- Moose Development/Moose/Ops/Chief.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Ops/Chief.lua b/Moose Development/Moose/Ops/Chief.lua index 9fd69ae8d..b74b5f13f 100644 --- a/Moose Development/Moose/Ops/Chief.lua +++ b/Moose Development/Moose/Ops/Chief.lua @@ -180,7 +180,7 @@ CHIEF.Strategy = { --- CHIEF class version. -- @field #string version -CHIEF.version="0.0.1" +CHIEF.version="0.0.2" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -1558,12 +1558,18 @@ function CHIEF:CheckTargetQueue() -- * target threatlevel -- * how many assets are still in stock -- * is it inside of our border + -- * add damping factor + local NassetsMin=1 local NassetsMax=1 - if target.threatlevel0>=8 then + local threat = target.threatlevel0 / target.N0 -- avg threatlevel + local NoUnits = target.N0 -- no of units in here + + --if target.threatlevel0>=8 then + if threat>=8 and NoUnits >=10 then NassetsMax=3 - elseif target.threatlevel0>=5 then + elseif threat>=5 then NassetsMax=2 else NassetsMax=1 @@ -1932,8 +1938,8 @@ function CHIEF:_GetMissionPerformanceFromTarget(Target) -- EWR - --table.insert(missionperf, self:_CreateMissionPerformance(AUFTRAG.Type.SEAD, 100)) - table.insert(missionperf, self:_CreateMissionPerformance(AUFTRAG.Type.BAI, 100)) + table.insert(missionperf, self:_CreateMissionPerformance(AUFTRAG.Type.SEAD, 100)) + --table.insert(missionperf, self:_CreateMissionPerformance(AUFTRAG.Type.BAI, 100)) elseif attribute==GROUP.Attribute.GROUND_AAA then From aa3967d88fba41677ab74c59c71b80d8d8812f5e Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Sat, 20 Nov 2021 17:09:55 +0100 Subject: [PATCH 12/14] Update ArmyGroup.lua Added code to obey routing on roads --- Moose Development/Moose/Ops/ArmyGroup.lua | 67 +++++++++++++++-------- 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/Moose Development/Moose/Ops/ArmyGroup.lua b/Moose Development/Moose/Ops/ArmyGroup.lua index 9bdfb59a0..32553dcb7 100644 --- a/Moose Development/Moose/Ops/ArmyGroup.lua +++ b/Moose Development/Moose/Ops/ArmyGroup.lua @@ -65,7 +65,7 @@ ARMYGROUP = { --- Army Group version. -- @field #string version -ARMYGROUP.version="0.7.0" +ARMYGROUP.version="0.7.1" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -679,7 +679,7 @@ function ARMYGROUP:Status() -- Info text. local text=string.format("%s [ROE-AS=%d-%d T/M=%d/%d]: Wp=%d/%d-->%d (final %s), Life=%.1f, Speed=%.1f (%d), Heading=%03d, Ammo=%d, Cargo=%.1f", fsmstate, roe, alarm, nTaskTot, nMissions, self.currentwp, #self.waypoints, self:GetWaypointIndexNext(), tostring(self.passedfinalwp), self.life or 0, speed, speedEx, self.heading or 0, ammo.Total, cargo) - self:I(self.lid..text) + self:T(self.lid..text) end @@ -720,7 +720,7 @@ function ARMYGROUP:Status() if #self.elements==0 then text=text.." none!" end - self:I(self.lid..text) + self:T(self.lid..text) end --- @@ -732,7 +732,7 @@ function ARMYGROUP:Status() -- If we found a group, we engage it. if targetgroup then - self:I(self.lid..string.format("Engaging target group %s at distance %d meters", targetgroup:GetName(), targetdist)) + self:T(self.lid..string.format("Engaging target group %s at distance %d meters", targetgroup:GetName(), targetdist)) self:EngageTarget(targetgroup) end @@ -925,13 +925,13 @@ function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, N, Speed, Formation) -- Next waypoint. local wp=UTILS.DeepCopy(self.waypoints[i]) --Ops.OpsGroup#OPSGROUP.Waypoint - + self:T({wp}) -- Speed. if Speed then wp.speed=UTILS.KnotsToMps(Speed) else - -- Take default waypoint speed. But make sure speed>0 if patrol ad infinitum. - if wp.speed<0.1 then --self.adinfinitum and + -- Take default waypoint speed. But make sure speed>0 if patrol ad infinitum. + if wp.speed<0.1 then --self.adinfinitum and wp.speed=UTILS.KmphToMps(self.speedCruise) end end @@ -951,7 +951,7 @@ function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, N, Speed, Formation) -- Add "On Road" waypoint in between. local wproad=wp.roadcoord:WaypointGround(UTILS.MpsToKmph(wp.speed), ENUMS.Formation.Vehicle.OnRoad) --Ops.OpsGroup#OPSGROUP.Waypoint - + -- Insert road waypoint. table.insert(waypoints, wproad) end @@ -972,21 +972,32 @@ function ARMYGROUP:onafterUpdateRoute(From, Event, To, n, N, Speed, Formation) -- Current set speed in m/s. self.speedWp=wp.speed - local formation0=wp.action==ENUMS.Formation.Vehicle.OnRoad and ENUMS.Formation.Vehicle.OffRoad or wp.action + local formation0=wp.action==ENUMS.Formation.Vehicle.OnRoad and ENUMS.Formation.Vehicle.OnRoad or wp.action -- Current point. local current=self:GetCoordinate():WaypointGround(UTILS.MpsToKmph(self.speedWp), formation0) table.insert(waypoints, 1, current) -- Insert a point on road. - if wp.action==ENUMS.Formation.Vehicle.OnRoad then - local current=self:GetClosestRoad():WaypointGround(UTILS.MpsToKmph(self.speedWp), ENUMS.Formation.Vehicle.OnRoad) - table.insert(waypoints, 2, current) + if wp.action==ENUMS.Formation.Vehicle.OnRoad and (wp.coordinate or wp.roadcoord) then + --local current=self:GetClosestRoad():WaypointGround(UTILS.MpsToKmph(self.speedWp), ENUMS.Formation.Vehicle.OnRoad) + local wptable,length,valid=self:GetCoordinate():GetPathOnRoad(wp.coordinate or wp.roadcoord,true,false,false,false) or {} + local count = 2 + if valid then + for _,_coord in ipairs(wptable) do + local current = _coord:WaypointGround(UTILS.MpsToKmph(self.speedWp), ENUMS.Formation.Vehicle.OnRoad) + table.insert(waypoints, count, current) + count=count+1 + end + else + current=self:GetClosestRoad():WaypointGround(UTILS.MpsToKmph(self.speedWp), ENUMS.Formation.Vehicle.OnRoad) + table.insert(waypoints, count, current) + end end - -- Debug output. if self.verbose>=10 then + --if true then for i,_wp in pairs(waypoints) do local wp=_wp --Ops.OpsGroup#OPSGROUP.Waypoint local text=string.format("WP #%d UID=%d type=%s: Speed=%d m/s, alt=%d m, Action=%s", i, wp.uid and wp.uid or -1, wp.type, wp.speed, wp.alt, wp.action) @@ -1083,14 +1094,14 @@ end -- @param #string Event Event. -- @param #string To To state. function ARMYGROUP:onafterOutOfAmmo(From, Event, To) - self:I(self.lid..string.format("Group is out of ammo at t=%.3f", timer.getTime())) + self:T(self.lid..string.format("Group is out of ammo at t=%.3f", timer.getTime())) -- Get current task. local task=self:GetTaskCurrent() if task then if task.dcstask.id=="FireAtPoint" or task.dcstask.id==AUFTRAG.SpecialTask.BARRAGE then - self:I(self.lid..string.format("Cancelling current %s task because out of ammo!", task.dcstask.id)) + self:T(self.lid..string.format("Cancelling current %s task because out of ammo!", task.dcstask.id)) self:TaskCancel(task) end end @@ -1169,7 +1180,7 @@ end function ARMYGROUP:onafterRearm(From, Event, To, Coordinate, Formation) -- Debug info. - self:I(self.lid..string.format("Group send to rearm")) + self:T(self.lid..string.format("Group send to rearm")) -- ID of current waypoint. local uid=self:GetWaypointCurrent().uid @@ -1188,7 +1199,7 @@ end -- @param #string Event Event. -- @param #string To To state. function ARMYGROUP:onafterRearmed(From, Event, To) - self:I(self.lid.."Group rearmed") + self:T(self.lid.."Group rearmed") -- Check group done. self:_CheckGroupDone(1) @@ -1216,7 +1227,7 @@ function ARMYGROUP:onafterRTZ(From, Event, To, Zone, Formation) else -- Debug info. - self:I(self.lid..string.format("RTZ to Zone %s", zone:GetName())) + self:T(self.lid..string.format("RTZ to Zone %s", zone:GetName())) local Coordinate=zone:GetRandomCoordinate() @@ -1552,11 +1563,11 @@ end -- @param Core.Point#COORDINATE Coordinate The coordinate of the waypoint. -- @param #number Speed Speed in knots. Default is default cruise speed or 70% of max speed. -- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint. --- @param #number Formation Formation the group will use. +-- @param #string Formation Formation the group will use. -- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call. -- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table. function ARMYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Formation, Updateroute) - + self:T(self.lid..string.format("AddWaypoint Formation = %s",tostring(Formation) or "none")) -- Create coordinate. local coordinate=self:_CoordinateFromObject(Coordinate) @@ -1565,8 +1576,20 @@ function ARMYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Formation -- Speed in knots. Speed=Speed or self:GetSpeedCruise() - - -- Create a Naval waypoint. + + -- Formation + + if not Formation then + if self.formationPerma then + Formation = self.formationPerma + elseif self.option.Formation then + Formation = self.option.Formation + else + Formation = "On Road" + end + end + + -- Create a Ground waypoint. local wp=coordinate:WaypointGround(UTILS.KnotsToKmph(Speed), Formation) -- Create waypoint data table. From a1426c3e8121196a77481005c6f4e33bd035882b Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Sat, 20 Nov 2021 17:12:33 +0100 Subject: [PATCH 13/14] Update OpsZone.lua --- Moose Development/Moose/Ops/OpsZone.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Moose Development/Moose/Ops/OpsZone.lua b/Moose Development/Moose/Ops/OpsZone.lua index 5674c6467..e802a0f87 100644 --- a/Moose Development/Moose/Ops/OpsZone.lua +++ b/Moose Development/Moose/Ops/OpsZone.lua @@ -1232,6 +1232,7 @@ end function OPSZONE:_GetMissions() return self.Missions end + --- Add an entry to the OpsZone mission table -- @param #OPSZONE self -- @param #number Coalition Coalition of type e.g. coalition.side.NEUTRAL @@ -1266,6 +1267,8 @@ function OPSZONE:_CleanMissionTable() self.Missions = missions return self end + + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- From b41b8f251fc6d7fa2afc673131bafefb5d1c36d7 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Sat, 20 Nov 2021 17:26:42 +0100 Subject: [PATCH 14/14] Update Chief.lua --- Moose Development/Moose/Ops/Chief.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Moose Development/Moose/Ops/Chief.lua b/Moose Development/Moose/Ops/Chief.lua index b74b5f13f..c6997e083 100644 --- a/Moose Development/Moose/Ops/Chief.lua +++ b/Moose Development/Moose/Ops/Chief.lua @@ -1770,6 +1770,7 @@ function CHIEF:CheckOpsZoneQueue() -- Has a CAS mission? --local hasMissionCAS=stratzone.missionCAS and stratzone.missionCAS:IsNotOver() or false local hasMissionCAS, CASMissions = stratzone.opszone:_FindMissions(self.coalition,AUFTRAG.Type.CAS) + local hasMissionARTY, ARTYMissions = stratzone.opszone:_FindMissions(self.coalition,AUFTRAG.Type.ARTY) if ownercoalition==self.coalition and stratzone.opszone:IsEmpty() and hasMissionCAS then -- Cancel CAS mission if zone is ours and no enemies are present. @@ -1780,6 +1781,14 @@ function CHIEF:CheckOpsZoneQueue() end end + if ownercoalition==self.coalition and hasMissionARTY then + -- Cancel CAS mission if zone is ours and no enemies are present. + -- TODO: Might want to check if we still have ARTY capable assets in stock?! + --stratzone.missionCAS:Cancel() + for _,_auftrag in pairs(ARTYMissions) do + _auftrag:Cancel() + end + end end