From 62930f39b1476802ff3b0733bfc41627e6588c28 Mon Sep 17 00:00:00 2001 From: entropySG Date: Wed, 18 Jan 2017 19:31:52 +0100 Subject: [PATCH 1/2] Fixed FireAtPoint bug --- Moose Development/Moose/Wrapper/Controllable.lua | 4 ++++ Moose Mission Setup/Moose.lua | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index fd9ec7dec..77f5932c2 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -956,6 +956,8 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius ) -- params = { -- point = Vec2, -- radius = Distance, + -- expendQty = number, + -- expendQtyEnabled = boolean, -- } -- } @@ -964,6 +966,8 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius ) params = { point = Vec2, radius = Radius, + expendQty = 100, -- added both parameters to override the bug the apparent custome value of expendQty = 1 and expendQty = true + expendQtyEnabled = false, -- -- added both parameters to override the bug the apparent custome value of expendQty = 1 and expendQty = true } } diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index e02bdb889..21e0adcad 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -13466,6 +13466,8 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius ) -- params = { -- point = Vec2, -- radius = Distance, + -- expendQty = number, + -- expendQtyEnabled = boolean, -- } -- } @@ -13474,6 +13476,8 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius ) params = { point = Vec2, radius = Radius, + expendQty = 100, -- added both parameters to override the bug the apparent custome value of expendQty = 1 and expendQty = true + expendQtyEnabled = false, -- -- added both parameters to override the bug the apparent custome value of expendQty = 1 and expendQty = true } } From 8eb76e0da2722c4948437f98d6efa5dcd04fe890 Mon Sep 17 00:00:00 2001 From: 132nd-etcher <132nd-etcher@daribouca.net> Date: Thu, 19 Jan 2017 08:19:17 +0100 Subject: [PATCH 2/2] Add optional AmmoCount to CONTROLLABLE:TaskFireAtPoint --- Moose Development/Moose/Wrapper/Controllable.lua | 16 +++++++++++----- Moose Mission Setup/Moose.lua | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 77f5932c2..bc5104782 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -39,7 +39,7 @@ -- * @{#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location. -- * @{#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne controllable. -- * @{#CONTROLLABLE.TaskFAC_AttackControllable}: (AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction. --- * @{#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished. +-- * @{#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire some or all ammunition at a VEC2 point. -- * @{#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne controllable. -- * @{#CONTROLLABLE.TaskHold}: (GROUND) Hold ground controllable from moving. -- * @{#CONTROLLABLE.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the controllable. @@ -947,9 +947,10 @@ end -- @param #CONTROLLABLE self -- @param Dcs.DCSTypes#Vec2 Vec2 The point to fire at. -- @param Dcs.DCSTypes#Distance Radius The radius of the zone to deploy the fire at. +-- @param #number AmmoCount (optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted). -- @return Dcs.DCSTasking.Task#Task The DCS task structure. -function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius ) - self:F2( { self.ControllableName, Vec2, Radius } ) +function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount ) + self:F2( { self.ControllableName, Vec2, Radius, AmmoCount } ) -- FireAtPoint = { -- id = 'FireAtPoint', @@ -966,10 +967,15 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius ) params = { point = Vec2, radius = Radius, - expendQty = 100, -- added both parameters to override the bug the apparent custome value of expendQty = 1 and expendQty = true - expendQtyEnabled = false, -- -- added both parameters to override the bug the apparent custome value of expendQty = 1 and expendQty = true + expendQty = 100, -- dummy value + expendQtyEnabled = false, } } + + if AmmoCount then + DCSTask.params.expendQty = AmmoCount + DCSTask.params.expendQtyEnabled = true + end self:T3( { DCSTask } ) return DCSTask diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 21e0adcad..c3a487230 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -12549,7 +12549,7 @@ end -- * @{#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location. -- * @{#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne controllable. -- * @{#CONTROLLABLE.TaskFAC_AttackControllable}: (AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction. --- * @{#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished. +-- * @{#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire some or all ammunition at a VEC2 point. -- * @{#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne controllable. -- * @{#CONTROLLABLE.TaskHold}: (GROUND) Hold ground controllable from moving. -- * @{#CONTROLLABLE.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the controllable. @@ -13457,9 +13457,10 @@ end -- @param #CONTROLLABLE self -- @param Dcs.DCSTypes#Vec2 Vec2 The point to fire at. -- @param Dcs.DCSTypes#Distance Radius The radius of the zone to deploy the fire at. +-- @param #number AmmoCount (optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted). -- @return Dcs.DCSTasking.Task#Task The DCS task structure. -function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius ) - self:F2( { self.ControllableName, Vec2, Radius } ) +function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount ) + self:F2( { self.ControllableName, Vec2, Radius, AmmoCount } ) -- FireAtPoint = { -- id = 'FireAtPoint', @@ -13476,10 +13477,15 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius ) params = { point = Vec2, radius = Radius, - expendQty = 100, -- added both parameters to override the bug the apparent custome value of expendQty = 1 and expendQty = true - expendQtyEnabled = false, -- -- added both parameters to override the bug the apparent custome value of expendQty = 1 and expendQty = true + expendQty = 100, -- dummy value + expendQtyEnabled = false, } } + + if AmmoCount then + DCSTask.params.expendQty = AmmoCount + DCSTask.params.expendQtyEnabled = true + end self:T3( { DCSTask } ) return DCSTask