From aca4e4d7caccb4daa48cdef34a50e4193529b721 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Tue, 12 Mar 2024 10:49:06 +0100 Subject: [PATCH 1/3] Update Controllable.lua (#2105) Added setting of AI radio options --- .../Moose/Wrapper/Controllable.lua | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 696cdb15b..46556ef21 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -4116,6 +4116,74 @@ function CONTROLLABLE:SetOptionRadarUsingForContinousSearch() return self end +--- [AIR] Set if the AI is reporting passing of waypoints +-- @param #CONTROLLABLE self +-- @param #boolean OnOff If true or nil, AI will report passing waypoints, if false, it will not. +-- @return #CONTROLLABLE self +function CONTROLLABLE:SetOptionWaypointPassReport(OnOff) + self:F2( { self.ControllableName } ) + local onoff = (OnOff == nil or OnOff == true) and false or true + if self:IsAir() then + self:SetOption(AI.Option.Air.id.PROHIBIT_WP_PASS_REPORT,onoff) + end + return self +end + +--- [AIR] Set the AI to not report anything over the radio - radio silence +-- @param #CONTROLLABLE self +-- @param #boolean OnOff If true or nil, radio is set to silence, if false radio silence is lifted. +-- @return #CONTROLLABLE self +function CONTROLLABLE:SetOptionRadioSilence(OnOff) + local onoff = (OnOff == true or OnOff == nil) and true or false + self:F2( { self.ControllableName } ) + if self:IsAir() then + self:SetOption(AI.Option.Air.id.SILENCE,onoff) + end + return self +end + +--- [AIR] Set the AI to report contact for certain types of objects. +-- @param #CONTROLLABLE self +-- @param #table Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @return #CONTROLLABLE self +function CONTROLLABLE:SetOptionRadioContact(Objects) + self:F2( { self.ControllableName } ) + if not Objects then Objects = {"Air"} end + if type(Objects) ~= "table" then Objects = {Objects} end + if self:IsAir() then + self:SetOption(AI.Option.Air.id.OPTION_RADIO_USAGE_CONTACT,Objects) + end + return self +end + +--- [AIR] Set the AI to report engaging certain types of objects. +-- @param #CONTROLLABLE self +-- @param #table Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @return #CONTROLLABLE self +function CONTROLLABLE:SetOptionRadioEngage(Objects) + self:F2( { self.ControllableName } ) + if not Objects then Objects = {"Air"} end + if type(Objects) ~= "table" then Objects = {Objects} end + if self:IsAir() then + self:SetOption(AI.Option.Air.id.OPTION_RADIO_USAGE_ENGAGE,Objects) + end + return self +end + +--- [AIR] Set the AI to report killing certain types of objects. +-- @param #CONTROLLABLE self +-- @param #table Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @return #CONTROLLABLE self +function CONTROLLABLE:SetOptionRadioKill(Objects) + self:F2( { self.ControllableName } ) + if not Objects then Objects = {"Air"} end + if type(Objects) ~= "table" then Objects = {Objects} end + if self:IsAir() then + self:SetOption(AI.Option.Air.id.OPTION_RADIO_USAGE_KILL,Objects) + end + return self +end + --- (GROUND) Relocate controllable to a random point within a given radius; use e.g.for evasive actions; Note that not all ground controllables can actually drive, also the alarm state of the controllable might stop it from moving. -- @param #CONTROLLABLE self -- @param #number speed Speed of the controllable, default 20 From 3dd069d7d67470afcde7dbe47fd997159858bd83 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:25:33 +0100 Subject: [PATCH 2/3] Update Controllable.lua Docu adjustments --- Moose Development/Moose/Wrapper/Controllable.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 46556ef21..df538f28f 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -4144,7 +4144,7 @@ end --- [AIR] Set the AI to report contact for certain types of objects. -- @param #CONTROLLABLE self --- @param #table Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) -- @return #CONTROLLABLE self function CONTROLLABLE:SetOptionRadioContact(Objects) self:F2( { self.ControllableName } ) @@ -4158,7 +4158,7 @@ end --- [AIR] Set the AI to report engaging certain types of objects. -- @param #CONTROLLABLE self --- @param #table Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) -- @return #CONTROLLABLE self function CONTROLLABLE:SetOptionRadioEngage(Objects) self:F2( { self.ControllableName } ) @@ -4172,7 +4172,7 @@ end --- [AIR] Set the AI to report killing certain types of objects. -- @param #CONTROLLABLE self --- @param #table Table of attribute names for which AI reports contact. Defaults to {"Air"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @param #table Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) -- @return #CONTROLLABLE self function CONTROLLABLE:SetOptionRadioKill(Objects) self:F2( { self.ControllableName } ) From 241b31fcec3b87701816c677183cd356a93d8a4c Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:26:59 +0100 Subject: [PATCH 3/3] Update Controllable.lua --- Moose Development/Moose/Wrapper/Controllable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index df538f28f..2817147e4 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -4172,7 +4172,7 @@ end --- [AIR] Set the AI to report killing certain types of objects. -- @param #CONTROLLABLE self --- @param #table Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) +-- @param #table Objects Table of attribute names for which AI reports contact. Defaults to {"Air"}, see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes) -- @return #CONTROLLABLE self function CONTROLLABLE:SetOptionRadioKill(Objects) self:F2( { self.ControllableName } )