mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Merge pull request #2 from FlightControl-Master/master
Merge FlightControl-Master/master to Delta-99/master
This commit is contained in:
commit
273b5fc7e5
4
DCS_Folder_Sync.bat
Normal file
4
DCS_Folder_Sync.bat
Normal file
@ -0,0 +1,4 @@
|
||||
rem This script will pull the latest changes from the remote repository, and update the submodules accordingly.
|
||||
|
||||
git pull
|
||||
git submodule update --init
|
||||
@ -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 )
|
||||
|
||||
528
Moose Development/Moose/AI/AI_CAP.lua
Normal file
528
Moose Development/Moose/AI/AI_CAP.lua
Normal file
@ -0,0 +1,528 @@
|
||||
--- 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.
|
||||
-- * **[Whisper](http://forums.eagle.ru/member.php?u=3829): Testing.
|
||||
-- * **[Delta99](https://forums.eagle.ru/member.php?u=125166): Testing.
|
||||
--
|
||||
-- ### 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 )
|
||||
|
||||
-- Call the parent Start event handler
|
||||
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
||||
|
||||
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
|
||||
|
||||
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, DetectedUnit:IsAlive(), DetectedUnit:IsAir() } )
|
||||
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( 1 )
|
||||
self:__Route( 1 )
|
||||
self:SetDetectionActivated()
|
||||
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" )
|
||||
|
||||
self:SetDetectionDeactivated()
|
||||
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:SetDetectionOff()
|
||||
end
|
||||
|
||||
|
||||
516
Moose Development/Moose/AI/AI_CAS.lua
Normal file
516
Moose Development/Moose/AI/AI_CAS.lua
Normal file
@ -0,0 +1,516 @@
|
||||
--- 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 @{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.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 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 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**
|
||||
--
|
||||
-- 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_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_PATROL_ZONE
|
||||
AI_CAS_ZONE = {
|
||||
ClassName = "AI_CAS_ZONE",
|
||||
}
|
||||
|
||||
|
||||
|
||||
--- Creates a new AI_CAS_ZONE object
|
||||
-- @param #AI_CAS_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.
|
||||
-- @param Core.Zone#ZONE EngageZone
|
||||
-- @return #AI_CAS_ZONE self
|
||||
function AI_CAS_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageZone )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, AI_PATROL_ZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed ) ) -- #AI_CAS_ZONE
|
||||
|
||||
self.EngageZone = EngageZone
|
||||
self.Accomplished = false
|
||||
|
||||
self:SetDetectionZone( self.EngageZone )
|
||||
|
||||
self:AddTransition( { "Patrolling", "Engaging" }, "Engage", "Engaging" ) -- FSM_CONTROLLABLE Transition for type #AI_CAS_ZONE.
|
||||
|
||||
--- 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.
|
||||
|
||||
--- 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.
|
||||
|
||||
--- 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.
|
||||
-- @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_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.
|
||||
|
||||
--- Synchronous Event Trigger for Event Abort.
|
||||
-- @function [parent=#AI_CAS_ZONE] Abort
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- Asynchronous Event Trigger for Event Abort.
|
||||
-- @function [parent=#AI_CAS_ZONE] __Abort
|
||||
-- @param #AI_CAS_ZONE self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
self:AddTransition( "Engaging", "Accomplish", "Patrolling" ) -- 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.
|
||||
|
||||
--- 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.
|
||||
|
||||
--- Synchronous Event Trigger for Event Accomplish.
|
||||
-- @function [parent=#AI_CAS_ZONE] Accomplish
|
||||
-- @param #AI_CAS_ZONE self
|
||||
|
||||
--- 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.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAS_ZONE:onafterStart( Controllable, From, Event, To )
|
||||
|
||||
-- Call the parent Start event handler
|
||||
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
||||
self:EventOnDead( self.OnDead )
|
||||
|
||||
end
|
||||
|
||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||
function _NewEngageRoute( AIControllable )
|
||||
|
||||
AIControllable:T( "NewEngageRoute" )
|
||||
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.
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To )
|
||||
|
||||
if Controllable:IsAlive() then
|
||||
|
||||
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
|
||||
|
||||
-- Find a random 2D point in EngageZone.
|
||||
local ToEngageZoneVec2 = self.EngageZone:GetRandomVec2()
|
||||
self:T2( ToEngageZoneVec2 )
|
||||
|
||||
-- Define Speed and Altitude.
|
||||
local ToEngageZoneAltitude = math.random( self.EngageFloorAltitude, self.EngageCeilingAltitude )
|
||||
local ToEngageZoneSpeed = self.PatrolMaxSpeed
|
||||
self:T2( ToEngageZoneSpeed )
|
||||
|
||||
-- Obtain a 3D @{Point} from the 2D point + altitude.
|
||||
local ToEngageZonePointVec3 = POINT_VEC3:New( ToEngageZoneVec2.x, ToEngageZoneAltitude, ToEngageZoneVec2.y )
|
||||
|
||||
-- Create a route point of type air.
|
||||
local ToEngageZoneRoutePoint = ToEngageZonePointVec3:RoutePointAir(
|
||||
POINT_VEC3.RoutePointAltType.BARO,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
ToEngageZoneSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
EngageRoute[#EngageRoute+1] = ToEngageZoneRoutePoint
|
||||
|
||||
end
|
||||
|
||||
--- Define a random point in the @{Zone}. The AI will fly to that point within the zone.
|
||||
|
||||
--- Find a random 2D point in EngageZone.
|
||||
local ToTargetVec2 = self.EngageZone: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 ToTargetRoutePoint = ToTargetPointVec3:RoutePointAir(
|
||||
POINT_VEC3.RoutePointAltType.BARO,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
ToTargetSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
ToTargetPointVec3:SmokeBlue()
|
||||
|
||||
EngageRoute[#EngageRoute+1] = ToTargetRoutePoint
|
||||
|
||||
|
||||
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() 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
|
||||
|
||||
EngageRoute[1].task = Controllable:TaskCombo( AttackTasks )
|
||||
|
||||
--- 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 )
|
||||
|
||||
--- 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, "_NewEngageRoute" )
|
||||
|
||||
--- NOW ROUTE THE GROUP!
|
||||
self.Controllable:WayPointExecute( 1, 2 )
|
||||
end
|
||||
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.
|
||||
-- @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:SetDetectionOff()
|
||||
end
|
||||
|
||||
--- @param #AI_CAS_ZONE self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function AI_CAS_ZONE:OnDead( EventData )
|
||||
self:T( { "EventDead", EventData } )
|
||||
|
||||
if EventData.IniDCSUnit then
|
||||
self:__Destroy( 1, EventData )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -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
@ -115,6 +115,19 @@
|
||||
-- * @{#BASE.GetClassName}(): Gets the name of the object, which is the name of the class the object was instantiated from.
|
||||
-- * @{#BASE.GetClassNameAndID}(): Gets the name and ID of the object.
|
||||
--
|
||||
-- ## 1.5) All objects derived from BASE can have "States"
|
||||
--
|
||||
-- A mechanism is in place in MOOSE, that allows to let the objects administer **states**.
|
||||
-- States are essentially properties of objects, which are identified by a **Key** and a **Value**.
|
||||
-- The method @{#BASE.SetState}() can be used to set a Value with a reference Key to the object.
|
||||
-- To **read or retrieve** a state Value based on a Key, use the @{#BASE.GetState} method.
|
||||
-- These two methods provide a very handy way to keep state at long lasting processes.
|
||||
-- Values can be stored within the objects, and later retrieved or changed when needed.
|
||||
-- There is one other important thing to note, the @{#BASE.SetState}() and @{#BASE.GetState} methods
|
||||
-- receive as the **first parameter the object for which the state needs to be set**.
|
||||
-- Thus, if the state is to be set for the same object as the object for which the method is used, then provide the same
|
||||
-- object name to the method.
|
||||
--
|
||||
-- ## 1.10) BASE Inheritance (tree) support
|
||||
--
|
||||
-- The following methods are available to support inheritance:
|
||||
@ -706,25 +719,41 @@ function BASE:onEvent(event)
|
||||
end
|
||||
end
|
||||
|
||||
function BASE:SetState( Object, StateName, State )
|
||||
--- Set a state or property of the Object given a Key and a Value.
|
||||
-- Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.
|
||||
-- @param #BASE self
|
||||
-- @param Object The object that will hold the Value set by the Key.
|
||||
-- @param Key The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!
|
||||
-- @param Value The value to is stored in the object.
|
||||
-- @return The Value set.
|
||||
-- @return #nil The Key was not found and thus the Value could not be retrieved.
|
||||
function BASE:SetState( Object, Key, Value )
|
||||
|
||||
local ClassNameAndID = Object:GetClassNameAndID()
|
||||
|
||||
self.States[ClassNameAndID] = self.States[ClassNameAndID] or {}
|
||||
self.States[ClassNameAndID][StateName] = State
|
||||
self:T2( { ClassNameAndID, StateName, State } )
|
||||
self.States[ClassNameAndID][Key] = Value
|
||||
self:T2( { ClassNameAndID, Key, Value } )
|
||||
|
||||
return self.States[ClassNameAndID][StateName]
|
||||
return self.States[ClassNameAndID][Key]
|
||||
end
|
||||
|
||||
function BASE:GetState( Object, StateName )
|
||||
|
||||
|
||||
--- Get a Value given a Key from the Object.
|
||||
-- Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.
|
||||
-- @param #BASE self
|
||||
-- @param Object The object that holds the Value set by the Key.
|
||||
-- @param Key The key that is used to retrieve the value. Note that the key can be a #string, but it can also be any other type!
|
||||
-- @param Value The value to is stored in the Object.
|
||||
-- @return The Value retrieved.
|
||||
function BASE:GetState( Object, Key )
|
||||
|
||||
local ClassNameAndID = Object:GetClassNameAndID()
|
||||
|
||||
if self.States[ClassNameAndID] then
|
||||
local State = self.States[ClassNameAndID][StateName] or false
|
||||
self:T2( { ClassNameAndID, StateName, State } )
|
||||
return State
|
||||
local Value = self.States[ClassNameAndID][Key] or false
|
||||
self:T2( { ClassNameAndID, Key, Value } )
|
||||
return Value
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
@ -717,6 +717,16 @@ end
|
||||
-- @param #EVENTDATA Event
|
||||
function EVENT:onEvent( Event )
|
||||
|
||||
local ErrorHandler = function( errmsg )
|
||||
|
||||
env.info( "Error in SCHEDULER function:" .. errmsg )
|
||||
if debug ~= nil then
|
||||
env.info( debug.traceback() )
|
||||
end
|
||||
|
||||
return errmsg
|
||||
end
|
||||
|
||||
if self and self.Events and self.Events[Event.id] then
|
||||
if Event.initiator and Event.initiator:getCategory() == Object.Category.UNIT then
|
||||
Event.IniDCSUnit = Event.initiator
|
||||
@ -758,14 +768,16 @@ function EVENT:onEvent( Event )
|
||||
-- If the EventData is for a UNIT, the call directly the EventClass EventFunction for that UNIT.
|
||||
if Event.IniDCSUnitName and EventData.IniUnit and EventData.IniUnit[Event.IniDCSUnitName] then
|
||||
self:T( { "Calling EventFunction for Class ", EventClass:GetClassNameAndID(), ", Unit ", Event.IniUnitName } )
|
||||
EventData.IniUnit[Event.IniDCSUnitName].EventFunction( EventData.IniUnit[Event.IniDCSUnitName].EventClass, Event )
|
||||
local Result, Value = xpcall( function() return EventData.IniUnit[Event.IniDCSUnitName].EventFunction( EventData.IniUnit[Event.IniDCSUnitName].EventClass, Event ) end, ErrorHandler )
|
||||
--EventData.IniUnit[Event.IniDCSUnitName].EventFunction( EventData.IniUnit[Event.IniDCSUnitName].EventClass, Event )
|
||||
else
|
||||
-- If the EventData is not bound to a specific unit, then call the EventClass EventFunction.
|
||||
-- Note that here the EventFunction will need to implement and determine the logic for the relevant source- or target unit, or weapon.
|
||||
if Event.IniDCSUnit and not EventData.IniUnit then
|
||||
if EventClass == EventData.EventClass then
|
||||
self:T( { "Calling EventFunction for Class ", EventClass:GetClassNameAndID() } )
|
||||
EventData.EventFunction( EventData.EventClass, Event )
|
||||
local Result, Value = xpcall( function() return EventData.EventFunction( EventData.EventClass, Event ) end, ErrorHandler )
|
||||
--EventData.EventFunction( EventData.EventClass, Event )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
-- The following example provides a little demonstration on the difference between synchronous and asynchronous Event Triggering.
|
||||
--
|
||||
-- function FSM:OnAfterEvent( From, Event, To, Amount )
|
||||
-- self:E( { Amount = Amount } )
|
||||
-- self:T( { Amount = Amount } )
|
||||
-- end
|
||||
--
|
||||
-- local Amount = 1
|
||||
@ -198,7 +198,7 @@
|
||||
-- 
|
||||
--
|
||||
-- function FsmDemo:OnAfterSwitch( From, Event, To, FsmUnit )
|
||||
-- self:E( { From, Event, To, FsmUnit } )
|
||||
-- self:T( { From, Event, To, FsmUnit } )
|
||||
--
|
||||
-- if From == "Green" then
|
||||
-- FsmUnit:Flare(FLARECOLOR.Green)
|
||||
@ -221,7 +221,7 @@
|
||||
--
|
||||
-- For debugging reasons the received parameters are traced within the DCS.log.
|
||||
--
|
||||
-- self:E( { From, Event, To, FsmUnit } )
|
||||
-- self:T( { From, Event, To, FsmUnit } )
|
||||
--
|
||||
-- The method will check if the From state received is either "Green" or "Red" and will flare the respective color from the FsmUnit.
|
||||
--
|
||||
@ -365,7 +365,7 @@ do -- FSM
|
||||
Transition.Event = Event
|
||||
Transition.To = To
|
||||
|
||||
self:E( Transition )
|
||||
self:T( Transition )
|
||||
|
||||
self._Transitions[Transition] = Transition
|
||||
self:_eventmap( self.Events, Transition )
|
||||
@ -387,7 +387,7 @@ do -- FSM
|
||||
-- @param #table ReturnEvents A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.
|
||||
-- @return Core.Fsm#FSM_PROCESS The SubFSM.
|
||||
function FSM:AddProcess( From, Event, Process, ReturnEvents )
|
||||
self:E( { From, Event, Process, ReturnEvents } )
|
||||
self:T( { From, Event, Process, ReturnEvents } )
|
||||
|
||||
local Sub = {}
|
||||
Sub.From = From
|
||||
@ -417,7 +417,7 @@ do -- FSM
|
||||
|
||||
for ProcessID, Process in pairs( self:GetProcesses() ) do
|
||||
if Process.From == From and Process.Event == Event then
|
||||
self:E( Process )
|
||||
self:T( Process )
|
||||
return Process.fsm
|
||||
end
|
||||
end
|
||||
@ -468,7 +468,7 @@ do -- FSM
|
||||
|
||||
local Process = self:GetProcess( From, Event )
|
||||
|
||||
self:E( { Process = Process._Name, Scores = Process._Scores, State = State, ScoreText = ScoreText, Score = Score } )
|
||||
self:T( { Process = Process._Name, Scores = Process._Scores, State = State, ScoreText = ScoreText, Score = Score } )
|
||||
Process._Scores[State] = Process._Scores[State] or {}
|
||||
Process._Scores[State].ScoreText = ScoreText
|
||||
Process._Scores[State].Score = Score
|
||||
@ -528,26 +528,35 @@ do -- FSM
|
||||
|
||||
function FSM:_call_handler(handler, params)
|
||||
if self[handler] then
|
||||
self:E( "Calling " .. handler )
|
||||
return self[handler]( self, unpack(params) )
|
||||
self:T( "Calling " .. handler )
|
||||
local Value = self[handler]( self, unpack(params) )
|
||||
return Value
|
||||
end
|
||||
end
|
||||
|
||||
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:T( "FSM Transition for " .. self.Controllable.ControllableName .. " :" .. self.current .. " --> " .. EventName .. " --> " .. to )
|
||||
else
|
||||
self:T( "FSM Transition:" .. self.current .. " --> " .. EventName .. " --> " .. to )
|
||||
end
|
||||
|
||||
if self:_call_handler("onbefore" .. EventName, params) == false
|
||||
or self:_call_handler("OnBefore" .. EventName, params) == false
|
||||
or self:_call_handler("onleave" .. from, params) == false
|
||||
or self:_call_handler("OnLeave" .. from, params) == false then
|
||||
if ( self:_call_handler("onbefore" .. EventName, params) == false )
|
||||
or ( self:_call_handler("OnBefore" .. EventName, params) == false )
|
||||
or ( self:_call_handler("onleave" .. from, params) == false )
|
||||
or ( self:_call_handler("OnLeave" .. from, params) == false ) then
|
||||
self:T( "Cancel Transition" )
|
||||
return false
|
||||
end
|
||||
|
||||
@ -561,7 +570,7 @@ do -- FSM
|
||||
-- self:F2( "nextevent = " .. sub.nextevent )
|
||||
-- self[sub.nextevent]( self )
|
||||
--end
|
||||
self:E( "calling sub start event: " .. sub.StartEvent )
|
||||
self:T( "calling sub start event: " .. sub.StartEvent )
|
||||
sub.fsm.fsmparent = self
|
||||
sub.fsm.ReturnEvents = sub.ReturnEvents
|
||||
sub.fsm[sub.StartEvent]( sub.fsm )
|
||||
@ -592,29 +601,30 @@ do -- FSM
|
||||
|
||||
self:_call_handler("onstatechange", params)
|
||||
end
|
||||
else
|
||||
self:T( "Cannot execute transition." )
|
||||
self:T( { From = self.current, Event = EventName, To = to, Can = Can } )
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
function FSM:_delayed_transition( EventName )
|
||||
self:E( { EventName = EventName } )
|
||||
return function( self, DelaySeconds, ... )
|
||||
self:T( "Delayed Event: " .. EventName )
|
||||
self:T2( "Delayed Event: " .. EventName )
|
||||
local CallID = self.CallScheduler:Schedule( self, self._handler, { EventName, ... }, DelaySeconds or 1 )
|
||||
self:T( { CallID = CallID } )
|
||||
self:T2( { CallID = CallID } )
|
||||
end
|
||||
end
|
||||
|
||||
function FSM:_create_transition( EventName )
|
||||
self:E( { Event = EventName } )
|
||||
return function( self, ... ) return self._handler( self, EventName , ... ) end
|
||||
end
|
||||
|
||||
function FSM:_gosub( ParentFrom, ParentEvent )
|
||||
local fsmtable = {}
|
||||
if self.subs[ParentFrom] and self.subs[ParentFrom][ParentEvent] then
|
||||
self:E( { ParentFrom, ParentEvent, self.subs[ParentFrom], self.subs[ParentFrom][ParentEvent] } )
|
||||
self:T( { ParentFrom, ParentEvent, self.subs[ParentFrom], self.subs[ParentFrom][ParentEvent] } )
|
||||
return self.subs[ParentFrom][ParentEvent]
|
||||
else
|
||||
return {}
|
||||
@ -624,17 +634,17 @@ do -- FSM
|
||||
function FSM:_isendstate( Current )
|
||||
local FSMParent = self.fsmparent
|
||||
if FSMParent and self.endstates[Current] then
|
||||
self:E( { state = Current, endstates = self.endstates, endstate = self.endstates[Current] } )
|
||||
self:T( { state = Current, endstates = self.endstates, endstate = self.endstates[Current] } )
|
||||
FSMParent.current = Current
|
||||
local ParentFrom = FSMParent.current
|
||||
self:E( ParentFrom )
|
||||
self:E( self.ReturnEvents )
|
||||
self:T( ParentFrom )
|
||||
self:T( self.ReturnEvents )
|
||||
local Event = self.ReturnEvents[Current]
|
||||
self:E( { ParentFrom, Event, self.ReturnEvents } )
|
||||
self:T( { ParentFrom, Event, self.ReturnEvents } )
|
||||
if Event then
|
||||
return FSMParent, Event
|
||||
else
|
||||
self:E( { "Could not find parent event name for state ", ParentFrom } )
|
||||
self:T( { "Could not find parent event name for state ", ParentFrom } )
|
||||
end
|
||||
end
|
||||
|
||||
@ -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,8 +745,9 @@ do -- FSM_CONTROLLABLE
|
||||
end
|
||||
|
||||
if self[handler] then
|
||||
self:E( "Calling " .. handler )
|
||||
return xpcall( function() return self[handler]( self, self.Controllable, unpack( params ) ) end, ErrorHandler )
|
||||
self:F3( "Calling " .. handler )
|
||||
local Result, Value = xpcall( function() return self[handler]( self, self.Controllable, unpack( params ) ) end, ErrorHandler )
|
||||
return Value
|
||||
--return self[handler]( self, self.Controllable, unpack( params ) )
|
||||
end
|
||||
end
|
||||
@ -769,14 +779,14 @@ do -- FSM_PROCESS
|
||||
end
|
||||
|
||||
function FSM_PROCESS:Init( FsmProcess )
|
||||
self:E( "No Initialisation" )
|
||||
self:T( "No Initialisation" )
|
||||
end
|
||||
|
||||
--- Creates a new FSM_PROCESS object based on this FSM_PROCESS.
|
||||
-- @param #FSM_PROCESS self
|
||||
-- @return #FSM_PROCESS
|
||||
function FSM_PROCESS:Copy( Controllable, Task )
|
||||
self:E( { self:GetClassNameAndID() } )
|
||||
self:T( { self:GetClassNameAndID() } )
|
||||
|
||||
local NewFsm = self:New( Controllable, Task ) -- Core.Fsm#FSM_PROCESS
|
||||
|
||||
@ -795,19 +805,19 @@ do -- FSM_PROCESS
|
||||
|
||||
-- Copy Processes
|
||||
for ProcessID, Process in pairs( self:GetProcesses() ) do
|
||||
self:E( { Process} )
|
||||
self:T( { Process} )
|
||||
local FsmProcess = NewFsm:AddProcess( Process.From, Process.Event, Process.fsm:Copy( Controllable, Task ), Process.ReturnEvents )
|
||||
end
|
||||
|
||||
-- Copy End States
|
||||
for EndStateID, EndState in pairs( self:GetEndStates() ) do
|
||||
self:E( EndState )
|
||||
self:T( EndState )
|
||||
NewFsm:AddEndState( EndState )
|
||||
end
|
||||
|
||||
-- Copy the score tables
|
||||
for ScoreID, Score in pairs( self:GetScores() ) do
|
||||
self:E( Score )
|
||||
self:T( Score )
|
||||
NewFsm:AddScore( ScoreID, Score.ScoreText, Score.Score )
|
||||
end
|
||||
|
||||
@ -877,7 +887,7 @@ end
|
||||
-- @param Wrapper.Unit#UNIT ProcessUnit
|
||||
-- @return #FSM_PROCESS self
|
||||
function FSM_PROCESS:Assign( ProcessUnit, Task )
|
||||
self:E( { Task, ProcessUnit } )
|
||||
self:T( { Task, ProcessUnit } )
|
||||
|
||||
self:SetControllable( ProcessUnit )
|
||||
self:SetTask( Task )
|
||||
@ -886,37 +896,21 @@ end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Adds a score for the FSM_PROCESS to be achieved.
|
||||
-- @param #FSM_PROCESS self
|
||||
-- @param #string State is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
|
||||
-- @param #string ScoreText is a text describing the score that is given according the status.
|
||||
-- @param #number Score is a number providing the score of the status.
|
||||
-- @return #FSM_PROCESS self
|
||||
function FSM_PROCESS:AddScore( State, ScoreText, Score )
|
||||
self:F2( { State, ScoreText, Score } )
|
||||
|
||||
self.Scores[State] = self.Scores[State] or {}
|
||||
self.Scores[State].ScoreText = ScoreText
|
||||
self.Scores[State].Score = Score
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
function FSM_PROCESS:onenterAssigned( ProcessUnit )
|
||||
self:E( "Assign" )
|
||||
self:T( "Assign" )
|
||||
|
||||
self.Task:Assign()
|
||||
end
|
||||
|
||||
function FSM_PROCESS:onenterFailed( ProcessUnit )
|
||||
self:E( "Failed" )
|
||||
self:T( "Failed" )
|
||||
|
||||
self.Task:Fail()
|
||||
end
|
||||
|
||||
function FSM_PROCESS:onenterSuccess( ProcessUnit )
|
||||
self:E( "Success" )
|
||||
self:T( "Success" )
|
||||
|
||||
self.Task:Success()
|
||||
end
|
||||
@ -928,20 +922,20 @@ end
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function FSM_PROCESS:onstatechange( ProcessUnit, From, Event, To, Dummy )
|
||||
self:E( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
|
||||
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
|
||||
|
||||
if self:IsTrace() then
|
||||
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
|
||||
end
|
||||
|
||||
self:E( self.Scores[To] )
|
||||
self:T( self._Scores[To] )
|
||||
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
|
||||
if self.Scores[To] then
|
||||
if self._Scores[To] then
|
||||
|
||||
local Task = self.Task
|
||||
local Scoring = Task:GetScoring()
|
||||
if Scoring then
|
||||
Scoring:_AddMissionTaskScore( Task.Mission, ProcessUnit, self.Scores[To].ScoreText, self.Scores[To].Score )
|
||||
Scoring:_AddMissionTaskScore( Task.Mission, ProcessUnit, self._Scores[To].ScoreText, self._Scores[To].Score )
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -975,7 +969,7 @@ do -- FSM_TASK
|
||||
|
||||
function FSM_TASK:_call_handler( handler, params )
|
||||
if self[handler] then
|
||||
self:E( "Calling " .. handler )
|
||||
self:T( "Calling " .. handler )
|
||||
return self[handler]( self, unpack( params ) )
|
||||
end
|
||||
end
|
||||
@ -1027,7 +1021,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.
|
||||
|
||||
@ -66,12 +66,12 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr
|
||||
-- If the object used as the key is nil, then the garbage collector will remove the item from the Functions array.
|
||||
self.ObjectSchedulers = self.ObjectSchedulers or setmetatable( {}, { __mode = "v" } )
|
||||
|
||||
if Scheduler.SchedulerObject then
|
||||
if Scheduler.MasterObject then
|
||||
self.ObjectSchedulers[self.CallID] = Scheduler
|
||||
self:E( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), SchedulerObject = tostring(Scheduler.SchedulerObject) } )
|
||||
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" } )
|
||||
@ -80,7 +80,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr
|
||||
self.Schedule[Scheduler][self.CallID].Function = ScheduleFunction
|
||||
self.Schedule[Scheduler][self.CallID].Arguments = ScheduleArguments
|
||||
self.Schedule[Scheduler][self.CallID].StartTime = timer.getTime() + ( Start or 0 )
|
||||
self.Schedule[Scheduler][self.CallID].Start = Start + .001
|
||||
self.Schedule[Scheduler][self.CallID].Start = Start + .1
|
||||
self.Schedule[Scheduler][self.CallID].Repeat = Repeat
|
||||
self.Schedule[Scheduler][self.CallID].Randomize = Randomize
|
||||
self.Schedule[Scheduler][self.CallID].Stop = Stop
|
||||
@ -156,7 +156,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr
|
||||
self:Stop( Scheduler, CallID )
|
||||
end
|
||||
else
|
||||
--self:E( "Scheduled obscolete call for CallID: " .. CallID )
|
||||
self:E( "Scheduled obscolete call for CallID: " .. CallID )
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
@ -69,6 +69,8 @@ function SCHEDULER:New( SchedulerObject, SchedulerFunction, SchedulerArguments,
|
||||
|
||||
local ScheduleID = nil
|
||||
|
||||
self.MasterObject = SchedulerObject
|
||||
|
||||
if SchedulerFunction then
|
||||
ScheduleID = self:Schedule( SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop )
|
||||
end
|
||||
@ -100,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(
|
||||
|
||||
@ -274,27 +274,30 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
||||
local PlayerName = PlayerUnit:GetPlayerName()
|
||||
local MissionName = Mission:GetName()
|
||||
|
||||
self:F( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
|
||||
self:E( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
|
||||
|
||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||
if PlayerName then
|
||||
local PlayerData = self.Players[PlayerName]
|
||||
|
||||
local PlayerData = self.Players[PlayerName]
|
||||
|
||||
if not PlayerData.Mission[MissionName] then
|
||||
PlayerData.Mission[MissionName] = {}
|
||||
PlayerData.Mission[MissionName].ScoreTask = 0
|
||||
PlayerData.Mission[MissionName].ScoreMission = 0
|
||||
if not PlayerData.Mission[MissionName] then
|
||||
PlayerData.Mission[MissionName] = {}
|
||||
PlayerData.Mission[MissionName].ScoreTask = 0
|
||||
PlayerData.Mission[MissionName].ScoreMission = 0
|
||||
end
|
||||
|
||||
self:T( PlayerName )
|
||||
self:T( PlayerData.Mission[MissionName] )
|
||||
|
||||
PlayerData.Score = self.Players[PlayerName].Score + Score
|
||||
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
|
||||
|
||||
MESSAGE:New( "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
|
||||
Score .. " task score!",
|
||||
30 ):ToAll()
|
||||
|
||||
self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
|
||||
end
|
||||
|
||||
self:T( PlayerName )
|
||||
self:T( PlayerData.Mission[MissionName] )
|
||||
|
||||
PlayerData.Score = self.Players[PlayerName].Score + Score
|
||||
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
|
||||
|
||||
MESSAGE:New( "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
|
||||
Score .. " task score!",
|
||||
30 ):ToAll()
|
||||
|
||||
self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
|
||||
end
|
||||
|
||||
|
||||
@ -436,7 +439,7 @@ function SCORING:_EventOnHit( Event )
|
||||
):ToAll()
|
||||
self:ScoreCSV( InitPlayerName, "HIT_PENALTY", 1, -25, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType )
|
||||
else
|
||||
self.Players[InitPlayerName].Score = self.Players[InitPlayerName].Score + 10
|
||||
self.Players[InitPlayerName].Score = self.Players[InitPlayerName].Score + 1
|
||||
self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].Score = self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].Score + 1
|
||||
self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].ScoreHit = self.Players[InitPlayerName].Hit[TargetCategory][TargetUnitName].ScoreHit + 1
|
||||
MESSAGE:New( "Player '" .. InitPlayerName .. "' hit a target " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " ..
|
||||
|
||||
@ -47,6 +47,9 @@
|
||||
-- * @{#SPAWN.InitRepeat}(): Re-spawn groups when they land at the home base. Similar methods are @{#SPAWN.InitRepeatOnLanding} and @{#SPAWN.InitRepeatOnEngineShutDown}.
|
||||
-- * @{#SPAWN.InitRandomizeUnits}(): Randomizes the @{Unit}s in the @{Group} that is spawned within a **radius band**, given an Outer and Inner radius.
|
||||
-- * @{#SPAWN.InitRandomizeZones}(): Randomizes the spawning between a predefined list of @{Zone}s that are declared using this function. Each zone can be given a probability factor.
|
||||
-- * @{#SPAWN.InitAIOn}(): Turns the AI On when spawning the new @{Group} object.
|
||||
-- * @{#SPAWN.InitAIOff}(): Turns the AI Off when spawning the new @{Group} object.
|
||||
-- * @{#SPAWN.InitAIOnOff}(): Turns the AI On or Off when spawning the new @{Group} object.
|
||||
--
|
||||
-- ## 1.3) SPAWN spawning methods
|
||||
--
|
||||
@ -109,71 +112,40 @@
|
||||
--
|
||||
-- Hereby the change log:
|
||||
--
|
||||
-- 2016-08-15: SPAWN:**InitCleanUp**( SpawnCleanUpInterval ) replaces SPAWN:_CleanUp_( SpawnCleanUpInterval )
|
||||
-- 2017-01-24: SPAWN:**InitAIOnOff( AIOnOff )** added.
|
||||
--
|
||||
-- * Want to ensure that the methods starting with **Init** are the first called methods before any _Spawn_ method is called!
|
||||
-- * This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
|
||||
-- 2017-01-24: SPAWN:**InitAIOn()** added.
|
||||
--
|
||||
-- 2017-01-24: SPAWN:**InitAIOff()** added.
|
||||
--
|
||||
-- 2016-08-15: SPAWN:**InitCleanUp**( SpawnCleanUpInterval ) replaces SPAWN:_CleanUp_( SpawnCleanUpInterval ).
|
||||
--
|
||||
-- 2016-08-15: SPAWN:**InitRandomizeZones( SpawnZones )** added.
|
||||
--
|
||||
-- * This method provides the functionality to randomize the spawning of the Groups at a given list of zones of different types.
|
||||
--
|
||||
-- 2016-08-14: SPAWN:**OnSpawnGroup**( SpawnCallBackFunction, ... ) replaces SPAWN:_SpawnFunction_( SpawnCallBackFunction, ... ).
|
||||
--
|
||||
-- 2016-08-14: SPAWN.SpawnInZone( Zone, __RandomizeGroup__, SpawnIndex ) replaces SpawnInZone( Zone, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ).
|
||||
--
|
||||
-- * The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method @{#SPAWN.InitRandomizeUnits}( RandomizeUnits, OuterRadius, InnerRadius ).
|
||||
-- * A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned @{Group}.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.SpawnFromVec3( Vec3, SpawnIndex ) replaces SpawnFromVec3( Vec3, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ):
|
||||
--
|
||||
-- * The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method @{#SPAWN.InitRandomizeUnits}( RandomizeUnits, OuterRadius, InnerRadius ).
|
||||
-- * A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned @{Group}.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.SpawnFromVec2( Vec2, SpawnIndex ) replaces SpawnFromVec2( Vec2, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ):
|
||||
--
|
||||
-- * The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method @{#SPAWN.InitRandomizeUnits}( RandomizeUnits, OuterRadius, InnerRadius ).
|
||||
-- * A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned @{Group}.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.SpawnFromUnit( SpawnUnit, SpawnIndex ) replaces SpawnFromUnit( SpawnUnit, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ):
|
||||
--
|
||||
-- * The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method @{#SPAWN.InitRandomizeUnits}( RandomizeUnits, OuterRadius, InnerRadius ).
|
||||
-- * A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned @{Group}.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.SpawnFromUnit( SpawnUnit, SpawnIndex ) replaces SpawnFromStatic( SpawnStatic, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ):
|
||||
--
|
||||
-- * The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method @{#SPAWN.InitRandomizeUnits}( RandomizeUnits, OuterRadius, InnerRadius ).
|
||||
-- * A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned @{Group}.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.**InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius )** added:
|
||||
--
|
||||
-- * This method enables the randomization of units at the first route point in a radius band at a spawn event.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.**Init**Limit( SpawnMaxUnitsAlive, SpawnMaxGroups ) replaces SPAWN._Limit_( SpawnMaxUnitsAlive, SpawnMaxGroups ):
|
||||
--
|
||||
-- * Want to ensure that the methods starting with **Init** are the first called methods before any _Spawn_ method is called!
|
||||
-- * This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.**Init**Array( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY ) replaces SPAWN._Array_( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY ).
|
||||
--
|
||||
-- * Want to ensure that the methods starting with **Init** are the first called methods before any _Spawn_ method is called!
|
||||
-- * This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.**Init**RandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight ) replaces SPAWN._RandomizeRoute_( SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight ).
|
||||
--
|
||||
-- * Want to ensure that the methods starting with **Init** are the first called methods before any _Spawn_ method is called!
|
||||
-- * This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.**Init**RandomizeTemplate( SpawnTemplatePrefixTable ) replaces SPAWN._RandomizeTemplate_( SpawnTemplatePrefixTable ).
|
||||
--
|
||||
-- * Want to ensure that the methods starting with **Init** are the first called methods before any _Spawn_ method is called!
|
||||
-- * This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
|
||||
--
|
||||
-- 2016-08-14: SPAWN.**Init**UnControlled() replaces SPAWN._UnControlled_().
|
||||
--
|
||||
-- * Want to ensure that the methods starting with **Init** are the first called methods before any _Spawn_ method is called!
|
||||
-- * This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # **AUTHORS and CONTRIBUTIONS**
|
||||
@ -181,6 +153,7 @@
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- * **Aaron**: Posed the idea for Group position randomization at SpawnInZone and make the Unit randomization separate from the Group randomization.
|
||||
-- * [**Entropy**](https://forums.eagle.ru/member.php?u=111471), **Afinegan**: Came up with the requirement for AIOnOff().
|
||||
--
|
||||
-- ### Authors:
|
||||
--
|
||||
@ -238,6 +211,7 @@ function SPAWN:New( SpawnTemplatePrefix )
|
||||
self.SpawnMaxGroups = 0 -- The maximum amount of groups that can be spawned.
|
||||
self.SpawnRandomize = false -- Sets the randomization flag of new Spawned units to false.
|
||||
self.SpawnVisible = false -- Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
|
||||
self.AIOnOff = true -- The AI is on by default when spawning a group.
|
||||
|
||||
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
|
||||
else
|
||||
@ -275,6 +249,7 @@ function SPAWN:NewWithAlias( SpawnTemplatePrefix, SpawnAliasPrefix )
|
||||
self.SpawnMaxGroups = 0 -- The maximum amount of groups that can be spawned.
|
||||
self.SpawnRandomize = false -- Sets the randomization flag of new Spawned units to false.
|
||||
self.SpawnVisible = false -- Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
|
||||
self.AIOnOff = true -- The AI is on by default when spawning a group.
|
||||
|
||||
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
|
||||
else
|
||||
@ -565,7 +540,34 @@ function SPAWN:InitArray( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY )
|
||||
return self
|
||||
end
|
||||
|
||||
do -- AI methods
|
||||
--- Turns the AI On or Off for the @{Group} when spawning.
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean AIOnOff A value of true sets the AI On, a value of false sets the AI Off.
|
||||
-- @return #SPAWN The SPAWN object
|
||||
function SPAWN:InitAIOnOff( AIOnOff )
|
||||
|
||||
self.AIOnOff = AIOnOff
|
||||
return self
|
||||
end
|
||||
|
||||
--- Turns the AI On for the @{Group} when spawning.
|
||||
-- @param #SPAWN self
|
||||
-- @return #SPAWN The SPAWN object
|
||||
function SPAWN:InitAIOn()
|
||||
|
||||
return self:InitAIOnOff( true )
|
||||
end
|
||||
|
||||
--- Turns the AI Off for the @{Group} when spawning.
|
||||
-- @param #SPAWN self
|
||||
-- @return #SPAWN The SPAWN object
|
||||
function SPAWN:InitAIOff()
|
||||
|
||||
return self:InitAIOnOff( false )
|
||||
end
|
||||
|
||||
end -- AI methods
|
||||
|
||||
--- Will spawn a group based on the internal index.
|
||||
-- Note: Uses @{DATABASE} module defined in MOOSE.
|
||||
@ -591,6 +593,7 @@ function SPAWN:ReSpawn( SpawnIndex )
|
||||
|
||||
-- TODO: This logic makes DCS crash and i don't know why (yet).
|
||||
local SpawnGroup = self:GetGroupFromIndex( SpawnIndex )
|
||||
local WayPoints = SpawnGroup and SpawnGroup.WayPoints or nil
|
||||
if SpawnGroup then
|
||||
local SpawnDCSGroup = SpawnGroup:GetDCSObject()
|
||||
if SpawnDCSGroup then
|
||||
@ -598,7 +601,18 @@ function SPAWN:ReSpawn( SpawnIndex )
|
||||
end
|
||||
end
|
||||
|
||||
return self:SpawnWithIndex( SpawnIndex )
|
||||
local SpawnGroup = self:SpawnWithIndex( SpawnIndex )
|
||||
if SpawnGroup and WayPoints then
|
||||
-- If there were WayPoints set, then Re-Execute those WayPoints!
|
||||
SpawnGroup:WayPointInitialize( WayPoints )
|
||||
SpawnGroup:WayPointExecute( 1, 5 )
|
||||
end
|
||||
|
||||
if SpawnGroup.ReSpawnFunction then
|
||||
SpawnGroup:ReSpawnFunction()
|
||||
end
|
||||
|
||||
return SpawnGroup
|
||||
end
|
||||
|
||||
--- Will spawn a group with a specified index number.
|
||||
@ -649,6 +663,14 @@ function SPAWN:SpawnWithIndex( SpawnIndex )
|
||||
|
||||
self.SpawnGroups[self.SpawnIndex].Group = _DATABASE:Spawn( SpawnTemplate )
|
||||
|
||||
local SpawnGroup = self.SpawnGroups[self.SpawnIndex].Group -- Wrapper.Group#GROUP
|
||||
|
||||
--TODO: Need to check if this function doesn't need to be scheduled, as the group may not be immediately there!
|
||||
if SpawnGroup then
|
||||
|
||||
SpawnGroup:SetAIOnOff( self.AIOnOff )
|
||||
end
|
||||
|
||||
-- If there is a SpawnFunction hook defined, call it.
|
||||
if self.SpawnFunctionHook then
|
||||
self.SpawnFunctionHook( self.SpawnGroups[self.SpawnIndex].Group, unpack( self.SpawnFunctionArguments ) )
|
||||
|
||||
@ -42,6 +42,8 @@ Include.File( "Functional/Detection" )
|
||||
--- AI Classes
|
||||
Include.File( "AI/AI_Balancer" )
|
||||
Include.File( "AI/AI_Patrol" )
|
||||
Include.File( "AI/AI_Cap" )
|
||||
Include.File( "AI/AI_Cas" )
|
||||
Include.File( "AI/AI_Cargo" )
|
||||
|
||||
--- Actions
|
||||
|
||||
@ -239,7 +239,8 @@ end
|
||||
function COMMANDCENTER:MessageToCoalition( Message )
|
||||
|
||||
local CCCoalition = self:GetPositionable():GetCoalition()
|
||||
self:GetPositionable():MessageToBlue( Message , 20, CCCoalition )
|
||||
--TODO: Fix coalition bug!
|
||||
self:GetPositionable():MessageToCoalition( Message, 20, CCCoalition, self:GetName() )
|
||||
|
||||
end
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
-- This module contains the DETECTION_MANAGER class and derived classes.
|
||||
--- This module contains the DETECTION_MANAGER class and derived classes.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
|
||||
@ -630,7 +630,7 @@ function TASK.MenuTaskAbort( MenuParam )
|
||||
local self = MenuParam.self
|
||||
local TaskGroup = MenuParam.TaskGroup
|
||||
|
||||
--self:AssignToGroup( TaskGroup )
|
||||
self:Abort()
|
||||
end
|
||||
|
||||
|
||||
@ -897,8 +897,8 @@ end
|
||||
|
||||
--- FSM function for a TASK
|
||||
-- @param #TASK self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
function TASK:onenterAborted( From, Event, To )
|
||||
|
||||
@ -907,12 +907,29 @@ function TASK:onenterAborted( From, Event, To )
|
||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been aborted! Task may be replanned." )
|
||||
|
||||
self:UnAssignFromGroups()
|
||||
|
||||
self:__Replan( 5 )
|
||||
end
|
||||
|
||||
--- FSM function for a TASK
|
||||
-- @param #TASK self
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
function TASK:onafterReplan( From, Event, To )
|
||||
|
||||
self:E( "Task Replanned" )
|
||||
|
||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Replanning Task " .. self:GetName() .. "." )
|
||||
|
||||
self:SetMenu()
|
||||
|
||||
end
|
||||
|
||||
--- FSM function for a TASK
|
||||
-- @param #TASK self
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
function TASK:onenterFailed( From, Event, To )
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
-- * @{#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location.
|
||||
-- * @{#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne controllable.
|
||||
-- * @{#CONTROLLABLE.TaskFAC_AttackControllable}: (AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.
|
||||
-- * @{#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished.
|
||||
-- * @{#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire some or all ammunition at a VEC2 point.
|
||||
-- * @{#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne controllable.
|
||||
-- * @{#CONTROLLABLE.TaskHold}: (GROUND) Hold ground controllable from moving.
|
||||
-- * @{#CONTROLLABLE.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the controllable.
|
||||
@ -123,7 +123,6 @@
|
||||
-- ===
|
||||
--
|
||||
-- @module Controllable
|
||||
-- @author FlightControl
|
||||
|
||||
--- The CONTROLLABLE class
|
||||
-- @type CONTROLLABLE
|
||||
@ -144,6 +143,8 @@ function CONTROLLABLE:New( ControllableName )
|
||||
local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) )
|
||||
self:F2( ControllableName )
|
||||
self.ControllableName = ControllableName
|
||||
|
||||
self.TaskScheduler = SCHEDULER:New( self )
|
||||
return self
|
||||
end
|
||||
|
||||
@ -165,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
|
||||
@ -202,7 +255,7 @@ function CONTROLLABLE:PushTask( DCSTask, WaitTime )
|
||||
-- Controller:pushTask( DCSTask )
|
||||
|
||||
if WaitTime then
|
||||
SCHEDULER:New( Controller, Controller.pushTask, { DCSTask }, WaitTime )
|
||||
self.TaskScheduler:Schedule( Controller, Controller.pushTask, { DCSTask }, WaitTime )
|
||||
else
|
||||
Controller:pushTask( DCSTask )
|
||||
end
|
||||
@ -224,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.
|
||||
@ -233,7 +286,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
||||
if not WaitTime then
|
||||
Controller:setTask( DCSTask )
|
||||
else
|
||||
SCHEDULER:New( Controller, Controller.setTask, { DCSTask }, WaitTime )
|
||||
self.TaskScheduler:Schedule( Controller, Controller.setTask, { DCSTask }, WaitTime )
|
||||
end
|
||||
|
||||
return self
|
||||
@ -304,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
|
||||
@ -489,19 +546,24 @@ function CONTROLLABLE:TaskAttackUnit( AttackUnit, WeaponType, WeaponExpend, Atta
|
||||
-- }
|
||||
|
||||
local DCSTask
|
||||
DCSTask = { id = 'AttackUnit',
|
||||
DCSTask = {
|
||||
id = 'AttackUnit',
|
||||
params = {
|
||||
altitudeEnabled = true,
|
||||
unitId = AttackUnit:GetID(),
|
||||
weaponType = WeaponType,
|
||||
expend = WeaponExpend,
|
||||
attackQty = AttackQty,
|
||||
direction = Direction,
|
||||
attackQtyLimit = AttackQtyLimit,
|
||||
controllableAttack = ControllableAttack,
|
||||
},
|
||||
},
|
||||
attackQtyLimit = AttackQtyLimit or false,
|
||||
attackQty = AttackQty or 2,
|
||||
expend = WeaponExpend or "Auto",
|
||||
altitude = 2000,
|
||||
directionEnabled = true,
|
||||
groupAttack = true,
|
||||
--weaponType = WeaponType or 1073741822,
|
||||
direction = Direction or 0,
|
||||
}
|
||||
}
|
||||
|
||||
self:T3( { DCSTask } )
|
||||
self:E( DCSTask )
|
||||
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
@ -885,15 +947,18 @@ end
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The point to fire at.
|
||||
-- @param Dcs.DCSTypes#Distance Radius The radius of the zone to deploy the fire at.
|
||||
-- @param #number AmmoCount (optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted).
|
||||
-- @return Dcs.DCSTasking.Task#Task The DCS task structure.
|
||||
function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius )
|
||||
self:F2( { self.ControllableName, Vec2, Radius } )
|
||||
function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount )
|
||||
self:F2( { self.ControllableName, Vec2, Radius, AmmoCount } )
|
||||
|
||||
-- FireAtPoint = {
|
||||
-- id = 'FireAtPoint',
|
||||
-- params = {
|
||||
-- point = Vec2,
|
||||
-- radius = Distance,
|
||||
-- expendQty = number,
|
||||
-- expendQtyEnabled = boolean,
|
||||
-- }
|
||||
-- }
|
||||
|
||||
@ -902,8 +967,15 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius )
|
||||
params = {
|
||||
point = Vec2,
|
||||
radius = Radius,
|
||||
expendQty = 100, -- dummy value
|
||||
expendQtyEnabled = false,
|
||||
}
|
||||
}
|
||||
|
||||
if AmmoCount then
|
||||
DCSTask.params.expendQty = AmmoCount
|
||||
DCSTask.params.expendQtyEnabled = true
|
||||
end
|
||||
|
||||
self:T3( { DCSTask } )
|
||||
return DCSTask
|
||||
@ -1494,7 +1566,7 @@ function CONTROLLABLE:Route( GoPoints )
|
||||
local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, }
|
||||
local Controller = self:_GetController()
|
||||
--Controller.setTask( Controller, MissionTask )
|
||||
SCHEDULER:New( Controller, Controller.setTask, { MissionTask }, 1 )
|
||||
self.TaskScheduler:Schedule( Controller, Controller.setTask, { MissionTask }, 1 )
|
||||
return self
|
||||
end
|
||||
|
||||
@ -2122,7 +2194,7 @@ end
|
||||
-- @param #table WayPoints If WayPoints is given, then use the route.
|
||||
-- @return #CONTROLLABLE
|
||||
function CONTROLLABLE:WayPointInitialize( WayPoints )
|
||||
self:F( { WayPoint, WayPointIndex, WayPointFunction } )
|
||||
self:F( { WayPoints } )
|
||||
|
||||
if WayPoints then
|
||||
self.WayPoints = WayPoints
|
||||
@ -2133,6 +2205,18 @@ function CONTROLLABLE:WayPointInitialize( WayPoints )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get the current WayPoints set with the WayPoint functions( Note that the WayPoints can be nil, although there ARE waypoints).
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #table WayPoints If WayPoints is given, then return the WayPoints structure.
|
||||
function CONTROLLABLE:GetWayPoints()
|
||||
self:F( )
|
||||
|
||||
if self.WayPoints then
|
||||
return self.WayPoints
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Registers a waypoint function that will be executed when the controllable moves over the WayPoint.
|
||||
-- @param #CONTROLLABLE self
|
||||
@ -2201,6 +2285,4 @@ function CONTROLLABLE:WayPointExecute( WayPoint, WaitTime )
|
||||
return self
|
||||
end
|
||||
|
||||
-- Message APIs
|
||||
|
||||
|
||||
-- Message APIs
|
||||
@ -28,114 +28,26 @@
|
||||
-- * @{#GROUP.Find}(): Find a GROUP instance from the _DATABASE object using a DCS Group object.
|
||||
-- * @{#GROUP.FindByName}(): Find a GROUP instance from the _DATABASE object using a DCS Group name.
|
||||
--
|
||||
-- 1.2) GROUP task methods
|
||||
-- -----------------------
|
||||
-- Several group task methods are available that help you to prepare tasks.
|
||||
-- These methods return a string consisting of the task description, which can then be given to either a
|
||||
-- @{Wrapper.Controllable#CONTROLLABLE.PushTask} or @{Wrapper.Controllable#CONTROLLABLE.SetTask} method to assign the task to the GROUP.
|
||||
-- Tasks are specific for the category of the GROUP, more specific, for AIR, GROUND or AIR and GROUND.
|
||||
-- Each task description where applicable indicates for which group category the task is valid.
|
||||
-- There are 2 main subdivisions of tasks: Assigned tasks and EnRoute tasks.
|
||||
--
|
||||
-- ### 1.2.1) Assigned task methods
|
||||
--
|
||||
-- Assigned task methods make the group execute the task where the location of the (possible) targets of the task are known before being detected.
|
||||
-- This is different from the EnRoute tasks, where the targets of the task need to be detected before the task can be executed.
|
||||
--
|
||||
-- Find below a list of the **assigned task** methods:
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackGroup}: (AIR) Attack a Group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackMapObject}: (AIR) Attacking the map object (building, structure, e.t.c).
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskAttackUnit}: (AIR) Attack the Unit.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskBombing}: (Wrapper.Controllable#CONTROLLABLEDelivering weapon at the point on the ground.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskBombingRunway}: (AIR) Delivering weapon on the runway.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskEmbarking}: (AIR) Move the group to a Vec2 Point, wait for a defined duration and embark a group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskFAC_AttackGroup}: (AIR + GROUND) The task makes the group/unit a FAC and orders the FAC to control the target (enemy ground group) destruction.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskHold}: (GROUND) Hold ground group from moving.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the group.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskLand}: (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskLandAtZone}: (AIR) Land the group at a @{Core.Zone#ZONE_RADIUS).
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskOrbitCircle}: (AIR) Orbit at the current position of the first unit of the group at a specified alititude.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskOrbitCircleAtVec2}: (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRefueling}: (AIR) Refueling from the nearest tanker. No parameters.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRoute}: (AIR + GROUND) Return a Misson task to follow a given route defined by Points.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRouteToVec2}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRouteToVec3}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskRouteToZone}: (AIR + GROUND) Route the group to a given zone.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskReturnToBase}: (AIR) Route the group to an airbase.
|
||||
-- ## 1.2) GROUP task methods
|
||||
--
|
||||
-- ### 1.2.2) EnRoute task methods
|
||||
--
|
||||
-- EnRoute tasks require the targets of the task need to be detected by the group (using its sensors) before the task can be executed:
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskAWACS}: (AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts). No parameters.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskEngageGroup}: (AIR) Engaging a group. The task does not assign the target group to the unit/group to attack now; it just allows the unit/group to engage the target group as well as other assigned targets.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskEngageTargets}: (AIR) Engaging targets of defined types.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskEWR}: (AIR) Attack the Unit.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskFAC}: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose a targets (enemy ground group) around as well as other assigned targets.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskFAC_EngageGroup}: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose the target (enemy ground group) as well as other assigned targets.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.EnRouteTaskTanker}: (AIR) Aircraft will act as a tanker for friendly units. No parameters.
|
||||
--
|
||||
-- ### 1.2.3) Preparation task methods
|
||||
--
|
||||
-- There are certain task methods that allow to tailor the task behaviour:
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} task methods section for a description of the task methods.
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskWrappedAction}: Return a WrappedAction Task taking a Command.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskCombo}: Return a Combo Task taking an array of Tasks.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskCondition}: Return a condition section for a controlled task.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskControlled}: Return a Controlled Task taking a Task and a TaskCondition.
|
||||
--
|
||||
-- ### 1.2.4) Obtain the mission from group templates
|
||||
--
|
||||
-- Group templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a group and assign it to another:
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.TaskMission}: (AIR + GROUND) Return a mission task from a mission template.
|
||||
--
|
||||
-- 1.3) GROUP Command methods
|
||||
-- --------------------------
|
||||
-- Group **command methods** prepare the execution of commands using the @{Wrapper.Controllable#CONTROLLABLE.SetCommand} method:
|
||||
-- ## 1.3) GROUP Command methods
|
||||
--
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} command methods section for a description of the command methods.
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.CommandDoScript}: Do Script command.
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.CommandSwitchWayPoint}: Perform a switch waypoint command.
|
||||
-- ## 1.4) GROUP option methods
|
||||
--
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} option methods section for a description of the option methods.
|
||||
--
|
||||
-- 1.4) GROUP Option methods
|
||||
-- -------------------------
|
||||
-- Group **Option methods** change the behaviour of the Group while being alive.
|
||||
-- ## 1.5) GROUP Zone validation methods
|
||||
--
|
||||
-- ### 1.4.1) Rule of Engagement:
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEWeaponFree}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEOpenFire}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEReturnFire}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEEvadeFire}
|
||||
--
|
||||
-- To check whether an ROE option is valid for a specific group, use:
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEWeaponFreePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEOpenFirePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEReturnFirePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROEEvadeFirePossible}
|
||||
--
|
||||
-- ### 1.4.2) Rule on thread:
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTNoReaction}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTPassiveDefense}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTEvadeFire}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTVertical}
|
||||
--
|
||||
-- To test whether an ROT option is valid for a specific group, use:
|
||||
--
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTNoReactionPossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTPassiveDefensePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTEvadeFirePossible}
|
||||
-- * @{Wrapper.Controllable#CONTROLLABLE.OptionROTVerticalPossible}
|
||||
--
|
||||
-- 1.5) GROUP Zone validation methods
|
||||
-- ----------------------------------
|
||||
-- The group can be validated whether it is completely, partly or not within a @{Zone}.
|
||||
-- Use the following Zone validation methods on the group:
|
||||
--
|
||||
@ -145,6 +57,43 @@
|
||||
--
|
||||
-- The zone can be of any @{Zone} class derived from @{Core.Zone#ZONE_BASE}. So, these methods are polymorphic to the zones tested on.
|
||||
--
|
||||
-- ## 1.6) GROUP AI methods
|
||||
--
|
||||
-- A GROUP has AI methods to control the AI activation.
|
||||
--
|
||||
-- * @{#GROUP.SetAIOnOff}(): Turns the GROUP AI On or Off.
|
||||
-- * @{#GROUP.SetAIOn}(): Turns the GROUP AI On.
|
||||
-- * @{#GROUP.SetAIOff}(): Turns the GROUP AI Off.
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- # **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-24: GROUP:**SetAIOnOff( AIOnOff )** added.
|
||||
--
|
||||
-- 2017-01-24: GROUP:**SetAIOn()** added.
|
||||
--
|
||||
-- 2017-01-24: GROUP:**SetAIOff()** added.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- # **AUTHORS and CONTRIBUTIONS**
|
||||
--
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- * [**Entropy**](https://forums.eagle.ru/member.php?u=111471), **Afinegan**: Came up with the requirement for AIOnOff().
|
||||
--
|
||||
-- ### Authors:
|
||||
--
|
||||
-- * **FlightControl**: Design & Programming
|
||||
--
|
||||
-- @module Group
|
||||
-- @author FlightControl
|
||||
|
||||
@ -205,6 +154,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 +357,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
|
||||
@ -497,7 +443,7 @@ end
|
||||
|
||||
|
||||
|
||||
-- Is Zone Functions
|
||||
do -- Is Zone methods
|
||||
|
||||
--- Returns true if all units of the group are within a @{Zone}.
|
||||
-- @param #GROUP self
|
||||
@ -663,6 +609,49 @@ function GROUP:AllOnGround()
|
||||
return nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
do -- AI methods
|
||||
|
||||
--- Turns the AI On or Off for the GROUP.
|
||||
-- @param #GROUP self
|
||||
-- @param #boolean AIOnOff The value true turns the AI On, the value false turns the AI Off.
|
||||
-- @return #GROUP The GROUP.
|
||||
function GROUP:SetAIOnOff( AIOnOff )
|
||||
|
||||
local DCSGroup = self:GetDCSObject() -- Dcs.DCSGroup#Group
|
||||
|
||||
if DCSGroup then
|
||||
local DCSController = DCSGroup:getController() -- Dcs.DCSController#Controller
|
||||
if DCSController then
|
||||
DCSController:setOnOff( AIOnOff )
|
||||
return self
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Turns the AI On for the GROUP.
|
||||
-- @param #GROUP self
|
||||
-- @return #GROUP The GROUP.
|
||||
function GROUP:SetAIOn()
|
||||
|
||||
return self:SetAIOnOff( true )
|
||||
end
|
||||
|
||||
--- Turns the AI Off for the GROUP.
|
||||
-- @param #GROUP self
|
||||
-- @return #GROUP The GROUP.
|
||||
function GROUP:SetAIOff()
|
||||
|
||||
return self:SetAIOnOff( false )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Returns the current maximum velocity of the group.
|
||||
-- Each unit within the group gets evaluated, and the maximum velocity (= the unit which is going the fastest) is returned.
|
||||
-- @param #GROUP self
|
||||
@ -882,4 +871,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
|
||||
|
||||
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
-- ===
|
||||
--
|
||||
-- @module Identifiable
|
||||
-- @author FlightControl
|
||||
|
||||
--- The IDENTIFIABLE class
|
||||
-- @type IDENTIFIABLE
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
-- ===
|
||||
--
|
||||
-- @module Object
|
||||
-- @author FlightControl
|
||||
|
||||
--- The OBJECT class
|
||||
-- @type OBJECT
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
-- ===
|
||||
--
|
||||
-- @module Positionable
|
||||
-- @author FlightControl
|
||||
|
||||
--- The POSITIONABLE class
|
||||
-- @type POSITIONABLE
|
||||
@ -46,6 +45,7 @@ POSITIONABLE = {
|
||||
function POSITIONABLE:New( PositionableName )
|
||||
local self = BASE:Inherit( self, IDENTIFIABLE:New( PositionableName ) )
|
||||
|
||||
self.PositionableName = PositionableName
|
||||
return self
|
||||
end
|
||||
|
||||
@ -54,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
|
||||
@ -111,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
|
||||
@ -220,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
|
||||
|
||||
@ -315,6 +329,7 @@ end
|
||||
-- @param #POSITIONABLE self
|
||||
-- @param #string Message The message text
|
||||
-- @param Dcs.DCSTYpes#Duration Duration The duration of the message.
|
||||
-- @param Dcs.DCScoalition#coalition MessageCoalition The Coalition receiving the message.
|
||||
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
||||
function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition, Name )
|
||||
self:F2( { Message, Duration } )
|
||||
|
||||
@ -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,6 +80,8 @@ 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
|
||||
|
||||
|
||||
|
||||
BIN
Moose Presentations/AI_CAP.pptx
Normal file
BIN
Moose Presentations/AI_CAP.pptx
Normal file
Binary file not shown.
BIN
Moose Presentations/AI_CAS.pptx
Normal file
BIN
Moose Presentations/AI_CAS.pptx
Normal file
Binary file not shown.
BIN
Moose Presentations/AI_PATROL.pptx
Normal file
BIN
Moose Presentations/AI_PATROL.pptx
Normal file
Binary file not shown.
Binary file not shown.
BIN
Moose Presentations/SETUP.pptx
Normal file
BIN
Moose Presentations/SETUP.pptx
Normal file
Binary file not shown.
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
|
||||
--
|
||||
@ -31,15 +27,17 @@ 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 )
|
||||
|
||||
local PatrolZones = {}
|
||||
|
||||
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
|
||||
local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" )
|
||||
local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
|
||||
|
||||
|
||||
local Patrol = AI_PATROLZONE:New( PatrolZone, 3000, 6000, 400, 600 )
|
||||
Patrol:ManageFuel( 0.2, 60 )
|
||||
Patrol:SetControllable( AIGroup )
|
||||
Patrol:__Start( 5 )
|
||||
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 )
|
||||
|
||||
end
|
||||
|
||||
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" )
|
||||
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.
@ -0,0 +1,210 @@
|
||||
-- View scripts
|
||||
-- Copyright (C) 2004, Eagle Dynamics.
|
||||
DisableCombatViews = false -- F5 & Ctrl-F5
|
||||
ExternalObjectsLockDistance = 10000.0
|
||||
ShowTargetInfo = false
|
||||
CameraTerrainRestriction = true
|
||||
hAngleRearDefault = 180
|
||||
vAngleRearDefault = -8.0
|
||||
vAngleRearMin = -90 -- -8.0
|
||||
vAngleRearMax = 90.0
|
||||
|
||||
dbg_shell = "weapons.shells.PKT_7_62_T" -- 23mm shell
|
||||
dbg_shell = "weapons.nurs.WGr21"
|
||||
-- dbg_shell = "weapons.shells.2A64_152" -- 152mm shell
|
||||
dbg_shell_v0 = -1 -- Muzzle speed m/s (-1 - speed from shall database)
|
||||
dbg_shell_fire_rate = 60
|
||||
--reformatted per-unit data to be mod system friendly
|
||||
--this file is no longer should be edited for adding new flyable aircraft , DCS automatically check core database (i.e. where you define your aircraft in aircraft table just define ViewSettings and SnapViews tables)
|
||||
|
||||
function default_fighter_player(t)
|
||||
local res = {
|
||||
CameraViewAngleLimits = {20.000000,140.000000},
|
||||
CameraAngleRestriction = {false ,90.000000,0.500000},
|
||||
EyePoint = {0.05 ,0.000000 ,0.000000},
|
||||
limits_6DOF = {x = {-0.050000,0.4500000},y ={-0.300000,0.100000},z = {-0.220000,0.220000},roll = 90.000000},
|
||||
Allow360rotation = false,
|
||||
CameraAngleLimits = {200,-80.000000,110.000000},
|
||||
ShoulderSize = 0.2, -- move body when azimuth value more then 90 degrees
|
||||
}
|
||||
if t then
|
||||
for i,o in pairs(t) do
|
||||
res[i] = o
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
function fulcrum()
|
||||
return {
|
||||
Cockpit = {
|
||||
default_fighter_player({CockpitLocalPoint = {4.71,1.28,0.000000}})
|
||||
},
|
||||
Chase = {
|
||||
LocalPoint = {1.220000,3.750000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-15.080000,6.350000,0.000000},
|
||||
AnglesDefault = {0.000000,-8.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
end
|
||||
|
||||
ViewSettings = {}
|
||||
ViewSettings["A-10A"] = {
|
||||
Cockpit = {
|
||||
[1] = default_fighter_player({CockpitLocalPoint = {4.300000,1.282000,0.000000},
|
||||
EyePoint = {0.000000,0.000000,0.000000},
|
||||
limits_6DOF = {x = {-0.050000,0.600000},
|
||||
y = {-0.300000,0.100000},
|
||||
z = {-0.250000,0.250000},
|
||||
roll = 90.000000}}),
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {0.600000,3.682000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-27.000000,12.000000,0.000000},
|
||||
AnglesDefault = {0.000000,-12.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
ViewSettings["A-10C"] = {
|
||||
Cockpit = {
|
||||
[1] = default_fighter_player({CockpitLocalPoint = {4.300000,1.282000,0.000000},
|
||||
EyePoint = {0.000000,0.000000,0.000000},
|
||||
limits_6DOF = {x = {-0.050000,0.600000},
|
||||
y = {-0.300000,0.100000},
|
||||
z = {-0.250000,0.250000},
|
||||
roll = 90.000000}}),
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {0.600000,3.682000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-27.000000,12.000000,0.000000},
|
||||
AnglesDefault = {0.000000,-12.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
ViewSettings["F-15C"] = {
|
||||
Cockpit = {
|
||||
[1] = default_fighter_player({CockpitLocalPoint = {6.210000,1.204000,0.000000}})-- player slot 1
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {2.510000,3.604000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-13.790000,6.204000,0.000000},
|
||||
AnglesDefault = {0.000000,-8.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
ViewSettings["Ka-50"] = {
|
||||
Cockpit = {
|
||||
[1] = {-- player slot 1
|
||||
CockpitLocalPoint = {3.188000,0.390000,0.000000},
|
||||
CameraViewAngleLimits = {20.000000,120.000000},
|
||||
CameraAngleRestriction = {false,60.000000,0.400000},
|
||||
CameraAngleLimits = {140.000000,-65.000000,90.000000},
|
||||
EyePoint = {0.090000,0.000000,0.000000},
|
||||
limits_6DOF = {x = {-0.020000,0.350000},y ={-0.150000,0.165000},z = {-0.170000,0.170000},roll = 90.000000},
|
||||
},
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {-0.512000,2.790000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-16.812000,5.390000,0.000000},
|
||||
AnglesDefault = {0.000000,-8.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
ViewSettings["MiG-29A"] = fulcrum()
|
||||
ViewSettings["MiG-29G"] = fulcrum()
|
||||
ViewSettings["MiG-29S"] = fulcrum()
|
||||
|
||||
ViewSettings["P-51D"] = {
|
||||
Cockpit = {
|
||||
[1] = {-- player slot 1
|
||||
CockpitLocalPoint = {-1.500000,0.618000,0.000000},
|
||||
CameraViewAngleLimits = {20.000000,120.000000},
|
||||
CameraAngleRestriction = {false,90.000000,0.500000},
|
||||
CameraAngleLimits = {200,-80.000000,90.000000},
|
||||
EyePoint = {0.025000,0.100000,0.000000},
|
||||
ShoulderSize = 0.15,
|
||||
Allow360rotation = false,
|
||||
limits_6DOF = {x = {-0.050000,0.450000},y ={-0.200000,0.200000},z = {-0.220000,0.220000},roll = 90.000000},
|
||||
},
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {0.200000,-0.652000,-0.650000},
|
||||
AnglesDefault = {0.000000,0.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-21.500000,5.618000,0.000000},
|
||||
AnglesDefault = {0.000000,-8.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
ViewSettings["Su-25"] = {
|
||||
Cockpit = {
|
||||
[1] = default_fighter_player({CockpitLocalPoint = {3.352000,0.506000,0.000000}}),-- player slot 1
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {-0.348000,2.906000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-16.648001,5.506000,0.000000},
|
||||
AnglesDefault = {0.000000,-8.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
ViewSettings["Su-25T"] = {
|
||||
Cockpit = {
|
||||
[1] = default_fighter_player({CockpitLocalPoint = {3.406000,0.466000,0.000000}}),-- player slot 1
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {-0.294000,2.866000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-16.594000,5.466000,0.000000},
|
||||
AnglesDefault = {0.000000,-8.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
ViewSettings["Su-25TM"] = {
|
||||
Cockpit = {
|
||||
[1] = {-- player slot 1
|
||||
CockpitLocalPoint = {4.000000,1.000000,0.000000},
|
||||
CameraViewAngleLimits = {20.000000,140.000000},
|
||||
CameraAngleRestriction = {true,90.000000,0.400000},
|
||||
CameraAngleLimits = {160.000000,-70.000000,90.000000},
|
||||
EyePoint = {0.000000,0.000000,0.000000},
|
||||
limits_6DOF = {x = {-0.200000,0.200000},y ={-0.200000,0.200000},z = {-0.200000,0.200000},roll = 60.000000},
|
||||
},
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {4.000000,2.000000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {4.000000,2.000000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
ViewSettings["Su-27"] = {
|
||||
Cockpit = {
|
||||
[1] = default_fighter_player({CockpitLocalPoint = {7.959000,1.419000,0.000000}})-- player slot 1
|
||||
}, -- Cockpit
|
||||
Chase = {
|
||||
LocalPoint = {4.259000,3.819000,0.000000},
|
||||
AnglesDefault = {180.000000,-8.000000},
|
||||
}, -- Chase
|
||||
Arcade = {
|
||||
LocalPoint = {-12.041000,6.419000,0.000000},
|
||||
AnglesDefault = {0.000000,-8.000000},
|
||||
}, -- Arcade
|
||||
}
|
||||
|
||||
ViewSettings["Su-33"] = ViewSettings["Su-27"]
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,128 @@
|
||||
-- View scripts
|
||||
-- Copyright (C) 2004, Eagle Dynamics.
|
||||
|
||||
CockpitMouse = true --false
|
||||
CockpitMouseSpeedSlow = 1.0
|
||||
CockpitMouseSpeedNormal = 10.0
|
||||
CockpitMouseSpeedFast = 20.0
|
||||
CockpitKeyboardAccelerationSlow = 5.0
|
||||
CockpitKeyboardAccelerationNormal = 30.0
|
||||
CockpitKeyboardAccelerationFast = 80.0
|
||||
CockpitKeyboardZoomAcceleration = 300.0
|
||||
DisableSnapViewsSaving = false
|
||||
UseDefaultSnapViews = true
|
||||
CockpitPanStepHor = 45.0
|
||||
CockpitPanStepVert = 30.0
|
||||
CockpitNyMove = true
|
||||
|
||||
CockpitHAngleAccelerateTimeMax = 0.15
|
||||
CockpitVAngleAccelerateTimeMax = 0.15
|
||||
CockpitZoomAccelerateTimeMax = 0.2
|
||||
|
||||
function NaturalHeadMoving(tang, roll, omz)
|
||||
local r = roll
|
||||
if r > 90.0 then
|
||||
r = 180.0 - r
|
||||
elseif roll < -90.0 then
|
||||
r = -180.0 - r
|
||||
end
|
||||
local hAngle = -0.25 * r
|
||||
local vAngle = math.min(math.max(0.0, 0.4 * tang + 45.0 * omz), 90.0)
|
||||
return hAngle, vAngle
|
||||
end
|
||||
|
||||
ExternalMouse = true
|
||||
ExternalMouseSpeedSlow = 1.0
|
||||
ExternalMouseSpeedNormal = 5.0
|
||||
ExternalMouseSpeedFast = 20.0
|
||||
ExternalViewAngleMin = 3.0
|
||||
ExternalViewAngleMax = 170.0
|
||||
ExternalViewAngleDefault = 60.0
|
||||
ExternalKeyboardZoomAcceleration = 30.0
|
||||
ExternalKeyboardZoomAccelerateTimeMax = 1.0
|
||||
ExplosionExpoTime = 4.0
|
||||
ExternalKeyboardAccelerationSlow = 1.0
|
||||
ExternalKeyboardAccelerationNormal = 10.0
|
||||
ExternalKeyboardAccelerationFast = 30.0
|
||||
ExternalHAngleAccelerateTimeMax = 3.0
|
||||
ExternalVAngleAccelerateTimeMax = 3.0
|
||||
ExternalDistAccelerateTimeMax = 3.0
|
||||
ExternalHAngleLocalAccelerateTimeMax = 3.0
|
||||
ExternalVAngleLocalAccelerateTimeMax = 3.0
|
||||
ExternalAngleNormalDiscreteStep = 15.0/ExternalKeyboardAccelerationNormal -- When 'S' is pressed only
|
||||
ChaseCameraNyMove = true
|
||||
FreeCameraAngleIncrement = 3.0
|
||||
FreeCameraDistanceIncrement = 200.0
|
||||
FreeCameraLeftRightIncrement = 2.0
|
||||
FreeCameraAltitudeIncrement = 2.0
|
||||
FreeCameraScalarSpeedAcceleration = 0.1
|
||||
xMinMap = -300000
|
||||
xMaxMap = 500000
|
||||
yMinMap = -400000
|
||||
yMaxMap = 200000
|
||||
dxMap = 150000
|
||||
dyMap = 100000
|
||||
|
||||
head_roll_shaking = true
|
||||
head_roll_shaking_max = 30.0
|
||||
head_roll_shaking_compensation_gain = 0.3
|
||||
|
||||
-- CameraJiggle() and CameraFloat() functions make camera position
|
||||
-- dependent on FPS so be careful in using the Shift-J command with tracks, please.
|
||||
-- uncomment to use custom jiggle functions
|
||||
--[[
|
||||
function CameraJiggle(t,rnd1,rnd2,rnd3)
|
||||
local rotX, rotY, rotZ
|
||||
rotX = 0.05 * rnd1 * math.sin(37.0 * (t - 0.0))
|
||||
rotY = 0.05 * rnd2 * math.sin(41.0 * (t - 1.0))
|
||||
rotZ = 0.05 * rnd3 * math.sin(53.0 * (t - 2.0))
|
||||
return rotX, rotY, rotZ
|
||||
end
|
||||
|
||||
function CameraFloat(t)
|
||||
local dX, dY, dZ
|
||||
dX = 0.61 * math.sin(0.7 * t) + 0.047 * math.sin(1.6 * t);
|
||||
dY = 0.43 * math.sin(0.6 * t) + 0.067 * math.sin(1.7 * t);
|
||||
dZ = 0.53 * math.sin(1.0 * t) + 0.083 * math.sin(1.9 * t);
|
||||
return dX, dY, dZ
|
||||
end
|
||||
--]]
|
||||
--Debug keys
|
||||
|
||||
DEBUG_TEXT = 1
|
||||
DEBUG_GEOMETRY = 2
|
||||
|
||||
debug_keys = {
|
||||
[DEBUG_TEXT] = 1,
|
||||
[DEBUG_GEOMETRY] = 1
|
||||
}
|
||||
|
||||
function onDebugCommand(command)
|
||||
if command == 10000 then
|
||||
if debug_keys[DEBUG_TEXT] ~= 0 or debug_keys[DEBUG_GEOMETRY] ~= 0 then
|
||||
debug_keys[DEBUG_GEOMETRY] = 0
|
||||
debug_keys[DEBUG_TEXT] = 0
|
||||
else
|
||||
debug_keys[DEBUG_GEOMETRY] = 1
|
||||
debug_keys[DEBUG_TEXT] = 1
|
||||
end
|
||||
elseif command == 10001 then
|
||||
if debug_keys[DEBUG_TEXT] ~= 0 then
|
||||
debug_keys[DEBUG_TEXT] = 0
|
||||
else
|
||||
debug_keys[DEBUG_TEXT] = 1
|
||||
end
|
||||
elseif command == 10002 then
|
||||
if debug_keys[DEBUG_GEOMETRY] ~= 0 then
|
||||
debug_keys[DEBUG_GEOMETRY] = 0
|
||||
else
|
||||
debug_keys[DEBUG_GEOMETRY] = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- gain values for TrackIR , to unify responce on diffrent types of aircraft
|
||||
TrackIR_gain_x = -0.6
|
||||
TrackIR_gain_y = 0.3
|
||||
TrackIR_gain_z = -0.25
|
||||
TrackIR_gain_roll = -90
|
||||
@ -0,0 +1,880 @@
|
||||
SAT_SYS_GLONASS = 0
|
||||
SAT_SYS_GPS = 1
|
||||
|
||||
almanac = {}
|
||||
--GPS
|
||||
almanac[0] = {}
|
||||
almanac[0]["System"] = SAT_SYS_GPS
|
||||
almanac[0]["Number"] = 1
|
||||
almanac[0]["Orbital"] = "F"
|
||||
almanac[0]["Eccentricity"] = 6.294000e-003
|
||||
almanac[0]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[0]["Orbital_Inclination"] = 9.885676e-001
|
||||
almanac[0]["Rate_of_Right_Ascen"] = -7.862702e-009
|
||||
almanac[0]["SQRT_A"] = 5.153700e+003
|
||||
almanac[0]["Right_Ascen_at_Week"] = 8.096750e-001
|
||||
almanac[0]["Argument_of_Perigee"] = -1.777773e+000
|
||||
almanac[0]["Mean_Anom"] = -5.315745e-001
|
||||
almanac[0]["week"] = 1390
|
||||
|
||||
almanac[1] = {}
|
||||
almanac[1]["System"] = SAT_SYS_GPS
|
||||
almanac[1]["Number"] = 2
|
||||
almanac[1]["Orbital"] = "C"
|
||||
almanac[1]["Eccentricity"] = 8.794000e-003
|
||||
almanac[1]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[1]["Orbital_Inclination"] = 9.487811e-001
|
||||
almanac[1]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[1]["SQRT_A"] = 5.153700e+003
|
||||
almanac[1]["Right_Ascen_at_Week"] = -1.329172e+000
|
||||
almanac[1]["Argument_of_Perigee"] = 2.138637e+000
|
||||
almanac[1]["Mean_Anom"] = 7.311702e-001
|
||||
almanac[1]["week"] = 1390
|
||||
|
||||
almanac[2] = {}
|
||||
almanac[2]["System"] = SAT_SYS_GPS
|
||||
almanac[2]["Number"] = 3
|
||||
almanac[2]["Orbital"] = "F"
|
||||
almanac[2]["Eccentricity"] = 8.424000e-003
|
||||
almanac[2]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[2]["Orbital_Inclination"] = 9.262804e-001
|
||||
almanac[2]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[2]["SQRT_A"] = 5.153600e+003
|
||||
almanac[2]["Right_Ascen_at_Week"] = -2.341514e+000
|
||||
almanac[2]["Argument_of_Perigee"] = 6.749357e-001
|
||||
almanac[2]["Mean_Anom"] = -2.296153e-001
|
||||
almanac[2]["week"] = 1389
|
||||
|
||||
almanac[3] = {}
|
||||
almanac[3]["System"] = SAT_SYS_GPS
|
||||
almanac[3]["Number"] = 4
|
||||
almanac[3]["Orbital"] = "D"
|
||||
almanac[3]["Eccentricity"] = 7.413000e-003
|
||||
almanac[3]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[3]["Orbital_Inclination"] = 9.482889e-001
|
||||
almanac[3]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[3]["SQRT_A"] = 5.153600e+003
|
||||
almanac[3]["Right_Ascen_at_Week"] = -1.309589e+000
|
||||
almanac[3]["Argument_of_Perigee"] = 1.623504e-001
|
||||
almanac[3]["Mean_Anom"] = -3.022943e+000
|
||||
almanac[3]["week"] = 1390
|
||||
|
||||
almanac[4] = {}
|
||||
almanac[4]["System"] = SAT_SYS_GPS
|
||||
almanac[4]["Number"] = 5
|
||||
almanac[4]["Orbital"] = "B"
|
||||
almanac[4]["Eccentricity"] = 7.432000e-003
|
||||
almanac[4]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[4]["Orbital_Inclination"] = 9.387437e-001
|
||||
almanac[4]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[4]["SQRT_A"] = 5.153700e+003
|
||||
almanac[4]["Right_Ascen_at_Week"] = 2.779487e+000
|
||||
almanac[4]["Argument_of_Perigee"] = 1.099033e+000
|
||||
almanac[4]["Mean_Anom"] = 2.970984e+000
|
||||
almanac[4]["week"] = 1390
|
||||
|
||||
almanac[5] = {}
|
||||
almanac[5]["System"] = SAT_SYS_GPS
|
||||
almanac[5]["Number"] = 6
|
||||
almanac[5]["Orbital"] = "C"
|
||||
almanac[5]["Eccentricity"] = 6.020000e-003
|
||||
almanac[5]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[5]["Orbital_Inclination"] = 9.337591e-001
|
||||
almanac[5]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[5]["SQRT_A"] = 5.153600e+003
|
||||
almanac[5]["Right_Ascen_at_Week"] = -2.407627e+000
|
||||
almanac[5]["Argument_of_Perigee"] = -1.788263e+000
|
||||
almanac[5]["Mean_Anom"] = -2.149877e+000
|
||||
almanac[5]["week"] = 1390
|
||||
|
||||
almanac[6] = {}
|
||||
almanac[6]["System"] = SAT_SYS_GPS
|
||||
almanac[6]["Number"] = 7
|
||||
almanac[6]["Orbital"] = "C"
|
||||
almanac[6]["Eccentricity"] = 1.052400e-002
|
||||
almanac[6]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[6]["Orbital_Inclination"] = 9.353229e-001
|
||||
almanac[6]["Rate_of_Right_Ascen"] = -8.080868e-009
|
||||
almanac[6]["SQRT_A"] = 5.153700e+003
|
||||
almanac[6]["Right_Ascen_at_Week"] = -2.433580e+000
|
||||
almanac[6]["Argument_of_Perigee"] = -1.767301e+000
|
||||
almanac[6]["Mean_Anom"] = -3.141503e+000
|
||||
almanac[6]["week"] = 1390
|
||||
|
||||
almanac[7] = {}
|
||||
almanac[7]["System"] = SAT_SYS_GPS
|
||||
almanac[7]["Number"] = 8
|
||||
almanac[7]["Orbital"] = "A"
|
||||
almanac[7]["Eccentricity"] = 9.822000e-003
|
||||
almanac[7]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[7]["Orbital_Inclination"] = 9.741390e-001
|
||||
almanac[7]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[7]["SQRT_A"] = 5.153600e+003
|
||||
almanac[7]["Right_Ascen_at_Week"] = 1.857849e+000
|
||||
almanac[7]["Argument_of_Perigee"] = 2.674034e+000
|
||||
almanac[7]["Mean_Anom"] = -2.009745e+000
|
||||
almanac[7]["week"] = 1390
|
||||
|
||||
almanac[8] = {}
|
||||
almanac[8]["System"] = SAT_SYS_GPS
|
||||
almanac[8]["Number"] = 9
|
||||
almanac[8]["Orbital"] = "A"
|
||||
almanac[8]["Eccentricity"] = 1.839300e-002
|
||||
almanac[8]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[8]["Orbital_Inclination"] = 9.617541e-001
|
||||
almanac[8]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[8]["SQRT_A"] = 5.153600e+003
|
||||
almanac[8]["Right_Ascen_at_Week"] = 1.777005e+000
|
||||
almanac[8]["Argument_of_Perigee"] = 1.274962e+000
|
||||
almanac[8]["Mean_Anom"] = -2.349578e+000
|
||||
almanac[8]["week"] = 1390
|
||||
|
||||
almanac[9] = {}
|
||||
almanac[9]["System"] = SAT_SYS_GPS
|
||||
almanac[9]["Number"] = 10
|
||||
almanac[9]["Orbital"] = "E"
|
||||
almanac[9]["Eccentricity"] = 7.061000e-003
|
||||
almanac[9]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[9]["Orbital_Inclination"] = 9.728876e-001
|
||||
almanac[9]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[9]["SQRT_A"] = 5.153600e+003
|
||||
almanac[9]["Right_Ascen_at_Week"] = -2.563014e-001
|
||||
almanac[9]["Argument_of_Perigee"] = 4.377980e-001
|
||||
almanac[9]["Mean_Anom"] = 1.210716e+000
|
||||
almanac[9]["week"] = 1390
|
||||
|
||||
almanac[10] = {}
|
||||
almanac[10]["System"] = SAT_SYS_GPS
|
||||
almanac[10]["Number"] = 11
|
||||
almanac[10]["Orbital"] = "D"
|
||||
almanac[10]["Eccentricity"] = 5.744000e-003
|
||||
almanac[10]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[10]["Orbital_Inclination"] = 8.959309e-001
|
||||
almanac[10]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[10]["SQRT_A"] = 5.153600e+003
|
||||
almanac[10]["Right_Ascen_at_Week"] = -1.478816e+000
|
||||
almanac[10]["Argument_of_Perigee"] = 3.750011e-001
|
||||
almanac[10]["Mean_Anom"] = -1.522048e+000
|
||||
almanac[10]["week"] = 1390
|
||||
|
||||
almanac[11] = {}
|
||||
almanac[11]["System"] = SAT_SYS_GPS
|
||||
almanac[11]["Number"] = 13
|
||||
almanac[11]["Orbital"] = "F"
|
||||
almanac[11]["Eccentricity"] = 3.088000e-003
|
||||
almanac[11]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[11]["Orbital_Inclination"] = 9.927564e-001
|
||||
almanac[11]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[11]["SQRT_A"] = 5.153700e+003
|
||||
almanac[11]["Right_Ascen_at_Week"] = 7.956600e-001
|
||||
almanac[11]["Argument_of_Perigee"] = 1.279395e+000
|
||||
almanac[11]["Mean_Anom"] = 1.004349e+000
|
||||
almanac[11]["week"] = 1390
|
||||
|
||||
almanac[12] = {}
|
||||
almanac[12]["System"] = SAT_SYS_GPS
|
||||
almanac[12]["Number"] = 14
|
||||
almanac[12]["Orbital"] = "F"
|
||||
almanac[12]["Eccentricity"] = 2.591000e-003
|
||||
almanac[12]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[12]["Orbital_Inclination"] = 9.868729e-001
|
||||
almanac[12]["Rate_of_Right_Ascen"] = -7.885391e-009
|
||||
almanac[12]["SQRT_A"] = 5.153600e+003
|
||||
almanac[12]["Right_Ascen_at_Week"] = 7.819592e-001
|
||||
almanac[12]["Argument_of_Perigee"] = -2.158621e+000
|
||||
almanac[12]["Mean_Anom"] = 5.412611e-001
|
||||
almanac[12]["week"] = 1390
|
||||
|
||||
almanac[13] = {}
|
||||
almanac[13]["System"] = SAT_SYS_GPS
|
||||
almanac[13]["Number"] = 15
|
||||
almanac[13]["Orbital"] = "D"
|
||||
almanac[13]["Eccentricity"] = 9.828000e-003
|
||||
almanac[13]["Time_of_Applicability"] = 3.194880e+005
|
||||
almanac[13]["Orbital_Inclination"] = 9.554204e-001
|
||||
almanac[13]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[13]["SQRT_A"] = 5.153600e+003
|
||||
almanac[13]["Right_Ascen_at_Week"] = -1.123869e+000
|
||||
almanac[13]["Argument_of_Perigee"] = 2.690266e+000
|
||||
almanac[13]["Mean_Anom"] = 2.220476e+000
|
||||
almanac[13]["week"] = 1389
|
||||
|
||||
almanac[14] = {}
|
||||
almanac[14]["System"] = SAT_SYS_GPS
|
||||
almanac[14]["Number"] = 16
|
||||
almanac[14]["Orbital"] = "B"
|
||||
almanac[14]["Eccentricity"] = 3.494000e-003
|
||||
almanac[14]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[14]["Orbital_Inclination"] = 9.629340e-001
|
||||
almanac[14]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[14]["SQRT_A"] = 5.153700e+003
|
||||
almanac[14]["Right_Ascen_at_Week"] = 2.873124e+000
|
||||
almanac[14]["Argument_of_Perigee"] = -7.819243e-001
|
||||
almanac[14]["Mean_Anom"] = 2.623629e+000
|
||||
almanac[14]["week"] = 1390
|
||||
|
||||
almanac[15] = {}
|
||||
almanac[15]["System"] = SAT_SYS_GPS
|
||||
almanac[15]["Number"] = 17
|
||||
almanac[15]["Orbital"] = "C"
|
||||
almanac[15]["Eccentricity"] = 2.141000e-003
|
||||
almanac[15]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[15]["Orbital_Inclination"] = 9.601170e-001
|
||||
almanac[15]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[15]["SQRT_A"] = 5.153700e+003
|
||||
almanac[15]["Right_Ascen_at_Week"] = -2.371499e+000
|
||||
almanac[15]["Argument_of_Perigee"] = 3.087694e+000
|
||||
almanac[15]["Mean_Anom"] = 1.611217e+000
|
||||
almanac[15]["week"] = 1390
|
||||
|
||||
almanac[16] = {}
|
||||
almanac[16]["System"] = SAT_SYS_GPS
|
||||
almanac[16]["Number"] = 18
|
||||
almanac[16]["Orbital"] = "E"
|
||||
almanac[16]["Eccentricity"] = 7.636000e-003
|
||||
almanac[16]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[16]["Orbital_Inclination"] = 9.569597e-001
|
||||
almanac[16]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[16]["SQRT_A"] = 5.153700e+003
|
||||
almanac[16]["Right_Ascen_at_Week"] = -2.359858e-001
|
||||
almanac[16]["Argument_of_Perigee"] = -2.649216e+000
|
||||
almanac[16]["Mean_Anom"] = 2.675029e+000
|
||||
almanac[16]["week"] = 1390
|
||||
|
||||
almanac[17] = {}
|
||||
almanac[17]["System"] = SAT_SYS_GPS
|
||||
almanac[17]["Number"] = 19
|
||||
almanac[17]["Orbital"] = "C"
|
||||
almanac[17]["Eccentricity"] = 3.602000e-003
|
||||
almanac[17]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[17]["Orbital_Inclination"] = 9.580209e-001
|
||||
almanac[17]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[17]["SQRT_A"] = 5.153600e+003
|
||||
almanac[17]["Right_Ascen_at_Week"] = -2.312385e+000
|
||||
almanac[17]["Argument_of_Perigee"] = -1.161079e+000
|
||||
almanac[17]["Mean_Anom"] = 1.310619e+000
|
||||
almanac[17]["week"] = 1390
|
||||
|
||||
almanac[18] = {}
|
||||
almanac[18]["System"] = SAT_SYS_GPS
|
||||
almanac[18]["Number"] = 20
|
||||
almanac[18]["Orbital"] = "E"
|
||||
almanac[18]["Eccentricity"] = 2.796000e-003
|
||||
almanac[18]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[18]["Orbital_Inclination"] = 9.564693e-001
|
||||
almanac[18]["Rate_of_Right_Ascen"] = -7.908080e-009
|
||||
almanac[18]["SQRT_A"] = 5.153600e+003
|
||||
almanac[18]["Right_Ascen_at_Week"] = -2.889565e-001
|
||||
almanac[18]["Argument_of_Perigee"] = 1.379612e+000
|
||||
almanac[18]["Mean_Anom"] = 2.461750e+000
|
||||
almanac[18]["week"] = 1390
|
||||
|
||||
almanac[19] = {}
|
||||
almanac[19]["System"] = SAT_SYS_GPS
|
||||
almanac[19]["Number"] = 21
|
||||
almanac[19]["Orbital"] = "D"
|
||||
almanac[19]["Eccentricity"] = 1.162900e-002
|
||||
almanac[19]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[19]["Orbital_Inclination"] = 9.418592e-001
|
||||
almanac[19]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[19]["SQRT_A"] = 5.153600e+003
|
||||
almanac[19]["Right_Ascen_at_Week"] = -1.289972e+000
|
||||
almanac[19]["Argument_of_Perigee"] = -2.923686e+000
|
||||
almanac[19]["Mean_Anom"] = -2.349194e+000
|
||||
almanac[19]["week"] = 1390
|
||||
|
||||
almanac[20] = {}
|
||||
almanac[20]["System"] = SAT_SYS_GPS
|
||||
almanac[20]["Number"] = 22
|
||||
almanac[20]["Orbital"] = "E"
|
||||
almanac[20]["Eccentricity"] = 4.893000e-003
|
||||
almanac[20]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[20]["Orbital_Inclination"] = 9.545093e-001
|
||||
almanac[20]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[20]["SQRT_A"] = 5.153600e+003
|
||||
almanac[20]["Right_Ascen_at_Week"] = -2.280969e-001
|
||||
almanac[20]["Argument_of_Perigee"] = -1.674502e+000
|
||||
almanac[20]["Mean_Anom"] = 1.106852e+000
|
||||
almanac[20]["week"] = 1390
|
||||
|
||||
almanac[21] = {}
|
||||
almanac[21]["System"] = SAT_SYS_GPS
|
||||
almanac[21]["Number"] = 23
|
||||
almanac[21]["Orbital"] = "F"
|
||||
almanac[21]["Eccentricity"] = 4.822000e-003
|
||||
almanac[21]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[21]["Orbital_Inclination"] = 9.691247e-001
|
||||
almanac[21]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[21]["SQRT_A"] = 5.153700e+003
|
||||
almanac[21]["Right_Ascen_at_Week"] = 7.667399e-001
|
||||
almanac[21]["Argument_of_Perigee"] = 2.497634e+000
|
||||
almanac[21]["Mean_Anom"] = 3.184700e-001
|
||||
almanac[21]["week"] = 1390
|
||||
|
||||
almanac[22] = {}
|
||||
almanac[22]["System"] = SAT_SYS_GPS
|
||||
almanac[22]["Number"] = 24
|
||||
almanac[22]["Orbital"] = "D"
|
||||
almanac[22]["Eccentricity"] = 9.277000e-003
|
||||
almanac[22]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[22]["Orbital_Inclination"] = 9.585183e-001
|
||||
almanac[22]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[22]["SQRT_A"] = 5.153900e+003
|
||||
almanac[22]["Right_Ascen_at_Week"] = -1.274840e+000
|
||||
almanac[22]["Argument_of_Perigee"] = -8.815651e-001
|
||||
almanac[22]["Mean_Anom"] = -1.695551e+000
|
||||
almanac[22]["week"] = 1390
|
||||
|
||||
almanac[23] = {}
|
||||
almanac[23]["System"] = SAT_SYS_GPS
|
||||
almanac[23]["Number"] = 25
|
||||
almanac[23]["Orbital"] = "A"
|
||||
almanac[23]["Eccentricity"] = 1.257400e-002
|
||||
almanac[23]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[23]["Orbital_Inclination"] = 9.551027e-001
|
||||
almanac[23]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[23]["SQRT_A"] = 5.153600e+003
|
||||
almanac[23]["Right_Ascen_at_Week"] = 1.721853e+000
|
||||
almanac[23]["Argument_of_Perigee"] = -1.329870e+000
|
||||
almanac[23]["Mean_Anom"] = -1.769623e+000
|
||||
almanac[23]["week"] = 1390
|
||||
|
||||
almanac[24] = {}
|
||||
almanac[24]["System"] = SAT_SYS_GPS
|
||||
almanac[24]["Number"] = 26
|
||||
almanac[24]["Orbital"] = "F"
|
||||
almanac[24]["Eccentricity"] = 1.745700e-002
|
||||
almanac[24]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[24]["Orbital_Inclination"] = 9.908749e-001
|
||||
almanac[24]["Rate_of_Right_Ascen"] = -7.840012e-009
|
||||
almanac[24]["SQRT_A"] = 5.153700e+003
|
||||
almanac[24]["Right_Ascen_at_Week"] = 7.961836e-001
|
||||
almanac[24]["Argument_of_Perigee"] = 8.161502e-001
|
||||
almanac[24]["Mean_Anom"] = -5.841961e-001
|
||||
almanac[24]["week"] = 1390
|
||||
|
||||
almanac[25] = {}
|
||||
almanac[25]["System"] = SAT_SYS_GPS
|
||||
almanac[25]["Number"] = 27
|
||||
almanac[25]["Orbital"] = "A"
|
||||
almanac[25]["Eccentricity"] = 1.991000e-002
|
||||
almanac[25]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[25]["Orbital_Inclination"] = 9.596563e-001
|
||||
almanac[25]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[25]["SQRT_A"] = 5.153600e+003
|
||||
almanac[25]["Right_Ascen_at_Week"] = 1.754124e+000
|
||||
almanac[25]["Argument_of_Perigee"] = -1.900854e+000
|
||||
almanac[25]["Mean_Anom"] = 3.046487e+000
|
||||
almanac[25]["week"] = 1390
|
||||
|
||||
almanac[26] = {}
|
||||
almanac[26]["System"] = SAT_SYS_GPS
|
||||
almanac[26]["Number"] = 28
|
||||
almanac[26]["Orbital"] = "B"
|
||||
almanac[26]["Eccentricity"] = 1.162800e-002
|
||||
almanac[26]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[26]["Orbital_Inclination"] = 9.610106e-001
|
||||
almanac[26]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[26]["SQRT_A"] = 5.153600e+003
|
||||
almanac[26]["Right_Ascen_at_Week"] = 2.882583e+000
|
||||
almanac[26]["Argument_of_Perigee"] = -2.242868e+000
|
||||
almanac[26]["Mean_Anom"] = 1.860642e+000
|
||||
almanac[26]["week"] = 1390
|
||||
|
||||
almanac[27] = {}
|
||||
almanac[27]["System"] = SAT_SYS_GPS
|
||||
almanac[27]["Number"] = 29
|
||||
almanac[27]["Orbital"] = "F"
|
||||
almanac[27]["Eccentricity"] = 9.462000e-003
|
||||
almanac[27]["Time_of_Applicability"] = 1.474560e+005
|
||||
almanac[27]["Orbital_Inclination"] = 9.874838e-001
|
||||
almanac[27]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[27]["SQRT_A"] = 5.153700e+003
|
||||
almanac[27]["Right_Ascen_at_Week"] = 7.647503e-001
|
||||
almanac[27]["Argument_of_Perigee"] = -8.614589e-001
|
||||
almanac[27]["Mean_Anom"] = -4.488983e-001
|
||||
almanac[27]["week"] = 1390
|
||||
|
||||
almanac[28] = {}
|
||||
almanac[28]["System"] = SAT_SYS_GPS
|
||||
almanac[28]["Number"] = 30
|
||||
almanac[28]["Orbital"] = "B"
|
||||
almanac[28]["Eccentricity"] = 9.296000e-003
|
||||
almanac[28]["Time_of_Applicability"] = 5.898240e+005
|
||||
almanac[28]["Orbital_Inclination"] = 9.452992e-001
|
||||
almanac[28]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[28]["SQRT_A"] = 5.153600e+003
|
||||
almanac[28]["Right_Ascen_at_Week"] = 2.826698e+000
|
||||
almanac[28]["Argument_of_Perigee"] = 1.306413e+000
|
||||
almanac[28]["Mean_Anom"] = 2.148725e+000
|
||||
almanac[28]["week"] = 1390
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--GLONASS
|
||||
--1 îðáèòàëüíàÿ ïëîñêîñòü, íîìåðà 1-8
|
||||
almanac[29] = {}
|
||||
almanac[29]["System"] = SAT_SYS_GLONASS
|
||||
almanac[29]["Number"] = 1
|
||||
almanac[29]["Orbital"] = 1
|
||||
almanac[29]["GLONASS_Data"] = {}
|
||||
almanac[29]["GLONASS_Data"]["NKU_Number"] = 796
|
||||
almanac[29]["GLONASS_Data"]["Cosmos_Number"] = 2411
|
||||
almanac[29]["Eccentricity"] = 1.184000e-003
|
||||
almanac[29]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[29]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[29]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[29]["SQRT_A"] = 5.050500e+003
|
||||
almanac[29]["Right_Ascen_at_Week"] = 5.979807e+000
|
||||
almanac[29]["Argument_of_Perigee"] = 2.622634e+000
|
||||
almanac[29]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[29]["week"] = 1390
|
||||
almanac[29]["Commit_date"] = "06.02.2005"
|
||||
almanac[29]["Life_dates"] = {}
|
||||
|
||||
almanac[30] = {}
|
||||
almanac[30]["System"] = SAT_SYS_GLONASS
|
||||
almanac[30]["Number"] = 2
|
||||
almanac[30]["Orbital"] = 1
|
||||
almanac[30]["GLONASS_Data"] = {}
|
||||
almanac[30]["GLONASS_Data"]["NKU_Number"] = 794
|
||||
almanac[30]["GLONASS_Data"]["Cosmos_Number"] = 2401
|
||||
almanac[30]["Eccentricity"] = 4.486000e-003
|
||||
almanac[30]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[30]["Orbital_Inclination"] = 1.128459e+000
|
||||
almanac[30]["Rate_of_Right_Ascen"] = -6.759654e-009
|
||||
almanac[30]["SQRT_A"] = 5.050500e+003
|
||||
almanac[30]["Right_Ascen_at_Week"] = 5.997871e+000
|
||||
almanac[30]["Argument_of_Perigee"] = 1.709531e+000
|
||||
almanac[30]["Mean_Anom"] = -5.367633e+000
|
||||
almanac[30]["week"] = 1390
|
||||
almanac[30]["Commit_date"] = "02.02.2004"
|
||||
almanac[30]["Life_dates"] = {}
|
||||
|
||||
almanac[31] = {}
|
||||
almanac[31]["System"] = SAT_SYS_GLONASS
|
||||
almanac[31]["Number"] = 3
|
||||
almanac[31]["Orbital"] = 1
|
||||
almanac[31]["GLONASS_Data"] = {}
|
||||
almanac[31]["GLONASS_Data"]["NKU_Number"] = 789
|
||||
almanac[31]["GLONASS_Data"]["Cosmos_Number"] = 2381
|
||||
almanac[31]["Eccentricity"] = 2.459000e-003
|
||||
almanac[31]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[31]["Orbital_Inclination"] = 1.122958e+000
|
||||
almanac[31]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[31]["SQRT_A"] = 5.050500e+003
|
||||
almanac[31]["Right_Ascen_at_Week"] = 5.960713e+000
|
||||
almanac[31]["Argument_of_Perigee"] = -2.683407e+000
|
||||
almanac[31]["Mean_Anom"] = -1.791788e+000
|
||||
almanac[31]["week"] = 1390
|
||||
almanac[31]["Commit_date"] = "04.01.2002"
|
||||
almanac[31]["Life_dates"] = {}
|
||||
|
||||
almanac[32] = {}
|
||||
almanac[32]["System"] = SAT_SYS_GLONASS
|
||||
almanac[32]["Number"] = 4
|
||||
almanac[32]["Orbital"] = 1
|
||||
almanac[32]["GLONASS_Data"] = {}
|
||||
almanac[32]["GLONASS_Data"]["NKU_Number"] = 795
|
||||
almanac[29]["GLONASS_Data"]["Cosmos_Number"] = 2403
|
||||
almanac[32]["Eccentricity"] = 4.054000e-003
|
||||
almanac[32]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[32]["Orbital_Inclination"] = 1.128543e+000
|
||||
almanac[32]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[32]["SQRT_A"] = 5.050500e+003
|
||||
almanac[32]["Right_Ascen_at_Week"] = 5.998081e+000
|
||||
almanac[32]["Argument_of_Perigee"] = 1.497160e+000
|
||||
almanac[32]["Mean_Anom"] = -4.293681e-001
|
||||
almanac[32]["week"] = 1390
|
||||
almanac[32]["Commit_date"] = "29.01.2004"
|
||||
almanac[32]["Life_dates"] = {}
|
||||
|
||||
almanac[33] = {}
|
||||
almanac[33]["System"] = SAT_SYS_GLONASS
|
||||
almanac[33]["Number"] = 5
|
||||
almanac[33]["Orbital"] = 1
|
||||
almanac[33]["GLONASS_Data"] = {}
|
||||
almanac[33]["GLONASS_Data"]["NKU_Number"] = 711
|
||||
almanac[33]["GLONASS_Data"]["Cosmos_Number"] = 2382
|
||||
almanac[33]["Eccentricity"] = 7.040000e-004
|
||||
almanac[33]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[33]["Orbital_Inclination"] = 1.122886e+000
|
||||
almanac[33]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[33]["SQRT_A"] = 5.050600e+003
|
||||
almanac[33]["Right_Ascen_at_Week"] = 5.960713e+000
|
||||
almanac[33]["Argument_of_Perigee"] = 2.740933e+000
|
||||
almanac[33]["Mean_Anom"] = -2.523604e+000
|
||||
almanac[33]["week"] = 1390
|
||||
almanac[33]["Commit_date"] = "13.02.2003"
|
||||
almanac[33]["Life_dates"] = {}
|
||||
|
||||
almanac[34] = {}
|
||||
almanac[34]["System"] = SAT_SYS_GLONASS
|
||||
almanac[34]["Number"] = 6
|
||||
almanac[34]["Orbital"] = 1
|
||||
almanac[34]["GLONASS_Data"] = {}
|
||||
almanac[34]["GLONASS_Data"]["NKU_Number"] = 701
|
||||
almanac[34]["GLONASS_Data"]["Cosmos_Number"] = 2404
|
||||
almanac[34]["Eccentricity"] = 4.766000e-003
|
||||
almanac[34]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[34]["Orbital_Inclination"] = 1.128276e+000
|
||||
almanac[34]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[34]["SQRT_A"] = 5.050500e+003
|
||||
almanac[34]["Right_Ascen_at_Week"] = 5.997906e+000
|
||||
almanac[34]["Argument_of_Perigee"] = 1.802417e+000
|
||||
almanac[34]["Mean_Anom"] = -2.426512e+000
|
||||
almanac[34]["week"] = 1390
|
||||
almanac[34]["Commit_date"] = "08.12.2004"
|
||||
almanac[34]["Life_dates"] = {}
|
||||
|
||||
almanac[35] = {}
|
||||
almanac[35]["System"] = SAT_SYS_GLONASS
|
||||
almanac[35]["Number"] = 7
|
||||
almanac[35]["Orbital"] = 1
|
||||
almanac[35]["GLONASS_Data"] = {}
|
||||
almanac[35]["GLONASS_Data"]["NKU_Number"] = 712
|
||||
almanac[35]["GLONASS_Data"]["Cosmos_Number"] = 2413
|
||||
almanac[35]["Eccentricity"] = 7.570000e-004
|
||||
almanac[35]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[35]["Orbital_Inclination"] = 1.126344e+000
|
||||
almanac[35]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[35]["SQRT_A"] = 5.050500e+003
|
||||
almanac[35]["Right_Ascen_at_Week"] = 5.979388e+000
|
||||
almanac[35]["Argument_of_Perigee"] = 2.566068e+000
|
||||
almanac[35]["Mean_Anom"] = -3.921228e+000
|
||||
almanac[35]["week"] = 1390
|
||||
almanac[35]["Commit_date"] = "07.10.2005"
|
||||
almanac[35]["Life_dates"] = {}
|
||||
|
||||
almanac[36] = {}
|
||||
almanac[36]["System"] = SAT_SYS_GLONASS
|
||||
almanac[36]["GLONASS_Data"] = {}
|
||||
almanac[36]["Number"] = 8
|
||||
almanac[36]["Orbital"] = 1
|
||||
almanac[36]["GLONASS_Data"] = {}
|
||||
almanac[36]["GLONASS_Data"]["NKU_Number"] = 797
|
||||
almanac[36]["GLONASS_Data"]["Cosmos_Number"] = 2412
|
||||
almanac[36]["Eccentricity"] = 4.060000e-004
|
||||
almanac[36]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[36]["Orbital_Inclination"] = 1.126564e+000
|
||||
almanac[36]["Rate_of_Right_Ascen"] = -6.785834e-009
|
||||
almanac[36]["SQRT_A"] = 5.050600e+003
|
||||
almanac[36]["Right_Ascen_at_Week"] = 5.980069e+000
|
||||
almanac[36]["Argument_of_Perigee"] = 2.673633e+000
|
||||
almanac[36]["Mean_Anom"] = -4.812026e+000
|
||||
almanac[36]["week"] = 1390
|
||||
almanac[36]["Commit_date"] = "06.02.2005"
|
||||
almanac[36]["Life_dates"] = {}
|
||||
|
||||
--3 îðáèòàëüíàÿ ïëîñêîñòü, íîìåðà 17-24
|
||||
almanac[37] = {}
|
||||
almanac[37]["System"] = SAT_SYS_GLONASS
|
||||
almanac[37]["Number"] = 17
|
||||
almanac[37]["Orbital"] = 3
|
||||
almanac[37]["GLONASS_Data"] = {}
|
||||
almanac[37]["GLONASS_Data"]["NKU_Number"] = 787
|
||||
almanac[37]["GLONASS_Data"]["Cosmos_Number"] = 2375
|
||||
almanac[37]["Eccentricity"] = 5.670000e-004
|
||||
almanac[37]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[37]["Orbital_Inclination"] = 1.126524e+000
|
||||
almanac[37]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[37]["SQRT_A"] = 5.050500e+003
|
||||
almanac[37]["Right_Ascen_at_Week"] = 3.895554e+000
|
||||
almanac[37]["Argument_of_Perigee"] = 6.085085e-001
|
||||
almanac[37]["Mean_Anom"] = -2.977407e+000
|
||||
almanac[37]["week"] = 1390
|
||||
almanac[37]["Commit_date"] = "04.11.2000"
|
||||
almanac[37]["Life_dates"] = {}
|
||||
|
||||
|
||||
almanac[38] = {}
|
||||
almanac[38]["System"] = SAT_SYS_GLONASS
|
||||
almanac[38]["Number"] = 18
|
||||
almanac[38]["Orbital"] = 3
|
||||
almanac[38]["GLONASS_Data"] = {}
|
||||
almanac[38]["GLONASS_Data"]["NKU_Number"] = 783
|
||||
almanac[38]["GLONASS_Data"]["Cosmos_Number"] = 2374
|
||||
almanac[38]["Eccentricity"] = 4.520000e-003
|
||||
almanac[38]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[38]["Orbital_Inclination"] = 1.126239e+000
|
||||
almanac[38]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[38]["SQRT_A"] = 5.050600e+003
|
||||
almanac[38]["Right_Ascen_at_Week"] = 3.894071e+000
|
||||
almanac[38]["Argument_of_Perigee"] = -2.509589e+000
|
||||
almanac[38]["Mean_Anom"] = -1.020057e+000
|
||||
almanac[38]["week"] = 1390
|
||||
almanac[38]["Commit_date"] = "05.01.2001"
|
||||
almanac[38]["Life_dates"] = {}
|
||||
|
||||
almanac[39] = {}
|
||||
almanac[39]["System"] = SAT_SYS_GLONASS
|
||||
almanac[39]["Number"] = 19
|
||||
almanac[39]["Orbital"] = 3
|
||||
almanac[39]["GLONASS_Data"] = {}
|
||||
almanac[39]["GLONASS_Data"]["NKU_Number"] = 798
|
||||
almanac[39]["GLONASS_Data"]["Cosmos_Number"] = 2417
|
||||
almanac[39]["Eccentricity"] = 2.023000e-003
|
||||
almanac[39]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[39]["Orbital_Inclination"] = 1.132205e+000
|
||||
almanac[39]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[39]["SQRT_A"] = 5.050500e+003
|
||||
almanac[39]["Right_Ascen_at_Week"] = 3.884018e+000
|
||||
almanac[39]["Argument_of_Perigee"] = 2.718313e+000
|
||||
almanac[39]["Mean_Anom"] = -3.933620e-001
|
||||
almanac[39]["week"] = 1390
|
||||
almanac[39]["Commit_date"] = "22.01.2006"
|
||||
almanac[39]["Life_dates"] = {}
|
||||
|
||||
almanac[40] = {}
|
||||
almanac[40]["System"] = SAT_SYS_GLONASS
|
||||
almanac[40]["Number"] = 20
|
||||
almanac[40]["Orbital"] = 3
|
||||
almanac[40]["GLONASS_Data"] = {}
|
||||
almanac[40]["GLONASS_Data"]["NKU_Number"] = 793
|
||||
almanac[40]["GLONASS_Data"]["Cosmos_Number"] = 2396
|
||||
almanac[40]["Eccentricity"] = 1.822000e-003
|
||||
almanac[40]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[40]["Orbital_Inclination"] = 1.129789e+000
|
||||
almanac[40]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[40]["SQRT_A"] = 5.050500e+003
|
||||
almanac[40]["Right_Ascen_at_Week"] = 3.896863e+000
|
||||
almanac[40]["Argument_of_Perigee"] = 2.723776e+000
|
||||
almanac[40]["Mean_Anom"] = -1.193647e+000
|
||||
almanac[40]["week"] = 1390
|
||||
almanac[40]["Commit_date"] = "31.01.2003"
|
||||
almanac[40]["Life_dates"] = {}
|
||||
|
||||
almanac[41] = {}
|
||||
almanac[41]["System"] = SAT_SYS_GLONASS
|
||||
almanac[41]["Number"] = 21
|
||||
almanac[41]["Orbital"] = 3
|
||||
almanac[41]["GLONASS_Data"] = {}
|
||||
almanac[41]["GLONASS_Data"]["NKU_Number"] = 792
|
||||
almanac[41]["GLONASS_Data"]["Cosmos_Number"] = 2395
|
||||
almanac[41]["Eccentricity"] = 5.290000e-004
|
||||
almanac[41]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[41]["Orbital_Inclination"] = 1.129957e+000
|
||||
almanac[41]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[41]["SQRT_A"] = 5.050500e+003
|
||||
almanac[41]["Right_Ascen_at_Week"] = 3.897806e+000
|
||||
almanac[41]["Argument_of_Perigee"] = -9.519367e-001
|
||||
almanac[41]["Mean_Anom"] = -4.578920e+000
|
||||
almanac[41]["week"] = 1390
|
||||
almanac[41]["Commit_date"] = "31.01.2003"
|
||||
almanac[41]["Life_dates"] = {}
|
||||
|
||||
almanac[42] = {}
|
||||
almanac[42]["System"] = SAT_SYS_GLONASS
|
||||
almanac[42]["Number"] = 22
|
||||
almanac[42]["Orbital"] = 3
|
||||
almanac[42]["GLONASS_Data"] = {}
|
||||
almanac[42]["GLONASS_Data"]["NKU_Number"] = 791
|
||||
almanac[42]["GLONASS_Data"]["Cosmos_Number"] = 2394
|
||||
almanac[42]["Eccentricity"] = 9.200000e-005
|
||||
almanac[42]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[42]["Orbital_Inclination"] = 1.129742e+000
|
||||
almanac[42]["Rate_of_Right_Ascen"] = -6.740456e-009
|
||||
almanac[42]["SQRT_A"] = 5.050500e+003
|
||||
almanac[42]["Right_Ascen_at_Week"] = 3.897404e+000
|
||||
almanac[42]["Argument_of_Perigee"] = 2.518211e+000
|
||||
almanac[42]["Mean_Anom"] = -2.530167e+000
|
||||
almanac[42]["week"] = 1390
|
||||
almanac[42]["Commit_date"] = "21.01.2003"
|
||||
almanac[42]["Life_dates"] = {}
|
||||
|
||||
almanac[43] = {}
|
||||
almanac[43]["System"] = SAT_SYS_GLONASS
|
||||
almanac[43]["Number"] = 23
|
||||
almanac[43]["Orbital"] = 3
|
||||
almanac[43]["GLONASS_Data"] = {}
|
||||
almanac[43]["GLONASS_Data"]["NKU_Number"] = 714
|
||||
almanac[43]["GLONASS_Data"]["Cosmos_Number"] = 2419
|
||||
almanac[43]["Eccentricity"] = 8.730000e-004
|
||||
almanac[43]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[43]["Orbital_Inclination"] = 1.132105e+000
|
||||
almanac[43]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[43]["SQRT_A"] = 5.050500e+003
|
||||
almanac[43]["Right_Ascen_at_Week"] = 3.883808e+000
|
||||
almanac[43]["Argument_of_Perigee"] = -3.039139e-001
|
||||
almanac[43]["Mean_Anom"] = -5.228304e-001
|
||||
almanac[43]["week"] = 1390
|
||||
almanac[43]["Commit_date"] = "31.08.2006"
|
||||
almanac[43]["Life_dates"] = {}
|
||||
|
||||
almanac[44] = {}
|
||||
almanac[44]["System"] = SAT_SYS_GLONASS
|
||||
almanac[44]["Number"] = 24
|
||||
almanac[44]["Orbital"] = 3
|
||||
almanac[44]["GLONASS_Data"] = {}
|
||||
almanac[44]["GLONASS_Data"]["NKU_Number"] = 713
|
||||
almanac[44]["GLONASS_Data"]["Cosmos_Number"] = 2418
|
||||
almanac[44]["Eccentricity"] = 2.044000e-003
|
||||
almanac[44]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[44]["Orbital_Inclination"] = 1.132430e+000
|
||||
almanac[44]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[44]["SQRT_A"] = 5.050500e+003
|
||||
almanac[44]["Right_Ascen_at_Week"] = 3.883983e+000
|
||||
almanac[44]["Argument_of_Perigee"] = -3.722784e-001
|
||||
almanac[44]["Mean_Anom"] = -1.240457e+000
|
||||
almanac[44]["week"] = 1390
|
||||
almanac[44]["Commit_date"] = "31.08.2006"
|
||||
almanac[44]["Life_dates"] = {}
|
||||
|
||||
--2 îðáèòàëüíàÿ ïëîñêîñòü, íîìåðà 9-16
|
||||
almanac[45] = {}
|
||||
almanac[45]["System"] = SAT_SYS_GLONASS
|
||||
almanac[45]["Number"] = 9
|
||||
almanac[45]["Orbital"] = 2
|
||||
almanac[45]["GLONASS_Data"] = {}
|
||||
almanac[45]["GLONASS_Data"]["NKU_Number"] = "N/A"
|
||||
almanac[45]["GLONASS_Data"]["Cosmos_Number"] = "N/A"
|
||||
almanac[45]["Eccentricity"] = 1.184000e-003
|
||||
almanac[45]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[45]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[45]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[45]["SQRT_A"] = 5.050500e+003
|
||||
almanac[45]["Right_Ascen_at_Week"] = 1.79067e+000
|
||||
almanac[45]["Argument_of_Perigee"] = 2.88430067
|
||||
almanac[45]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[45]["week"] = 1390
|
||||
almanac[45]["Commit_date"] = "N/A"
|
||||
almanac[45]["Life_dates"] = {}
|
||||
|
||||
almanac[46] = {}
|
||||
almanac[46]["System"] = SAT_SYS_GLONASS
|
||||
almanac[46]["Number"] = 10
|
||||
almanac[46]["Orbital"] = 2
|
||||
almanac[46]["GLONASS_Data"] = {}
|
||||
almanac[46]["GLONASS_Data"]["NKU_Number"] = "N/A"
|
||||
almanac[46]["GLONASS_Data"]["Cosmos_Number"] = "N/A"
|
||||
almanac[46]["Eccentricity"] = 1.184000e-003
|
||||
almanac[46]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[46]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[46]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[46]["SQRT_A"] = 5.050500e+003
|
||||
almanac[46]["Right_Ascen_at_Week"] = 1.79067e+000
|
||||
almanac[46]["Argument_of_Perigee"] = 3.66930067
|
||||
almanac[46]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[46]["week"] = 1390
|
||||
almanac[46]["Commit_date"] = "N/A"
|
||||
almanac[46]["Life_dates"] = {}
|
||||
|
||||
almanac[47] = {}
|
||||
almanac[47]["System"] = SAT_SYS_GLONASS
|
||||
almanac[47]["Number"] = 11
|
||||
almanac[47]["Orbital"] = 2
|
||||
almanac[47]["GLONASS_Data"] = {}
|
||||
almanac[47]["GLONASS_Data"]["NKU_Number"] = "N/A"
|
||||
almanac[47]["GLONASS_Data"]["Cosmos_Number"] = "N/A"
|
||||
almanac[47]["Eccentricity"] = 1.184000e-003
|
||||
almanac[47]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[47]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[47]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[47]["SQRT_A"] = 5.050500e+003
|
||||
almanac[47]["Right_Ascen_at_Week"] = 1.79067e+000
|
||||
almanac[47]["Argument_of_Perigee"] = 4.45430067
|
||||
almanac[47]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[47]["week"] = 1390
|
||||
almanac[47]["Commit_date"] = "N/A"
|
||||
almanac[47]["Life_dates"] = {}
|
||||
|
||||
almanac[48] = {}
|
||||
almanac[48]["System"] = SAT_SYS_GLONASS
|
||||
almanac[48]["Number"] = 12
|
||||
almanac[48]["Orbital"] = 2
|
||||
almanac[48]["GLONASS_Data"] = {}
|
||||
almanac[48]["GLONASS_Data"]["NKU_Number"] = "N/A"
|
||||
almanac[48]["GLONASS_Data"]["Cosmos_Number"] = "N/A"
|
||||
almanac[48]["Eccentricity"] = 1.184000e-003
|
||||
almanac[48]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[48]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[48]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[48]["SQRT_A"] = 5.050500e+003
|
||||
almanac[48]["Right_Ascen_at_Week"] = 1.79067e+000
|
||||
almanac[48]["Argument_of_Perigee"] = 5.23930067
|
||||
almanac[48]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[48]["week"] = 1390
|
||||
almanac[48]["Commit_date"] = "N/A"
|
||||
almanac[48]["Life_dates"] = {}
|
||||
|
||||
almanac[49] = {}
|
||||
almanac[49]["System"] = SAT_SYS_GLONASS
|
||||
almanac[49]["Number"] = 13
|
||||
almanac[49]["Orbital"] = 2
|
||||
almanac[49]["GLONASS_Data"] = {}
|
||||
almanac[49]["GLONASS_Data"]["NKU_Number"] = "N/A"
|
||||
almanac[49]["GLONASS_Data"]["Cosmos_Number"] = "N/A"
|
||||
almanac[49]["Eccentricity"] = 1.184000e-003
|
||||
almanac[49]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[49]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[49]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[49]["SQRT_A"] = 5.050500e+003
|
||||
almanac[49]["Right_Ascen_at_Week"] = 1.79067e+000
|
||||
almanac[49]["Argument_of_Perigee"] = 6.02430067
|
||||
almanac[49]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[49]["week"] = 1390
|
||||
almanac[49]["Commit_date"] = "N/A"
|
||||
almanac[49]["Life_dates"] = {}
|
||||
|
||||
almanac[50] = {}
|
||||
almanac[50]["System"] = SAT_SYS_GLONASS
|
||||
almanac[50]["Number"] = 14
|
||||
almanac[50]["Orbital"] = 2
|
||||
almanac[50]["GLONASS_Data"] = {}
|
||||
almanac[50]["GLONASS_Data"]["NKU_Number"] = "N/A"
|
||||
almanac[50]["GLONASS_Data"]["Cosmos_Number"] = "N/A"
|
||||
almanac[50]["Eccentricity"] = 1.184000e-003
|
||||
almanac[50]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[50]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[50]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[50]["SQRT_A"] = 5.050500e+003
|
||||
almanac[50]["Right_Ascen_at_Week"] = 1.79067e+000
|
||||
almanac[50]["Argument_of_Perigee"] = 0.52930067
|
||||
almanac[50]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[50]["week"] = 1390
|
||||
almanac[50]["Commit_date"] = "N/A"
|
||||
almanac[50]["Life_dates"] = {}
|
||||
|
||||
almanac[51] = {}
|
||||
almanac[51]["System"] = SAT_SYS_GLONASS
|
||||
almanac[51]["Number"] = 15
|
||||
almanac[51]["Orbital"] = 2
|
||||
almanac[51]["GLONASS_Data"] = {}
|
||||
almanac[51]["GLONASS_Data"]["NKU_Number"] = "N/A"
|
||||
almanac[51]["GLONASS_Data"]["Cosmos_Number"] = "N/A"
|
||||
almanac[51]["Eccentricity"] = 1.184000e-003
|
||||
almanac[51]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[51]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[51]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[51]["SQRT_A"] = 5.050500e+003
|
||||
almanac[51]["Right_Ascen_at_Week"] = 1.79067e+000
|
||||
almanac[51]["Argument_of_Perigee"] = 1.31430067
|
||||
almanac[51]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[51]["week"] = 1390
|
||||
almanac[51]["Commit_date"] = "N/A"
|
||||
almanac[51]["Life_dates"] = {}
|
||||
|
||||
almanac[52] = {}
|
||||
almanac[52]["System"] = SAT_SYS_GLONASS
|
||||
almanac[52]["Number"] = 16
|
||||
almanac[52]["Orbital"] = 2
|
||||
almanac[52]["GLONASS_Data"] = {}
|
||||
almanac[52]["GLONASS_Data"]["NKU_Number"] = "N/A"
|
||||
almanac[52]["GLONASS_Data"]["Cosmos_Number"] = "N/A"
|
||||
almanac[52]["Eccentricity"] = 1.184000e-003
|
||||
almanac[52]["Time_of_Applicability"] = 0.000000e+000
|
||||
almanac[52]["Orbital_Inclination"] = 1.126443e+000
|
||||
almanac[52]["Rate_of_Right_Ascen"] = 0.000000e+000
|
||||
almanac[52]["SQRT_A"] = 5.050500e+003
|
||||
almanac[52]["Right_Ascen_at_Week"] = 1.79067e+000
|
||||
almanac[52]["Argument_of_Perigee"] = 2.09930067
|
||||
almanac[52]["Mean_Anom"] = -5.519651e+000
|
||||
almanac[52]["week"] = 1390
|
||||
almanac[52]["Commit_date"] = "N/A"
|
||||
almanac[52]["Life_dates"] = {}
|
||||
|
||||
SA_mode = false
|
||||
AS_mode = false
|
||||
@ -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
@ -0,0 +1,229 @@
|
||||
options =
|
||||
{
|
||||
["playerName"] = "Killer",
|
||||
["miscellaneous"] =
|
||||
{
|
||||
["headmove"] = true,
|
||||
["TrackIR_external_views"] = true,
|
||||
["f5_nearest_ac"] = true,
|
||||
["f11_free_camera"] = true,
|
||||
["F2_view_effects"] = 2,
|
||||
["f10_awacs"] = true,
|
||||
["Coordinate_Display"] = "Lat Long",
|
||||
["accidental_failures"] = false,
|
||||
["force_feedback_enabled"] = true,
|
||||
["synchronize_controls"] = false,
|
||||
["show_pilot_body"] = true,
|
||||
}, -- end of ["miscellaneous"]
|
||||
["difficulty"] =
|
||||
{
|
||||
["padlock"] = true,
|
||||
["labels"] = false,
|
||||
["easyCommunication"] = true,
|
||||
["easyRadar"] = false,
|
||||
["fuel"] = false,
|
||||
["miniHUD"] = false,
|
||||
["tips"] = true,
|
||||
["birds"] = 0,
|
||||
["optionsView"] = "optview_all",
|
||||
["permitCrash"] = true,
|
||||
["immortal"] = false,
|
||||
["cockpitStatusBarAllowed"] = false,
|
||||
["cockpitVisualRM"] = true,
|
||||
["easyFlight"] = false,
|
||||
["reports"] = true,
|
||||
["hideStick"] = false,
|
||||
["radio"] = true,
|
||||
["externalViews"] = true,
|
||||
["units"] = "metric",
|
||||
["userMarks"] = true,
|
||||
["cockpitLanguage"] = "english",
|
||||
["spectatorExternalViews"] = true,
|
||||
["userSnapView"] = true,
|
||||
["avionicsLanguage"] = "native",
|
||||
["impostors"] = "medium",
|
||||
["iconsTheme"] = "nato",
|
||||
["map"] = true,
|
||||
["weapons"] = false,
|
||||
["setGlobal"] = true,
|
||||
["geffect"] = "realistic",
|
||||
}, -- end of ["difficulty"]
|
||||
["VR"] =
|
||||
{
|
||||
["use_mouse"] = false,
|
||||
["enable"] = true,
|
||||
["box_mouse_cursor"] = true,
|
||||
["pixel_density"] = 1,
|
||||
}, -- end of ["VR"]
|
||||
["graphics"] =
|
||||
{
|
||||
["OculusRift"] = false,
|
||||
["color"] = "32",
|
||||
["LensEffects"] = 3,
|
||||
["heatBlr"] = 2,
|
||||
["scenes"] = "high",
|
||||
["water"] = 2,
|
||||
["visibRange"] = "High",
|
||||
["treesVisibility"] = 25000,
|
||||
["aspect"] = 1.25,
|
||||
["lights"] = 2,
|
||||
["HDR"] = 1,
|
||||
["MSAA"] = 2,
|
||||
["civTraffic"] = "high",
|
||||
["clutterMaxDistance"] = 1500,
|
||||
["terrainTextures"] = "max",
|
||||
["multiMonitorSetup"] = "1camera",
|
||||
["shadowTree"] = true,
|
||||
["fullScreen"] = false,
|
||||
["disableAero"] = false,
|
||||
["DOF"] = 0,
|
||||
["clouds"] = 1,
|
||||
["flatTerrainShadows"] = 1,
|
||||
["cockpitShadows"] = true,
|
||||
["height"] = 1024,
|
||||
["width"] = 1280,
|
||||
["shadows"] = 4,
|
||||
["TranspSSAA"] = false,
|
||||
["sync"] = true,
|
||||
["preloadRadius"] = 73885,
|
||||
["anisotropy"] = 2,
|
||||
["haze"] = 1,
|
||||
["textures"] = 2,
|
||||
["effects"] = 3,
|
||||
}, -- end of ["graphics"]
|
||||
["plugins"] =
|
||||
{
|
||||
["CA"] =
|
||||
{
|
||||
["kompass_options"] = 1,
|
||||
["ground_target_info"] = true,
|
||||
["ground_aim_helper"] = true,
|
||||
["ground_platform_shake"] = true,
|
||||
["ground_automatic"] = true,
|
||||
}, -- end of ["CA"]
|
||||
["M-2000C"] =
|
||||
{
|
||||
["UNI_NODRIFT"] = false,
|
||||
["TDC_"] = false,
|
||||
["CPLocalList"] = "default",
|
||||
["PPA_TOTPAR"] = false,
|
||||
["UNI_ALIGNED"] = false,
|
||||
}, -- end of ["M-2000C"]
|
||||
["A-10C"] =
|
||||
{
|
||||
["CPLocalList"] = "default",
|
||||
}, -- end of ["A-10C"]
|
||||
["FC3"] =
|
||||
{
|
||||
["CPLocalList_F-15C"] = "default",
|
||||
["CPLocalList_MiG-29S"] = "default",
|
||||
["CPLocalList_MiG-29A"] = "default",
|
||||
["CPLocalList_Su-25"] = "default",
|
||||
["CPLocalList_A-10A"] = "default",
|
||||
["CPLocalList_Su-27"] = "chinese",
|
||||
["CPLocalList_MiG-29G"] = "default",
|
||||
["CPLocalList_Su-33"] = "default",
|
||||
}, -- end of ["FC3"]
|
||||
["Hawk"] =
|
||||
{
|
||||
["CPLocalList"] = "high",
|
||||
}, -- end of ["Hawk"]
|
||||
["P-51D"] =
|
||||
{
|
||||
["assistance"] = 100,
|
||||
["CPLocalList"] = "default",
|
||||
["autoRudder"] = false,
|
||||
}, -- end of ["P-51D"]
|
||||
["TF-51D"] =
|
||||
{
|
||||
["assistance"] = 100,
|
||||
["CPLocalList"] = "default",
|
||||
["autoRudder"] = false,
|
||||
}, -- end of ["TF-51D"]
|
||||
["MiG-21Bis"] =
|
||||
{
|
||||
["Engine"] = false,
|
||||
["Shake"] = 100,
|
||||
["CustomCockpit"] = false,
|
||||
["Reticle"] = false,
|
||||
["Freeze"] = false,
|
||||
}, -- end of ["MiG-21Bis"]
|
||||
["F-86F"] =
|
||||
{
|
||||
["landSeatAdjustF86"] = true,
|
||||
["aiHelper"] = false,
|
||||
["CPLocalList"] = "default",
|
||||
["NoseWheelSteeringSimpleBehaviourF86"] = true,
|
||||
["gunCamera"] = 0,
|
||||
}, -- end of ["F-86F"]
|
||||
["Su-25T"] =
|
||||
{
|
||||
["CPLocalList"] = "default",
|
||||
}, -- end of ["Su-25T"]
|
||||
["Mi-8MTV2"] =
|
||||
{
|
||||
["Mi8TrimmingMethod"] = 0,
|
||||
["Mi8AutopilotAdjustment"] = false,
|
||||
["gunCamera"] = 0,
|
||||
["controlHelperMi8"] = false,
|
||||
["weapTooltipsMi8"] = true,
|
||||
["Mi8RudderTrimmer"] = false,
|
||||
["CPLocalList"] = "default",
|
||||
["altMi8TrimmingMethod"] = false,
|
||||
["Mi8FOV"] = 120,
|
||||
}, -- end of ["Mi-8MTV2"]
|
||||
["MiG-15bis"] =
|
||||
{
|
||||
["autoLeanToAimMiG15"] = true,
|
||||
["CPLocalList"] = "chinese",
|
||||
["gunCamera"] = 0,
|
||||
["aiHelper"] = false,
|
||||
}, -- end of ["MiG-15bis"]
|
||||
["FW-190D9"] =
|
||||
{
|
||||
["assistance"] = 100,
|
||||
["CPLocalList"] = "default",
|
||||
["autoRudder"] = false,
|
||||
}, -- end of ["FW-190D9"]
|
||||
["UH-1H"] =
|
||||
{
|
||||
["UHTrackIRAiming"] = true,
|
||||
["autoPilot"] = true,
|
||||
["UHTrimmingMethod"] = 0,
|
||||
["altUHTrimmingMethod"] = false,
|
||||
["CPLocalList"] = "default",
|
||||
["weapTooltips"] = true,
|
||||
["UHRudderTrimmer"] = false,
|
||||
}, -- end of ["UH-1H"]
|
||||
["Ka-50"] =
|
||||
{
|
||||
["altTrimmingMethod"] = false,
|
||||
["Ka50RudderTrimmer"] = false,
|
||||
["CPLocalList"] = "english",
|
||||
}, -- end of ["Ka-50"]
|
||||
}, -- end of ["plugins"]
|
||||
["format"] = 1,
|
||||
["sound"] =
|
||||
{
|
||||
["hear_in_helmet"] = false,
|
||||
["headphones"] = 100,
|
||||
["cockpit"] = 100,
|
||||
["GBreathEffect"] = true,
|
||||
["gui"] = 100,
|
||||
["volume"] = 100,
|
||||
["radioSpeech"] = true,
|
||||
["music"] = 100,
|
||||
["subtitles"] = true,
|
||||
["world"] = 100,
|
||||
}, -- end of ["sound"]
|
||||
["views"] =
|
||||
{
|
||||
["cockpit"] =
|
||||
{
|
||||
["mirrors"] = false,
|
||||
["reflections"] = false,
|
||||
["avionics"] = 3,
|
||||
["russianHud"] = false,
|
||||
}, -- end of ["cockpit"]
|
||||
}, -- end of ["views"]
|
||||
} -- end of options
|
||||
@ -0,0 +1,807 @@
|
||||
warehouses =
|
||||
{
|
||||
["airports"] =
|
||||
{
|
||||
[12] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "RED",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [12]
|
||||
[13] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "BLUE",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [13]
|
||||
[14] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "RED",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [14]
|
||||
[15] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "RED",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [15]
|
||||
[16] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "BLUE",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [16]
|
||||
[17] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [17]
|
||||
[18] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [18]
|
||||
[19] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [19]
|
||||
[20] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [20]
|
||||
[21] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [21]
|
||||
[22] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [22]
|
||||
[23] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [23]
|
||||
[24] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [24]
|
||||
[25] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [25]
|
||||
[26] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [26]
|
||||
[27] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [27]
|
||||
[28] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [28]
|
||||
[29] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [29]
|
||||
[30] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [30]
|
||||
[31] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [31]
|
||||
[32] =
|
||||
{
|
||||
["gasoline"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["gasoline"]
|
||||
["unlimitedMunitions"] = true,
|
||||
["methanol_mixture"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["methanol_mixture"]
|
||||
["OperatingLevel_Air"] = 10,
|
||||
["diesel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["diesel"]
|
||||
["speed"] = 16.666666,
|
||||
["size"] = 100,
|
||||
["periodicity"] = 30,
|
||||
["suppliers"] =
|
||||
{
|
||||
}, -- end of ["suppliers"]
|
||||
["coalition"] = "NEUTRAL",
|
||||
["jet_fuel"] =
|
||||
{
|
||||
["InitFuel"] = 100,
|
||||
}, -- end of ["jet_fuel"]
|
||||
["OperatingLevel_Eqp"] = 10,
|
||||
["unlimitedFuel"] = true,
|
||||
["aircrafts"] =
|
||||
{
|
||||
}, -- end of ["aircrafts"]
|
||||
["weapons"] =
|
||||
{
|
||||
}, -- end of ["weapons"]
|
||||
["OperatingLevel_Fuel"] = 10,
|
||||
["unlimitedAircrafts"] = true,
|
||||
}, -- end of [32]
|
||||
}, -- end of ["airports"]
|
||||
["warehouses"] =
|
||||
{
|
||||
}, -- end of ["warehouses"]
|
||||
} -- end of warehouses
|
||||
@ -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.
@ -0,0 +1,59 @@
|
||||
-- Name: CAS in a ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 January 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- # 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" )
|
||||
|
||||
-- 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")
|
||||
|
||||
|
||||
-- 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, CheckScheduleID = SCHEDULER:New(nil,
|
||||
function()
|
||||
BASE:E( { "In Scheduler: ", Targets:GetSize() } )
|
||||
if Targets:IsAlive() and Targets:GetSize() > 5 then
|
||||
BASE:E("Still alive")
|
||||
else
|
||||
BASE:E("Destroyed")
|
||||
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.
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.
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