mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #195 from FlightControl-Master/FlightControl
-- AI_PATROL_ZONE rename -- AI_CAS_ZONE new class -- AI_CAP_ZONE new class -- documentation -- test missions -- presentations -- fixed errors in AI_PATROL_ZONE -- Fixed AI returning too early back to base -- When AI is respawned, the FSM is reset.
This commit is contained in:
commit
9c81380b50
@ -1,10 +1,9 @@
|
||||
--- SP:N MP:Y AI:Y HU:N TYP:A -- This module contains the AI_BALANCER class. AI Balancing will replace in multi player missions
|
||||
--- Single-Player:**No** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**All** -- **AI Balancing will replace in multi player missions
|
||||
-- non-occupied human slots with AI groups, in order to provide an engaging simulation environment,
|
||||
-- even when there are hardly any players in the mission.
|
||||
-- even when there are hardly any players in the mission.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Examples can be found in the test missions.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@ -73,6 +72,8 @@
|
||||
--
|
||||
-- Hereby the change log:
|
||||
--
|
||||
-- 2017-01-17: There is still a problem with AI being destroyed, but not respawned. Need to check further upon that.
|
||||
--
|
||||
-- 2017-01-08: AI_BALANCER:**InitSpawnInterval( Earliest, Latest )** added.
|
||||
--
|
||||
-- ===
|
||||
@ -82,7 +83,6 @@
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- * **[Dutch_Baron](https://forums.eagle.ru/member.php?u=112075)**: Working together with James has resulted in the creation of the AI_BALANCER class. James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)
|
||||
--
|
||||
-- * **SNAFU**: Had a couple of mails with the guys to validate, if the same concept in the GCI/CAP script could be reworked within MOOSE. None of the script code has been used however within the new AI_BALANCER moose class.
|
||||
--
|
||||
-- ### Authors:
|
||||
@ -231,16 +231,15 @@ end
|
||||
--- @param #AI_BALANCER self
|
||||
function AI_BALANCER:onenterMonitoring( SetGroup )
|
||||
|
||||
self:E( { self.SetClient:Count() } )
|
||||
self.SetClient:Flush()
|
||||
self:T2( { self.SetClient:Count() } )
|
||||
--self.SetClient:Flush()
|
||||
|
||||
self.SetClient:ForEachClient(
|
||||
--- @param Wrapper.Client#CLIENT Client
|
||||
function( Client )
|
||||
self:E(Client.ClientName)
|
||||
self:T3(Client.ClientName)
|
||||
|
||||
local AIGroup = self.Set:Get( Client.UnitName ) -- Wrapper.Group#GROUP
|
||||
self:E({Client:IsAlive()})
|
||||
if Client:IsAlive() then
|
||||
|
||||
if AIGroup and AIGroup:IsAlive() == true then
|
||||
@ -255,16 +254,16 @@ function AI_BALANCER:onenterMonitoring( SetGroup )
|
||||
local PlayerInRange = { Value = false }
|
||||
local RangeZone = ZONE_RADIUS:New( 'RangeZone', AIGroup:GetVec2(), self.ReturnTresholdRange )
|
||||
|
||||
self:E( RangeZone )
|
||||
self:T2( RangeZone )
|
||||
|
||||
_DATABASE:ForEachPlayer(
|
||||
--- @param Wrapper.Unit#UNIT RangeTestUnit
|
||||
function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange )
|
||||
self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
||||
self:T2( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
||||
if RangeTestUnit:IsInZone( RangeZone ) == true then
|
||||
self:E( "in zone" )
|
||||
self:T2( "in zone" )
|
||||
if RangeTestUnit:GetCoalition() ~= AIGroup:GetCoalition() then
|
||||
self:E( "in range" )
|
||||
self:T2( "in range" )
|
||||
PlayerInRange.Value = true
|
||||
end
|
||||
end
|
||||
@ -285,7 +284,7 @@ function AI_BALANCER:onenterMonitoring( SetGroup )
|
||||
end
|
||||
else
|
||||
if not AIGroup or not AIGroup:IsAlive() == true then
|
||||
self:E( "Client " .. Client.UnitName .. " not alive." )
|
||||
self:T( "Client " .. Client.UnitName .. " not alive." )
|
||||
if not self.SpawnQueue[Client.UnitName] then
|
||||
-- Spawn a new AI taking into account the spawn interval Earliest, Latest
|
||||
self:__Spawn( math.random( self.Earliest, self.Latest ), Client.UnitName )
|
||||
|
||||
550
Moose Development/Moose/AI/AI_CAP.lua
Normal file
550
Moose Development/Moose/AI/AI_CAP.lua
Normal file
@ -0,0 +1,550 @@
|
||||
--- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Execute Combat Air Patrol (CAP).**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{#AI_CAP_ZONE} class, extends @{AI.AI_Cap#AI_PATROL_ZONE}
|
||||
--
|
||||
-- The @{#AI_CAP_ZONE} class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}
|
||||
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_CAP_ZONE is assigned a @(Group) and this must be done before the AI_CAP_ZONE process can be started using the **Start** event.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
|
||||
-- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- This cycle will continue.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- When enemies are detected, the AI will automatically engage the enemy.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.
|
||||
-- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ## 1.1) AI_CAP_ZONE constructor
|
||||
--
|
||||
-- * @{#AI_CAP_ZONE.New}(): Creates a new AI_CAP_ZONE object.
|
||||
--
|
||||
-- ## 1.2) AI_CAP_ZONE is a FSM
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ### 1.2.1) AI_CAP_ZONE States
|
||||
--
|
||||
-- * **None** ( Group ): The process is not started yet.
|
||||
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
|
||||
-- * **Engaging** ( Group ): The AI is engaging the bogeys.
|
||||
-- * **Returning** ( Group ): The AI is returning to Base..
|
||||
--
|
||||
-- ### 1.2.2) AI_CAP_ZONE Events
|
||||
--
|
||||
-- * **Start** ( Group ): Start the process.
|
||||
-- * **Route** ( Group ): Route the AI to a new random 3D point within the Patrol Zone.
|
||||
-- * **Engage** ( Group ): Let the AI engage the bogeys.
|
||||
-- * **RTB** ( Group ): Route the AI to the home base.
|
||||
-- * **Detect** ( Group ): The AI is detecting targets.
|
||||
-- * **Detected** ( Group ): The AI has detected new targets.
|
||||
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
|
||||
--
|
||||
-- ## 1.3) Set the Range of Engagement
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- An optional range can be set in meters,
|
||||
-- that will define when the AI will engage with the detected airborne enemy targets.
|
||||
-- The range can be beyond or smaller than the range of the Patrol Zone.
|
||||
-- The range is applied at the position of the AI.
|
||||
-- Use the method @{AI.AI_Cap#AI_CAP_ZONE.SetEngageRange}() to define that range.
|
||||
--
|
||||
-- ## 1.4) Set the Zone of Engagement
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- An optional @{Zone} can be set,
|
||||
-- that will define when the AI will engage with the detected airborne enemy targets.
|
||||
-- Use the method @{AI.AI_Cap#AI_CAP_ZONE.SetEngageZone}() to define that Zone.
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- # **API CHANGE HISTORY**
|
||||
--
|
||||
-- The underlying change log documents the API changes. Please read this carefully. The following notation is used:
|
||||
--
|
||||
-- * **Added** parts are expressed in bold type face.
|
||||
-- * _Removed_ parts are expressed in italic type face.
|
||||
--
|
||||
-- Hereby the change log:
|
||||
--
|
||||
-- 2017-01-15: Initial class and API.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # **AUTHORS and CONTRIBUTIONS**
|
||||
--
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- * **[Quax](https://forums.eagle.ru/member.php?u=90530)**: Concept, Advice & Testing.
|
||||
-- * **[Pikey](https://forums.eagle.ru/member.php?u=62835)**: Concept, Advice & Testing.
|
||||
-- * **[Gunterlund](http://forums.eagle.ru:8080/member.php?u=75036)**: Test case revision.
|
||||
--
|
||||
-- ### Authors:
|
||||
--
|
||||
-- * **FlightControl**: Concept, Design & Programming.
|
||||
--
|
||||
-- @module AI_Cap
|
||||
|
||||
|
||||
--- AI_CAP_ZONE class
|
||||
-- @type AI_CAP_ZONE
|
||||
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.
|
||||
-- @field Core.Zone#ZONE_BASE TargetZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @extends AI.AI_Patrol#AI_PATROL_ZONE
|
||||
AI_CAP_ZONE = {
|
||||
ClassName = "AI_CAP_ZONE",
|
||||
}
|
||||
|
||||
|
||||
|
||||
--- Creates a new AI_CAP_ZONE object
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Core.Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @param Dcs.DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @param Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @param Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||
-- @param Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||
-- @return #AI_CAP_ZONE self
|
||||
function AI_CAP_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed ) ) -- #AI_CAP_ZONE
|
||||
|
||||
self.Accomplished = false
|
||||
self.Engaging = false
|
||||
|
||||
self:AddTransition( { "Patrolling", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
|
||||
|
||||
--- OnBefore Transition Handler for Event Engage.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnBeforeEngage
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter Transition Handler for Event Engage.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnAfterEngage
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Synchronous Event Trigger for Event Engage.
|
||||
-- @function [parent=#AI_CAP_ZONE] Engage
|
||||
-- @param #AI_CAP_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Engage.
|
||||
-- @function [parent=#AI_CAP_ZONE] __Engage
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
--- OnLeave Transition Handler for State Engaging.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnLeaveEngaging
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter Transition Handler for State Engaging.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnEnterEngaging
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
self:AddTransition( "Engaging", "Fired", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
|
||||
|
||||
--- OnBefore Transition Handler for Event Fired.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnBeforeFired
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter Transition Handler for Event Fired.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnAfterFired
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Synchronous Event Trigger for Event Fired.
|
||||
-- @function [parent=#AI_CAP_ZONE] Fired
|
||||
-- @param #AI_CAP_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Fired.
|
||||
-- @function [parent=#AI_CAP_ZONE] __Fired
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
self:AddTransition( "*", "Destroy", "*" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
|
||||
|
||||
--- OnBefore Transition Handler for Event Destroy.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnBeforeDestroy
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter Transition Handler for Event Destroy.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnAfterDestroy
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Synchronous Event Trigger for Event Destroy.
|
||||
-- @function [parent=#AI_CAP_ZONE] Destroy
|
||||
-- @param #AI_CAP_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Destroy.
|
||||
-- @function [parent=#AI_CAP_ZONE] __Destroy
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
|
||||
self:AddTransition( "Engaging", "Abort", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
|
||||
|
||||
--- OnBefore Transition Handler for Event Abort.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnBeforeAbort
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter Transition Handler for Event Abort.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnAfterAbort
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Synchronous Event Trigger for Event Abort.
|
||||
-- @function [parent=#AI_CAP_ZONE] Abort
|
||||
-- @param #AI_CAP_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Abort.
|
||||
-- @function [parent=#AI_CAP_ZONE] __Abort
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
self:AddTransition( "Engaging", "Accomplish", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_CAP_ZONE.
|
||||
|
||||
--- OnBefore Transition Handler for Event Accomplish.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnBeforeAccomplish
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter Transition Handler for Event Accomplish.
|
||||
-- @function [parent=#AI_CAP_ZONE] OnAfterAccomplish
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Synchronous Event Trigger for Event Accomplish.
|
||||
-- @function [parent=#AI_CAP_ZONE] Accomplish
|
||||
-- @param #AI_CAP_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Accomplish.
|
||||
-- @function [parent=#AI_CAP_ZONE] __Accomplish
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Set the Engage Zone which defines where the AI will engage bogies.
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Core.Zone#ZONE EngageZone The zone where the AI is performing CAP.
|
||||
-- @return #AI_CAP_ZONE self
|
||||
function AI_CAP_ZONE:SetEngageZone( EngageZone )
|
||||
self:F2()
|
||||
|
||||
if EngageZone then
|
||||
self.EngageZone = EngageZone
|
||||
else
|
||||
self.EngageZone = nil
|
||||
end
|
||||
end
|
||||
|
||||
--- Set the Engage Range when the AI will engage with airborne enemies.
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param #number EngageRange The Engage Range.
|
||||
-- @return #AI_CAP_ZONE self
|
||||
function AI_CAP_ZONE:SetEngageRange( EngageRange )
|
||||
self:F2()
|
||||
|
||||
if EngageRange then
|
||||
self.EngageRange = EngageRange
|
||||
else
|
||||
self.EngageRange = nil
|
||||
end
|
||||
end
|
||||
|
||||
--- onafter State Transition for Event Start.
|
||||
-- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAP_ZONE:onafterStart( Controllable, From, Event, To )
|
||||
|
||||
|
||||
self:Route()
|
||||
self:__Status( 30 ) -- Check status status every 30 seconds.
|
||||
self:__Detect( self.DetectInterval ) -- Detect for new targets every DetectInterval in the EngageZone.
|
||||
|
||||
self:EventOnDead( self.OnDead )
|
||||
|
||||
Controllable:OptionROEOpenFire()
|
||||
|
||||
self.Controllable:OnReSpawn(
|
||||
function( PatrolGroup )
|
||||
self:E( "ReSpawn" )
|
||||
self:__Reset()
|
||||
self:__Route( 5 )
|
||||
end
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||
function _NewEngageCapRoute( AIControllable )
|
||||
|
||||
AIControllable:T( "NewEngageRoute" )
|
||||
local EngageZone = AIControllable:GetState( AIControllable, "EngageZone" ) -- AI.AI_Cap#AI_CAP_ZONE
|
||||
EngageZone:__Engage( 1 )
|
||||
end
|
||||
|
||||
--- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAP_ZONE:onbeforeEngage( Controllable, From, Event, To )
|
||||
|
||||
if self.Accomplished == true then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
--- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAP_ZONE:onafterDetected( Controllable, From, Event, To )
|
||||
|
||||
if From ~= "Engaging" then
|
||||
|
||||
local Engage = false
|
||||
|
||||
for DetectedUnitID, DetectedUnit in pairs( self.DetectedUnits ) do
|
||||
|
||||
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
|
||||
self:T( DetectedUnit )
|
||||
if DetectedUnit:IsAlive() and DetectedUnit:IsAir() then
|
||||
Engage = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if Engage == true then
|
||||
self:E( 'Detected -> Engaging' )
|
||||
self:__Engage( 1 )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
|
||||
|
||||
if Controllable:IsAlive() then
|
||||
|
||||
self:Detect( self.EngageZone )
|
||||
|
||||
local EngageRoute = {}
|
||||
|
||||
--- Calculate the current route point.
|
||||
local CurrentVec2 = self.Controllable:GetVec2()
|
||||
|
||||
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
|
||||
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local ToEngageZoneSpeed = self.PatrolMaxSpeed
|
||||
local CurrentRoutePoint = CurrentPointVec3:RoutePointAir(
|
||||
POINT_VEC3.RoutePointAltType.BARO,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
ToEngageZoneSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
EngageRoute[#EngageRoute+1] = CurrentRoutePoint
|
||||
|
||||
|
||||
--- Find a random 2D point in PatrolZone.
|
||||
local ToTargetVec2 = self.PatrolZone:GetRandomVec2()
|
||||
self:T2( ToTargetVec2 )
|
||||
|
||||
--- Define Speed and Altitude.
|
||||
local ToTargetAltitude = math.random( self.EngageFloorAltitude, self.EngageCeilingAltitude )
|
||||
local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed )
|
||||
self:T2( { self.PatrolMinSpeed, self.PatrolMaxSpeed, ToTargetSpeed } )
|
||||
|
||||
--- Obtain a 3D @{Point} from the 2D point + altitude.
|
||||
local ToTargetPointVec3 = POINT_VEC3:New( ToTargetVec2.x, ToTargetAltitude, ToTargetVec2.y )
|
||||
|
||||
--- Create a route point of type air.
|
||||
local ToPatrolRoutePoint = ToTargetPointVec3:RoutePointAir(
|
||||
POINT_VEC3.RoutePointAltType.BARO,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
ToTargetSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
EngageRoute[#EngageRoute+1] = ToPatrolRoutePoint
|
||||
|
||||
Controllable:OptionROEOpenFire()
|
||||
Controllable:OptionROTPassiveDefense()
|
||||
|
||||
local AttackTasks = {}
|
||||
|
||||
for DetectedUnitID, DetectedUnit in pairs( self.DetectedUnits ) do
|
||||
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
|
||||
self:T( DetectedUnit )
|
||||
if DetectedUnit:IsAlive() and DetectedUnit:IsAir() then
|
||||
if self.EngageZone then
|
||||
if DetectedUnit:IsInZone( self.EngageZone ) then
|
||||
self:E( {"Within Zone and Engaging ", DetectedUnit } )
|
||||
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit )
|
||||
end
|
||||
else
|
||||
if self.EngageRange then
|
||||
if DetectedUnit:GetPointVec3():Get2DDistance(Controllable:GetPointVec3() ) <= self.EngageRange then
|
||||
self:E( {"Within Range and Engaging", DetectedUnit } )
|
||||
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit )
|
||||
end
|
||||
else
|
||||
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit )
|
||||
end
|
||||
end
|
||||
else
|
||||
self.DetectedUnits[DetectedUnit] = nil
|
||||
end
|
||||
end
|
||||
|
||||
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
|
||||
self.Controllable:WayPointInitialize( EngageRoute )
|
||||
|
||||
|
||||
if #AttackTasks == 0 then
|
||||
self:E("No targets found -> Going back to Patrolling")
|
||||
self:Accomplish()
|
||||
self:Route()
|
||||
else
|
||||
EngageRoute[1].task = Controllable:TaskCombo( AttackTasks )
|
||||
|
||||
--- Do a trick, link the NewEngageRoute function of the object to the AIControllable in a temporary variable ...
|
||||
self.Controllable:SetState( self.Controllable, "EngageZone", self )
|
||||
|
||||
self.Controllable:WayPointFunction( #EngageRoute, 1, "_NewEngageCapRoute" )
|
||||
|
||||
end
|
||||
|
||||
--- NOW ROUTE THE GROUP!
|
||||
self.Controllable:WayPointExecute( 1, 2 )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
||||
|
||||
if EventData.IniUnit then
|
||||
self.DetectedUnits[EventData.IniUnit] = nil
|
||||
end
|
||||
|
||||
Controllable:MessageToAll( "Destroyed a target", 15 , "Destroyed!" )
|
||||
end
|
||||
|
||||
--- @param #AI_CAP_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
||||
self.Accomplished = true
|
||||
self.DetectUnits = false
|
||||
end
|
||||
|
||||
--- @param #AI_CAP_ZONE self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function AI_CAP_ZONE:OnDead( EventData )
|
||||
self:T( { "EventDead", EventData } )
|
||||
|
||||
if EventData.IniDCSUnit then
|
||||
self:__Destroy( 1, EventData )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -1,47 +1,96 @@
|
||||
--- SP:Y MP:Y AI:Y HU:N TYP:Air -- This module contains the AI_CAS_ZONE class.
|
||||
--- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Provide Close Air Support to friendly ground troops.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{#AI_CAS_ZONE} class, extends @{Core.Fsm#FSM_CONTROLLABLE}
|
||||
-- ================================================================
|
||||
-- The @{#AI_CAS_ZONE} class implements the core functions to CAS a @{Zone} by an AIR @{Controllable} @{Group}.
|
||||
-- # 1) @{#AI_CAS_ZONE} class, extends @{AI.AI_Patrol#AI_PATROL_ZONE}
|
||||
--
|
||||
-- @{#AI_CAS_ZONE} derives from the @{AI.AI_Patrol#AI_PATROL_ZONE}, inheriting its methods and behaviour.
|
||||
--
|
||||
-- The @{#AI_CAS_ZONE} class implements the core functions to provide Close Air Support in an Engage @{Zone} by an AIR @{Controllable} or @{Group}.
|
||||
-- The AI_CAS_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_CAS_ZONE is assigned a @(Group) and this must be done before the AI_CAS_ZONE process can be started through the **Start** event.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Upon started, The AI will **Route** itself towards the random 3D point within a patrol zone,
|
||||
-- using a random speed within the given altitude and speed limits.
|
||||
-- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits.
|
||||
-- This cycle will continue until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- When the AI is commanded to provide Close Air Support (through the event **Engage**), the AI will fly towards the Engage Zone.
|
||||
-- Any target that is detected in the Engage Zone will be reported and will be destroyed by the AI.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI will detect the targets and will only destroy the targets within the Engage Zone.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Every target that is destroyed, is reported< by the AI.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Note that the AI does not know when the Engage Zone is cleared, and therefore will keep circling in the zone.
|
||||
--
|
||||
-- 1.1) AI_CAS_ZONE constructor:
|
||||
-- ----------------------------
|
||||
-- 
|
||||
--
|
||||
-- Until it is notified through the event **Accomplish**, which is to be triggered by an observing party:
|
||||
--
|
||||
-- * a FAC
|
||||
-- * a timed event
|
||||
-- * a menu option selected by a human
|
||||
-- * a condition
|
||||
-- * others ...
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- When the AI has accomplished the CAS, it will fly back to the Patrol Zone.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- It will keep patrolling there, until it is notified to RTB or move to another CAS Zone.
|
||||
-- It can be notified to go RTB through the **RTB** event.
|
||||
--
|
||||
-- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # 1.1) AI_CAS_ZONE constructor
|
||||
--
|
||||
-- * @{#AI_CAS_ZONE.New}(): Creates a new AI_CAS_ZONE object.
|
||||
--
|
||||
-- 1.2) AI_CAS_ZONE state machine:
|
||||
-- ----------------------------------
|
||||
-- The AI_CAS_ZONE is a state machine: it manages the different events and states of the AIControllable it is controlling.
|
||||
--
|
||||
-- ### 1.2.1) AI_CAS_ZONE Events:
|
||||
--
|
||||
-- * @{#AI_CAS_ZONE.TakeOff}( AIControllable ): The AI is taking-off from an airfield.
|
||||
-- * @{#AI_CAS_ZONE.Hold}( AIControllable ): The AI is holding in airspace at a zone.
|
||||
-- * @{#AI_CAS_ZONE.Engage}( AIControllable ): The AI is engaging the targets.
|
||||
-- * @{#AI_CAS_ZONE.WeaponReleased}( AIControllable ): The AI has released a weapon to the target.
|
||||
-- * @{#AI_CAS_ZONE.Destroy}( AIControllable ): The AI has destroyed a target.
|
||||
-- * @{#AI_CAS_ZONE.Complete}( AIControllable ): The AI has destroyed all defined targets.
|
||||
-- * @{#AI_CAS_ZONE.RTB}( AIControllable ): The AI is returning to the home base.
|
||||
--
|
||||
-- ### 1.2.2) AI_CAS_ZONE States:
|
||||
--
|
||||
--
|
||||
-- ### 1.2.3) AI_CAS_ZONE state transition methods:
|
||||
--
|
||||
--
|
||||
-- 1.3) Manage the AI_CAS_ZONE parameters:
|
||||
-- ------------------------------------------
|
||||
-- The following methods are available to modify the parameters of an AI_CAS_ZONE object:
|
||||
--
|
||||
-- * @{#AI_CAS_ZONE.SetControllable}(): Set the AIControllable.
|
||||
-- * @{#AI_CAS_ZONE.GetControllable}(): Get the AIControllable.
|
||||
--
|
||||
-- ## 1.2) AI_CAS_ZONE is a FSM
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ### 1.2.1) AI_CAS_ZONE States
|
||||
--
|
||||
-- * **None** ( Group ): The process is not started yet.
|
||||
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
|
||||
-- * **Engaging** ( Group ): The AI is engaging the targets in the Engage Zone, executing CAS.
|
||||
-- * **Returning** ( Group ): The AI is returning to Base..
|
||||
--
|
||||
-- ### 1.2.2) AI_CAS_ZONE Events
|
||||
--
|
||||
-- * **Start** ( Group ): Start the process.
|
||||
-- * **Route** ( Group ): Route the AI to a new random 3D point within the Patrol Zone.
|
||||
-- * **Engage** ( Group ): Engage the AI to provide CAS in the Engage Zone, destroying any target it finds.
|
||||
-- * **RTB** ( Group ): Route the AI to the home base.
|
||||
-- * **Detect** ( Group ): The AI is detecting targets.
|
||||
-- * **Detected** ( Group ): The AI has detected new targets.
|
||||
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- **API CHANGE HISTORY**
|
||||
-- ======================
|
||||
-- # **API CHANGE HISTORY**
|
||||
--
|
||||
-- The underlying change log documents the API changes. Please read this carefully. The following notation is used:
|
||||
--
|
||||
@ -50,31 +99,30 @@
|
||||
--
|
||||
-- Hereby the change log:
|
||||
--
|
||||
-- 2017-01-12: Initial class and API.
|
||||
-- 2017-01-15: Initial class and API.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- AUTHORS and CONTRIBUTIONS
|
||||
-- =========================
|
||||
-- # **AUTHORS and CONTRIBUTIONS**
|
||||
--
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- * **Quax**: Concept & Testing.
|
||||
-- * **Pikey**: Concept & Testing.
|
||||
-- * **[Quax](https://forums.eagle.ru/member.php?u=90530)**: Concept, Advice & Testing.
|
||||
-- * **[Pikey](https://forums.eagle.ru/member.php?u=62835)**: Concept, Advice & Testing.
|
||||
-- * **[Gunterlund](http://forums.eagle.ru:8080/member.php?u=75036)**: Test case revision.
|
||||
--
|
||||
-- ### Authors:
|
||||
--
|
||||
-- * **FlightControl**: Concept, Design & Programming.
|
||||
--
|
||||
--
|
||||
-- @module Cas
|
||||
-- @module AI_Cas
|
||||
|
||||
|
||||
--- AI_CAS_ZONE class
|
||||
-- @type AI_CAS_ZONE
|
||||
-- @field Wrapper.Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.
|
||||
-- @field Core.Zone#ZONE_BASE TargetZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @extends AI.AI_Patrol#AI_PATROLZONE
|
||||
-- @extends AI.AI_Patrol#AI_CAS_ZONE
|
||||
AI_CAS_ZONE = {
|
||||
ClassName = "AI_CAS_ZONE",
|
||||
}
|
||||
@ -93,179 +141,118 @@ AI_CAS_ZONE = {
|
||||
function AI_CAS_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageZone )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, AI_PATROLZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed ) ) -- #AI_CAS_ZONE
|
||||
local self = BASE:Inherit( self, AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed ) ) -- #AI_CAS_ZONE
|
||||
|
||||
self.PatrolZone = PatrolZone
|
||||
self.PatrolFloorAltitude = PatrolFloorAltitude
|
||||
self.PatrolCeilingAltitude = PatrolCeilingAltitude
|
||||
self.PatrolMinSpeed = PatrolMinSpeed
|
||||
self.PatrolMaxSpeed = PatrolMaxSpeed
|
||||
|
||||
self.EngageZone = EngageZone
|
||||
self.Accomplished = false
|
||||
|
||||
do self:AddTransition( { "Patrol", "Route", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
self:SetDetectionZone( self.EngageZone )
|
||||
|
||||
self:AddTransition( { "Patrolling", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
--- OnLeave State Transition for Holding.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnLeaveHolding
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnEnterEngaging
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Engage.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeEngage
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter State Transition for Engage.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterEngage
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Embedded Event Trigger for Engage.
|
||||
-- @function [parent=#AI_CAS_ZONE] Engage
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Delayed Event Trigger for Engage
|
||||
-- @function [parent=#AI_CAS_ZONE] __Engage
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- AI_CAS_ZONE
|
||||
|
||||
|
||||
do self:AddTransition( "Engaging", "Fired", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
--- OnLeave State Transition for Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnLeaveEngaging
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnEnterEngaging
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Fired.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeFired
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter State Transition for Fired.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterFired
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean
|
||||
|
||||
--- Embedded Event Trigger for Fired.
|
||||
-- @function [parent=#AI_CAS_ZONE] Fired
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Delayed Event Trigger for Fired
|
||||
-- @function [parent=#AI_CAS_ZONE] __Fired
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- AI_CAS_ZONE
|
||||
|
||||
do self:AddTransition( "Engaging", "Destroy", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
--- OnLeave State Transition for Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnLeaveEngaging
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnEnterEngaging
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Destroy.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeDestroy
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter State Transition for Destroy.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterDestroy
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Embedded Event Trigger for Destroy.
|
||||
-- @function [parent=#AI_CAS_ZONE] Destroy
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Delayed Event Trigger for Destroy
|
||||
-- @function [parent=#AI_CAS_ZONE] __Destroy
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- AI_CAS_ZONE
|
||||
|
||||
do self:AddTransition( "Engaging", "Abort", "Patrol" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
--- OnLeave State Transition for Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnLeaveEngaging
|
||||
--- OnBefore Transition Handler for Event Engage.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeEngage
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Patrol.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnEnterPatrol
|
||||
|
||||
--- OnAfter Transition Handler for Event Engage.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterEngage
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Abort.
|
||||
|
||||
--- Synchronous Event Trigger for Event Engage.
|
||||
-- @function [parent=#AI_CAS_ZONE] Engage
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Engage.
|
||||
-- @function [parent=#AI_CAS_ZONE] __Engage
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
--- OnLeave Transition Handler for State Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnLeaveEngaging
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter Transition Handler for State Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnEnterEngaging
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
self:AddTransition( "Engaging", "Fired", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
--- OnBefore Transition Handler for Event Fired.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeFired
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter Transition Handler for Event Fired.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterFired
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Synchronous Event Trigger for Event Fired.
|
||||
-- @function [parent=#AI_CAS_ZONE] Fired
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Fired.
|
||||
-- @function [parent=#AI_CAS_ZONE] __Fired
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
self:AddTransition( "*", "Destroy", "*" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
--- OnBefore Transition Handler for Event Destroy.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeDestroy
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter Transition Handler for Event Destroy.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterDestroy
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Synchronous Event Trigger for Event Destroy.
|
||||
-- @function [parent=#AI_CAS_ZONE] Destroy
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Destroy.
|
||||
-- @function [parent=#AI_CAS_ZONE] __Destroy
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
|
||||
self:AddTransition( "Engaging", "Abort", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
--- OnBefore Transition Handler for Event Abort.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeAbort
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
@ -273,78 +260,72 @@ do self:AddTransition( "Engaging", "Abort", "Patrol" ) -- FSM_CONTROLLABLE Trans
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter State Transition for Abort.
|
||||
|
||||
--- OnAfter Transition Handler for Event Abort.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterAbort
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Embedded Event Trigger for Abort.
|
||||
|
||||
--- Synchronous Event Trigger for Event Abort.
|
||||
-- @function [parent=#AI_CAS_ZONE] Abort
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Delayed Event Trigger for Abort
|
||||
|
||||
--- Asynchronous Event Trigger for Event Abort.
|
||||
-- @function [parent=#AI_CAS_ZONE] __Abort
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- AI_CAS_ZONE
|
||||
self:AddTransition( "Engaging", "Accomplish", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
|
||||
do self:AddTransition( "Engaging", "Completed", "Patrol" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
--- OnBefore Transition Handler for Event Accomplish.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeAccomplish
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnLeave State Transition for Engaging.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnLeaveEngaging
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Patrol.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnEnterPatrol
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
--- OnAfter Transition Handler for Event Accomplish.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterAccomplish
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Completed.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnBeforeCompleted
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
--- Synchronous Event Trigger for Event Accomplish.
|
||||
-- @function [parent=#AI_CAS_ZONE] Accomplish
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- OnAfter State Transition for Completed.
|
||||
-- @function [parent=#AI_CAS_ZONE] OnAfterCompleted
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Embedded Event Trigger for Completed.
|
||||
-- @function [parent=#AI_CAS_ZONE] Completed
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Delayed Event Trigger for Completed
|
||||
-- @function [parent=#AI_CAS_ZONE] __Completed
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- AI_CAS_ZONE
|
||||
--- Asynchronous Event Trigger for Event Accomplish.
|
||||
-- @function [parent=#AI_CAS_ZONE] __Accomplish
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Set the Engage Zone where the AI is performing CAS. Note that if the EngageZone is changed, the AI needs to re-detect targets.
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Core.Zone#ZONE EngageZone The zone where the AI is performing CAS.
|
||||
-- @return #AI_CAS_ZONE self
|
||||
function AI_CAS_ZONE:SetEngageZone( EngageZone )
|
||||
self:F2()
|
||||
|
||||
if EngageZone then
|
||||
self.EngageZone = EngageZone
|
||||
else
|
||||
self.EngageZone = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- onafter State Transition for Event Start.
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
@ -354,25 +335,45 @@ end
|
||||
function AI_CAS_ZONE:onafterStart( Controllable, From, Event, To )
|
||||
|
||||
|
||||
if Controllable:IsAlive() then
|
||||
self:__Route( 1 )
|
||||
end
|
||||
|
||||
self:Route()
|
||||
self:__Status( 30 ) -- Check status status every 30 seconds.
|
||||
self:__Detect( self.DetectInterval ) -- Detect for new targets every DetectInterval in the EngageZone.
|
||||
|
||||
self:EventOnDead( self.OnDead )
|
||||
|
||||
Controllable:OptionROEHoldFire()
|
||||
Controllable:OptionROTVertical()
|
||||
|
||||
self.Controllable:OnReSpawn(
|
||||
function( PatrolGroup )
|
||||
self:E( "ReSpawn" )
|
||||
self:__Reset()
|
||||
self:__Route( 5 )
|
||||
end
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||
function _NewEngageRoute( AIControllable )
|
||||
|
||||
AIControllable:T( "NewEngageRoute" )
|
||||
local EngageZone = AIControllable:GetState( AIControllable, "EngageZone" ) -- AI.AI_Patrol#AI_PATROLZONE
|
||||
local EngageZone = AIControllable:GetState( AIControllable, "EngageZone" ) -- AI.AI_Cas#AI_CAS_ZONE
|
||||
EngageZone:__Engage( 1 )
|
||||
end
|
||||
|
||||
--- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAS_ZONE:onbeforeEngage( Controllable, From, Event, To )
|
||||
|
||||
if self.Accomplished == true then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
@ -383,7 +384,27 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To )
|
||||
|
||||
if Controllable:IsAlive() then
|
||||
|
||||
self:Detect( self.EngageZone )
|
||||
|
||||
local EngageRoute = {}
|
||||
|
||||
--- Calculate the current route point.
|
||||
local CurrentVec2 = self.Controllable:GetVec2()
|
||||
|
||||
--TODO: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||
local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
|
||||
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local ToEngageZoneSpeed = self.PatrolMaxSpeed
|
||||
local CurrentRoutePoint = CurrentPointVec3:RoutePointAir(
|
||||
POINT_VEC3.RoutePointAltType.BARO,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
ToEngageZoneSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
EngageRoute[#EngageRoute+1] = CurrentRoutePoint
|
||||
|
||||
|
||||
if self.Controllable:IsNotInZone( self.EngageZone ) then
|
||||
|
||||
@ -435,7 +456,7 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To )
|
||||
true
|
||||
)
|
||||
|
||||
ToTargetPointVec3:SmokeRed()
|
||||
ToTargetPointVec3:SmokeBlue()
|
||||
|
||||
EngageRoute[#EngageRoute+1] = ToTargetRoutePoint
|
||||
|
||||
@ -445,21 +466,16 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To )
|
||||
|
||||
local AttackTasks = {}
|
||||
|
||||
local DetectedTargets = Controllable:GetDetectedTargets()
|
||||
for TargetID, Target in pairs( DetectedTargets ) do
|
||||
local TargetObject = Target.object
|
||||
self:T( TargetObject )
|
||||
if TargetObject and TargetObject:isExist() and TargetObject.id_ < 50000000 then
|
||||
|
||||
local TargetUnit = UNIT:Find( TargetObject )
|
||||
local TargetUnitName = TargetUnit:GetName()
|
||||
|
||||
if TargetUnit:IsInZone( self.EngageZone ) then
|
||||
self:E( {"Engaging ", TargetUnit } )
|
||||
--local EngageTask = Controllable:EnRouteTaskEngageUnit( TargetUnit, 1 )
|
||||
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( TargetUnit )
|
||||
for DetectedUnitID, DetectedUnit in pairs( self.DetectedUnits ) do
|
||||
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
|
||||
self:T( DetectedUnit )
|
||||
if DetectedUnit:IsAlive() then
|
||||
if DetectedUnit:IsInZone( self.EngageZone ) then
|
||||
self:E( {"Engaging ", DetectedUnit } )
|
||||
AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit )
|
||||
end
|
||||
|
||||
else
|
||||
self.DetectedUnits[DetectedUnit] = nil
|
||||
end
|
||||
end
|
||||
|
||||
@ -474,7 +490,7 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To )
|
||||
self.Controllable:WayPointFunction( #EngageRoute, 1, "_NewEngageRoute" )
|
||||
|
||||
--- NOW ROUTE THE GROUP!
|
||||
self.Controllable:WayPointExecute( 1, 5 )
|
||||
self.Controllable:WayPointExecute( 1, 2 )
|
||||
end
|
||||
end
|
||||
|
||||
@ -483,11 +499,26 @@ end
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To )
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
||||
|
||||
if EventData.IniUnit then
|
||||
self.DetectedUnits[EventData.IniUnit] = nil
|
||||
end
|
||||
|
||||
Controllable:MessageToAll( "Destroyed a target", 15 , "Destroyed!" )
|
||||
end
|
||||
|
||||
--- @param #AI_CAS_ZONE self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAS_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
||||
self.Accomplished = true
|
||||
self.DetectUnits = false
|
||||
end
|
||||
|
||||
--- @param #AI_CAS_ZONE self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function AI_CAS_ZONE:OnDead( EventData )
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
--- Management of logical cargo objects, that can be transported from and to transportation carriers.
|
||||
--- Single-Player:Yes / Mulit-Player:Yes / AI:Yes / Human:No / Types:Ground -- Management of logical cargo objects, that can be transported from and to transportation carriers.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -535,14 +535,21 @@ do -- FSM
|
||||
|
||||
function FSM._handler( self, EventName, ... )
|
||||
|
||||
self:E( { EventName, ... } )
|
||||
|
||||
local Can, to = self:can( EventName )
|
||||
self:E( { From = self.current, Event = EventName, To = to, Can = Can } )
|
||||
|
||||
if to == "*" then
|
||||
to = self.current
|
||||
end
|
||||
|
||||
if Can then
|
||||
local from = self.current
|
||||
local params = { from, EventName, to, ... }
|
||||
|
||||
if self.Controllable then
|
||||
self:E( "FSM Transition for " .. self.Controllable.ControllableName .. " :" .. self.current .. " --> " .. EventName .. " --> " .. to )
|
||||
else
|
||||
self:E( "FSM Transition:" .. self.current .. " --> " .. EventName .. " --> " .. to )
|
||||
end
|
||||
|
||||
if self:_call_handler("onbefore" .. EventName, params) == false
|
||||
or self:_call_handler("OnBefore" .. EventName, params) == false
|
||||
@ -592,6 +599,9 @@ do -- FSM
|
||||
|
||||
self:_call_handler("onstatechange", params)
|
||||
end
|
||||
else
|
||||
self:E( "Cannot execute transition." )
|
||||
self:E( { From = self.current, Event = EventName, To = to, Can = Can } )
|
||||
end
|
||||
|
||||
return nil
|
||||
@ -667,7 +677,6 @@ do -- FSM
|
||||
end
|
||||
|
||||
function FSM:can(e)
|
||||
self:E( { e, self.Events, self.Events[e] } )
|
||||
local Event = self.Events[e]
|
||||
self:F3( { self.current, Event } )
|
||||
local To = Event and Event.map[self.current] or Event.map['*']
|
||||
@ -736,7 +745,7 @@ do -- FSM_CONTROLLABLE
|
||||
end
|
||||
|
||||
if self[handler] then
|
||||
self:E( "Calling " .. handler )
|
||||
self:F3( "Calling " .. handler )
|
||||
return xpcall( function() return self[handler]( self, self.Controllable, unpack( params ) ) end, ErrorHandler )
|
||||
--return self[handler]( self, self.Controllable, unpack( params ) )
|
||||
end
|
||||
@ -1027,7 +1036,7 @@ do -- FSM_SET
|
||||
|
||||
function FSM_SET:_call_handler( handler, params )
|
||||
if self[handler] then
|
||||
self:E( "Calling " .. handler )
|
||||
self:T( "Calling " .. handler )
|
||||
return self[handler]( self, self.Set, unpack( params ) )
|
||||
end
|
||||
end
|
||||
|
||||
@ -74,9 +74,11 @@ POINT_VEC3 = {
|
||||
BARO = "BARO",
|
||||
},
|
||||
RoutePointType = {
|
||||
TakeOffParking = "TakeOffParking",
|
||||
TurningPoint = "Turning Point",
|
||||
},
|
||||
RoutePointAction = {
|
||||
FromParkingArea = "From Parking Area",
|
||||
TurningPoint = "Turning Point",
|
||||
},
|
||||
}
|
||||
@ -99,10 +101,12 @@ do -- POINT_VEC3
|
||||
|
||||
--- RoutePoint Types
|
||||
-- @type POINT_VEC3.RoutePointType
|
||||
-- @field TakeOffParking "TakeOffParking"
|
||||
-- @field TurningPoint "Turning Point"
|
||||
|
||||
--- RoutePoint Actions
|
||||
-- @type POINT_VEC3.RoutePointAction
|
||||
-- @field FromParkingArea "From Parking Area"
|
||||
-- @field TurningPoint "Turning Point"
|
||||
|
||||
-- Constructor.
|
||||
|
||||
@ -68,10 +68,10 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr
|
||||
|
||||
if Scheduler.MasterObject then
|
||||
self.ObjectSchedulers[self.CallID] = Scheduler
|
||||
self:E( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), MasterObject = tostring(Scheduler.MasterObject) } )
|
||||
self:F3( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), MasterObject = tostring(Scheduler.MasterObject) } )
|
||||
else
|
||||
self.PersistentSchedulers[self.CallID] = Scheduler
|
||||
self:E( { CallID = self.CallID, PersistentScheduler = self.PersistentSchedulers[self.CallID] } )
|
||||
self:F3( { CallID = self.CallID, PersistentScheduler = self.PersistentSchedulers[self.CallID] } )
|
||||
end
|
||||
|
||||
self.Schedule = self.Schedule or setmetatable( {}, { __mode = "k" } )
|
||||
|
||||
@ -102,7 +102,7 @@ function SCHEDULER:Schedule( SchedulerObject, SchedulerFunction, SchedulerArgume
|
||||
if SchedulerObject and SchedulerObject.ClassName and SchedulerObject.ClassID then
|
||||
ObjectName = SchedulerObject.ClassName .. SchedulerObject.ClassID
|
||||
end
|
||||
self:E( { "Schedule :", ObjectName, tostring( SchedulerObject ), Start, Repeat, RandomizeFactor, Stop } )
|
||||
self:F3( { "Schedule :", ObjectName, tostring( SchedulerObject ), Start, Repeat, RandomizeFactor, Stop } )
|
||||
self.SchedulerObject = SchedulerObject
|
||||
|
||||
local ScheduleID = _SCHEDULEDISPATCHER:AddSchedule(
|
||||
|
||||
@ -602,11 +602,14 @@ function SPAWN:ReSpawn( SpawnIndex )
|
||||
local SpawnGroup = self:SpawnWithIndex( SpawnIndex )
|
||||
if SpawnGroup and WayPoints then
|
||||
-- If there were WayPoints set, then Re-Execute those WayPoints!
|
||||
self:E( WayPoints )
|
||||
SpawnGroup:WayPointInitialize( WayPoints )
|
||||
SpawnGroup:WayPointExecute( 1, 5 )
|
||||
end
|
||||
|
||||
if SpawnGroup.ReSpawnFunction then
|
||||
SpawnGroup:ReSpawnFunction()
|
||||
end
|
||||
|
||||
return SpawnGroup
|
||||
end
|
||||
|
||||
|
||||
@ -42,8 +42,9 @@ Include.File( "Functional/Detection" )
|
||||
--- AI Classes
|
||||
Include.File( "AI/AI_Balancer" )
|
||||
Include.File( "AI/AI_Patrol" )
|
||||
Include.File( "AI/AI_Cargo" )
|
||||
Include.File( "AI/AI_Cap" )
|
||||
Include.File( "AI/AI_Cas" )
|
||||
Include.File( "AI/AI_Cargo" )
|
||||
|
||||
--- Actions
|
||||
Include.File( "Actions/Act_Assign" )
|
||||
|
||||
@ -166,6 +166,58 @@ function CONTROLLABLE:_GetController()
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Get methods
|
||||
|
||||
--- Returns the UNITs wrappers of the DCS Units of the Controllable (default is a GROUP).
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #list<Wrapper.Unit#UNIT> The UNITs wrappers.
|
||||
function CONTROLLABLE:GetUnits()
|
||||
self:F2( { self.ControllableName } )
|
||||
local DCSControllable = self:GetDCSObject()
|
||||
|
||||
if DCSControllable then
|
||||
local DCSUnits = DCSControllable:getUnits()
|
||||
local Units = {}
|
||||
for Index, UnitData in pairs( DCSUnits ) do
|
||||
Units[#Units+1] = UNIT:Find( UnitData )
|
||||
end
|
||||
self:T3( Units )
|
||||
return Units
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Returns the health. Dead controllables have health <= 1.0.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #number The controllable health value (unit or group average).
|
||||
-- @return #nil The controllable is not existing or alive.
|
||||
function CONTROLLABLE:GetLife()
|
||||
self:F2( self.ControllableName )
|
||||
|
||||
local DCSControllable = self:GetDCSObject()
|
||||
|
||||
if DCSControllable then
|
||||
local UnitLife = 0
|
||||
local Units = self:GetUnits()
|
||||
if #Units == 1 then
|
||||
local Unit = Units[1] -- Wrapper.Unit#UNIT
|
||||
UnitLife = Unit:GetLife()
|
||||
else
|
||||
local UnitLifeTotal = 0
|
||||
for UnitID, Unit in pairs( Units ) do
|
||||
local Unit = Unit -- Wrapper.Unit#UNIT
|
||||
UnitLifeTotal = UnitLifeTotal + Unit:GetLife()
|
||||
end
|
||||
UnitLife = UnitLifeTotal / #Units
|
||||
end
|
||||
return UnitLife
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- Tasks
|
||||
@ -225,7 +277,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
||||
if DCSControllable then
|
||||
|
||||
local Controller = self:_GetController()
|
||||
self:E(Controller)
|
||||
self:T3( Controller )
|
||||
|
||||
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
|
||||
-- Therefore we schedule the functions to set the mission and options for the Controllable.
|
||||
@ -305,6 +357,10 @@ function CONTROLLABLE:TaskCombo( DCSTasks )
|
||||
tasks = DCSTasks
|
||||
}
|
||||
}
|
||||
|
||||
for TaskID, Task in ipairs( DCSTasks ) do
|
||||
self:E( Task )
|
||||
end
|
||||
|
||||
self:T3( { DCSTaskCombo } )
|
||||
return DCSTaskCombo
|
||||
@ -490,22 +546,24 @@ function CONTROLLABLE:TaskAttackUnit( AttackUnit, WeaponType, WeaponExpend, Atta
|
||||
-- }
|
||||
|
||||
local DCSTask
|
||||
DCSTask = { id = 'AttackUnit',
|
||||
DCSTask = {
|
||||
id = 'AttackUnit',
|
||||
params = {
|
||||
altitudeEnabled = false,
|
||||
altitudeEnabled = true,
|
||||
unitId = AttackUnit:GetID(),
|
||||
attackQtyLimit = AttackQtyLimit or false,
|
||||
attackQty = AttackQty or 1,
|
||||
attackQty = AttackQty or 2,
|
||||
expend = WeaponExpend or "Auto",
|
||||
altitude = 2000,
|
||||
directionEnabled = false,
|
||||
groupAttack = false,
|
||||
weaponType = WeaponType or 1073741822,
|
||||
directionEnabled = true,
|
||||
groupAttack = true,
|
||||
--weaponType = WeaponType or 1073741822,
|
||||
direction = Direction or 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
self:E( { DCSTask } )
|
||||
self:E( DCSTask )
|
||||
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
@ -2217,6 +2275,4 @@ function CONTROLLABLE:WayPointExecute( WayPoint, WaitTime )
|
||||
return self
|
||||
end
|
||||
|
||||
-- Message APIs
|
||||
|
||||
|
||||
-- Message APIs
|
||||
@ -205,6 +205,23 @@ function GROUP:GetDCSObject()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the @{Dcs.DCSTypes#Position3} position vectors indicating the point and direction vectors in 3D of the POSITIONABLE within the mission.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Dcs.DCSTypes#Position The 3D position vectors of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function GROUP:GetPositionVec3() -- Overridden from POSITIONABLE:GetPositionVec3()
|
||||
self:F2( self.PositionableName )
|
||||
|
||||
local DCSPositionable = self:GetDCSObject()
|
||||
|
||||
if DCSPositionable then
|
||||
local PositionablePosition = DCSPositionable:getUnits()[1]:getPosition().p
|
||||
self:T3( PositionablePosition )
|
||||
return PositionablePosition
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns if the DCS Group is alive.
|
||||
-- When the group exists at run-time, this method will return true, otherwise false.
|
||||
@ -391,26 +408,6 @@ function GROUP:GetInitialSize()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the UNITs wrappers of the DCS Units of the DCS Group.
|
||||
-- @param #GROUP self
|
||||
-- @return #table The UNITs wrappers.
|
||||
function GROUP:GetUnits()
|
||||
self:F2( { self.GroupName } )
|
||||
local DCSGroup = self:GetDCSObject()
|
||||
|
||||
if DCSGroup then
|
||||
local DCSUnits = DCSGroup:getUnits()
|
||||
local Units = {}
|
||||
for Index, UnitData in pairs( DCSUnits ) do
|
||||
Units[#Units+1] = UNIT:Find( UnitData )
|
||||
end
|
||||
self:T3( Units )
|
||||
return Units
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Returns the DCS Units of the DCS Group.
|
||||
-- @param #GROUP self
|
||||
@ -882,4 +879,30 @@ function GROUP:CalculateThreatLevelA2G()
|
||||
return MaxThreatLevelA2G
|
||||
end
|
||||
|
||||
--- Returns true if the first unit of the GROUP is in the air.
|
||||
-- @param Wrapper.Group#GROUP self
|
||||
-- @return #boolean true if in the first unit of the group is in the air.
|
||||
-- @return #nil The GROUP is not existing or not alive.
|
||||
function GROUP:InAir()
|
||||
self:F2( self.GroupName )
|
||||
|
||||
local DCSGroup = self:GetDCSObject()
|
||||
|
||||
if DCSGroup then
|
||||
local DCSUnit = DCSGroup:getUnit(1)
|
||||
if DCSUnit then
|
||||
local GroupInAir = DCSGroup:getUnit(1):inAir()
|
||||
self:T3( GroupInAir )
|
||||
return GroupInAir
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
function GROUP:OnReSpawn( ReSpawnFunction )
|
||||
|
||||
self.ReSpawnFunction = ReSpawnFunction
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ POSITIONABLE = {
|
||||
function POSITIONABLE:New( PositionableName )
|
||||
local self = BASE:Inherit( self, IDENTIFIABLE:New( PositionableName ) )
|
||||
|
||||
self.PositionableName = PositionableName
|
||||
return self
|
||||
end
|
||||
|
||||
@ -53,12 +54,12 @@ end
|
||||
-- @return Dcs.DCSTypes#Position The 3D position vectors of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetPositionVec3()
|
||||
self:F2( self.PositionableName )
|
||||
self:E( self.PositionableName )
|
||||
|
||||
local DCSPositionable = self:GetDCSObject()
|
||||
|
||||
if DCSPositionable then
|
||||
local PositionablePosition = DCSPositionable:getPosition()
|
||||
local PositionablePosition = DCSPositionable:getPosition().p
|
||||
self:T3( PositionablePosition )
|
||||
return PositionablePosition
|
||||
end
|
||||
@ -110,6 +111,27 @@ function POSITIONABLE:GetPointVec2()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns a POINT_VEC3 object indicating the point in 3D of the POSITIONABLE within the mission.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return Core.Point#POINT_VEC3 The 3D point vector of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetPointVec3()
|
||||
self:F2( self.PositionableName )
|
||||
|
||||
local DCSPositionable = self:GetDCSObject()
|
||||
|
||||
if DCSPositionable then
|
||||
local PositionableVec3 = self:GetPositionVec3()
|
||||
|
||||
local PositionablePointVec3 = POINT_VEC3:NewFromVec3( PositionableVec3 )
|
||||
|
||||
self:T2( PositionablePointVec3 )
|
||||
return PositionablePointVec3
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Returns a random @{Dcs.DCSTypes#Vec3} vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
@ -219,20 +241,13 @@ end
|
||||
|
||||
|
||||
--- Returns true if the POSITIONABLE is in the air.
|
||||
-- Polymorphic, is overridden in GROUP and UNIT.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
-- @return #boolean true if in the air.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:InAir()
|
||||
self:F2( self.PositionableName )
|
||||
|
||||
local DCSPositionable = self:GetDCSObject()
|
||||
|
||||
if DCSPositionable then
|
||||
local PositionableInAir = DCSPositionable:inAir()
|
||||
self:T3( PositionableInAir )
|
||||
return PositionableInAir
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
@ -467,6 +467,25 @@ function UNIT:GetFuel()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the UNIT in a UNIT list of one element.
|
||||
-- @param #UNIT self
|
||||
-- @return #list<Wrapper.Unit#UNIT> The UNITs wrappers.
|
||||
function UNIT:GetUnits()
|
||||
self:F2( { self.UnitName } )
|
||||
local DCSUnit = self:GetDCSObject()
|
||||
|
||||
if DCSUnit then
|
||||
local DCSUnits = DCSUnit:getUnits()
|
||||
local Units = {}
|
||||
Units[1] = UNIT:Find( DCSUnit )
|
||||
self:T3( Units )
|
||||
return Units
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Returns the unit's health. Dead units has health <= 1.0.
|
||||
-- @param #UNIT self
|
||||
-- @return #number The Unit's health value.
|
||||
@ -799,3 +818,21 @@ function UNIT:IsShip()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns true if the UNIT is in the air.
|
||||
-- @param Wrapper.Positionable#UNIT self
|
||||
-- @return #boolean true if in the air.
|
||||
-- @return #nil The UNIT is not existing or alive.
|
||||
function UNIT:InAir()
|
||||
self:F2( self.UnitName )
|
||||
|
||||
local DCSUnit = self:GetDCSObject()
|
||||
|
||||
if DCSUnit then
|
||||
local UnitInAir = DCSUnit:inAir()
|
||||
self:T3( UnitInAir )
|
||||
return UnitInAir
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -80,8 +80,9 @@ COPY /b Moose.lua + %1\Functional\Detection.lua Moose.lua
|
||||
rem AI Classes
|
||||
COPY /b Moose.lua + %1\AI\AI_Balancer.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\AI\AI_Patrol.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\AI\AI_Cas.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\AI\AI_Cap.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\AI\AI_Cargo.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\AI\AI_CAS.lua Moose.lua
|
||||
|
||||
|
||||
rem Actions
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,8 +1,4 @@
|
||||
--- AI Spawning and Decomissioning
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Name: Spawned AI
|
||||
-- Name: AIB-001 - Spawned AI
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Dec 2016
|
||||
--
|
||||
@ -18,10 +14,6 @@
|
||||
-- 1. If no player is logging into the red slots, 2 red AI planes should be alive.
|
||||
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.
|
||||
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
|
||||
--
|
||||
-- # Status: TESTED 07 Dec 2016
|
||||
--
|
||||
-- @module TEST.AI_BALANCER.T001
|
||||
|
||||
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
|
||||
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
|
||||
|
||||
Binary file not shown.
@ -1,8 +1,4 @@
|
||||
--- AI Patrolling
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Name: Patrol AI
|
||||
-- Name: AIB-002 - Patrol AI.lua
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 December 2016
|
||||
--
|
||||
@ -39,7 +35,7 @@ function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
|
||||
|
||||
|
||||
PatrolZones[AIGroup] = AI_PATROLZONE:New( PatrolZone, 3000, 6000, 400, 600 )
|
||||
PatrolZones[AIGroup] = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 )
|
||||
PatrolZones[AIGroup]:ManageFuel( 0.2, 60 )
|
||||
PatrolZones[AIGroup]:SetControllable( AIGroup )
|
||||
PatrolZones[AIGroup]:__Start( 5 )
|
||||
|
||||
Binary file not shown.
@ -15,10 +15,10 @@ US_AI_Balancer = AI_BALANCER:New( US_PlanesClientSet, US_PlanesSpawn )
|
||||
|
||||
--local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Blue" )
|
||||
--local PatrolZoneBlue = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
|
||||
--local PatrolZoneB = AI_PATROLZONE:New( PatrolZoneBlue, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 )
|
||||
--local PatrolZoneB = AI_PATROL_ZONE:New( PatrolZoneBlue, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 )
|
||||
--US_AI_Balancer:SetPatrolZone( PatrolZoneB )
|
||||
--
|
||||
--local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Red" )
|
||||
--local PatrolZoneRed = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
|
||||
--local PatrolZoneR = AI_PATROLZONE:New( PatrolZoneRed, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 )
|
||||
--local PatrolZoneR = AI_PATROL_ZONE:New( PatrolZoneRed, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 )
|
||||
--RU_AI_Balancer:SetPatrolZone( PatrolZoneR )
|
||||
|
||||
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
-- Name: Respawn Test when Destroyed
|
||||
-- Name: AIB-004 - Respawn Test when Destroyed.lua
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 January 2017
|
||||
--
|
||||
@ -19,7 +19,7 @@
|
||||
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.
|
||||
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
|
||||
-- 4. Monitor that once a red AI is destroyed, that it ReSpawns...
|
||||
--
|
||||
|
||||
|
||||
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
|
||||
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
|
||||
@ -38,7 +38,7 @@ function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
|
||||
|
||||
|
||||
local Patrol = AI_PATROLZONE:New( PatrolZone, 3000, 6000, 400, 600 )
|
||||
local Patrol = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 )
|
||||
Patrol:ManageFuel( 0.2, 60 )
|
||||
Patrol:SetControllable( AIGroup )
|
||||
Patrol:__Start( 5 )
|
||||
|
||||
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
-- Name: AIB-006 - Declutter AI at Airbases
|
||||
-- Name: AIB-005 - Patrol AI and Randomize Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2016
|
||||
--
|
||||
@ -25,7 +25,7 @@ local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCa
|
||||
-- Define the SPAWN object for the red AI plane template.
|
||||
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
|
||||
-- If a blocked plane exists, this red plane will be ReSpawned.
|
||||
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 60 )
|
||||
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
|
||||
|
||||
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
|
||||
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
|
||||
@ -43,9 +43,9 @@ local PatrolZoneArray = { PatrolZone1, PatrolZone2 }
|
||||
|
||||
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
|
||||
local Patrol = AI_PATROLZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
|
||||
local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
|
||||
Patrol:ManageFuel( 0.2, 60 )
|
||||
Patrol:SetControllable( AIGroup )
|
||||
Patrol:__Start( 5 )
|
||||
Patrol:Start()
|
||||
|
||||
end
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,27 @@
|
||||
birds_avail = true --Birds availability. false - there is no birds
|
||||
birds_maximum_hrad = 200 --Maximum altitude above ground al sea level bird could be met
|
||||
birds_maximum_absolute_height = 8000 --Maximum absolute altitude bird could be met
|
||||
birds_minimum_velocity = 40 --Minimum velocity bird could be met
|
||||
birds_delta_time = 3.55
|
||||
birds_probability = {0.006333333*150,
|
||||
0.004166667*150,
|
||||
0.001966667*150,
|
||||
0.001090909*150,
|
||||
0.000741818*150,
|
||||
0.0006*150,
|
||||
0.000510545*150,
|
||||
0.000447273*150,
|
||||
0.000389455*150,
|
||||
0.000349091*150,
|
||||
0.000310909*150,
|
||||
0.000282545*150,
|
||||
0.000250909*150,
|
||||
0.000220364*150,
|
||||
0.000196364*150,
|
||||
0.000174545*150,
|
||||
0.000152727*150,
|
||||
0.000128727*150,
|
||||
0.000103636*150,
|
||||
7.63636E-05*150,
|
||||
0*150
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
settings=
|
||||
{
|
||||
["dials"]=
|
||||
{
|
||||
["channel"]=-1,
|
||||
},
|
||||
["presets"]=
|
||||
{
|
||||
[1]=124000000,
|
||||
[2]=124000000,
|
||||
[3]=131000000,
|
||||
[4]=139000000,
|
||||
},
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
-- Name: AIB-005 - Patrol AI and Randomize Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2016
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- For the red coalition, 2 client slots are foreseen.
|
||||
-- For those players that have not joined the mission, red AI is spawned.
|
||||
-- The red AI should start patrolling an area until fuel is empty and return to the home base.
|
||||
-- For each AI being spawned, ensure that they fly to a random zone defined within the mission editor.
|
||||
-- Right now there are two patrol zones defined, so the AI should start patrolliing in one of these zones.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. If no player is logging into the red slots, 2 red AI planes should be alive.
|
||||
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.
|
||||
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
|
||||
-- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa.
|
||||
-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa.
|
||||
-- 6. Ensure that you see the AI patrol in one of the two zones ...
|
||||
|
||||
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
|
||||
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
|
||||
|
||||
-- Define the SPAWN object for the red AI plane template.
|
||||
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
|
||||
-- If a blocked plane exists, this red plane will be ReSpawned.
|
||||
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
|
||||
|
||||
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
|
||||
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
|
||||
|
||||
-- Create the first polygon zone ...
|
||||
local PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
|
||||
local PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
|
||||
|
||||
-- Create the second polygon zone ...
|
||||
local PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" )
|
||||
local PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 )
|
||||
|
||||
-- Now, create an array of these zones ...
|
||||
local PatrolZoneArray = { PatrolZone1, PatrolZone2 }
|
||||
|
||||
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
|
||||
local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
|
||||
Patrol:ManageFuel( 0.2, 60 )
|
||||
Patrol:SetControllable( AIGroup )
|
||||
Patrol:Start()
|
||||
|
||||
end
|
||||
@ -0,0 +1,31 @@
|
||||
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170116_2116' )
|
||||
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
|
||||
Include.File = function( IncludeFile )
|
||||
if not Include.Files[ IncludeFile ] then
|
||||
Include.Files[IncludeFile] = IncludeFile
|
||||
env.info( "Include:" .. IncludeFile .. " from " .. Include.ProgramPath )
|
||||
local f = assert( base.loadfile( Include.ProgramPath .. IncludeFile .. ".lua" ) )
|
||||
if f == nil then
|
||||
error ("Could not load MOOSE file " .. IncludeFile .. ".lua" )
|
||||
else
|
||||
env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.ProgramPath )
|
||||
return f()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Include.ProgramPath = "Scripts/Moose/"
|
||||
|
||||
env.info( "Include.ProgramPath = " .. Include.ProgramPath)
|
||||
|
||||
Include.Files = {}
|
||||
|
||||
Include.File( "Moose" )
|
||||
|
||||
BASE:TraceOnOff( true )
|
||||
env.info( '*** MOOSE INCLUDE END *** ' )
|
||||
@ -0,0 +1,416 @@
|
||||
dictionary =
|
||||
{
|
||||
["DictKey_UnitName_89"] = "",
|
||||
["DictKey_UnitName_67"] = "AI US 1",
|
||||
["DictKey_UnitName_156"] = "RU Client #020",
|
||||
["DictKey_UnitName_297"] = "US Client #023",
|
||||
["DictKey_WptName_310"] = "",
|
||||
["DictKey_GroupName_125"] = "RU Client #010",
|
||||
["DictKey_UnitName_135"] = "RU Client #013",
|
||||
["DictKey_UnitName_374"] = "RU Client #004",
|
||||
["DictKey_WptName_292"] = "",
|
||||
["DictKey_WptName_48"] = "",
|
||||
["DictKey_GroupName_137"] = "RU Client #014",
|
||||
["DictKey_WptName_70"] = "",
|
||||
["DictKey_WptName_295"] = "",
|
||||
["DictKey_UnitName_25"] = "AI RU",
|
||||
["DictKey_GroupName_113"] = "RU Client #006",
|
||||
["DictKey_GroupName_284"] = "US Client #019",
|
||||
["DictKey_UnitName_312"] = "US Client #028",
|
||||
["DictKey_WptName_13"] = "",
|
||||
["DictKey_WptName_124"] = "",
|
||||
["DictKey_WptName_217"] = "",
|
||||
["DictKey_GroupName_10"] = "Client Group 2",
|
||||
["DictKey_GroupName_302"] = "US Client #025",
|
||||
["DictKey_UnitName_258"] = "US Client #010",
|
||||
["DictKey_WptName_181"] = "",
|
||||
["DictKey_WptName_109"] = "",
|
||||
["DictKey_WptName_336"] = "",
|
||||
["DictKey_GroupName_311"] = "US Client #028",
|
||||
["DictKey_GroupName_242"] = "US Client #005",
|
||||
["DictKey_UnitName_74"] = "Pilot #004",
|
||||
["DictKey_WptName_136"] = "",
|
||||
["DictKey_WptName_99"] = "",
|
||||
["DictKey_UnitName_315"] = "US Client #029",
|
||||
["DictKey_UnitName_43"] = "Client 5",
|
||||
["DictKey_GroupName_331"] = "PatrolZone2",
|
||||
["DictKey_WptName_178"] = "",
|
||||
["DictKey_GroupName_30"] = "AI RU",
|
||||
["DictKey_UnitName_249"] = "US Client #007",
|
||||
["DictKey_WptName_53"] = "",
|
||||
["DictKey_UnitName_171"] = "RU Client #025",
|
||||
["DictKey_WptName_289"] = "",
|
||||
["DictKey_GroupName_352"] = "RU Client #008",
|
||||
["DictKey_GroupName_260"] = "US Client #011",
|
||||
["DictKey_descriptionRedTask_2"] = "",
|
||||
["DictKey_WptName_55"] = "",
|
||||
["DictKey_GroupName_33"] = "AI RU",
|
||||
["DictKey_UnitName_183"] = "RU Client #029",
|
||||
["DictKey_WptName_190"] = "",
|
||||
["DictKey_UnitName_216"] = "RU Client #040",
|
||||
["DictKey_WptName_286"] = "",
|
||||
["DictKey_UnitName_153"] = "RU Client #019",
|
||||
["DictKey_WptName_75"] = "",
|
||||
["DictKey_UnitName_105"] = "RU Client #003",
|
||||
["DictKey_GroupName_382"] = "RU Client #007",
|
||||
["DictKey_UnitName_270"] = "US Client #014",
|
||||
["DictKey_WptName_47"] = "",
|
||||
["DictKey_GroupName_170"] = "RU Client #025",
|
||||
["DictKey_UnitName_46"] = "Client 7",
|
||||
["DictKey_WptName_92"] = "",
|
||||
["DictKey_UnitName_380"] = "RU Client #006",
|
||||
["DictKey_GroupName_191"] = "RU Client #032",
|
||||
["DictKey_UnitName_40"] = "Client 6",
|
||||
["DictKey_UnitName_95"] = "Pilot #002",
|
||||
["DictKey_GroupName_296"] = "US Client #023",
|
||||
["DictKey_WptName_244"] = "",
|
||||
["DictKey_UnitName_377"] = "RU Client #005",
|
||||
["DictKey_WptName_9"] = "",
|
||||
["DictKey_UnitName_11"] = "Client 2",
|
||||
["DictKey_GroupName_308"] = "US Client #027",
|
||||
["DictKey_GroupName_27"] = "AI RU",
|
||||
["DictKey_UnitName_22"] = "Client 4",
|
||||
["DictKey_WptName_62"] = "",
|
||||
["DictKey_GroupName_367"] = "RU Client #002",
|
||||
["DictKey_sortie_4"] = "",
|
||||
["DictKey_WptName_333"] = "",
|
||||
["DictKey_UnitName_356"] = "RU Client #009",
|
||||
["DictKey_GroupName_152"] = "RU Client #019",
|
||||
["DictKey_GroupName_281"] = "US Client #018",
|
||||
["DictKey_WptName_235"] = "",
|
||||
["DictKey_UnitName_362"] = "RU Client #011",
|
||||
["DictKey_WptName_375"] = "",
|
||||
["DictKey_GroupName_379"] = "RU Client #006",
|
||||
["DictKey_UnitName_267"] = "US Client #013",
|
||||
["DictKey_GroupName_173"] = "RU Client #026",
|
||||
["DictKey_GroupName_248"] = "US Client #007",
|
||||
["DictKey_WptName_369"] = "",
|
||||
["DictKey_UnitName_58"] = "Pilot #003",
|
||||
["DictKey_WptName_160"] = "",
|
||||
["DictKey_UnitName_246"] = "US Client #006",
|
||||
["DictKey_WptName_163"] = "",
|
||||
["DictKey_WptName_98"] = "",
|
||||
["DictKey_GroupName_340"] = "RU Client #004",
|
||||
["DictKey_UnitName_365"] = "RU Client #012",
|
||||
["DictKey_GroupName_221"] = "RU Client #042",
|
||||
["DictKey_UnitName_318"] = "US Client #030",
|
||||
["DictKey_GroupName_158"] = "RU Client #021",
|
||||
["DictKey_GroupName_320"] = "US Client #031",
|
||||
["DictKey_UnitName_34"] = "AI RU",
|
||||
["DictKey_WptName_208"] = "",
|
||||
["DictKey_WptName_334"] = "",
|
||||
["DictKey_WptName_54"] = "",
|
||||
["DictKey_WptName_82"] = "",
|
||||
["DictKey_UnitName_383"] = "RU Client #007",
|
||||
["DictKey_UnitName_234"] = "US Client #002",
|
||||
["DictKey_GroupName_104"] = "RU Client #003",
|
||||
["DictKey_UnitName_368"] = "RU Client #002",
|
||||
["DictKey_WptName_366"] = "",
|
||||
["DictKey_GroupName_206"] = "RU Client #037",
|
||||
["DictKey_GroupName_24"] = "AI RU",
|
||||
["DictKey_GroupName_325"] = "PatrolZone1",
|
||||
["DictKey_UnitName_225"] = "RU Client #043",
|
||||
["DictKey_WptName_328"] = "",
|
||||
["DictKey_WptName_193"] = "",
|
||||
["DictKey_UnitName_219"] = "RU Client #041",
|
||||
["DictKey_WptName_68"] = "",
|
||||
["DictKey_GroupName_122"] = "RU Client #009",
|
||||
["DictKey_GroupName_266"] = "US Client #013",
|
||||
["DictKey_UnitName_350"] = "RU Client #007",
|
||||
["DictKey_UnitName_341"] = "RU Client #004",
|
||||
["DictKey_UnitName_228"] = "RU Client #044",
|
||||
["DictKey_UnitName_204"] = "RU Client #036",
|
||||
["DictKey_WptName_49"] = "",
|
||||
["DictKey_UnitName_303"] = "US Client #025",
|
||||
["DictKey_GroupName_245"] = "US Client #006",
|
||||
["DictKey_GroupName_275"] = "US Client #016",
|
||||
["DictKey_WptName_90"] = "",
|
||||
["DictKey_UnitName_222"] = "RU Client #042",
|
||||
["DictKey_GroupName_110"] = "RU Client #005",
|
||||
["DictKey_UnitName_120"] = "RU Client #008",
|
||||
["DictKey_WptName_280"] = "",
|
||||
["DictKey_UnitName_144"] = "RU Client #016",
|
||||
["DictKey_UnitName_306"] = "US Client #026",
|
||||
["DictKey_WptName_118"] = "",
|
||||
["DictKey_WptName_307"] = "",
|
||||
["DictKey_UnitName_129"] = "RU Client #011",
|
||||
["DictKey_GroupName_59"] = "Client Group Range 1",
|
||||
["DictKey_GroupName_164"] = "RU Client #023",
|
||||
["DictKey_UnitName_252"] = "US Client #008",
|
||||
["DictKey_WptName_61"] = "",
|
||||
["DictKey_WptName_184"] = "",
|
||||
["DictKey_GroupName_361"] = "RU Client #011",
|
||||
["DictKey_WptName_80"] = "",
|
||||
["DictKey_GroupName_299"] = "US Client #024",
|
||||
["DictKey_GroupName_314"] = "US Client #029",
|
||||
["DictKey_WptName_86"] = "",
|
||||
["DictKey_GroupName_346"] = "RU Client #006",
|
||||
["DictKey_WptName_205"] = "",
|
||||
["DictKey_WptName_390"] = "",
|
||||
["DictKey_WptName_196"] = "",
|
||||
["DictKey_GroupName_263"] = "US Client #012",
|
||||
["DictKey_WptName_238"] = "",
|
||||
["DictKey_WptName_51"] = "",
|
||||
["DictKey_UnitName_150"] = "RU Client #018",
|
||||
["DictKey_WptName_76"] = "",
|
||||
["DictKey_UnitName_291"] = "US Client #021",
|
||||
["DictKey_WptName_127"] = "",
|
||||
["DictKey_GroupName_21"] = "Client Group 4",
|
||||
["DictKey_GroupName_364"] = "RU Client #012",
|
||||
["DictKey_GroupName_278"] = "US Client #017",
|
||||
["DictKey_WptName_44"] = "",
|
||||
["DictKey_WptName_335"] = "",
|
||||
["DictKey_WptName_100"] = "",
|
||||
["DictKey_GroupName_185"] = "RU Client #030",
|
||||
["DictKey_UnitName_321"] = "US Client #031",
|
||||
["DictKey_WptName_112"] = "",
|
||||
["DictKey_GroupName_230"] = "RU Client #045",
|
||||
["DictKey_UnitName_201"] = "RU Client #035",
|
||||
["DictKey_WptName_145"] = "",
|
||||
["DictKey_GroupName_128"] = "RU Client #011",
|
||||
["DictKey_descriptionBlueTask_3"] = "",
|
||||
["DictKey_WptName_241"] = "",
|
||||
["DictKey_descriptionText_1"] = "-- Name: AIB-005 - Patrol AI and Randomize Zones\
|
||||
-- Author: FlightControl\
|
||||
-- Date Created: 10 Jan 2016\
|
||||
--\
|
||||
-- # Situation:\
|
||||
--\
|
||||
-- For the red coalition, 2 client slots are foreseen.\
|
||||
-- For those players that have not joined the mission, red AI is spawned.\
|
||||
-- The red AI should start patrolling an area until fuel is empty and return to the home base.\
|
||||
-- For each AI being spawned, ensure that they fly to a random zone defined within the mission editor.\
|
||||
-- Right now there are two patrol zones defined, so the AI should start patrolliing in one of these zones.\
|
||||
-- \
|
||||
-- # Test cases:\
|
||||
-- \
|
||||
-- 1. If no player is logging into the red slots, 2 red AI planes should be alive.\
|
||||
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.\
|
||||
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.\
|
||||
-- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa.\
|
||||
-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa.\
|
||||
-- 6. Ensure that you see the AI patrol in one of the two zones ...\
|
||||
",
|
||||
["DictKey_GroupName_134"] = "RU Client #013",
|
||||
["DictKey_UnitName_102"] = "RU Client #002",
|
||||
["DictKey_WptName_378"] = "",
|
||||
["DictKey_GroupName_224"] = "RU Client #043",
|
||||
["DictKey_UnitName_371"] = "RU Client #003",
|
||||
["DictKey_UnitName_392"] = "RU Client #010",
|
||||
["DictKey_UnitName_108"] = "RU Client #004",
|
||||
["DictKey_UnitName_132"] = "RU Client #012",
|
||||
["DictKey_UnitName_174"] = "RU Client #026",
|
||||
["DictKey_WptName_274"] = "",
|
||||
["DictKey_GroupName_176"] = "RU Client #027",
|
||||
["DictKey_WptName_339"] = "",
|
||||
["DictKey_WptName_199"] = "",
|
||||
["DictKey_UnitName_123"] = "RU Client #009",
|
||||
["DictKey_WptName_81"] = "",
|
||||
["DictKey_UnitName_213"] = "RU Client #039",
|
||||
["DictKey_WptName_211"] = "",
|
||||
["DictKey_GroupName_227"] = "RU Client #044",
|
||||
["DictKey_WptName_77"] = "",
|
||||
["DictKey_WptName_29"] = "",
|
||||
["DictKey_WptName_166"] = "",
|
||||
["DictKey_WptName_396"] = "",
|
||||
["DictKey_UnitName_168"] = "RU Client #024",
|
||||
["DictKey_UnitName_210"] = "RU Client #038",
|
||||
["DictKey_WptName_169"] = "",
|
||||
["DictKey_GroupName_7"] = "US Client #001",
|
||||
["DictKey_WptName_384"] = "",
|
||||
["DictKey_WptName_354"] = "",
|
||||
["DictKey_GroupName_143"] = "RU Client #016",
|
||||
["DictKey_UnitName_288"] = "US Client #020",
|
||||
["DictKey_GroupName_155"] = "RU Client #020",
|
||||
["DictKey_GroupName_236"] = "US Client #003",
|
||||
["DictKey_ActionText_17"] = "",
|
||||
["DictKey_WptName_157"] = "",
|
||||
["DictKey_UnitName_114"] = "RU Client #006",
|
||||
["DictKey_WptName_298"] = "",
|
||||
["DictKey_WptName_142"] = "",
|
||||
["DictKey_GroupName_254"] = "US Client #009",
|
||||
["DictKey_WptName_91"] = "",
|
||||
["DictKey_WptName_259"] = "",
|
||||
["DictKey_WptName_23"] = "",
|
||||
["DictKey_WptName_172"] = "",
|
||||
["DictKey_WptName_214"] = "",
|
||||
["DictKey_UnitName_264"] = "US Client #012",
|
||||
["DictKey_WptName_151"] = "",
|
||||
["DictKey_UnitName_15"] = "AI US 2",
|
||||
["DictKey_GroupName_45"] = "Client Group 7",
|
||||
["DictKey_WptName_71"] = "",
|
||||
["DictKey_WptName_26"] = "",
|
||||
["DictKey_UnitName_57"] = "Pilot #002",
|
||||
["DictKey_UnitName_31"] = "AI RU",
|
||||
["DictKey_UnitName_111"] = "RU Client #005",
|
||||
["DictKey_WptName_12"] = "",
|
||||
["DictKey_GroupName_39"] = "Client Group 6",
|
||||
["DictKey_WptName_52"] = "",
|
||||
["DictKey_UnitName_159"] = "RU Client #021",
|
||||
["DictKey_WptName_38"] = "",
|
||||
["DictKey_UnitName_138"] = "RU Client #014",
|
||||
["DictKey_WptName_330"] = "",
|
||||
["DictKey_UnitName_309"] = "US Client #027",
|
||||
["DictKey_WptName_85"] = "",
|
||||
["DictKey_GroupName_290"] = "US Client #021",
|
||||
["DictKey_GroupName_373"] = "RU Client #004",
|
||||
["DictKey_UnitName_240"] = "US Client #004",
|
||||
["DictKey_GroupName_358"] = "RU Client #010",
|
||||
["DictKey_WptName_247"] = "",
|
||||
["DictKey_WptName_223"] = "",
|
||||
["DictKey_WptName_324"] = "",
|
||||
["DictKey_GroupName_18"] = "RU Client #001",
|
||||
["DictKey_WptName_148"] = "",
|
||||
["DictKey_GroupName_349"] = "RU Client #007",
|
||||
["DictKey_GroupName_36"] = "AI RU",
|
||||
["DictKey_WptName_130"] = "",
|
||||
["DictKey_WptName_381"] = "",
|
||||
["DictKey_UnitName_180"] = "RU Client #028",
|
||||
["DictKey_UnitName_117"] = "RU Client #007",
|
||||
["DictKey_WptName_329"] = "",
|
||||
["DictKey_GroupName_73"] = "Patrol Zone Blue",
|
||||
["DictKey_WptName_121"] = "",
|
||||
["DictKey_WptName_78"] = "",
|
||||
["DictKey_UnitName_147"] = "RU Client #017",
|
||||
["DictKey_UnitName_56"] = "Pilot #001",
|
||||
["DictKey_GroupName_203"] = "RU Client #036",
|
||||
["DictKey_GroupName_337"] = "RU Client #003",
|
||||
["DictKey_WptName_304"] = "",
|
||||
["DictKey_WptName_103"] = "",
|
||||
["DictKey_WptName_265"] = "",
|
||||
["DictKey_GroupName_14"] = "AI US 2",
|
||||
["DictKey_UnitName_282"] = "US Client #018",
|
||||
["DictKey_WptName_357"] = "",
|
||||
["DictKey_WptName_175"] = "",
|
||||
["DictKey_WptName_327"] = "",
|
||||
["DictKey_WptName_342"] = "",
|
||||
["DictKey_WptName_154"] = "",
|
||||
["DictKey_GroupName_391"] = "RU Client #010",
|
||||
["DictKey_UnitName_359"] = "RU Client #010",
|
||||
["DictKey_GroupName_197"] = "RU Client #034",
|
||||
["DictKey_GroupName_42"] = "Client Group 5",
|
||||
["DictKey_WptName_283"] = "",
|
||||
["DictKey_GroupName_161"] = "RU Client #022",
|
||||
["DictKey_UnitName_19"] = "RU Client #001",
|
||||
["DictKey_UnitName_237"] = "US Client #003",
|
||||
["DictKey_WptName_65"] = "",
|
||||
["DictKey_WptName_372"] = "",
|
||||
["DictKey_WptName_322"] = "",
|
||||
["DictKey_WptName_97"] = "",
|
||||
["DictKey_WptName_360"] = "",
|
||||
["DictKey_GroupName_131"] = "RU Client #012",
|
||||
["DictKey_WptName_16"] = "",
|
||||
["DictKey_GroupName_101"] = "RU Client #002",
|
||||
["DictKey_WptName_202"] = "",
|
||||
["DictKey_UnitName_198"] = "RU Client #034",
|
||||
["DictKey_WptName_253"] = "",
|
||||
["DictKey_GroupName_394"] = "RU Client #011",
|
||||
["DictKey_WptName_32"] = "",
|
||||
["DictKey_UnitName_279"] = "US Client #017",
|
||||
["DictKey_GroupName_305"] = "US Client #026",
|
||||
["DictKey_UnitName_141"] = "RU Client #015",
|
||||
["DictKey_WptName_79"] = "",
|
||||
["DictKey_UnitName_207"] = "RU Client #037",
|
||||
["DictKey_WptName_250"] = "",
|
||||
["DictKey_GroupName_116"] = "RU Client #007",
|
||||
["DictKey_GroupName_94"] = "Patrol Zone Red",
|
||||
["DictKey_GroupName_212"] = "RU Client #039",
|
||||
["DictKey_GroupName_233"] = "US Client #002",
|
||||
["DictKey_GroupName_200"] = "RU Client #035",
|
||||
["DictKey_WptName_96"] = "",
|
||||
["DictKey_WptName_50"] = "",
|
||||
["DictKey_WptName_115"] = "",
|
||||
["DictKey_WptName_226"] = "",
|
||||
["DictKey_UnitName_126"] = "RU Client #010",
|
||||
["DictKey_UnitName_243"] = "US Client #005",
|
||||
["DictKey_WptName_316"] = "",
|
||||
["DictKey_WptName_69"] = "",
|
||||
["DictKey_UnitName_347"] = "RU Client #006",
|
||||
["DictKey_GroupName_209"] = "RU Client #038",
|
||||
["DictKey_UnitName_28"] = "AI RU",
|
||||
["DictKey_GroupName_215"] = "RU Client #040",
|
||||
["DictKey_WptName_64"] = "",
|
||||
["DictKey_UnitName_192"] = "RU Client #032",
|
||||
["DictKey_UnitName_338"] = "RU Client #003",
|
||||
["DictKey_GroupName_257"] = "US Client #010",
|
||||
["DictKey_GroupName_188"] = "RU Client #031",
|
||||
["DictKey_GroupName_107"] = "RU Client #004",
|
||||
["DictKey_UnitName_255"] = "US Client #009",
|
||||
["DictKey_UnitName_231"] = "RU Client #045",
|
||||
["DictKey_UnitName_88"] = "Pilot #001",
|
||||
["DictKey_WptName_232"] = "",
|
||||
["DictKey_UnitName_195"] = "RU Client #033",
|
||||
["DictKey_GroupName_370"] = "RU Client #003",
|
||||
["DictKey_WptName_229"] = "",
|
||||
["DictKey_WptName_256"] = "",
|
||||
["DictKey_WptName_345"] = "",
|
||||
["DictKey_WptName_277"] = "",
|
||||
["DictKey_WptName_63"] = "",
|
||||
["DictKey_WptName_363"] = "",
|
||||
["DictKey_GroupName_167"] = "RU Client #024",
|
||||
["DictKey_GroupName_385"] = "RU Client #008",
|
||||
["DictKey_GroupName_376"] = "RU Client #005",
|
||||
["DictKey_UnitName_60"] = "Client Range 1",
|
||||
["DictKey_UnitName_326"] = "Pilot #001",
|
||||
["DictKey_GroupName_388"] = "RU Client #009",
|
||||
["DictKey_GroupName_251"] = "US Client #008",
|
||||
["DictKey_WptName_41"] = "",
|
||||
["DictKey_UnitName_273"] = "US Client #015",
|
||||
["DictKey_GroupName_66"] = "AI US",
|
||||
["DictKey_WptName_87"] = "",
|
||||
["DictKey_GroupName_343"] = "RU Client #005",
|
||||
["DictKey_GroupName_119"] = "RU Client #008",
|
||||
["DictKey_WptName_268"] = "",
|
||||
["DictKey_WptName_220"] = "",
|
||||
["DictKey_WptName_262"] = "",
|
||||
["DictKey_WptName_83"] = "",
|
||||
["DictKey_WptName_72"] = "",
|
||||
["DictKey_UnitName_276"] = "US Client #016",
|
||||
["DictKey_WptName_387"] = "",
|
||||
["DictKey_GroupName_272"] = "US Client #015",
|
||||
["DictKey_WptName_187"] = "",
|
||||
["DictKey_UnitName_189"] = "RU Client #031",
|
||||
["DictKey_UnitName_162"] = "RU Client #022",
|
||||
["DictKey_GroupName_146"] = "RU Client #017",
|
||||
["DictKey_GroupName_140"] = "RU Client #015",
|
||||
["DictKey_GroupName_239"] = "US Client #004",
|
||||
["DictKey_UnitName_353"] = "RU Client #008",
|
||||
["DictKey_UnitName_386"] = "RU Client #008",
|
||||
["DictKey_WptName_351"] = "",
|
||||
["DictKey_WptName_313"] = "",
|
||||
["DictKey_UnitName_93"] = "Pilot #001",
|
||||
["DictKey_GroupName_287"] = "US Client #020",
|
||||
["DictKey_UnitName_395"] = "RU Client #011",
|
||||
["DictKey_UnitName_332"] = "Pilot #002",
|
||||
["DictKey_WptName_133"] = "",
|
||||
["DictKey_UnitName_186"] = "RU Client #030",
|
||||
["DictKey_GroupName_194"] = "RU Client #033",
|
||||
["DictKey_GroupName_179"] = "RU Client #028",
|
||||
["DictKey_GroupName_269"] = "US Client #014",
|
||||
["DictKey_WptName_20"] = "",
|
||||
["DictKey_WptName_348"] = "",
|
||||
["DictKey_WptName_301"] = "",
|
||||
["DictKey_UnitName_285"] = "US Client #019",
|
||||
["DictKey_UnitName_344"] = "RU Client #005",
|
||||
["DictKey_WptName_393"] = "",
|
||||
["DictKey_WptName_84"] = "",
|
||||
["DictKey_GroupName_355"] = "RU Client #009",
|
||||
["DictKey_UnitName_177"] = "RU Client #027",
|
||||
["DictKey_UnitName_37"] = "AI RU",
|
||||
["DictKey_WptName_319"] = "",
|
||||
["DictKey_WptName_106"] = "",
|
||||
["DictKey_UnitName_294"] = "US Client #022",
|
||||
["DictKey_UnitName_165"] = "RU Client #023",
|
||||
["DictKey_WptName_35"] = "",
|
||||
["DictKey_UnitName_261"] = "US Client #011",
|
||||
["DictKey_GroupName_293"] = "US Client #022",
|
||||
["DictKey_UnitName_389"] = "RU Client #009",
|
||||
["DictKey_GroupName_182"] = "RU Client #029",
|
||||
["DictKey_UnitName_300"] = "US Client #024",
|
||||
["DictKey_GroupName_317"] = "US Client #030",
|
||||
["DictKey_WptName_271"] = "",
|
||||
["DictKey_WptName_139"] = "",
|
||||
["DictKey_GroupName_149"] = "RU Client #018",
|
||||
["DictKey_GroupName_218"] = "RU Client #041",
|
||||
["DictKey_UnitName_8"] = "US Client #001",
|
||||
} -- end of dictionary
|
||||
@ -0,0 +1,5 @@
|
||||
mapResource =
|
||||
{
|
||||
["ResKey_Action_323"] = "Moose.lua",
|
||||
["ResKey_Action_6"] = "AIB-005 - Patrol AI and Randomize Zones.lua",
|
||||
} -- end of mapResource
|
||||
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@ warehouses =
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["coalition"] = "RED",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
@ -62,7 +62,7 @@ warehouses =
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["coalition"] = "BLUE",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
@ -100,7 +100,7 @@ warehouses =
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["coalition"] = "RED",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
@ -138,7 +138,7 @@ warehouses =
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["coalition"] = "RED",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
@ -176,7 +176,7 @@ warehouses =
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["coalition"] = "BLUE",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
@ -35,7 +35,7 @@ local PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
|
||||
|
||||
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
|
||||
local Patrol = AI_PATROLZONE:New( PatrolZone1, 3000, 6000, 400, 600 )
|
||||
local Patrol = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 )
|
||||
Patrol:ManageFuel( 0.2, 60 )
|
||||
Patrol:SetControllable( AIGroup )
|
||||
Patrol:__Start( 5 )
|
||||
|
||||
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
-- Name: CAP-001 - Combat Air Patrol
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 16 January 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
|
||||
local CapPlane = GROUP:FindByName( "Plane" )
|
||||
|
||||
local PatrolZone = ZONE:New( "Patrol Zone" )
|
||||
|
||||
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
|
||||
|
||||
AICapZone:SetControllable( CapPlane )
|
||||
|
||||
AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone.
|
||||
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
-- Name: CAP-001 - Combat Air Patrol
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 16 January 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
|
||||
local CapPlane = GROUP:FindByName( "Plane" )
|
||||
|
||||
local PatrolZone = ZONE:New( "Patrol Zone" )
|
||||
|
||||
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
|
||||
|
||||
AICapZone:SetControllable( CapPlane )
|
||||
AICapZone:SetEngageRange( 20000 ) -- Set the Engage Range to 20.000 meters. The AI won't engage when the enemy is beyond 20.000 meters.
|
||||
|
||||
AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone.
|
||||
Binary file not shown.
@ -0,0 +1,23 @@
|
||||
-- Name: CAP-001 - Combat Air Patrol
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 16 January 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
|
||||
local CapPlane = GROUP:FindByName( "Plane" )
|
||||
|
||||
local PatrolZone = ZONE:New( "Patrol Zone" )
|
||||
|
||||
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
|
||||
|
||||
local EngageZoneGroup = GROUP:FindByName( "Engage Zone" )
|
||||
|
||||
local CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup )
|
||||
|
||||
AICapZone:SetControllable( CapPlane )
|
||||
AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone.
|
||||
|
||||
AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone.
|
||||
Binary file not shown.
@ -6,32 +6,54 @@
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
|
||||
-- Create a local variable (in this case called CASEngagementZone) and
|
||||
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
|
||||
-- currently on the map and assign it to this variable
|
||||
local CASEngagementZone = ZONE:New( "Engagement Zone" )
|
||||
|
||||
-- Create a local variable (in this case called CASPlane) and
|
||||
-- using the GROUP function find the aircraft group called "Plane" and assign to this variable
|
||||
local CASPlane = GROUP:FindByName( "Plane" )
|
||||
|
||||
-- Create a local Variable (in this cased called PatrolZone and
|
||||
-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable
|
||||
local PatrolZone = ZONE:New( "Patrol Zone" )
|
||||
|
||||
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 350, 600, CASEngagementZone )
|
||||
-- Create and object (in this case called AICasZone) and
|
||||
-- using the functions AI_CAS_ZONE assign the parameters that define this object
|
||||
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
|
||||
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
|
||||
|
||||
-- Create an object (in this case called Targets) and
|
||||
-- using the GROUP function find the group labeled "Targets" and assign it to this object
|
||||
local Targets = GROUP:FindByName("Targets")
|
||||
|
||||
AICasZone:SetControllable(CASPlane)
|
||||
AICasZone:__Start(1)
|
||||
AICasZone:__Engage(10)
|
||||
|
||||
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function
|
||||
AICasZone:SetControllable( CASPlane )
|
||||
|
||||
-- Tell the group CASPlane to start the mission in 1 second.
|
||||
AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone.
|
||||
|
||||
-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds)
|
||||
AICasZone:__Engage( 600 )
|
||||
|
||||
-- Check every 60 seconds whether the Targets have been eliminated.
|
||||
-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone.
|
||||
Check = SCHEDULER:New(nil,
|
||||
Check, CheckScheduleID = SCHEDULER:New(nil,
|
||||
function()
|
||||
BASE:E( { "In Scheduler: ", Targets:GetSize() } )
|
||||
if Targets:IsAlive() and Targets:GetSize() ~= 0 then
|
||||
if Targets:IsAlive() and Targets:GetSize() > 5 then
|
||||
BASE:E("Still alive")
|
||||
else
|
||||
BASE:E("Destroyed")
|
||||
AICasZone:__Completed(1)
|
||||
AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol.
|
||||
Check:Stop(CheckScheduleID)
|
||||
end
|
||||
end, {}, 20, 60, 0.2 )
|
||||
|
||||
|
||||
|
||||
|
||||
-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ...
|
||||
function AICasZone:OnAfterAccomplish( Controllable, From, Event, To )
|
||||
AICasZone:__RTB( 1 )
|
||||
end
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -1,18 +0,0 @@
|
||||
dictionary =
|
||||
{
|
||||
["DictKey_WptName_7"] = "",
|
||||
["DictKey_WptName_11"] = "",
|
||||
["DictKey_descriptionText_1"] = "",
|
||||
["DictKey_descriptionBlueTask_3"] = "",
|
||||
["DictKey_WptName_10"] = "",
|
||||
["DictKey_UnitName_9"] = "Unit #1",
|
||||
["DictKey_sortie_4"] = "",
|
||||
["DictKey_UnitName_13"] = "Unit #002",
|
||||
["DictKey_GroupName_8"] = "New Vehicle Group",
|
||||
["DictKey_UnitName_14"] = "Unit #003",
|
||||
["DictKey_UnitName_15"] = "Unit #004",
|
||||
["DictKey_GroupName_5"] = "RU25T",
|
||||
["DictKey_UnitName_6"] = "Pilot #001",
|
||||
["DictKey_UnitName_12"] = "Unit #001",
|
||||
["DictKey_descriptionRedTask_2"] = "",
|
||||
} -- end of dictionary
|
||||
@ -1,3 +0,0 @@
|
||||
mapResource =
|
||||
{
|
||||
} -- end of mapResource
|
||||
@ -1,878 +0,0 @@
|
||||
mission =
|
||||
{
|
||||
["trig"] =
|
||||
{
|
||||
["actions"] =
|
||||
{
|
||||
}, -- end of ["actions"]
|
||||
["events"] =
|
||||
{
|
||||
}, -- end of ["events"]
|
||||
["custom"] =
|
||||
{
|
||||
}, -- end of ["custom"]
|
||||
["func"] =
|
||||
{
|
||||
}, -- end of ["func"]
|
||||
["flag"] =
|
||||
{
|
||||
}, -- end of ["flag"]
|
||||
["conditions"] =
|
||||
{
|
||||
}, -- end of ["conditions"]
|
||||
["customStartup"] =
|
||||
{
|
||||
}, -- end of ["customStartup"]
|
||||
["funcStartup"] =
|
||||
{
|
||||
}, -- end of ["funcStartup"]
|
||||
}, -- end of ["trig"]
|
||||
["date"] =
|
||||
{
|
||||
["Day"] = 1,
|
||||
["Year"] = 2011,
|
||||
["Month"] = 6,
|
||||
}, -- end of ["date"]
|
||||
["maxDictId"] = 15,
|
||||
["result"] =
|
||||
{
|
||||
["offline"] =
|
||||
{
|
||||
["conditions"] =
|
||||
{
|
||||
}, -- end of ["conditions"]
|
||||
["actions"] =
|
||||
{
|
||||
}, -- end of ["actions"]
|
||||
["func"] =
|
||||
{
|
||||
}, -- end of ["func"]
|
||||
}, -- end of ["offline"]
|
||||
["total"] = 0,
|
||||
["blue"] =
|
||||
{
|
||||
["conditions"] =
|
||||
{
|
||||
}, -- end of ["conditions"]
|
||||
["actions"] =
|
||||
{
|
||||
}, -- end of ["actions"]
|
||||
["func"] =
|
||||
{
|
||||
}, -- end of ["func"]
|
||||
}, -- end of ["blue"]
|
||||
["red"] =
|
||||
{
|
||||
["conditions"] =
|
||||
{
|
||||
}, -- end of ["conditions"]
|
||||
["actions"] =
|
||||
{
|
||||
}, -- end of ["actions"]
|
||||
["func"] =
|
||||
{
|
||||
}, -- end of ["func"]
|
||||
}, -- end of ["red"]
|
||||
}, -- end of ["result"]
|
||||
["groundControl"] =
|
||||
{
|
||||
["isPilotControlVehicles"] = false,
|
||||
["roles"] =
|
||||
{
|
||||
["artillery_commander"] =
|
||||
{
|
||||
["blue"] = 0,
|
||||
["red"] = 0,
|
||||
}, -- end of ["artillery_commander"]
|
||||
["instructor"] =
|
||||
{
|
||||
["blue"] = 0,
|
||||
["red"] = 0,
|
||||
}, -- end of ["instructor"]
|
||||
["observer"] =
|
||||
{
|
||||
["blue"] = 0,
|
||||
["red"] = 0,
|
||||
}, -- end of ["observer"]
|
||||
["forward_observer"] =
|
||||
{
|
||||
["blue"] = 0,
|
||||
["red"] = 0,
|
||||
}, -- end of ["forward_observer"]
|
||||
}, -- end of ["roles"]
|
||||
}, -- end of ["groundControl"]
|
||||
["triggers"] =
|
||||
{
|
||||
["zones"] =
|
||||
{
|
||||
}, -- end of ["zones"]
|
||||
}, -- end of ["triggers"]
|
||||
["weather"] =
|
||||
{
|
||||
["atmosphere_type"] = 0,
|
||||
["wind"] =
|
||||
{
|
||||
["at8000"] =
|
||||
{
|
||||
["speed"] = 0,
|
||||
["dir"] = 0,
|
||||
}, -- end of ["at8000"]
|
||||
["at2000"] =
|
||||
{
|
||||
["speed"] = 0,
|
||||
["dir"] = 0,
|
||||
}, -- end of ["at2000"]
|
||||
["atGround"] =
|
||||
{
|
||||
["speed"] = 0,
|
||||
["dir"] = 0,
|
||||
}, -- end of ["atGround"]
|
||||
}, -- end of ["wind"]
|
||||
["enable_fog"] = false,
|
||||
["season"] =
|
||||
{
|
||||
["temperature"] = 20,
|
||||
}, -- end of ["season"]
|
||||
["type_weather"] = 0,
|
||||
["qnh"] = 760,
|
||||
["cyclones"] =
|
||||
{
|
||||
}, -- end of ["cyclones"]
|
||||
["name"] = "Winter, clean sky",
|
||||
["fog"] =
|
||||
{
|
||||
["thickness"] = 0,
|
||||
["visibility"] = 25,
|
||||
["density"] = 7,
|
||||
}, -- end of ["fog"]
|
||||
["groundTurbulence"] = 0,
|
||||
["visibility"] =
|
||||
{
|
||||
["distance"] = 80000,
|
||||
}, -- end of ["visibility"]
|
||||
["clouds"] =
|
||||
{
|
||||
["thickness"] = 200,
|
||||
["density"] = 0,
|
||||
["base"] = 300,
|
||||
["iprecptns"] = 0,
|
||||
}, -- end of ["clouds"]
|
||||
}, -- end of ["weather"]
|
||||
["theatre"] = "Caucasus",
|
||||
["needModules"] =
|
||||
{
|
||||
}, -- end of ["needModules"]
|
||||
["map"] =
|
||||
{
|
||||
["centerY"] = 627628.57142857,
|
||||
["zoom"] = 100000,
|
||||
["centerX"] = -293371.42857143,
|
||||
}, -- end of ["map"]
|
||||
["coalitions"] =
|
||||
{
|
||||
["neutrals"] =
|
||||
{
|
||||
[1] = 7,
|
||||
[2] = 17,
|
||||
[3] = 22,
|
||||
[4] = 23,
|
||||
[5] = 25,
|
||||
[6] = 29,
|
||||
[7] = 30,
|
||||
[8] = 31,
|
||||
[9] = 32,
|
||||
[10] = 33,
|
||||
[11] = 35,
|
||||
[12] = 36,
|
||||
[13] = 39,
|
||||
[14] = 41,
|
||||
[15] = 42,
|
||||
[16] = 44,
|
||||
[17] = 46,
|
||||
[18] = 48,
|
||||
[19] = 49,
|
||||
[20] = 50,
|
||||
[21] = 51,
|
||||
[22] = 52,
|
||||
[23] = 53,
|
||||
[24] = 54,
|
||||
[25] = 55,
|
||||
[26] = 56,
|
||||
[27] = 57,
|
||||
[28] = 58,
|
||||
[29] = 59,
|
||||
[30] = 60,
|
||||
[31] = 61,
|
||||
[32] = 62,
|
||||
[33] = 63,
|
||||
[34] = 64,
|
||||
[35] = 65,
|
||||
}, -- end of ["neutrals"]
|
||||
["blue"] =
|
||||
{
|
||||
[1] = 11,
|
||||
[2] = 4,
|
||||
[3] = 6,
|
||||
[4] = 16,
|
||||
[5] = 13,
|
||||
[6] = 15,
|
||||
[7] = 9,
|
||||
[8] = 8,
|
||||
[9] = 12,
|
||||
[10] = 2,
|
||||
[11] = 3,
|
||||
[12] = 5,
|
||||
[13] = 10,
|
||||
[14] = 20,
|
||||
[15] = 21,
|
||||
[16] = 40,
|
||||
[17] = 26,
|
||||
[18] = 45,
|
||||
[19] = 28,
|
||||
}, -- end of ["blue"]
|
||||
["red"] =
|
||||
{
|
||||
[1] = 0,
|
||||
[2] = 1,
|
||||
[3] = 18,
|
||||
[4] = 19,
|
||||
[5] = 37,
|
||||
[6] = 24,
|
||||
[7] = 27,
|
||||
[8] = 43,
|
||||
[9] = 47,
|
||||
[10] = 34,
|
||||
[11] = 38,
|
||||
}, -- end of ["red"]
|
||||
}, -- end of ["coalitions"]
|
||||
["descriptionText"] = "DictKey_descriptionText_1",
|
||||
["pictureFileNameR"] =
|
||||
{
|
||||
}, -- end of ["pictureFileNameR"]
|
||||
["descriptionBlueTask"] = "DictKey_descriptionBlueTask_3",
|
||||
["descriptionRedTask"] = "DictKey_descriptionRedTask_2",
|
||||
["pictureFileNameB"] =
|
||||
{
|
||||
}, -- end of ["pictureFileNameB"]
|
||||
["trigrules"] =
|
||||
{
|
||||
}, -- end of ["trigrules"]
|
||||
["coalition"] =
|
||||
{
|
||||
["blue"] =
|
||||
{
|
||||
["bullseye"] =
|
||||
{
|
||||
["y"] = 617414,
|
||||
["x"] = -291014,
|
||||
}, -- end of ["bullseye"]
|
||||
["nav_points"] =
|
||||
{
|
||||
}, -- end of ["nav_points"]
|
||||
["name"] = "blue",
|
||||
["country"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["id"] = 11,
|
||||
["name"] = "Belgium",
|
||||
}, -- end of [1]
|
||||
[2] =
|
||||
{
|
||||
["id"] = 4,
|
||||
["name"] = "UK",
|
||||
}, -- end of [2]
|
||||
[3] =
|
||||
{
|
||||
["id"] = 6,
|
||||
["name"] = "Germany",
|
||||
}, -- end of [3]
|
||||
[4] =
|
||||
{
|
||||
["id"] = 16,
|
||||
["name"] = "Georgia",
|
||||
}, -- end of [4]
|
||||
[5] =
|
||||
{
|
||||
["id"] = 13,
|
||||
["name"] = "Denmark",
|
||||
}, -- end of [5]
|
||||
[6] =
|
||||
{
|
||||
["id"] = 15,
|
||||
["name"] = "Israel",
|
||||
}, -- end of [6]
|
||||
[7] =
|
||||
{
|
||||
["id"] = 9,
|
||||
["name"] = "Spain",
|
||||
}, -- end of [7]
|
||||
[8] =
|
||||
{
|
||||
["id"] = 8,
|
||||
["name"] = "Canada",
|
||||
}, -- end of [8]
|
||||
[9] =
|
||||
{
|
||||
["id"] = 12,
|
||||
["name"] = "Norway",
|
||||
}, -- end of [9]
|
||||
[10] =
|
||||
{
|
||||
["id"] = 2,
|
||||
["vehicle"] =
|
||||
{
|
||||
["group"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["visible"] = false,
|
||||
["taskSelected"] = true,
|
||||
["route"] =
|
||||
{
|
||||
["spans"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["y"] = 622200,
|
||||
["x"] = -288542.85714286,
|
||||
}, -- end of [1]
|
||||
[2] =
|
||||
{
|
||||
["y"] = 625342.85714286,
|
||||
["x"] = -286257.14285714,
|
||||
}, -- end of [2]
|
||||
}, -- end of [1]
|
||||
}, -- end of ["spans"]
|
||||
["points"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["alt"] = 3,
|
||||
["type"] = "Turning Point",
|
||||
["ETA"] = 0,
|
||||
["alt_type"] = "BARO",
|
||||
["formation_template"] = "",
|
||||
["y"] = 622978.57142857,
|
||||
["x"] = -287792.85714286,
|
||||
["name"] = "DictKey_WptName_10",
|
||||
["ETA_locked"] = true,
|
||||
["speed"] = 5.5555555555556,
|
||||
["action"] = "Off Road",
|
||||
["task"] =
|
||||
{
|
||||
["id"] = "ComboTask",
|
||||
["params"] =
|
||||
{
|
||||
["tasks"] =
|
||||
{
|
||||
}, -- end of ["tasks"]
|
||||
}, -- end of ["params"]
|
||||
}, -- end of ["task"]
|
||||
["speed_locked"] = true,
|
||||
}, -- end of [1]
|
||||
}, -- end of ["points"]
|
||||
}, -- end of ["route"]
|
||||
["groupId"] = 2,
|
||||
["tasks"] =
|
||||
{
|
||||
}, -- end of ["tasks"]
|
||||
["hidden"] = false,
|
||||
["units"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["type"] = "AAV7",
|
||||
["transportable"] =
|
||||
{
|
||||
["randomTransportable"] = false,
|
||||
}, -- end of ["transportable"]
|
||||
["unitId"] = 2,
|
||||
["skill"] = "Average",
|
||||
["y"] = 622978.57142857,
|
||||
["x"] = -287792.85714286,
|
||||
["name"] = "DictKey_UnitName_9",
|
||||
["playerCanDrive"] = true,
|
||||
["heading"] = 0.94200004037947,
|
||||
}, -- end of [1]
|
||||
[2] =
|
||||
{
|
||||
["type"] = "AAV7",
|
||||
["transportable"] =
|
||||
{
|
||||
["randomTransportable"] = false,
|
||||
}, -- end of ["transportable"]
|
||||
["unitId"] = 3,
|
||||
["skill"] = "Average",
|
||||
["y"] = 622457.14285714,
|
||||
["x"] = -288121.42857143,
|
||||
["name"] = "DictKey_UnitName_12",
|
||||
["playerCanDrive"] = true,
|
||||
["heading"] = 0.94200004037947,
|
||||
}, -- end of [2]
|
||||
[3] =
|
||||
{
|
||||
["type"] = "AAV7",
|
||||
["transportable"] =
|
||||
{
|
||||
["randomTransportable"] = false,
|
||||
}, -- end of ["transportable"]
|
||||
["unitId"] = 4,
|
||||
["skill"] = "Average",
|
||||
["y"] = 621935.71428571,
|
||||
["x"] = -288892.85714286,
|
||||
["name"] = "DictKey_UnitName_13",
|
||||
["playerCanDrive"] = true,
|
||||
["heading"] = 0.94200004037947,
|
||||
}, -- end of [3]
|
||||
[4] =
|
||||
{
|
||||
["type"] = "M1043 HMMWV Armament",
|
||||
["transportable"] =
|
||||
{
|
||||
["randomTransportable"] = false,
|
||||
}, -- end of ["transportable"]
|
||||
["unitId"] = 5,
|
||||
["skill"] = "Average",
|
||||
["y"] = 620992.85714286,
|
||||
["x"] = -287100,
|
||||
["name"] = "DictKey_UnitName_14",
|
||||
["playerCanDrive"] = true,
|
||||
["heading"] = 0.94200004037947,
|
||||
}, -- end of [4]
|
||||
[5] =
|
||||
{
|
||||
["type"] = "AAV7",
|
||||
["transportable"] =
|
||||
{
|
||||
["randomTransportable"] = false,
|
||||
}, -- end of ["transportable"]
|
||||
["unitId"] = 6,
|
||||
["skill"] = "Average",
|
||||
["y"] = 623271.42857143,
|
||||
["x"] = -286535.71428571,
|
||||
["name"] = "DictKey_UnitName_15",
|
||||
["playerCanDrive"] = true,
|
||||
["heading"] = 0.94200004037947,
|
||||
}, -- end of [5]
|
||||
}, -- end of ["units"]
|
||||
["y"] = 622978.57142857,
|
||||
["x"] = -287792.85714286,
|
||||
["name"] = "DictKey_GroupName_8",
|
||||
["start_time"] = 0,
|
||||
["task"] = "Ground Nothing",
|
||||
}, -- end of [1]
|
||||
}, -- end of ["group"]
|
||||
}, -- end of ["vehicle"]
|
||||
["name"] = "USA",
|
||||
}, -- end of [10]
|
||||
[11] =
|
||||
{
|
||||
["id"] = 3,
|
||||
["name"] = "Turkey",
|
||||
}, -- end of [11]
|
||||
[12] =
|
||||
{
|
||||
["id"] = 5,
|
||||
["name"] = "France",
|
||||
}, -- end of [12]
|
||||
[13] =
|
||||
{
|
||||
["id"] = 10,
|
||||
["name"] = "The Netherlands",
|
||||
}, -- end of [13]
|
||||
[14] =
|
||||
{
|
||||
["id"] = 20,
|
||||
["name"] = "Italy",
|
||||
}, -- end of [14]
|
||||
[15] =
|
||||
{
|
||||
["id"] = 21,
|
||||
["name"] = "Australia",
|
||||
}, -- end of [15]
|
||||
[16] =
|
||||
{
|
||||
["id"] = 40,
|
||||
["name"] = "Poland",
|
||||
}, -- end of [16]
|
||||
[17] =
|
||||
{
|
||||
["id"] = 26,
|
||||
["name"] = "Czech Republic",
|
||||
}, -- end of [17]
|
||||
[18] =
|
||||
{
|
||||
["id"] = 45,
|
||||
["name"] = "South Korea",
|
||||
}, -- end of [18]
|
||||
[19] =
|
||||
{
|
||||
["id"] = 28,
|
||||
["name"] = "Croatia",
|
||||
}, -- end of [19]
|
||||
}, -- end of ["country"]
|
||||
}, -- end of ["blue"]
|
||||
["red"] =
|
||||
{
|
||||
["bullseye"] =
|
||||
{
|
||||
["y"] = 371700,
|
||||
["x"] = 11557,
|
||||
}, -- end of ["bullseye"]
|
||||
["nav_points"] =
|
||||
{
|
||||
}, -- end of ["nav_points"]
|
||||
["name"] = "red",
|
||||
["country"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["id"] = 0,
|
||||
["name"] = "Russia",
|
||||
["plane"] =
|
||||
{
|
||||
["group"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["modulation"] = 0,
|
||||
["tasks"] =
|
||||
{
|
||||
}, -- end of ["tasks"]
|
||||
["radioSet"] = false,
|
||||
["task"] = "CAS",
|
||||
["uncontrolled"] = false,
|
||||
["route"] =
|
||||
{
|
||||
["points"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["alt"] = 2000,
|
||||
["action"] = "Turning Point",
|
||||
["alt_type"] = "BARO",
|
||||
["properties"] =
|
||||
{
|
||||
["vnav"] = 1,
|
||||
["scale"] = 0,
|
||||
["angle"] = 0,
|
||||
["vangle"] = 0,
|
||||
["steer"] = 2,
|
||||
}, -- end of ["properties"]
|
||||
["speed"] = 138.88888888889,
|
||||
["task"] =
|
||||
{
|
||||
["id"] = "ComboTask",
|
||||
["params"] =
|
||||
{
|
||||
["tasks"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["enabled"] = true,
|
||||
["auto"] = false,
|
||||
["id"] = "WrappedAction",
|
||||
["number"] = 1,
|
||||
["params"] =
|
||||
{
|
||||
["action"] =
|
||||
{
|
||||
["id"] = "Option",
|
||||
["params"] =
|
||||
{
|
||||
["value"] = 2,
|
||||
["name"] = 0,
|
||||
}, -- end of ["params"]
|
||||
}, -- end of ["action"]
|
||||
}, -- end of ["params"]
|
||||
}, -- end of [1]
|
||||
[2] =
|
||||
{
|
||||
["enabled"] = true,
|
||||
["auto"] = false,
|
||||
["id"] = "WrappedAction",
|
||||
["number"] = 2,
|
||||
["params"] =
|
||||
{
|
||||
["action"] =
|
||||
{
|
||||
["id"] = "Option",
|
||||
["params"] =
|
||||
{
|
||||
["value"] = 1,
|
||||
["name"] = 1,
|
||||
}, -- end of ["params"]
|
||||
}, -- end of ["action"]
|
||||
}, -- end of ["params"]
|
||||
}, -- end of [2]
|
||||
[3] =
|
||||
{
|
||||
["enabled"] = true,
|
||||
["auto"] = false,
|
||||
["id"] = "AttackUnit",
|
||||
["number"] = 3,
|
||||
["params"] =
|
||||
{
|
||||
["altitudeEnabled"] = false,
|
||||
["unitId"] = 2,
|
||||
["attackQtyLimit"] = false,
|
||||
["attackQty"] = 1,
|
||||
["expend"] = "Auto",
|
||||
["altitude"] = 2000,
|
||||
["directionEnabled"] = false,
|
||||
["groupAttack"] = false,
|
||||
["weaponType"] = 1073741822,
|
||||
["direction"] = 0,
|
||||
}, -- end of ["params"]
|
||||
}, -- end of [3]
|
||||
[4] =
|
||||
{
|
||||
["enabled"] = true,
|
||||
["auto"] = false,
|
||||
["id"] = "AttackUnit",
|
||||
["number"] = 4,
|
||||
["params"] =
|
||||
{
|
||||
["altitudeEnabled"] = false,
|
||||
["unitId"] = 3,
|
||||
["attackQtyLimit"] = false,
|
||||
["attackQty"] = 1,
|
||||
["expend"] = "Auto",
|
||||
["altitude"] = 2000,
|
||||
["directionEnabled"] = false,
|
||||
["groupAttack"] = false,
|
||||
["weaponType"] = 1073741822,
|
||||
["direction"] = 0,
|
||||
}, -- end of ["params"]
|
||||
}, -- end of [4]
|
||||
[5] =
|
||||
{
|
||||
["enabled"] = true,
|
||||
["auto"] = false,
|
||||
["id"] = "AttackUnit",
|
||||
["number"] = 5,
|
||||
["params"] =
|
||||
{
|
||||
["altitudeEnabled"] = false,
|
||||
["unitId"] = 4,
|
||||
["attackQtyLimit"] = false,
|
||||
["attackQty"] = 1,
|
||||
["expend"] = "Auto",
|
||||
["altitude"] = 2000,
|
||||
["directionEnabled"] = false,
|
||||
["groupAttack"] = false,
|
||||
["weaponType"] = 1073741822,
|
||||
["direction"] = 0,
|
||||
}, -- end of ["params"]
|
||||
}, -- end of [5]
|
||||
[6] =
|
||||
{
|
||||
["enabled"] = true,
|
||||
["auto"] = false,
|
||||
["id"] = "AttackUnit",
|
||||
["number"] = 6,
|
||||
["params"] =
|
||||
{
|
||||
["altitudeEnabled"] = false,
|
||||
["unitId"] = 5,
|
||||
["attackQtyLimit"] = false,
|
||||
["attackQty"] = 1,
|
||||
["expend"] = "Auto",
|
||||
["altitude"] = 2000,
|
||||
["directionEnabled"] = false,
|
||||
["groupAttack"] = false,
|
||||
["weaponType"] = 1073741822,
|
||||
["direction"] = 0,
|
||||
}, -- end of ["params"]
|
||||
}, -- end of [6]
|
||||
[7] =
|
||||
{
|
||||
["enabled"] = true,
|
||||
["auto"] = false,
|
||||
["id"] = "AttackUnit",
|
||||
["number"] = 7,
|
||||
["params"] =
|
||||
{
|
||||
["altitudeEnabled"] = false,
|
||||
["unitId"] = 6,
|
||||
["attackQtyLimit"] = false,
|
||||
["attackQty"] = 1,
|
||||
["expend"] = "Auto",
|
||||
["altitude"] = 2000,
|
||||
["directionEnabled"] = false,
|
||||
["groupAttack"] = false,
|
||||
["weaponType"] = 1073741822,
|
||||
["direction"] = 0,
|
||||
}, -- end of ["params"]
|
||||
}, -- end of [7]
|
||||
}, -- end of ["tasks"]
|
||||
}, -- end of ["params"]
|
||||
}, -- end of ["task"]
|
||||
["type"] = "Turning Point",
|
||||
["ETA"] = 0,
|
||||
["ETA_locked"] = true,
|
||||
["y"] = 619400,
|
||||
["x"] = -285628.57142857,
|
||||
["name"] = "DictKey_WptName_7",
|
||||
["formation_template"] = "",
|
||||
["speed_locked"] = true,
|
||||
}, -- end of [1]
|
||||
}, -- end of ["points"]
|
||||
}, -- end of ["route"]
|
||||
["groupId"] = 1,
|
||||
["hidden"] = false,
|
||||
["units"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["alt"] = 2000,
|
||||
["hardpoint_racks"] = true,
|
||||
["alt_type"] = "BARO",
|
||||
["livery_id"] = "af standard 1",
|
||||
["skill"] = "Excellent",
|
||||
["speed"] = 138.88888888889,
|
||||
["type"] = "Su-25T",
|
||||
["unitId"] = 1,
|
||||
["psi"] = 0,
|
||||
["y"] = 619400,
|
||||
["x"] = -285628.57142857,
|
||||
["name"] = "DictKey_UnitName_6",
|
||||
["payload"] =
|
||||
{
|
||||
["pylons"] =
|
||||
{
|
||||
[1] =
|
||||
{
|
||||
["CLSID"] = "{44EE8698-89F9-48EE-AF36-5FD31896A82D}",
|
||||
}, -- end of [1]
|
||||
[2] =
|
||||
{
|
||||
["CLSID"] = "{CBC29BFE-3D24-4C64-B81D-941239D12249}",
|
||||
}, -- end of [2]
|
||||
[3] =
|
||||
{
|
||||
["CLSID"] = "{0180F983-C14A-11d8-9897-000476191836}",
|
||||
}, -- end of [3]
|
||||
[4] =
|
||||
{
|
||||
["CLSID"] = "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}",
|
||||
}, -- end of [4]
|
||||
[5] =
|
||||
{
|
||||
["CLSID"] = "{E92CBFE5-C153-11d8-9897-000476191836}",
|
||||
}, -- end of [5]
|
||||
[6] =
|
||||
{
|
||||
["CLSID"] = "{B1EF6B0E-3D91-4047-A7A5-A99E7D8B4A8B}",
|
||||
}, -- end of [6]
|
||||
[7] =
|
||||
{
|
||||
["CLSID"] = "{E92CBFE5-C153-11d8-9897-000476191836}",
|
||||
}, -- end of [7]
|
||||
[8] =
|
||||
{
|
||||
["CLSID"] = "{F789E86A-EE2E-4E6B-B81E-D5E5F903B6ED}",
|
||||
}, -- end of [8]
|
||||
[9] =
|
||||
{
|
||||
["CLSID"] = "{0180F983-C14A-11d8-9897-000476191836}",
|
||||
}, -- end of [9]
|
||||
[10] =
|
||||
{
|
||||
["CLSID"] = "{CBC29BFE-3D24-4C64-B81D-941239D12249}",
|
||||
}, -- end of [10]
|
||||
[11] =
|
||||
{
|
||||
["CLSID"] = "{44EE8698-89F9-48EE-AF36-5FD31896A82C}",
|
||||
}, -- end of [11]
|
||||
}, -- end of ["pylons"]
|
||||
["fuel"] = "3790",
|
||||
["flare"] = 128,
|
||||
["chaff"] = 128,
|
||||
["gun"] = 100,
|
||||
}, -- end of ["payload"]
|
||||
["heading"] = 0,
|
||||
["callsign"] = 101,
|
||||
["onboard_num"] = "010",
|
||||
}, -- end of [1]
|
||||
}, -- end of ["units"]
|
||||
["y"] = 619400,
|
||||
["x"] = -285628.57142857,
|
||||
["name"] = "DictKey_GroupName_5",
|
||||
["communication"] = true,
|
||||
["start_time"] = 0,
|
||||
["frequency"] = 124,
|
||||
}, -- end of [1]
|
||||
}, -- end of ["group"]
|
||||
}, -- end of ["plane"]
|
||||
}, -- end of [1]
|
||||
[2] =
|
||||
{
|
||||
["id"] = 1,
|
||||
["name"] = "Ukraine",
|
||||
}, -- end of [2]
|
||||
[3] =
|
||||
{
|
||||
["id"] = 18,
|
||||
["name"] = "Abkhazia",
|
||||
}, -- end of [3]
|
||||
[4] =
|
||||
{
|
||||
["id"] = 19,
|
||||
["name"] = "South Ossetia",
|
||||
}, -- end of [4]
|
||||
[5] =
|
||||
{
|
||||
["id"] = 37,
|
||||
["name"] = "Kazakhstan",
|
||||
}, -- end of [5]
|
||||
[6] =
|
||||
{
|
||||
["id"] = 24,
|
||||
["name"] = "Belarus",
|
||||
}, -- end of [6]
|
||||
[7] =
|
||||
{
|
||||
["id"] = 27,
|
||||
["name"] = "China",
|
||||
}, -- end of [7]
|
||||
[8] =
|
||||
{
|
||||
["id"] = 43,
|
||||
["name"] = "Serbia",
|
||||
}, -- end of [8]
|
||||
[9] =
|
||||
{
|
||||
["id"] = 47,
|
||||
["name"] = "Syria",
|
||||
}, -- end of [9]
|
||||
[10] =
|
||||
{
|
||||
["id"] = 34,
|
||||
["name"] = "Iran",
|
||||
}, -- end of [10]
|
||||
[11] =
|
||||
{
|
||||
["id"] = 38,
|
||||
["name"] = "North Korea",
|
||||
}, -- end of [11]
|
||||
}, -- end of ["country"]
|
||||
}, -- end of ["red"]
|
||||
}, -- end of ["coalition"]
|
||||
["sortie"] = "DictKey_sortie_4",
|
||||
["version"] = 12,
|
||||
["goals"] =
|
||||
{
|
||||
}, -- end of ["goals"]
|
||||
["currentKey"] = 175,
|
||||
["start_time"] = 43200,
|
||||
["forcedOptions"] =
|
||||
{
|
||||
}, -- end of ["forcedOptions"]
|
||||
["failures"] =
|
||||
{
|
||||
}, -- end of ["failures"]
|
||||
} -- end of mission
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
-- This test mission models the behaviour of the AI_PATROLZONE class.
|
||||
-- This test mission models the behaviour of the AI_PATROL_ZONE class.
|
||||
--
|
||||
-- It creates a 2 AI_PATROLZONE objects with the name Patrol1 and Patrol2.
|
||||
-- It creates a 2 AI_PATROL_ZONE objects with the name Patrol1 and Patrol2.
|
||||
-- Patrol1 will govern a GROUP object to patrol the zone defined by PatrolZone1, within 3000 meters and 6000 meters, within a speed of 400 and 600 km/h.
|
||||
-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 60 secondes, before returning to base.
|
||||
--
|
||||
@ -23,16 +23,16 @@ local PatrolZone2 = ZONE_POLYGON:New( "Patrol Zone 2", PatrolZoneGroup2 )
|
||||
local PatrolSpawn = SPAWN:New( "Patrol Group" )
|
||||
local PatrolGroup = PatrolSpawn:Spawn()
|
||||
|
||||
local Patrol1 = AI_PATROLZONE:New( PatrolZone1, 3000, 6000, 400, 600 )
|
||||
local Patrol1 = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 )
|
||||
Patrol1:ManageFuel( 0.2, 60 )
|
||||
Patrol1:SetControllable( PatrolGroup )
|
||||
Patrol1:__Start( 5 )
|
||||
|
||||
local Patrol2 = AI_PATROLZONE:New( PatrolZone2, 600, 1000, 300, 400 )
|
||||
local Patrol2 = AI_PATROL_ZONE:New( PatrolZone2, 600, 1000, 300, 400 )
|
||||
Patrol2:ManageFuel( 0.2, 0 )
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||
-- @param #AI_PATROLZONE self
|
||||
-- @param #AI_PATROL_ZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
-- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
|
||||
function Patrol1:OnLeaveRTB( AIGroup )
|
||||
@ -40,7 +40,7 @@ function Patrol1:OnLeaveRTB( AIGroup )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||
-- @param Process_PatrolCore.Zone#AI_PATROLZONE self
|
||||
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function Patrol1:OnAfterRTB( AIGroup )
|
||||
local NewGroup = PatrolSpawn:Spawn()
|
||||
@ -49,14 +49,14 @@ function Patrol1:OnAfterRTB( AIGroup )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||
-- @param Process_PatrolCore.Zone#AI_PATROLZONE self
|
||||
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function Patrol1:OnEnterPatrol( AIGroup )
|
||||
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||
-- @param #AI_PATROLZONE self
|
||||
-- @param #AI_PATROL_ZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
-- @return #boolean If false is returned, then the OnEnter state transition function will not be called.
|
||||
function Patrol2:OnBeforeRTB( AIGroup )
|
||||
@ -64,7 +64,7 @@ function Patrol2:OnBeforeRTB( AIGroup )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||
-- @param Process_PatrolCore.Zone#AI_PATROLZONE self
|
||||
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function Patrol2:OnEnterRTB( AIGroup )
|
||||
local NewGroup = PatrolSpawn:Spawn()
|
||||
@ -73,7 +73,7 @@ function Patrol2:OnEnterRTB( AIGroup )
|
||||
end
|
||||
|
||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||
-- @param Process_PatrolCore.Zone#AI_PATROLZONE self
|
||||
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
||||
-- @param Wrapper.Group#GROUP AIGroup
|
||||
function Patrol2:OnEnterPatrol( AIGroup )
|
||||
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 )
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user