Merge pull request #502 from FlightControl-Master/344-AI-Bomb-Zone

Attack map object added
This commit is contained in:
Sven Van de Velde 2017-05-09 21:38:01 +02:00 committed by GitHub
commit 172696c3a5
13 changed files with 323 additions and 125 deletions

View File

@ -146,6 +146,18 @@
-- * **@{#AI_BAI_ZONE.Destroyed}**: The AI has destroyed all target @{Unit}s assigned in the BOMB task. -- * **@{#AI_BAI_ZONE.Destroyed}**: The AI has destroyed all target @{Unit}s assigned in the BOMB task.
-- * **Status**: The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB. -- * **Status**: The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
-- --
-- ## 3. Modify the Engage Zone behaviour to pinpoint a **map object** or **scenery object**
--
-- Use the method @{#AI_BAI_ZONE.SearchOff}() to specify that the EngageZone is not to be searched for potential targets (UNITs), but that the center of the zone
-- is the point where a map object is to be destroyed (like a bridge).
--
-- Example:
--
-- -- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location.
-- AIBAIZone:SearchOff()
--
-- Searching can be switched back on with the method @{#AI_BAI_ZONE.SearchOn}(). Use the method @{#AI_BAI_ZONE.SearchOnOff}() to flexibily switch searching on or off.
--
-- === -- ===
-- --
-- @field #AI_BAI_ZONE -- @field #AI_BAI_ZONE
@ -174,6 +186,7 @@ function AI_BAI_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude
self.Accomplished = false self.Accomplished = false
self:SetDetectionZone( self.EngageZone ) self:SetDetectionZone( self.EngageZone )
self:SearchOn()
self:AddTransition( { "Patrolling", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_BAI_ZONE. self:AddTransition( { "Patrolling", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_BAI_ZONE.
@ -369,6 +382,38 @@ function AI_BAI_ZONE:SetEngageZone( EngageZone )
end end
--- Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.
-- AI_BAI_ZONE will search for potential targets by default.
-- @param #AI_BAI_ZONE self
-- @return #AI_BAI_ZONE
function AI_BAI_ZONE:SearchOnOff( Search )
self.Search = Search
return self
end
--- If Search is Off, the current zone coordinate will be the center of the bombing.
-- @param #AI_BAI_ZONE self
-- @return #AI_BAI_ZONE
function AI_BAI_ZONE:SearchOff()
self:SearchOnOff( false )
return self
end
--- If Search is On, BAI will search for potential targets in the zone.
-- @param #AI_BAI_ZONE self
-- @return #AI_BAI_ZONE
function AI_BAI_ZONE:SearchOn()
self:SearchOnOff( true )
return self
end
--- onafter State Transition for Event Start. --- onafter State Transition for Event Start.
-- @param #AI_BAI_ZONE self -- @param #AI_BAI_ZONE self
@ -412,26 +457,41 @@ end
-- @param #string Event The Event string. -- @param #string Event The Event string.
-- @param #string To The To State string. -- @param #string To The To State string.
function AI_BAI_ZONE:onafterTarget( Controllable, From, Event, To ) function AI_BAI_ZONE:onafterTarget( Controllable, From, Event, To )
self:E("onafterTarget") self:F({"onafterTarget",self.Search,Controllable:IsAlive()})
if Controllable:IsAlive() then if Controllable:IsAlive() then
local AttackTasks = {} local AttackTasks = {}
for DetectedUnit, Detected in pairs( self.DetectedUnits ) do if self.Search == true then
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT for DetectedUnit, Detected in pairs( self.DetectedUnits ) do
if DetectedUnit:IsAlive() then local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
if DetectedUnit:IsInZone( self.EngageZone ) then if DetectedUnit:IsAlive() then
if Detected == true then if DetectedUnit:IsInZone( self.EngageZone ) then
self:E( {"Target: ", DetectedUnit } ) if Detected == true then
self.DetectedUnits[DetectedUnit] = false self:F( {"Target: ", DetectedUnit } )
local AttackTask = Controllable:TaskAttackUnit( DetectedUnit, false, self.EngageWeaponExpend, self.EngageAttackQty, self.EngageDirection, self.EngageAltitude, nil ) self.DetectedUnits[DetectedUnit] = false
self.Controllable:PushTask( AttackTask, 1 ) local AttackTask = Controllable:TaskAttackUnit( DetectedUnit, false, self.EngageWeaponExpend, self.EngageAttackQty, self.EngageDirection, self.EngageAltitude, nil )
self.Controllable:PushTask( AttackTask, 1 )
end
end end
else
self.DetectedUnits[DetectedUnit] = nil
end end
else
self.DetectedUnits[DetectedUnit] = nil
end end
else
self:F("Attack zone")
local AttackTask = Controllable:TaskAttackMapObject(
self.EngageZone:GetPointVec2():GetVec2(),
true,
self.EngageWeaponExpend,
self.EngageAttackQty,
self.EngageDirection,
self.EngageAltitude
)
self.Controllable:PushTask( AttackTask, 1 )
end end
self:__Target( -10 ) self:__Target( -10 )
@ -466,6 +526,7 @@ function AI_BAI_ZONE:onafterEngage( Controllable, From, Event, To,
EngageWeaponExpend, EngageWeaponExpend,
EngageAttackQty, EngageAttackQty,
EngageDirection ) EngageDirection )
self:F("onafterEngage") self:F("onafterEngage")
self.EngageSpeed = EngageSpeed or 400 self.EngageSpeed = EngageSpeed or 400
@ -496,27 +557,41 @@ function AI_BAI_ZONE:onafterEngage( Controllable, From, Event, To,
EngageRoute[#EngageRoute+1] = CurrentRoutePoint EngageRoute[#EngageRoute+1] = CurrentRoutePoint
local AttackTasks = {} local AttackTasks = {}
for DetectedUnitID, DetectedUnitData in pairs( self.DetectedUnits ) do if self.Search == true then
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
self:T( DetectedUnit ) for DetectedUnitID, DetectedUnitData in pairs( self.DetectedUnits ) do
if DetectedUnit:IsAlive() then local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
if DetectedUnit:IsInZone( self.EngageZone ) then self:T( DetectedUnit )
self:E( {"Engaging ", DetectedUnit } ) if DetectedUnit:IsAlive() then
AttackTasks[#AttackTasks+1] = Controllable:TaskBombing( if DetectedUnit:IsInZone( self.EngageZone ) then
DetectedUnit:GetPointVec2():GetVec2(), self:F( {"Engaging ", DetectedUnit } )
true, AttackTasks[#AttackTasks+1] = Controllable:TaskBombing(
EngageWeaponExpend, DetectedUnit:GetPointVec2():GetVec2(),
EngageAttackQty, true,
EngageDirection EngageWeaponExpend,
) EngageAttackQty,
EngageDirection,
EngageAltitude
)
end
else
self.DetectedUnits[DetectedUnit] = nil
end end
else
self.DetectedUnits[DetectedUnit] = nil
end end
else
self:F("Attack zone")
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackMapObject(
self.EngageZone:GetPointVec2():GetVec2(),
true,
EngageWeaponExpend,
EngageAttackQty,
EngageDirection,
EngageAltitude
)
end end
EngageRoute[1].task = Controllable:TaskCombo( AttackTasks ) EngageRoute[#EngageRoute].task = Controllable:TaskCombo( AttackTasks )
--- Define a random point in the @{Zone}. The AI will fly to that point within the zone. --- Define a random point in the @{Zone}. The AI will fly to that point within the zone.
@ -538,6 +613,9 @@ function AI_BAI_ZONE:onafterEngage( Controllable, From, Event, To,
EngageRoute[#EngageRoute+1] = ToTargetRoutePoint EngageRoute[#EngageRoute+1] = ToTargetRoutePoint
Controllable:OptionROEOpenFire()
Controllable:OptionROTVertical()
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable... --- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
Controllable:WayPointInitialize( EngageRoute ) Controllable:WayPointInitialize( EngageRoute )
@ -549,9 +627,6 @@ function AI_BAI_ZONE:onafterEngage( Controllable, From, Event, To,
--- NOW ROUTE THE GROUP! --- NOW ROUTE THE GROUP!
Controllable:WayPointExecute( 1 ) Controllable:WayPointExecute( 1 )
Controllable:OptionROEOpenFire()
Controllable:OptionROTVertical()
self:SetDetectionInterval( 2 ) self:SetDetectionInterval( 2 )
self:SetDetectionActivated() self:SetDetectionActivated()
self:__Target( -2 ) -- Start Targetting self:__Target( -2 ) -- Start Targetting

View File

@ -585,37 +585,29 @@ end
--- (AIR) Delivering weapon at the point on the ground. --- (AIR) Delivering weapon at the point on the ground.
-- @param #CONTROLLABLE self -- @param #CONTROLLABLE self
-- @param Dcs.DCSTypes#Vec2 Vec2 2D-coordinates of the point to deliver weapon at. -- @param Dcs.DCSTypes#Vec2 Vec2 2D-coordinates of the point to deliver weapon at.
-- @param #boolean GroupAttack (optional) Flag indicates that the target must be engaged by all aircrafts of the group. Has effect only if the task is assigned to a group, not to a single aircraft. -- @param #boolean GroupAttack (optional) If true, all units in the group will attack the Unit when found.
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion. -- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
-- @param #number AttackQty (optional) Desired quantity of passes. The parameter is not the same in AttackGroup and AttackUnit tasks. -- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction. -- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage. -- @param #number Altitude (optional) The altitude from where to attack.
-- @param #number WeaponType (optional) The WeaponType.
-- @return Dcs.DCSTasking.Task#Task The DCS task structure. -- @return Dcs.DCSTasking.Task#Task The DCS task structure.
function CONTROLLABLE:TaskBombing( Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, WeaponType ) function CONTROLLABLE:TaskBombing( Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType )
self:F2( { self.ControllableName, Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, WeaponType } ) self:F2( { self.ControllableName, Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType } )
-- Bombing = {
-- id = 'Bombing',
-- params = {
-- point = Vec2,
-- weaponType = number,
-- expend = enum AI.Task.WeaponExpend,
-- attackQty = number,
-- direction = Azimuth,
-- controllableAttack = boolean,
-- }
-- }
local DCSTask local DCSTask
DCSTask = { DCSTask = {
id = 'Bombing', id = 'Bombing',
params = { params = {
point = Vec2, point = Vec2,
groupAttack = GroupAttack, groupAttack = GroupAttack or false,
expend = WeaponExpend or "Auto", expend = WeaponExpend or "Auto",
attackQtyLimit = AttackQty and true or false,
attackQty = AttackQty, attackQty = AttackQty,
directionEnabled = Direction and true or false, directionEnabled = Direction and true or false,
direction = Direction, direction = Direction,
altitudeEnabled = Altitude and true or false,
altitude = Altitude or 30,
weaponType = WeaponType, weaponType = WeaponType,
}, },
}, },
@ -624,6 +616,41 @@ function CONTROLLABLE:TaskBombing( Vec2, GroupAttack, WeaponExpend, AttackQty, D
return DCSTask return DCSTask
end end
--- (AIR) Attacking the map object (building, structure, e.t.c).
-- @param #CONTROLLABLE self
-- @param Dcs.DCSTypes#Vec2 Vec2 2D-coordinates of the point to deliver weapon at.
-- @param #boolean GroupAttack (optional) If true, all units in the group will attack the Unit when found.
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
-- @param #number Altitude (optional) The altitude from where to attack.
-- @param #number WeaponType (optional) The WeaponType.
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
function CONTROLLABLE:TaskAttackMapObject( Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType )
self:F2( { self.ControllableName, Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType } )
local DCSTask
DCSTask = {
id = 'AttackMapObject',
params = {
point = Vec2,
groupAttack = GroupAttack or false,
expend = WeaponExpend or "Auto",
attackQtyLimit = AttackQty and true or false,
attackQty = AttackQty,
directionEnabled = Direction and true or false,
direction = Direction,
altitudeEnabled = Altitude and true or false,
altitude = Altitude or 30,
weaponType = WeaponType,
},
},
self:T3( { DCSTask } )
return DCSTask
end
--- (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed. --- (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
-- @param #CONTROLLABLE self -- @param #CONTROLLABLE self
-- @param Dcs.DCSTypes#Vec2 Point The point to hold the position. -- @param Dcs.DCSTypes#Vec2 Point The point to hold the position.
@ -702,45 +729,6 @@ end
--- (AIR) Attacking the map object (building, structure, e.t.c).
-- @param #CONTROLLABLE self
-- @param Dcs.DCSTypes#Vec2 Vec2 2D-coordinates of the point the map object is closest to. The distance between the point and the map object must not be greater than 2000 meters. Object id is not used here because Mission Editor doesn't support map object identificators.
-- @param #number WeaponType (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.
-- @param Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.
-- @param #number AttackQty (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.
-- @param Dcs.DCSTypes#Azimuth Direction (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.
-- @param #boolean ControllableAttack (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
function CONTROLLABLE:TaskAttackMapObject( Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack )
self:F2( { self.ControllableName, Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack } )
-- AttackMapObject = {
-- id = 'AttackMapObject',
-- params = {
-- point = Vec2,
-- weaponType = number,
-- expend = enum AI.Task.WeaponExpend,
-- attackQty = number,
-- direction = Azimuth,
-- controllableAttack = boolean,
-- }
-- }
local DCSTask
DCSTask = { id = 'AttackMapObject',
params = {
point = Vec2,
weaponType = WeaponType,
expend = WeaponExpend,
attackQty = AttackQty,
direction = Direction,
controllableAttack = ControllableAttack,
},
},
self:T3( { DCSTask } )
return DCSTask
end
--- (AIR) Delivering weapon on the runway. --- (AIR) Delivering weapon on the runway.

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' ) env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170509_1415' ) env.info( 'Moose Generation Timestamp: 20170509_2025' )
local base = _G local base = _G

View File

@ -96,7 +96,7 @@
<div id="content"> <div id="content">
<h1>Module <code>AI_BAI</code></h1> <h1>Module <code>AI_BAI</code></h1>
<p><strong>AI</strong> -- <strong>Provide Battleground Air Interdiction (bombing).</strong></p> <p><strong>AI</strong> -- <strong>Provide Battlefield Air Interdiction (bombing).</strong></p>
<p><img src="..\Presentations\AI_BAI\Dia1.JPG" alt="Banner Image"/></p> <p><img src="..\Presentations\AI_BAI\Dia1.JPG" alt="Banner Image"/></p>
@ -339,6 +339,30 @@
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnLeaveEngaging">AI_BAI_ZONE:OnLeaveEngaging(Controllable, From, Event, To)</a></td> <td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnLeaveEngaging">AI_BAI_ZONE:OnLeaveEngaging(Controllable, From, Event, To)</a></td>
<td class="summary"> <td class="summary">
<p>OnLeave Transition Handler for State Engaging.</p> <p>OnLeave Transition Handler for State Engaging.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).Search">AI_BAI_ZONE.Search</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).SearchOff">AI_BAI_ZONE:SearchOff()</a></td>
<td class="summary">
<p>If Search is Off, the current zone coordinate will be the center of the bombing.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).SearchOn">AI_BAI_ZONE:SearchOn()</a></td>
<td class="summary">
<p>If Search is On, BAI will search for potential targets in the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).SearchOnOff">AI_BAI_ZONE:SearchOnOff(Search)</a></td>
<td class="summary">
<p>Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -489,7 +513,7 @@ Any target that is detected in the Engage Zone will be reported and will be dest
<p><img src="..\Presentations\AI_BAI\Dia10.JPG" alt="Engage Event"/></p> <p><img src="..\Presentations\AI_BAI\Dia10.JPG" alt="Engage Event"/></p>
<p>When the AI has accomplished the BOMB, it will fly back to the Patrol Zone.</p> <p>When the AI has accomplished the Bombing, it will fly back to the Patrol Zone.</p>
<p><img src="..\Presentations\AI_BAI\Dia11.JPG" alt="Engage Event"/></p> <p><img src="..\Presentations\AI_BAI\Dia11.JPG" alt="Engage Event"/></p>
@ -534,6 +558,19 @@ It can be notified to go RTB through the <strong>RTB</strong> event.</p>
<li><strong>Status</strong>: The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.</li> <li><strong>Status</strong>: The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.</li>
</ul> </ul>
<h2>3. Modify the Engage Zone behaviour to pinpoint a <strong>map object</strong> or <strong>scenery object</strong></h2>
<p>Use the method <a href="##(AI_BAI_ZONE).SearchOff">AI<em>BAI</em>ZONE.SearchOff</a>() to specify that the EngageZone is not to be searched for potential targets (units), but that the center of the zone
is the point where a map object is to be destroyed (like a bridge).</p>
<p>Example:</p>
<pre><code> -- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location.
AIBAIZone:SearchOff()
</code></pre>
<p>Searching can be switched back on with the method <a href="##(AI_BAI_ZONE).SearchOn">AI<em>BAI</em>ZONE.SearchOn</a>(). Use the method <a href="##(AI_BAI_ZONE).SearchOnOff">AI<em>BAI</em>ZONE.SearchOnOff</a>() to flexibily switch searching on or off.</p>
<hr/> <hr/>
@ -1364,6 +1401,85 @@ The To State string.</p>
<p><em>#boolean:</em> <p><em>#boolean:</em>
Return false to cancel Transition.</p> Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_BAI_ZONE).Search" >
<strong>AI_BAI_ZONE.Search</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).SearchOff" >
<strong>AI_BAI_ZONE:SearchOff()</strong>
</a>
</dt>
<dd>
<p>If Search is Off, the current zone coordinate will be the center of the bombing.</p>
<h3>Return value</h3>
<p><em><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).SearchOn" >
<strong>AI_BAI_ZONE:SearchOn()</strong>
</a>
</dt>
<dd>
<p>If Search is On, BAI will search for potential targets in the zone.</p>
<h3>Return value</h3>
<p><em><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).SearchOnOff" >
<strong>AI_BAI_ZONE:SearchOnOff(Search)</strong>
</a>
</dt>
<dd>
<p>Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.</p>
<p>AI<em>BAI</em>ZONE will search for potential targets by default.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> Search </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>:</em></p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">

View File

@ -539,7 +539,7 @@ This is different from the EnRoute tasks, where the targets of the task need to
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskAttackMapObject">CONTROLLABLE:TaskAttackMapObject(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack)</a></td> <td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskAttackMapObject">CONTROLLABLE:TaskAttackMapObject(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType)</a></td>
<td class="summary"> <td class="summary">
<p>(AIR) Attacking the map object (building, structure, e.t.c).</p> <p>(AIR) Attacking the map object (building, structure, e.t.c).</p>
</td> </td>
@ -551,7 +551,7 @@ This is different from the EnRoute tasks, where the targets of the task need to
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskBombing">CONTROLLABLE:TaskBombing(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, WeaponType)</a></td> <td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskBombing">CONTROLLABLE:TaskBombing(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType)</a></td>
<td class="summary"> <td class="summary">
<p>(AIR) Delivering weapon at the point on the ground. </p> <p>(AIR) Delivering weapon at the point on the ground. </p>
</td> </td>
@ -2095,7 +2095,7 @@ The DCS task structure.</p>
<dt> <dt>
<a id="#(CONTROLLABLE).TaskAttackMapObject" > <a id="#(CONTROLLABLE).TaskAttackMapObject" >
<strong>CONTROLLABLE:TaskAttackMapObject(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack)</strong> <strong>CONTROLLABLE:TaskAttackMapObject(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType)</strong>
</a> </a>
</dt> </dt>
<dd> <dd>
@ -2107,13 +2107,13 @@ The DCS task structure.</p>
<li> <li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec2)">Dcs.DCSTypes#Vec2</a> Vec2 </em></code>: <p><code><em><a href="Dcs.DCSTypes.html##(Vec2)">Dcs.DCSTypes#Vec2</a> Vec2 </em></code>:
2D-coordinates of the point the map object is closest to. The distance between the point and the map object must not be greater than 2000 meters. Object id is not used here because Mission Editor doesn't support map object identificators.</p> 2D-coordinates of the point to deliver weapon at.</p>
</li> </li>
<li> <li>
<p><code><em>#number WeaponType </em></code>: <p><code><em>#boolean GroupAttack </em></code>:
(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.</p> (optional) If true, all units in the group will attack the Unit when found.</p>
</li> </li>
<li> <li>
@ -2136,8 +2136,14 @@ The DCS task structure.</p>
</li> </li>
<li> <li>
<p><code><em>#boolean ControllableAttack </em></code>: <p><code><em>#number Altitude </em></code>:
(optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.</p> (optional) The altitude from where to attack.</p>
</li>
<li>
<p><code><em>#number WeaponType </em></code>:
(optional) The WeaponType.</p>
</li> </li>
</ul> </ul>
@ -2221,7 +2227,7 @@ The DCS task structure.</p>
<dt> <dt>
<a id="#(CONTROLLABLE).TaskBombing" > <a id="#(CONTROLLABLE).TaskBombing" >
<strong>CONTROLLABLE:TaskBombing(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, WeaponType)</strong> <strong>CONTROLLABLE:TaskBombing(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType)</strong>
</a> </a>
</dt> </dt>
<dd> <dd>
@ -2239,7 +2245,7 @@ The DCS task structure.</p>
<li> <li>
<p><code><em>#boolean GroupAttack </em></code>: <p><code><em>#boolean GroupAttack </em></code>:
(optional) Flag indicates that the target must be engaged by all aircrafts of the group. Has effect only if the task is assigned to a group, not to a single aircraft.</p> (optional) If true, all units in the group will attack the Unit when found.</p>
</li> </li>
<li> <li>
@ -2251,7 +2257,7 @@ The DCS task structure.</p>
<li> <li>
<p><code><em>#number AttackQty </em></code>: <p><code><em>#number AttackQty </em></code>:
(optional) Desired quantity of passes. The parameter is not the same in AttackGroup and AttackUnit tasks. </p> (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.</p>
</li> </li>
<li> <li>
@ -2262,8 +2268,14 @@ The DCS task structure.</p>
</li> </li>
<li> <li>
<p><code><em>#number Altitude </em></code>:
(optional) The altitude from where to attack.</p>
</li>
<li>
<p><code><em>#number WeaponType </em></code>: <p><code><em>#number WeaponType </em></code>:
(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.</p> (optional) The WeaponType.</p>
</li> </li>
</ul> </ul>

View File

@ -1829,6 +1829,7 @@ self</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(DATABASE).UNITS_Position" > <a id="#(DATABASE).UNITS_Position" >
<strong>DATABASE.UNITS_Position</strong> <strong>DATABASE.UNITS_Position</strong>
</a> </a>

View File

@ -891,6 +891,7 @@ function below will use the range 1-7 just in case</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(DESIGNATE).LaserCodes" > <a id="#(DESIGNATE).LaserCodes" >
<strong>DESIGNATE.LaserCodes</strong> <strong>DESIGNATE.LaserCodes</strong>
</a> </a>

View File

@ -2336,7 +2336,6 @@ The index of the DetectedItem.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemMax" > <a id="#(DETECTION_BASE).DetectedItemMax" >
<strong>DETECTION_BASE.DetectedItemMax</strong> <strong>DETECTION_BASE.DetectedItemMax</strong>
</a> </a>

View File

@ -1623,7 +1623,7 @@ A string defining the start state.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em>#string</em>
<a id="#(FSM)._StartState" > <a id="#(FSM)._StartState" >
<strong>FSM._StartState</strong> <strong>FSM._StartState</strong>
</a> </a>
@ -1922,7 +1922,6 @@ A string defining the start state.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(FSM).current" > <a id="#(FSM).current" >
<strong>FSM.current</strong> <strong>FSM.current</strong>
</a> </a>

View File

@ -771,6 +771,12 @@ and any spaces before and after the resulting name are removed.</p>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td> <td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
<td class="summary"> <td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
<td class="summary">
</td> </td>
</tr> </tr>
</table> </table>
@ -2072,9 +2078,6 @@ The group that was spawned. You can use this group for further actions.</p>
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -2528,9 +2531,6 @@ when nothing was spawned.</p>
<p> Overwrite unit names by default with group name.</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -2545,9 +2545,6 @@ when nothing was spawned.</p>
<p> By default, no InitLimit</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -2583,7 +2580,7 @@ when nothing was spawned.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em> <em></em>
<a id="#(SPAWN).SpawnMaxGroups" > <a id="#(SPAWN).SpawnMaxGroups" >
<strong>SPAWN.SpawnMaxGroups</strong> <strong>SPAWN.SpawnMaxGroups</strong>
</a> </a>
@ -2600,7 +2597,7 @@ when nothing was spawned.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em> <em></em>
<a id="#(SPAWN).SpawnMaxUnitsAlive" > <a id="#(SPAWN).SpawnMaxUnitsAlive" >
<strong>SPAWN.SpawnMaxUnitsAlive</strong> <strong>SPAWN.SpawnMaxUnitsAlive</strong>
</a> </a>
@ -2952,7 +2949,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p> <p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
</dd> </dd>
</dl> </dl>
@ -3518,6 +3515,20 @@ True = Continue Scheduler</p>
</li> </li>
</ul> </ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).uncontrolled" >
<strong>SPAWN.uncontrolled</strong>
</a>
</dt>
<dd>
</dd> </dd>
</dl> </dl>

View File

@ -762,7 +762,6 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(SPOT).ScheduleID" > <a id="#(SPOT).ScheduleID" >
<strong>SPOT.ScheduleID</strong> <strong>SPOT.ScheduleID</strong>
</a> </a>
@ -776,7 +775,6 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(SPOT).SpotIR" > <a id="#(SPOT).SpotIR" >
<strong>SPOT.SpotIR</strong> <strong>SPOT.SpotIR</strong>
</a> </a>
@ -790,7 +788,6 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(SPOT).SpotLaser" > <a id="#(SPOT).SpotLaser" >
<strong>SPOT.SpotLaser</strong> <strong>SPOT.SpotLaser</strong>
</a> </a>
@ -804,7 +801,6 @@ true if it is lasing</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(SPOT).Target" > <a id="#(SPOT).Target" >
<strong>SPOT.Target</strong> <strong>SPOT.Target</strong>
</a> </a>

View File

@ -502,7 +502,7 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em><a href="Core.Cargo.html##(CARGO)">Core.Cargo#CARGO</a></em>
<a id="#(FSM_PROCESS).Cargo" > <a id="#(FSM_PROCESS).Cargo" >
<strong>FSM_PROCESS.Cargo</strong> <strong>FSM_PROCESS.Cargo</strong>
</a> </a>

View File

@ -99,7 +99,7 @@
<tr> <tr>
<td class="name" nowrap="nowrap"><a href="AI_BAI.html">AI_BAI</a></td> <td class="name" nowrap="nowrap"><a href="AI_BAI.html">AI_BAI</a></td>
<td class="summary"> <td class="summary">
<p><strong>AI</strong> -- <strong>Provide Battleground Air Interdiction (bombing).</strong></p> <p><strong>AI</strong> -- <strong>Provide Battlefield Air Interdiction (bombing).</strong></p>
<p><img src="..\Presentations\AI_BAI\Dia1.JPG" alt="Banner Image"/></p> <p><img src="..\Presentations\AI_BAI\Dia1.JPG" alt="Banner Image"/></p>