mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'refs/remotes/origin/master' into Bugfix
This commit is contained in:
commit
7b8ef52ae0
@ -13,8 +13,30 @@
|
||||
--
|
||||
-- * @{#AIBALANCER.New}: Creates a new AIBALANCER object.
|
||||
--
|
||||
-- 1.2) AIBALANCER returns AI to Airbases:
|
||||
-- ---------------------------------------
|
||||
-- You can configure to have the AI to return to:
|
||||
--
|
||||
-- * @{#AIBALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Airbase#AIRBASE}.
|
||||
-- * @{#AIBALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
||||
--
|
||||
-- 1.3) AIBALANCER allows AI to patrol specific zones:
|
||||
-- ---------------------------------------------------
|
||||
-- Use @{AIBalancer#AIBALANCER.SetPatrolZone}() to specify a zone where the AI needs to patrol.
|
||||
--
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- CREDITS
|
||||
-- =======
|
||||
-- **Dutch_Baron (James)** Who you can search on the Eagle Dynamics Forums.
|
||||
-- Working together with James has resulted in the creation of the AIBALANCER 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 AIBALANCER moose class.
|
||||
--
|
||||
-- @module AIBalancer
|
||||
-- @author FlightControl
|
||||
|
||||
@ -22,9 +44,16 @@
|
||||
-- @type AIBALANCER
|
||||
-- @field Set#SET_CLIENT SetClient
|
||||
-- @field Spawn#SPAWN SpawnAI
|
||||
-- @field #boolean ToNearestAirbase
|
||||
-- @field Set#SET_AIRBASE ReturnAirbaseSet
|
||||
-- @field DCSTypes#Distance ReturnTresholdRange
|
||||
-- @field #boolean ToHomeAirbase
|
||||
-- @field PatrolZone#PATROLZONE PatrolZone
|
||||
-- @extends Base#BASE
|
||||
AIBALANCER = {
|
||||
ClassName = "AIBALANCER",
|
||||
PatrolZones = {},
|
||||
AIGroups = {},
|
||||
}
|
||||
|
||||
--- Creates a new AIBALANCER object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.
|
||||
@ -38,13 +67,64 @@ function AIBALANCER:New( SetClient, SpawnAI )
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.SetClient = SetClient
|
||||
self.SpawnAI = SpawnAI
|
||||
if type( SpawnAI ) == "table" then
|
||||
if SpawnAI.ClassName and SpawnAI.ClassName == "SPAWN" then
|
||||
self.SpawnAI = { SpawnAI }
|
||||
else
|
||||
local SpawnObjects = true
|
||||
for SpawnObjectID, SpawnObject in pairs( SpawnAI ) do
|
||||
if SpawnObject.ClassName and SpawnObject.ClassName == "SPAWN" then
|
||||
self:E( SpawnObject.ClassName )
|
||||
else
|
||||
self:E( "other object" )
|
||||
SpawnObjects = false
|
||||
end
|
||||
end
|
||||
if SpawnObjects == true then
|
||||
self.SpawnAI = SpawnAI
|
||||
else
|
||||
error( "No SPAWN object given in parameter SpawnAI, either as a single object or as a table of objects!" )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.ToNearestAirbase = false
|
||||
self.ReturnHomeAirbase = false
|
||||
|
||||
self.AIMonitorSchedule = SCHEDULER:New( self, self._ClientAliveMonitorScheduler, {}, 1, 10, 0 )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Returns the AI to the nearest friendly @{Airbase#AIRBASE}.
|
||||
-- @param #AIBALANCER self
|
||||
-- @param DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Airbase#AIRBASE}.
|
||||
-- @param Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Set#SET_AIRBASE}s to evaluate where to return to.
|
||||
function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseSet )
|
||||
|
||||
self.ToNearestAirbase = true
|
||||
self.ReturnTresholdRange = ReturnTresholdRange
|
||||
self.ReturnAirbaseSet = ReturnAirbaseSet
|
||||
end
|
||||
|
||||
--- Returns the AI to the home @{Airbase#AIRBASE}.
|
||||
-- @param #AIBALANCER self
|
||||
-- @param DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Airbase#AIRBASE}.
|
||||
function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
||||
|
||||
self.ToHomeAirbase = true
|
||||
self.ReturnTresholdRange = ReturnTresholdRange
|
||||
end
|
||||
|
||||
--- Let the AI patrol a @{Zone} with a given Speed range and Altitude range.
|
||||
-- @param #AIBALANCER self
|
||||
-- @param PatrolZone#PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol.
|
||||
-- @return PatrolZone#PATROLZONE self
|
||||
function AIBALANCER:SetPatrolZone( PatrolZone )
|
||||
|
||||
self.PatrolZone = PatrolZone
|
||||
end
|
||||
|
||||
--- @param #AIBALANCER self
|
||||
function AIBALANCER:_ClientAliveMonitorScheduler()
|
||||
|
||||
@ -56,13 +136,100 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
||||
if Client:IsAlive() then
|
||||
if ClientAIAliveState == true then
|
||||
Client:SetState( self, 'AIAlive', false )
|
||||
local AIGroup = Client:GetState( self, 'AIGroup' ) -- Group#GROUP
|
||||
AIGroup:Destroy()
|
||||
|
||||
local AIGroup = self.AIGroups[Client.UnitName] -- Group#GROUP
|
||||
|
||||
-- local PatrolZone = Client:GetState( self, "PatrolZone" )
|
||||
-- if PatrolZone then
|
||||
-- PatrolZone = nil
|
||||
-- Client:ClearState( self, "PatrolZone" )
|
||||
-- end
|
||||
|
||||
if self.ToNearestAirbase == false and self.ToHomeAirbase == false then
|
||||
AIGroup:Destroy()
|
||||
else
|
||||
-- We test if there is no other CLIENT within the self.ReturnTresholdRange of the first unit of the AI group.
|
||||
-- If there is a CLIENT, the AI stays engaged and will not return.
|
||||
-- If there is no CLIENT within the self.ReturnTresholdRange, then the unit will return to the Airbase return method selected.
|
||||
|
||||
local PlayerInRange = { Value = false }
|
||||
local RangeZone = ZONE_RADIUS:New( 'RangeZone', AIGroup:GetPointVec2(), self.ReturnTresholdRange )
|
||||
|
||||
self:E( RangeZone )
|
||||
|
||||
_DATABASE:ForEachPlayer(
|
||||
--- @param Unit#UNIT RangeTestUnit
|
||||
function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange )
|
||||
self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } )
|
||||
if RangeTestUnit:IsInZone( RangeZone ) == true then
|
||||
self:E( "in zone" )
|
||||
if RangeTestUnit:GetCoalition() ~= AIGroup:GetCoalition() then
|
||||
self:E( "in range" )
|
||||
PlayerInRange.Value = true
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
--- @param Zone#ZONE_RADIUS RangeZone
|
||||
-- @param Group#GROUP AIGroup
|
||||
function( RangeZone, AIGroup, PlayerInRange )
|
||||
local AIGroupTemplate = AIGroup:GetTemplate()
|
||||
if PlayerInRange.Value == false then
|
||||
if self.ToHomeAirbase == true then
|
||||
local WayPointCount = #AIGroupTemplate.route.points
|
||||
local SwitchWayPointCommand = AIGroup:CommandSwitchWayPoint( 1, WayPointCount, 1 )
|
||||
AIGroup:SetCommand( SwitchWayPointCommand )
|
||||
AIGroup:MessageToRed( "Returning to home base ...", 30 )
|
||||
else
|
||||
-- Okay, we need to send this Group back to the nearest base of the Coalition of the AI.
|
||||
--TODO: i need to rework the POINT_VEC2 thing.
|
||||
local PointVec2 = POINT_VEC2:New( AIGroup:GetPointVec2().x, AIGroup:GetPointVec2().y )
|
||||
local ClosestAirbase = self.ReturnAirbaseSet:FindNearestAirbaseFromPointVec2( PointVec2 )
|
||||
self:T( ClosestAirbase.AirbaseName )
|
||||
AIGroup:MessageToRed( "Returning to " .. ClosestAirbase:GetName().. " ...", 30 )
|
||||
local RTBRoute = AIGroup:RouteReturnToAirbase( ClosestAirbase )
|
||||
AIGroupTemplate.route = RTBRoute
|
||||
AIGroup:Respawn( AIGroupTemplate )
|
||||
end
|
||||
end
|
||||
end
|
||||
, RangeZone, AIGroup, PlayerInRange
|
||||
)
|
||||
|
||||
end
|
||||
end
|
||||
else
|
||||
if not ClientAIAliveState or ClientAIAliveState == false then
|
||||
Client:SetState( self, 'AIAlive', true )
|
||||
Client:SetState( self, 'AIGroup', self.SpawnAI:Spawn() )
|
||||
|
||||
|
||||
-- OK, spawn a new group from the SpawnAI objects provided.
|
||||
local SpawnAICount = #self.SpawnAI
|
||||
local SpawnAIIndex = math.random( 1, SpawnAICount )
|
||||
local AIGroup = self.SpawnAI[SpawnAIIndex]:Spawn()
|
||||
AIGroup:E( "spawning new AIGroup" )
|
||||
--TODO: need to rework UnitName thing ...
|
||||
self.AIGroups[Client.UnitName] = AIGroup
|
||||
|
||||
--- Now test if the AIGroup needs to patrol a zone, otherwise let it follow its route...
|
||||
if self.PatrolZone then
|
||||
self.PatrolZones[#self.PatrolZones+1] = PATROLZONE:New(
|
||||
self.PatrolZone.PatrolZone,
|
||||
self.PatrolZone.PatrolFloorAltitude,
|
||||
self.PatrolZone.PatrolCeilingAltitude,
|
||||
self.PatrolZone.PatrolMinSpeed,
|
||||
self.PatrolZone.PatrolMaxSpeed
|
||||
)
|
||||
|
||||
if self.PatrolZone.PatrolManageFuel == true then
|
||||
self.PatrolZones[#self.PatrolZones]:ManageFuel( self.PatrolZone.PatrolFuelTresholdPercentage, self.PatrolZone.PatrolOutOfFuelOrbitTime )
|
||||
end
|
||||
self.PatrolZones[#self.PatrolZones]:SetGroup( AIGroup )
|
||||
|
||||
--self.PatrolZones[#self.PatrolZones+1] = PatrolZone
|
||||
|
||||
--Client:SetState( self, "PatrolZone", PatrolZone )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,15 +1,17 @@
|
||||
--- AIRBASE Class
|
||||
--- This module contains the AIRBASE classes.
|
||||
--
|
||||
-- @{AIRBASE} class
|
||||
-- ==============
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Airbase#AIRBASE} class, extends @{Base#BASE}
|
||||
-- =================================================
|
||||
-- The @{AIRBASE} class is a wrapper class to handle the DCS Airbase objects:
|
||||
--
|
||||
-- * Support all DCS Airbase APIs.
|
||||
-- * Enhance with Airbase specific APIs not in the DCS Airbase API set.
|
||||
--
|
||||
--
|
||||
-- AIRBASE reference methods
|
||||
-- ======================
|
||||
-- 1.1) AIRBASE reference methods
|
||||
-- ------------------------------
|
||||
-- For each DCS Airbase object alive within a running mission, a AIRBASE wrapper object (instance) will be created within the _@{DATABASE} object.
|
||||
-- This is done at the beginning of the mission (when the mission starts).
|
||||
--
|
||||
@ -27,8 +29,8 @@
|
||||
--
|
||||
-- IMPORTANT: ONE SHOULD NEVER SANATIZE these AIRBASE OBJECT REFERENCES! (make the AIRBASE object references nil).
|
||||
--
|
||||
-- DCS AIRBASE APIs
|
||||
-- =============
|
||||
-- 1.2) DCS AIRBASE APIs
|
||||
-- ---------------------
|
||||
-- The DCS Airbase APIs are used extensively within MOOSE. The AIRBASE class has for each DCS Airbase API a corresponding method.
|
||||
-- To be able to distinguish easily in your code the difference between a AIRBASE API call and a DCS Airbase API call,
|
||||
-- the first letter of the method is also capitalized. So, by example, the DCS Airbase method @{DCSAirbase#Airbase.getName}()
|
||||
@ -274,6 +276,21 @@ function AIRBASE:GetPointVec2()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the DCS Airbase category as defined within the DCS Airbase Descriptor.
|
||||
-- @param Airbase#AIRBASE self
|
||||
-- @return DCSAirbase#Airbase.Category The DCS Airbase Category
|
||||
function AIRBASE:GetCategory()
|
||||
local DCSAirbase = self:GetDCSAirbase()
|
||||
|
||||
if DCSAirbase then
|
||||
local AirbaseCategory = self:GetDesc().category
|
||||
return AirbaseCategory
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Returns the DCS Airbase category name as defined within the DCS Airbase Descriptor.
|
||||
-- @param Airbase#AIRBASE self
|
||||
-- @return #string The DCS Airbase Category Name
|
||||
@ -288,3 +305,4 @@ function AIRBASE:GetCategoryName()
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -236,7 +236,6 @@ end
|
||||
|
||||
--- @param #CLIENT self
|
||||
function CLIENT:_AliveCheckScheduler( SchedulerName )
|
||||
self:E( SchedulerName )
|
||||
self:F( { SchedulerName, self.ClientName, self.ClientAlive2, self.ClientBriefingShown, self.ClientCallBack } )
|
||||
|
||||
if self:IsAlive() then
|
||||
|
||||
@ -1,48 +1,41 @@
|
||||
--- Manage the mission database.
|
||||
--- This module contains the DATABASE class, managing the database of mission objects.
|
||||
--
|
||||
-- @{#DATABASE} class
|
||||
-- ==================
|
||||
-- ====
|
||||
--
|
||||
-- 1) @{Database#DATABASE} class, extends @{Base#BASE}
|
||||
-- ===================================================
|
||||
-- Mission designers can use the DATABASE class to refer to:
|
||||
--
|
||||
-- * UNITS
|
||||
-- * GROUPS
|
||||
-- * players
|
||||
-- * alive players
|
||||
-- * CLIENTS
|
||||
-- * alive CLIENTS
|
||||
-- * AIRPORTS
|
||||
-- * PLAYERSJOINED
|
||||
-- * PLAYERS
|
||||
--
|
||||
-- On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Gruop templates as defined within the Mission Editor.
|
||||
-- On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Group TEMPLATES as defined within the Mission Editor.
|
||||
--
|
||||
-- Moose will automatically create one instance of the DATABASE class into the **global** object _DATABASE.
|
||||
-- Moose refers to _DATABASE within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.
|
||||
--
|
||||
-- DATABASE iterators:
|
||||
-- ===================
|
||||
-- 1.1) DATABASE iterators
|
||||
-- -----------------------
|
||||
-- You can iterate the database with the available iterator methods.
|
||||
-- The iterator methods will walk the DATABASE set, and call for each element within the set a function that you provide.
|
||||
-- The following iterator methods are currently available within the DATABASE:
|
||||
--
|
||||
-- * @{#DATABASE.ForEachUnit}: Calls a function for each @{UNIT} it finds within the DATABASE.
|
||||
-- * @{#DATABASE.ForEachGroup}: Calls a function for each @{GROUP} it finds within the DATABASE.
|
||||
-- * @{#DATABASE.ForEachPlayer}: Calls a function for each player it finds within the DATABASE.
|
||||
-- * @{#DATABASE.ForEachPlayerAlive}: Calls a function for each alive player it finds within the DATABASE.
|
||||
-- * @{#DATABASE.ForEachPlayer}: Calls a function for each alive player it finds within the DATABASE.
|
||||
-- * @{#DATABASE.ForEachPlayerJoined}: Calls a function for each joined player it finds within the DATABASE.
|
||||
-- * @{#DATABASE.ForEachClient}: Calls a function for each @{CLIENT} it finds within the DATABASE.
|
||||
-- * @{#DATABASE.ForEachClientAlive}: Calls a function for each alive @{CLIENT} it finds within the DATABASE.
|
||||
--
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module Database
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--- DATABASE class
|
||||
-- @type DATABASE
|
||||
-- @extends Base#BASE
|
||||
@ -58,9 +51,9 @@ DATABASE = {
|
||||
STATICS = {},
|
||||
GROUPS = {},
|
||||
PLAYERS = {},
|
||||
PLAYERSALIVE = {},
|
||||
PLAYERSJOINED = {},
|
||||
CLIENTS = {},
|
||||
CLIENTSALIVE = {},
|
||||
AIRBASES = {},
|
||||
NavPoints = {},
|
||||
}
|
||||
|
||||
@ -105,6 +98,7 @@ function DATABASE:New()
|
||||
self:_RegisterClients()
|
||||
self:_RegisterStatics()
|
||||
self:_RegisterPlayers()
|
||||
self:_RegisterAirbases()
|
||||
|
||||
return self
|
||||
end
|
||||
@ -166,6 +160,33 @@ function DATABASE:FindStatic( StaticName )
|
||||
return StaticFound
|
||||
end
|
||||
|
||||
--- Adds a Airbase based on the Airbase Name in the DATABASE.
|
||||
-- @param #DATABASE self
|
||||
function DATABASE:AddAirbase( DCSAirbaseName )
|
||||
|
||||
if not self.AIRBASES[DCSAirbaseName] then
|
||||
self.AIRBASES[DCSAirbaseName] = AIRBASE:Register( DCSAirbaseName )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Deletes a Airbase from the DATABASE based on the Airbase Name.
|
||||
-- @param #DATABASE self
|
||||
function DATABASE:DeleteAirbase( DCSAirbaseName )
|
||||
|
||||
--self.AIRBASES[DCSAirbaseName] = nil
|
||||
end
|
||||
|
||||
--- Finds a AIRBASE based on the AirbaseName.
|
||||
-- @param #DATABASE self
|
||||
-- @param #string AirbaseName
|
||||
-- @return Airbase#AIRBASE The found AIRBASE.
|
||||
function DATABASE:FindAirbase( AirbaseName )
|
||||
|
||||
local AirbaseFound = self.AIRBASES[AirbaseName]
|
||||
return AirbaseFound
|
||||
end
|
||||
|
||||
|
||||
--- Finds a CLIENT based on the ClientName.
|
||||
-- @param #DATABASE self
|
||||
@ -218,9 +239,8 @@ function DATABASE:AddPlayer( UnitName, PlayerName )
|
||||
|
||||
if PlayerName then
|
||||
self:E( { "Add player for unit:", UnitName, PlayerName } )
|
||||
self.PLAYERS[PlayerName] = PlayerName
|
||||
self.PLAYERSALIVE[PlayerName] = PlayerName
|
||||
self.CLIENTSALIVE[PlayerName] = self:FindClient( UnitName )
|
||||
self.PLAYERS[PlayerName] = UNIT:FindByName( UnitName )
|
||||
self.PLAYERSJOINED[PlayerName] = PlayerName
|
||||
end
|
||||
end
|
||||
|
||||
@ -230,8 +250,7 @@ function DATABASE:DeletePlayer( PlayerName )
|
||||
|
||||
if PlayerName then
|
||||
self:E( { "Clean player:", PlayerName } )
|
||||
self.PLAYERSALIVE[PlayerName] = nil
|
||||
self.CLIENTSALIVE[PlayerName] = nil
|
||||
self.PLAYERS[PlayerName] = nil
|
||||
end
|
||||
end
|
||||
|
||||
@ -371,6 +390,18 @@ function DATABASE:GetCountryFromClientTemplate( ClientName )
|
||||
return self.Templates.ClientsByName[ClientName].CountryID
|
||||
end
|
||||
|
||||
--- Airbase
|
||||
|
||||
function DATABASE:GetCoalitionFromAirbase( AirbaseName )
|
||||
return self.AIRBASES[AirbaseName]:GetCoalition()
|
||||
end
|
||||
|
||||
function DATABASE:GetCategoryFromAirbase( AirbaseName )
|
||||
return self.AIRBASES[AirbaseName]:GetCategory()
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Private method that registers all alive players in the mission.
|
||||
-- @param #DATABASE self
|
||||
-- @return #DATABASE self
|
||||
@ -439,6 +470,7 @@ function DATABASE:_RegisterClients()
|
||||
return self
|
||||
end
|
||||
|
||||
--- @param #DATABASE self
|
||||
function DATABASE:_RegisterStatics()
|
||||
|
||||
local CoalitionsData = { GroupsRed = coalition.getStaticObjects( coalition.side.RED ), GroupsBlue = coalition.getStaticObjects( coalition.side.BLUE ) }
|
||||
@ -459,6 +491,23 @@ function DATABASE:_RegisterStatics()
|
||||
return self
|
||||
end
|
||||
|
||||
--- @param #DATABASE self
|
||||
function DATABASE:_RegisterAirbases()
|
||||
|
||||
local CoalitionsData = { AirbasesRed = coalition.getAirbases( coalition.side.RED ), AirbasesBlue = coalition.getAirbases( coalition.side.BLUE ), AirbasesNeutral = coalition.getAirbases( coalition.side.NEUTRAL ) }
|
||||
for CoalitionId, CoalitionData in pairs( CoalitionsData ) do
|
||||
for DCSAirbaseId, DCSAirbase in pairs( CoalitionData ) do
|
||||
|
||||
local DCSAirbaseName = DCSAirbase:getName()
|
||||
|
||||
self:E( { "Register Airbase:", DCSAirbaseName } )
|
||||
self:AddAirbase( DCSAirbaseName )
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Events
|
||||
|
||||
@ -497,10 +546,10 @@ end
|
||||
function DATABASE:_EventOnPlayerEnterUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
local PlayerName = Event.IniDCSUnit:getPlayerName()
|
||||
if not self.PLAYERSALIVE[PlayerName] then
|
||||
self:AddPlayer( Event.IniDCSUnitName, PlayerName )
|
||||
if Event.IniUnit then
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if not self.PLAYERS[PlayerName] then
|
||||
self:AddPlayer( Event.IniUnitName, PlayerName )
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -512,9 +561,9 @@ end
|
||||
function DATABASE:_EventOnPlayerLeaveUnit( Event )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
local PlayerName = Event.IniDCSUnit:getPlayerName()
|
||||
if self.PLAYERSALIVE[PlayerName] then
|
||||
if Event.IniUnit then
|
||||
local PlayerName = Event.IniUnit:GetPlayerName()
|
||||
if self.PLAYERS[PlayerName] then
|
||||
self:DeletePlayer( PlayerName )
|
||||
end
|
||||
end
|
||||
@ -526,7 +575,7 @@ end
|
||||
-- @param #DATABASE self
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database.
|
||||
-- @return #DATABASE self
|
||||
function DATABASE:ForEach( IteratorFunction, arg, Set )
|
||||
function DATABASE:ForEach( IteratorFunction, FinalizeFunction, arg, Set )
|
||||
self:F2( arg )
|
||||
|
||||
local function CoRoutine()
|
||||
@ -535,19 +584,21 @@ function DATABASE:ForEach( IteratorFunction, arg, Set )
|
||||
self:T2( Object )
|
||||
IteratorFunction( Object, unpack( arg ) )
|
||||
Count = Count + 1
|
||||
if Count % 10 == 0 then
|
||||
coroutine.yield( false )
|
||||
end
|
||||
-- if Count % 100 == 0 then
|
||||
-- coroutine.yield( false )
|
||||
-- end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local co = coroutine.create( CoRoutine )
|
||||
-- local co = coroutine.create( CoRoutine )
|
||||
local co = CoRoutine
|
||||
|
||||
local function Schedule()
|
||||
|
||||
local status, res = coroutine.resume( co )
|
||||
self:T2( { status, res } )
|
||||
-- local status, res = coroutine.resume( co )
|
||||
local status, res = co()
|
||||
self:T3( { status, res } )
|
||||
|
||||
if status == false then
|
||||
error( res )
|
||||
@ -555,7 +606,9 @@ function DATABASE:ForEach( IteratorFunction, arg, Set )
|
||||
if res == false then
|
||||
return true -- resume next time the loop
|
||||
end
|
||||
|
||||
if FinalizeFunction then
|
||||
FinalizeFunction( unpack( arg ) )
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
@ -569,10 +622,10 @@ end
|
||||
-- @param #DATABASE self
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the database. The function needs to accept a UNIT parameter.
|
||||
-- @return #DATABASE self
|
||||
function DATABASE:ForEachUnit( IteratorFunction, ... )
|
||||
function DATABASE:ForEachUnit( IteratorFunction, FinalizeFunction, ... )
|
||||
self:F2( arg )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.UNITS )
|
||||
self:ForEach( IteratorFunction, FinalizeFunction, arg, self.UNITS )
|
||||
|
||||
return self
|
||||
end
|
||||
@ -590,7 +643,7 @@ function DATABASE:ForEachGroup( IteratorFunction, ... )
|
||||
end
|
||||
|
||||
|
||||
--- Iterate the DATABASE and call an iterator function for each player, providing the player name and optional parameters.
|
||||
--- Iterate the DATABASE and call an iterator function for each **ALIVE** player, providing the player name and optional parameters.
|
||||
-- @param #DATABASE self
|
||||
-- @param #function IteratorFunction The function that will be called when there is an player in the database. The function needs to accept the player name.
|
||||
-- @return #DATABASE self
|
||||
@ -603,14 +656,14 @@ function DATABASE:ForEachPlayer( IteratorFunction, ... )
|
||||
end
|
||||
|
||||
|
||||
--- Iterate the DATABASE and call an iterator function for each **alive** player, providing the Unit of the player and optional parameters.
|
||||
--- Iterate the DATABASE and call an iterator function for each player who has joined the mission, providing the Unit of the player and optional parameters.
|
||||
-- @param #DATABASE self
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive player in the database. The function needs to accept a UNIT parameter.
|
||||
-- @param #function IteratorFunction The function that will be called when there is was a player in the database. The function needs to accept a UNIT parameter.
|
||||
-- @return #DATABASE self
|
||||
function DATABASE:ForEachPlayerAlive( IteratorFunction, ... )
|
||||
function DATABASE:ForEachPlayerJoined( IteratorFunction, ... )
|
||||
self:F2( arg )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.PLAYERSALIVE )
|
||||
self:ForEach( IteratorFunction, arg, self.PLAYERSJOINED )
|
||||
|
||||
return self
|
||||
end
|
||||
@ -627,18 +680,6 @@ function DATABASE:ForEachClient( IteratorFunction, ... )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the DATABASE and call an iterator function for each **ALIVE** CLIENT, providing the CLIENT to the function and optional parameters.
|
||||
-- @param #DATABASE self
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the database. The function needs to accept a CLIENT parameter.
|
||||
-- @return #DATABASE self
|
||||
function DATABASE:ForEachClientAlive( IteratorFunction, ... )
|
||||
self:F2( arg )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.CLIENTSALIVE )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
function DATABASE:_RegisterTemplates()
|
||||
self:F2()
|
||||
|
||||
162
Moose Development/Moose/Detection.lua
Normal file
162
Moose Development/Moose/Detection.lua
Normal file
@ -0,0 +1,162 @@
|
||||
--- This module contains the DETECTION classes.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Detection#DETECTION_BASE} class, extends @{Base#BASE}
|
||||
-- =====================================================
|
||||
-- The @{Detection#DETECTION_BASE} class defines the core functions to administer detected objects.
|
||||
-- Detected objects are grouped in SETS of UNITS.
|
||||
--
|
||||
-- @module Detection
|
||||
-- @author Mechanic : Concept & Testing
|
||||
-- @author FlightControl : Design & Programming
|
||||
|
||||
|
||||
|
||||
--- DETECTION_BASE class
|
||||
-- @type DETECTION_BASE
|
||||
-- @field Group#GROUP FACGroup The GROUP in the Forward Air Controller role.
|
||||
-- @field DCSTypes#Distance DetectionRange The range till which targets are accepted to be detected.
|
||||
-- @field DCSTypes#Distance DetectionZoneRange The range till which targets are grouped upon the first detected target.
|
||||
-- @field #DETECTION_BASE.DetectedUnitSets DetectedUnitSets A list of @{Set#SET_UNIT}s containing the units in each set that were detected within a DetectedZoneRange.
|
||||
-- @field #DETECTION_BASE.DetectedZones DetectedZones A list of @{Zone#ZONE_UNIT}s containing the zones of the reference detected units.
|
||||
-- @extends Set#SET_BASE
|
||||
DETECTION_BASE = {
|
||||
ClassName = "DETECTION_BASE",
|
||||
DetectedUnitSets = {},
|
||||
DetectedUnits = {},
|
||||
FACGroup = nil,
|
||||
DetectionRange = nil,
|
||||
DetectionZoneRange = nil,
|
||||
}
|
||||
|
||||
--- @type DETECTION_BASE.DetectedUnitSets
|
||||
-- @list <Set#SET_UNIT>
|
||||
|
||||
|
||||
--- @type DETECTION_BASE.DetectedZones
|
||||
-- @list <Zone#ZONE_UNIT>
|
||||
|
||||
|
||||
--- DETECTION constructor.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @return #DETECTION_BASE self
|
||||
function DETECTION_BASE:New( FACGroup, DetectionRange, DetectionZoneRange )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.FACGroup = FACGroup
|
||||
self.DetectionRange = DetectionRange
|
||||
self.DetectionZoneRange = DetectionZoneRange
|
||||
|
||||
self.DetectionScheduler = SCHEDULER:New(self, self._DetectionScheduler, { self, "Detection" }, 10, 30, 0.2 )
|
||||
end
|
||||
|
||||
--- Form @{Set}s of detected @{Unit#UNIT}s in an array of @{Set#SET_UNIT}s.
|
||||
-- @param #DETECTION_BASE self
|
||||
function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
||||
self:F2( { SchedulerName } )
|
||||
|
||||
self.DetectedUnitSets = {}
|
||||
|
||||
if self.FACGroup:IsAlive() then
|
||||
local FACGroupName = self.FACGroup:GetName()
|
||||
local FACDetectedTargets = self.FACGroup:GetDetectedTargets()
|
||||
|
||||
for FACDetectedTargetID, FACDetectedTarget in pairs( FACDetectedTargets ) do
|
||||
local FACObject = FACDetectedTarget.object
|
||||
self:T2( FACObject )
|
||||
|
||||
if FACObject and FACObject:isExist() and FACObject.id_ < 50000000 then
|
||||
|
||||
local FACDetectedUnit = UNIT:Find( FACObject )
|
||||
local FACDetectedUnitName = FACDetectedUnit:GetName()
|
||||
|
||||
local FACDetectedUnitPositionVec3 = FACDetectedUnit:GetPointVec3()
|
||||
local FACGroupPositionVec3 = self.FACGroup:GetPointVec3()
|
||||
local Distance = ( ( FACDetectedUnitPositionVec3.x - FACGroupPositionVec3.x )^2 +
|
||||
( FACDetectedUnitPositionVec3.y - FACGroupPositionVec3.y )^2 +
|
||||
( FACDetectedUnitPositionVec3.z - FACGroupPositionVec3.z )^2
|
||||
) ^ 0.5 / 1000
|
||||
|
||||
self:T( { FACGroupName, FACDetectedUnitName, Distance } )
|
||||
|
||||
if Distance <= self.DetectionRange then
|
||||
|
||||
if not self.DetectedUnits[FACDetectedUnitName] then
|
||||
self.DetectedUnits[FACDetectedUnitName] = {}
|
||||
end
|
||||
self.DetectedUnits[FACDetectedUnitName].DetectedUnit = UNIT:FindByName( FACDetectedUnitName )
|
||||
self.DetectedUnits[FACDetectedUnitName].Visible = FACDetectedTarget.visible
|
||||
self.DetectedUnits[FACDetectedUnitName].Type = FACDetectedTarget.type
|
||||
self.DetectedUnits[FACDetectedUnitName].Distance = FACDetectedTarget.distance
|
||||
else
|
||||
-- if beyond the DetectionRange then nullify...
|
||||
if self.DetectedUnits[FACDetectedUnitName] then
|
||||
self.DetectedUnits[FACDetectedUnitName] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- okay, now we have a list of detected unit names ...
|
||||
-- Sort the table based on distance ...
|
||||
self:T( { "Sorting DetectedUnits table:", self.DetectedUnits } )
|
||||
table.sort( self.DetectedUnits, function( a, b ) return a.Distance < b.Distance end )
|
||||
self:T( { "Sorted Targets Table:", self.DetectedUnits } )
|
||||
|
||||
-- Now group the DetectedUnits table into SET_UNITs, evaluating the DetectionZoneRange.
|
||||
|
||||
if self.DetectedUnits then
|
||||
for DetectedUnitName, DetectedUnitData in pairs( self.DetectedUnits ) do
|
||||
local DetectedUnit = DetectedUnitData.DetectedUnit -- Unit#UNIT
|
||||
if DetectedUnit and DetectedUnit:IsAlive() then
|
||||
self:T( DetectedUnit:GetName() )
|
||||
if #self.DetectedUnitSets == 0 then
|
||||
self:T( { "Adding Unit Set #", 1 } )
|
||||
self.DetectedUnitSets[1] = {}
|
||||
self.DetectedUnitSets[1].Zone = ZONE_UNIT:New( DetectedUnitName, DetectedUnit, self.DetectionZoneRange )
|
||||
self.DetectedUnitSets[1].Set = SET_UNIT:New()
|
||||
self.DetectedUnitSets[1].Set:AddUnit( DetectedUnit )
|
||||
else
|
||||
local AddedToSet = false
|
||||
for DetectedUnitSetID, DetectedUnitSetData in pairs( self.DetectedUnitSets ) do
|
||||
self:T( "Detected Unit Set #" .. DetectedUnitSetID )
|
||||
local DetectedUnitSet = DetectedUnitSetData.Set -- Set#SET_UNIT
|
||||
local DetectedZone = DetectedUnitSetData.Zone -- Zone#ZONE_UNIT
|
||||
if DetectedUnit:IsInZone( DetectedZone ) then
|
||||
self:T( "Adding to Unit Set #" .. DetectedUnitSetID )
|
||||
self.DetectedUnitSets[DetectedUnitSetID].Set:AddUnit( DetectedUnit )
|
||||
AddedToSet = true
|
||||
end
|
||||
end
|
||||
if AddedToSet == false then
|
||||
self:T( "Adding new Unit Set #" .. #self.DetectedUnitSets+1 )
|
||||
self.DetectedUnitSets[#self.DetectedUnitSets+1] = {}
|
||||
self.DetectedUnitSets[#self.DetectedUnitSets].Zone = ZONE_UNIT:New( DetectedUnitName, DetectedUnit, self.DetectionZoneRange )
|
||||
self.DetectedUnitSets[#self.DetectedUnitSets].Set = SET_UNIT:New()
|
||||
self.DetectedUnitSets[#self.DetectedUnitSets].Set:AddUnit( DetectedUnit )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Now all the tests should have been build, now make some smoke and flares...
|
||||
|
||||
for DetectedUnitSetID, DetectedUnitSetData in pairs( self.DetectedUnitSets ) do
|
||||
local DetectedUnitSet = DetectedUnitSetData.Set -- Set#SET_UNIT
|
||||
local DetectedZone = DetectedUnitSetData.Zone -- Zone#ZONE_UNIT
|
||||
self:T( "Detected Set #" .. DetectedUnitSetID )
|
||||
DetectedUnitSet:ForEachUnit(
|
||||
--- @param Unit#UNIT DetectedUnit
|
||||
function( DetectedUnit )
|
||||
self:T( DetectedUnit:GetName() )
|
||||
DetectedUnit:FlareRed()
|
||||
end
|
||||
)
|
||||
DetectedZone:SmokeZone( POINT_VEC3.SmokeColor.White, 30 )
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -45,10 +45,14 @@ local _EVENTCODES = {
|
||||
-- @field weapon
|
||||
-- @field IniDCSUnit
|
||||
-- @field IniDCSUnitName
|
||||
-- @field Unit#UNIT IniUnit
|
||||
-- @field #string IniUnitName
|
||||
-- @field IniDCSGroup
|
||||
-- @field IniDCSGroupName
|
||||
-- @field TgtDCSUnit
|
||||
-- @field TgtDCSUnitName
|
||||
-- @field Unit#UNIT TgtUnit
|
||||
-- @field #string TgtUnitName
|
||||
-- @field TgtDCSGroup
|
||||
-- @field TgtDCSGroupName
|
||||
-- @field Weapon
|
||||
@ -470,6 +474,8 @@ function EVENT:onEvent( Event )
|
||||
Event.IniDCSUnit = Event.initiator
|
||||
Event.IniDCSGroup = Event.IniDCSUnit:getGroup()
|
||||
Event.IniDCSUnitName = Event.IniDCSUnit:getName()
|
||||
Event.IniUnitName = Event.IniDCSUnitName
|
||||
Event.IniUnit = UNIT:FindByName( Event.IniDCSUnitName )
|
||||
Event.IniDCSGroupName = ""
|
||||
if Event.IniDCSGroup and Event.IniDCSGroup:isExist() then
|
||||
Event.IniDCSGroupName = Event.IniDCSGroup:getName()
|
||||
@ -480,6 +486,8 @@ function EVENT:onEvent( Event )
|
||||
Event.TgtDCSUnit = Event.target
|
||||
Event.TgtDCSGroup = Event.TgtDCSUnit:getGroup()
|
||||
Event.TgtDCSUnitName = Event.TgtDCSUnit:getName()
|
||||
Event.TgtUnitName = Event.TgtDCSUnitName
|
||||
Event.TgtUnit = UNIT:FindByName( Event.TgtDCSUnitName )
|
||||
Event.TgtDCSGroupName = ""
|
||||
if Event.TgtDCSGroup and Event.TgtDCSGroup:isExist() then
|
||||
Event.TgtDCSGroupName = Event.TgtDCSGroup:getName()
|
||||
|
||||
@ -65,6 +65,7 @@
|
||||
-- * @{#GROUP.TaskRouteToVec2}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{#GROUP.TaskRouteToVec3}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{#GROUP.TaskRouteToZone}: (AIR + GROUND) Route the group to a given zone.
|
||||
-- * @{#GROUP.TaskReturnToBase}: (AIR) Route the group to an airbase.
|
||||
--
|
||||
-- ### 1.2.2) EnRoute task methods
|
||||
--
|
||||
@ -493,10 +494,15 @@ end
|
||||
-- Use the method @{Group@GROUP:WayPointExecute) to start the execution of the new mission plan.
|
||||
-- Note that when WayPointInitialize is called, the Mission of the group is RESTARTED!
|
||||
-- @param #GROUP self
|
||||
-- @param #table WayPoints If WayPoints is given, then use the route.
|
||||
-- @return #GROUP
|
||||
function GROUP:WayPointInitialize()
|
||||
function GROUP:WayPointInitialize( WayPoints )
|
||||
|
||||
self.WayPoints = self:GetTaskRoute()
|
||||
if WayPoints then
|
||||
self.WayPoints = WayPoints
|
||||
else
|
||||
self.WayPoints = self:GetTaskRoute()
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
@ -1050,6 +1056,24 @@ function GROUP:CommandSwitchWayPoint( FromWayPoint, ToWayPoint, Index )
|
||||
return CommandSwitchWayPoint
|
||||
end
|
||||
|
||||
--- Perform stop route command
|
||||
-- @param #GROUP self
|
||||
-- @param #boolean StopRoute
|
||||
-- @return DCSTask#Task
|
||||
function GROUP:CommandStopRoute( StopRoute, Index )
|
||||
self:F2( { StopRoute, Index } )
|
||||
|
||||
local CommandStopRoute = {
|
||||
id = 'StopRoute',
|
||||
params = {
|
||||
value = StopRoute,
|
||||
},
|
||||
}
|
||||
|
||||
self:T3( { CommandStopRoute } )
|
||||
return CommandStopRoute
|
||||
end
|
||||
|
||||
|
||||
-- TASKS FOR AIR GROUPS
|
||||
|
||||
@ -1427,7 +1451,7 @@ function GROUP:TaskLandAtZone( Zone, Duration, RandomPoint )
|
||||
|
||||
local Point
|
||||
if RandomPoint then
|
||||
Point = Zone:GetRandomPointVec2()
|
||||
Point = Zone:GetRandomVec2()
|
||||
else
|
||||
Point = Zone:GetPointVec2()
|
||||
end
|
||||
@ -2183,7 +2207,7 @@ function GROUP:TaskRouteToZone( Zone, Randomize, Speed, Formation )
|
||||
local ZonePoint
|
||||
|
||||
if Randomize then
|
||||
ZonePoint = Zone:GetRandomPointVec2()
|
||||
ZonePoint = Zone:GetRandomVec2()
|
||||
else
|
||||
ZonePoint = Zone:GetPointVec2()
|
||||
end
|
||||
@ -2216,6 +2240,125 @@ function GROUP:TaskRouteToZone( Zone, Randomize, Speed, Formation )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- (AIR) Return the Group to an @{Airbase#AIRBASE}
|
||||
-- A speed can be given in km/h.
|
||||
-- A given formation can be given.
|
||||
-- @param #GROUP self
|
||||
-- @param Airbase#AIRBASE ReturnAirbase The @{Airbase#AIRBASE} to return to.
|
||||
-- @param #number Speed (optional) The speed.
|
||||
-- @return #string The route
|
||||
function GROUP:RouteReturnToAirbase( ReturnAirbase, Speed )
|
||||
self:F2( { ReturnAirbase, Speed } )
|
||||
|
||||
-- Example
|
||||
-- [4] =
|
||||
-- {
|
||||
-- ["alt"] = 45,
|
||||
-- ["type"] = "Land",
|
||||
-- ["action"] = "Landing",
|
||||
-- ["alt_type"] = "BARO",
|
||||
-- ["formation_template"] = "",
|
||||
-- ["properties"] =
|
||||
-- {
|
||||
-- ["vnav"] = 1,
|
||||
-- ["scale"] = 0,
|
||||
-- ["angle"] = 0,
|
||||
-- ["vangle"] = 0,
|
||||
-- ["steer"] = 2,
|
||||
-- }, -- end of ["properties"]
|
||||
-- ["ETA"] = 527.81058817743,
|
||||
-- ["airdromeId"] = 12,
|
||||
-- ["y"] = 243127.2973737,
|
||||
-- ["x"] = -5406.2803440839,
|
||||
-- ["name"] = "DictKey_WptName_53",
|
||||
-- ["speed"] = 138.88888888889,
|
||||
-- ["ETA_locked"] = false,
|
||||
-- ["task"] =
|
||||
-- {
|
||||
-- ["id"] = "ComboTask",
|
||||
-- ["params"] =
|
||||
-- {
|
||||
-- ["tasks"] =
|
||||
-- {
|
||||
-- }, -- end of ["tasks"]
|
||||
-- }, -- end of ["params"]
|
||||
-- }, -- end of ["task"]
|
||||
-- ["speed_locked"] = true,
|
||||
-- }, -- end of [4]
|
||||
|
||||
|
||||
local DCSGroup = self:GetDCSGroup()
|
||||
|
||||
if DCSGroup then
|
||||
|
||||
local GroupPoint = self:GetPointVec2()
|
||||
local GroupVelocity = self:GetMaxVelocity()
|
||||
|
||||
local PointFrom = {}
|
||||
PointFrom.x = GroupPoint.x
|
||||
PointFrom.y = GroupPoint.y
|
||||
PointFrom.type = "Turning Point"
|
||||
PointFrom.action = "Turning Point"
|
||||
PointFrom.speed = GroupVelocity
|
||||
|
||||
|
||||
local PointTo = {}
|
||||
local AirbasePoint = ReturnAirbase:GetPointVec2()
|
||||
|
||||
PointTo.x = AirbasePoint.x
|
||||
PointTo.y = AirbasePoint.y
|
||||
PointTo.type = "Land"
|
||||
PointTo.action = "Landing"
|
||||
PointTo.airdromeId = ReturnAirbase:GetID()-- Airdrome ID
|
||||
self:T(PointTo.airdromeId)
|
||||
--PointTo.alt = 0
|
||||
|
||||
local Points = { PointFrom, PointTo }
|
||||
|
||||
self:T3( Points )
|
||||
|
||||
local Route = { points = Points, }
|
||||
|
||||
return Route
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- @param Group#GROUP self
|
||||
function GROUP:Respawn( Template )
|
||||
|
||||
local Vec3 = self:GetPointVec3()
|
||||
--Template.x = Vec3.x
|
||||
--Template.y = Vec3.z
|
||||
Template.x = nil
|
||||
Template.y = nil
|
||||
|
||||
self:E( #Template.units )
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local GroupUnit = UnitData -- Unit#UNIT
|
||||
self:E( GroupUnit:GetName() )
|
||||
if GroupUnit:IsAlive() then
|
||||
local GroupUnitVec3 = GroupUnit:GetPointVec3()
|
||||
local GroupUnitHeading = GroupUnit:GetHeading()
|
||||
Template.units[UnitID].alt = GroupUnitVec3.y
|
||||
Template.units[UnitID].x = GroupUnitVec3.x
|
||||
Template.units[UnitID].y = GroupUnitVec3.z
|
||||
Template.units[UnitID].heading = GroupUnitHeading
|
||||
self:E( { UnitID, Template.units[UnitID], Template.units[UnitID] } )
|
||||
end
|
||||
end
|
||||
|
||||
_DATABASE:Spawn( Template )
|
||||
|
||||
end
|
||||
|
||||
function GROUP:GetTemplate()
|
||||
|
||||
return _DATABASE.Templates.Groups[self:GetName()].Template
|
||||
|
||||
end
|
||||
|
||||
-- Commands
|
||||
|
||||
--- Do Script command
|
||||
@ -2298,6 +2441,8 @@ function GROUP:CopyRoute( Begin, End, Randomize, Radius )
|
||||
end
|
||||
end
|
||||
return Points
|
||||
else
|
||||
error( "Template not found for Group : " .. GroupName )
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
--- Provides missile training functions.
|
||||
--- This module contains the MISSILETRAINER class.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @{#MISSILETRAINER} class
|
||||
-- ========================
|
||||
-- 1) @{MissileTrainer#MISSILETRAINER} class, extends @{Base#BASE}
|
||||
-- ===============================================================
|
||||
-- The @{#MISSILETRAINER} class uses the DCS world messaging system to be alerted of any missiles fired, and when a missile would hit your aircraft,
|
||||
-- the class will destroy the missile within a certain range, to avoid damage to your aircraft.
|
||||
-- It suports the following functionality:
|
||||
@ -43,16 +45,16 @@
|
||||
-- * **200 meter**: Destroys the missile when the distance to the aircraft is below or equal to 200 meter.
|
||||
--
|
||||
--
|
||||
-- MISSILETRAINER construction methods:
|
||||
-- ====================================
|
||||
-- 1.1) MISSILETRAINER construction methods:
|
||||
-- -----------------------------------------
|
||||
-- Create a new MISSILETRAINER object with the @{#MISSILETRAINER.New} method:
|
||||
--
|
||||
-- * @{#MISSILETRAINER.New}: Creates a new MISSILETRAINER object taking the maximum distance to your aircraft to evaluate when a missile needs to be destroyed.
|
||||
--
|
||||
-- MISSILETRAINER will collect each unit declared in the mission with a skill level "Client" and "Player", and will monitor the missiles shot at those.
|
||||
--
|
||||
-- MISSILETRAINER initialization methods:
|
||||
-- ======================================
|
||||
-- 1.2) MISSILETRAINER initialization methods:
|
||||
-- -------------------------------------------
|
||||
-- A MISSILETRAINER object will behave differently based on the usage of initialization methods:
|
||||
--
|
||||
-- * @{#MISSILETRAINER.InitMessagesOnOff}: Sets by default the display of any message to be ON or OFF.
|
||||
@ -66,6 +68,15 @@
|
||||
-- * @{#MISSILETRAINER.InitBearingOnOff}: Sets by default the display of bearing information of missiles ON of OFF.
|
||||
-- * @{#MISSILETRAINER.InitMenusOnOff}: Allows to configure the options through the radio menu.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- CREDITS
|
||||
-- =======
|
||||
-- **Stuka (Danny)** Who you can search on the Eagle Dynamics Forums.
|
||||
-- Working together with Danny has resulted in the MISSILETRAINER class.
|
||||
-- Danny has shared his ideas and together we made a design.
|
||||
-- Together with the **476 virtual team**, we tested the MISSILETRAINER class, and got much positive feedback!
|
||||
--
|
||||
-- @module MissileTrainer
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ Include.File( "Unit" )
|
||||
Include.File( "Zone" )
|
||||
Include.File( "Client" )
|
||||
Include.File( "Static" )
|
||||
Include.File( "Airbase" )
|
||||
Include.File( "Database" )
|
||||
Include.File( "Set" )
|
||||
Include.File( "Point" )
|
||||
@ -35,42 +36,10 @@ Include.File( "Movement" )
|
||||
Include.File( "Sead" )
|
||||
Include.File( "Escort" )
|
||||
Include.File( "MissileTrainer" )
|
||||
Include.File( "PatrolZone" )
|
||||
Include.File( "AIBalancer" )
|
||||
Include.File( "AirbasePolice" )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Include.File( "Detection" )
|
||||
|
||||
-- The order of the declarations is important here. Don't touch it.
|
||||
|
||||
|
||||
265
Moose Development/Moose/PatrolZone.lua
Normal file
265
Moose Development/Moose/PatrolZone.lua
Normal file
@ -0,0 +1,265 @@
|
||||
--- This module contains the PATROLZONE class.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Patrol#PATROLZONE} class, extends @{Base#BASE}
|
||||
-- ===================================================
|
||||
-- The @{Patrol#PATROLZONE} class implements the core functions to patrol a @{Zone}.
|
||||
--
|
||||
-- 1.1) PATROLZONE constructor:
|
||||
-- ----------------------------
|
||||
-- @{PatrolZone#PATROLZONE.New}(): Creates a new PATROLZONE object.
|
||||
--
|
||||
-- 1.2) Modify the PATROLZONE parameters:
|
||||
-- --------------------------------------
|
||||
-- The following methods are available to modify the parameters of a PATROLZONE object:
|
||||
--
|
||||
-- * @{PatrolZone#PATROLZONE.SetGroup}(): Set the AI Patrol Group.
|
||||
-- * @{PatrolZone#PATROLZONE.SetSpeed}(): Set the patrol speed of the AI, for the next patrol.
|
||||
-- * @{PatrolZone#PATROLZONE.SetAltitude}(): Set altitude of the AI, for the next patrol.
|
||||
--
|
||||
-- 1.3) Manage the out of fuel in the PATROLZONE:
|
||||
-- ----------------------------------------------
|
||||
-- When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.
|
||||
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
|
||||
-- When the fuel treshold is reached, the PatrolGroup will continue for a given time its patrol task in orbit, while a new PatrolGroup is targetted to the PATROLZONE.
|
||||
-- Once the time is finished, the old PatrolGroup will return to the base.
|
||||
-- Use the method @{PatrolZone#PATROLZONE.ManageFuel}() to have this proces in place.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module PatrolZone
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
--- PATROLZONE class
|
||||
-- @type PATROLZONE
|
||||
-- @field Group#GROUP PatrolGroup The @{Group} patrolling.
|
||||
-- @field Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @field DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @field DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @field DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Group} in km/h.
|
||||
-- @field DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Group} in km/h.
|
||||
-- @extends Base#BASE
|
||||
PATROLZONE = {
|
||||
ClassName = "PATROLZONE",
|
||||
}
|
||||
|
||||
--- Creates a new PATROLZONE object, taking a @{Group} object as a parameter. The GROUP needs to be alive.
|
||||
-- @param #PATROLZONE self
|
||||
-- @param Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
|
||||
-- @param DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @param DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @param DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Group} in km/h.
|
||||
-- @param DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Group} in km/h.
|
||||
-- @return #PATROLZONE self
|
||||
-- @usage
|
||||
-- -- Define a new PATROLZONE Object. This PatrolArea will patrol a group within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
|
||||
-- PatrolZone = ZONE:New( 'PatrolZone' )
|
||||
-- PatrolGroup = GROUP:FindByName( "Patrol Group" )
|
||||
-- PatrolArea = PATROLZONE:New( PatrolGroup, PatrolZone, 3000, 6000, 600, 900 )
|
||||
function PATROLZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.PatrolZone = PatrolZone
|
||||
self.PatrolFloorAltitude = PatrolFloorAltitude
|
||||
self.PatrolCeilingAltitude = PatrolCeilingAltitude
|
||||
self.PatrolMinSpeed = PatrolMinSpeed
|
||||
self.PatrolMaxSpeed = PatrolMaxSpeed
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set the @{Group} to act as the Patroller.
|
||||
-- @param #PATROLZONE self
|
||||
-- @param Group#GROUP PatrolGroup The @{Group} patrolling.
|
||||
-- @return #PATROLZONE self
|
||||
function PATROLZONE:SetGroup( PatrolGroup )
|
||||
|
||||
self.PatrolGroup = PatrolGroup
|
||||
self.PatrolGroupTemplateName = PatrolGroup:GetName()
|
||||
self:NewPatrolRoute()
|
||||
|
||||
if not self.PatrolOutOfFuelMonitor then
|
||||
self.PatrolOutOfFuelMonitor = SCHEDULER:New( nil, _MonitorOutOfFuelScheduled, { self }, 1, 120, 0 )
|
||||
self.SpawnPatrolGroup = SPAWN:New( self.PatrolGroupTemplateName )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sets (modifies) the minimum and maximum speed of the patrol.
|
||||
-- @param #PATROLZONE self
|
||||
-- @param DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Group} in km/h.
|
||||
-- @param DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Group} in km/h.
|
||||
-- @return #PATROLZONE self
|
||||
function PATROLZONE:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
|
||||
self:F2( { PatrolMinSpeed, PatrolMaxSpeed } )
|
||||
|
||||
self.PatrolMinSpeed = PatrolMinSpeed
|
||||
self.PatrolMaxSpeed = PatrolMaxSpeed
|
||||
end
|
||||
|
||||
--- Sets the floor and ceiling altitude of the patrol.
|
||||
-- @param #PATROLZONE self
|
||||
-- @param DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
|
||||
-- @param DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||
-- @return #PATROLZONE self
|
||||
function PATROLZONE:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
|
||||
self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } )
|
||||
|
||||
self.PatrolFloorAltitude = PatrolFloorAltitude
|
||||
self.PatrolCeilingAltitude = PatrolCeilingAltitude
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- @param Group#GROUP PatrolGroup
|
||||
function _NewPatrolRoute( PatrolGroup )
|
||||
|
||||
PatrolGroup:T( "NewPatrolRoute" )
|
||||
local PatrolZone = PatrolGroup:GetState( PatrolGroup, "PatrolZone" ) -- PatrolZone#PATROLZONE
|
||||
PatrolZone:NewPatrolRoute()
|
||||
end
|
||||
|
||||
--- Defines a new patrol route using the @{PatrolZone} parameters and settings.
|
||||
-- @param #PATROLZONE self
|
||||
-- @return #PATROLZONE self
|
||||
function PATROLZONE:NewPatrolRoute()
|
||||
|
||||
self:F2()
|
||||
|
||||
local PatrolRoute = {}
|
||||
|
||||
if self.PatrolGroup:IsAlive() then
|
||||
--- Determine if the PatrolGroup is within the PatrolZone.
|
||||
-- If not, make a waypoint within the to that the PatrolGroup will fly at maximum speed to that point.
|
||||
|
||||
-- --- Calculate the current route point.
|
||||
-- local CurrentVec2 = self.PatrolGroup:GetPointVec2()
|
||||
-- local CurrentAltitude = self.PatrolGroup:GetUnit(1):GetAltitude()
|
||||
-- local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
-- local CurrentRoutePoint = CurrentPointVec3:RoutePointAir(
|
||||
-- POINT_VEC3.RoutePointAltType.BARO,
|
||||
-- POINT_VEC3.RoutePointType.TurningPoint,
|
||||
-- POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
-- ToPatrolZoneSpeed,
|
||||
-- true
|
||||
-- )
|
||||
--
|
||||
-- PatrolRoute[#PatrolRoute+1] = CurrentRoutePoint
|
||||
|
||||
self:T2( PatrolRoute )
|
||||
|
||||
if self.PatrolGroup:IsNotInZone( self.PatrolZone ) then
|
||||
--- Find a random 2D point in PatrolZone.
|
||||
local ToPatrolZoneVec2 = self.PatrolZone:GetRandomVec2()
|
||||
self:T2( ToPatrolZoneVec2 )
|
||||
|
||||
--- Define Speed and Altitude.
|
||||
local ToPatrolZoneAltitude = math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude )
|
||||
local ToPatrolZoneSpeed = self.PatrolMaxSpeed
|
||||
self:T2( ToPatrolZoneSpeed )
|
||||
|
||||
--- Obtain a 3D @{Point} from the 2D point + altitude.
|
||||
local ToPatrolZonePointVec3 = POINT_VEC3:New( ToPatrolZoneVec2.x, ToPatrolZoneAltitude, ToPatrolZoneVec2.y )
|
||||
|
||||
--- Create a route point of type air.
|
||||
local ToPatrolZoneRoutePoint = ToPatrolZonePointVec3:RoutePointAir(
|
||||
POINT_VEC3.RoutePointAltType.BARO,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
ToPatrolZoneSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
PatrolRoute[#PatrolRoute+1] = ToPatrolZoneRoutePoint
|
||||
|
||||
end
|
||||
|
||||
--- Define a random point in the @{Zone}. The AI will fly to that point within the zone.
|
||||
|
||||
--- Find a random 2D point in PatrolZone.
|
||||
local ToTargetVec2 = self.PatrolZone:GetRandomVec2()
|
||||
self:T2( ToTargetVec2 )
|
||||
|
||||
--- Define Speed and Altitude.
|
||||
local ToTargetAltitude = math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude )
|
||||
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:SmokeRed()
|
||||
|
||||
PatrolRoute[#PatrolRoute+1] = ToTargetRoutePoint
|
||||
|
||||
--- Now we're going to do something special, we're going to call a function from a waypoint action at the PatrolGroup...
|
||||
self.PatrolGroup:WayPointInitialize( PatrolRoute )
|
||||
|
||||
--- Do a trick, link the NewPatrolRoute function of the PATROLGROUP object to the PatrolGroup in a temporary variable ...
|
||||
self.PatrolGroup:SetState( self.PatrolGroup, "PatrolZone", self )
|
||||
self.PatrolGroup:WayPointFunction( #PatrolRoute, 1, "_NewPatrolRoute" )
|
||||
|
||||
--- NOW ROUTE THE GROUP!
|
||||
self.PatrolGroup:WayPointExecute( 1, 2 )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.
|
||||
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
|
||||
-- When the fuel treshold is reached, the PatrolGroup will continue for a given time its patrol task in orbit, while a new PatrolGroup is targetted to the PATROLZONE.
|
||||
-- Once the time is finished, the old PatrolGroup will return to the base.
|
||||
-- @param #PATROLZONE self
|
||||
-- @param #number PatrolFuelTresholdPercentage The treshold in percentage (between 0 and 1) when the PatrolGroup is considered to get out of fuel.
|
||||
-- @param #number PatrolOutOfFuelOrbitTime The amount of seconds the out of fuel PatrolGroup will orbit before returning to the base.
|
||||
-- @return #PATROLZONE self
|
||||
function PATROLZONE:ManageFuel( PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime )
|
||||
|
||||
self.PatrolManageFuel = true
|
||||
self.PatrolFuelTresholdPercentage = PatrolFuelTresholdPercentage
|
||||
self.PatrolOutOfFuelOrbitTime = PatrolOutOfFuelOrbitTime
|
||||
|
||||
if self.PatrolGroup then
|
||||
self.PatrolOutOfFuelMonitor = SCHEDULER:New( self, self._MonitorOutOfFuelScheduled, {}, 1, 120, 0 )
|
||||
self.SpawnPatrolGroup = SPAWN:New( self.PatrolGroupTemplateName )
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- @param #PATROLZONE self
|
||||
function _MonitorOutOfFuelScheduled( self )
|
||||
self:F2( "_MonitorOutOfFuelScheduled" )
|
||||
|
||||
if self.PatrolGroup and self.PatrolGroup:IsAlive() then
|
||||
|
||||
local Fuel = self.PatrolGroup:GetUnit(1):GetFuel()
|
||||
if Fuel < self.PatrolFuelTresholdPercentage then
|
||||
local OldPatrolGroup = self.PatrolGroup
|
||||
local PatrolGroupTemplate = self.PatrolGroup:GetTemplate()
|
||||
|
||||
local OrbitTask = OldPatrolGroup:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed )
|
||||
local TimedOrbitTask = OldPatrolGroup:TaskControlled( OrbitTask, OldPatrolGroup:TaskCondition(nil,nil,nil,nil,self.PatrolOutOfFuelOrbitTime,nil ) )
|
||||
OldPatrolGroup:SetTask( TimedOrbitTask, 10 )
|
||||
|
||||
local NewPatrolGroup = self.SpawnPatrolGroup:Spawn()
|
||||
self.PatrolGroup = NewPatrolGroup
|
||||
self:NewPatrolRoute()
|
||||
end
|
||||
else
|
||||
self.PatrolOutOfFuelMonitor:Stop()
|
||||
end
|
||||
end
|
||||
@ -30,6 +30,9 @@
|
||||
-- @extends Base#BASE
|
||||
-- @field #POINT_VEC3.SmokeColor SmokeColor
|
||||
-- @field #POINT_VEC3.FlareColor FlareColor
|
||||
-- @field #POINT_VEC3.RoutePointAltType RoutePointAltType
|
||||
-- @field #POINT_VEC3.RoutePointType RoutePointType
|
||||
-- @field #POINT_VEC3.RoutePointAction RoutePointAction
|
||||
POINT_VEC3 = {
|
||||
ClassName = "POINT_VEC3",
|
||||
SmokeColor = {
|
||||
@ -38,14 +41,24 @@ POINT_VEC3 = {
|
||||
White = trigger.smokeColor.White,
|
||||
Orange = trigger.smokeColor.Orange,
|
||||
Blue = trigger.smokeColor.Blue
|
||||
},
|
||||
},
|
||||
FlareColor = {
|
||||
Green = trigger.flareColor.Green,
|
||||
Red = trigger.flareColor.Red,
|
||||
White = trigger.flareColor.White,
|
||||
Yellow = trigger.flareColor.Yellow
|
||||
},
|
||||
}
|
||||
},
|
||||
RoutePointAltType = {
|
||||
BARO = "BARO",
|
||||
},
|
||||
RoutePointType = {
|
||||
TurningPoint = "Turning Point",
|
||||
},
|
||||
RoutePointAction = {
|
||||
TurningPoint = "Turning Point",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
--- SmokeColor
|
||||
-- @type POINT_VEC3.SmokeColor
|
||||
@ -55,6 +68,8 @@ POINT_VEC3 = {
|
||||
-- @field Orange
|
||||
-- @field Blue
|
||||
|
||||
|
||||
|
||||
--- FlareColor
|
||||
-- @type POINT_VEC3.FlareColor
|
||||
-- @field Green
|
||||
@ -62,6 +77,26 @@ POINT_VEC3 = {
|
||||
-- @field White
|
||||
-- @field Yellow
|
||||
|
||||
|
||||
|
||||
--- RoutePoint AltTypes
|
||||
-- @type POINT_VEC3.RoutePointAltType
|
||||
-- @field BARO "BARO"
|
||||
|
||||
|
||||
|
||||
--- RoutePoint Types
|
||||
-- @type POINT_VEC3.RoutePointType
|
||||
-- @field TurningPoint "Turning Point"
|
||||
|
||||
|
||||
|
||||
--- RoutePoint Actions
|
||||
-- @type POINT_VEC3.RoutePointAction
|
||||
-- @field TurningPoint "Turning Point"
|
||||
|
||||
|
||||
|
||||
-- Constructor.
|
||||
|
||||
--- Create a new POINT_VEC3 object.
|
||||
@ -69,15 +104,61 @@ POINT_VEC3 = {
|
||||
-- @param DCSTypes#Distance x The x coordinate of the Vec3 point, pointing to the North.
|
||||
-- @param DCSTypes#Distance y The y coordinate of the Vec3 point, pointing Upwards.
|
||||
-- @param DCSTypes#Distance z The z coordinate of the Vec3 point, pointing to the Right.
|
||||
-- @return Point#POINT_VEC3
|
||||
-- @return Point#POINT_VEC3 self
|
||||
function POINT_VEC3:New( x, y, z )
|
||||
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
self:F2( { x, y, z } )
|
||||
self.PointVec3 = { x = x, y = y, z = z }
|
||||
self:F2( self.PointVec3 )
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Build an air type route point.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #POINT_VEC3.RoutePointAltType AltType The altitude type.
|
||||
-- @param #POINT_VEC3.RoutePointType Type The route point type.
|
||||
-- @param #POINT_VEC3.RoutePointAction Action The route point action.
|
||||
-- @param DCSTypes#Speed Speed Airspeed in km/h.
|
||||
-- @param #boolean SpeedLocked true means the speed is locked.
|
||||
-- @return #table The route point.
|
||||
function POINT_VEC3:RoutePointAir( AltType, Type, Action, Speed, SpeedLocked )
|
||||
self:F2( { AltType, Type, Action, Speed, SpeedLocked } )
|
||||
|
||||
local RoutePoint = {}
|
||||
RoutePoint.x = self.PointVec3.x
|
||||
RoutePoint.y = self.PointVec3.z
|
||||
RoutePoint.alt = self.PointVec3.y
|
||||
RoutePoint.alt_type = AltType
|
||||
|
||||
RoutePoint.type = Type
|
||||
RoutePoint.action = Action
|
||||
|
||||
RoutePoint.speed = Speed / 3.6
|
||||
RoutePoint.speed_locked = true
|
||||
|
||||
-- ["task"] =
|
||||
-- {
|
||||
-- ["id"] = "ComboTask",
|
||||
-- ["params"] =
|
||||
-- {
|
||||
-- ["tasks"] =
|
||||
-- {
|
||||
-- }, -- end of ["tasks"]
|
||||
-- }, -- end of ["params"]
|
||||
-- }, -- end of ["task"]
|
||||
|
||||
|
||||
RoutePoint.task = {}
|
||||
RoutePoint.task.id = "ComboTask"
|
||||
RoutePoint.task.params = {}
|
||||
RoutePoint.task.params.tasks = {}
|
||||
|
||||
|
||||
return RoutePoint
|
||||
end
|
||||
|
||||
|
||||
--- Smokes the point in a color.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param Point#POINT_VEC3.SmokeColor SmokeColor
|
||||
@ -164,6 +245,7 @@ end
|
||||
|
||||
--- The POINT_VEC2 class
|
||||
-- @type POINT_VEC2
|
||||
-- @field DCSTypes#Vec2 PointVec2
|
||||
-- @extends Point#POINT_VEC3
|
||||
POINT_VEC2 = {
|
||||
ClassName = "POINT_VEC2",
|
||||
@ -184,8 +266,36 @@ function POINT_VEC2:New( x, y, LandHeightAdd )
|
||||
|
||||
local self = BASE:Inherit( self, POINT_VEC3:New( x, LandHeight, y ) )
|
||||
self:F2( { x, y, LandHeightAdd } )
|
||||
|
||||
self.PointVec2 = { x = x, y = y }
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Calculate the distance from a reference @{Point#POINT_VEC2}.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #POINT_VEC2 PointVec2Reference The reference @{Point#POINT_VEC2}.
|
||||
-- @return DCSTypes#Distance The distance from the reference @{Point#POINT_VEC2} in meters.
|
||||
function POINT_VEC2:DistanceFromPointVec2( PointVec2Reference )
|
||||
self:F2( PointVec2Reference )
|
||||
|
||||
local Distance = ( ( PointVec2Reference.PointVec2.x - self.PointVec2.x ) ^ 2 + ( PointVec2Reference.PointVec2.y - self.PointVec2.y ) ^2 ) ^0.5
|
||||
|
||||
self:T2( Distance )
|
||||
return Distance
|
||||
end
|
||||
|
||||
--- Calculate the distance from a reference @{DCSTypes#Vec2}.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCSTypes#Vec2 Vec2Reference The reference @{DCSTypes#Vec2}.
|
||||
-- @return DCSTypes#Distance The distance from the reference @{DCSTypes#Vec2} in meters.
|
||||
function POINT_VEC2:DistanceFromVec2( Vec2Reference )
|
||||
self:F2( Vec2Reference )
|
||||
|
||||
local Distance = ( ( Vec2Reference.x - self.PointVec2.x ) ^ 2 + ( Vec2Reference.y - self.PointVec2.y ) ^2 ) ^0.5
|
||||
|
||||
self:T2( Distance )
|
||||
return Distance
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
-- @module Scheduler
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
--- The SCHEDULER class
|
||||
-- @type SCHEDULER
|
||||
-- @field #number ScheduleID the ID of the scheduler.
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
|
||||
-- ================================================
|
||||
-- ==============================================
|
||||
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
|
||||
-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
|
||||
-- In this way, large loops can be done while not blocking the simulator main processing loop.
|
||||
@ -14,15 +14,15 @@
|
||||
-- ---------------------------------------
|
||||
-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
|
||||
--
|
||||
-- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**.
|
||||
-- -------------------------------------------------------------------------------------
|
||||
-- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
|
||||
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
|
||||
-- ====================================================
|
||||
-- ==================================================
|
||||
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
|
||||
--
|
||||
-- * Coalitions
|
||||
@ -128,6 +128,8 @@
|
||||
-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
|
||||
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
|
||||
-- ===================================================
|
||||
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
|
||||
@ -178,9 +180,48 @@
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
|
||||
-- ====================================================
|
||||
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
|
||||
--
|
||||
-- * Coalitions
|
||||
--
|
||||
-- 5.1) SET_AIRBASE construction
|
||||
-- -----------------------------
|
||||
-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
|
||||
--
|
||||
-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
|
||||
--
|
||||
-- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
|
||||
-- --------------------------------------------
|
||||
-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
|
||||
-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
|
||||
--
|
||||
-- 5.3) SET_AIRBASE filter criteria
|
||||
-- --------------------------------
|
||||
-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
|
||||
-- Filter criteria are defined by:
|
||||
--
|
||||
-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
|
||||
--
|
||||
-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
|
||||
--
|
||||
-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
|
||||
--
|
||||
-- 5.4) SET_AIRBASE iterators:
|
||||
-- ---------------------------
|
||||
-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
|
||||
-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
|
||||
-- The following iterator methods are currently available within the SET_AIRBASE:
|
||||
--
|
||||
-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- @module Set
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
--- SET_BASE class
|
||||
-- @type SET_BASE
|
||||
-- @extends Base#BASE
|
||||
@ -197,8 +238,6 @@ SET_BASE = {
|
||||
-- DBObject = SET_BASE:New()
|
||||
function SET_BASE:New( Database )
|
||||
|
||||
env.info( tostring( Database ) )
|
||||
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
@ -279,6 +318,32 @@ function SET_BASE:_FilterStart()
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_BASE while identifying the nearest object from a @{Point#POINT_VEC2}.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate the closest object in the set.
|
||||
-- @return Base#BASE The closest object.
|
||||
function SET_BASE:FindNearestObjectFromPointVec2( PointVec2 )
|
||||
self:F2( PointVec2 )
|
||||
|
||||
local NearestObject = nil
|
||||
local ClosestDistance = nil
|
||||
|
||||
for ObjectID, ObjectData in pairs( self.Set ) do
|
||||
if NearestObject == nil then
|
||||
NearestObject = ObjectData
|
||||
ClosestDistance = PointVec2:DistanceFromVec2( ObjectData:GetPointVec2() )
|
||||
else
|
||||
local Distance = PointVec2:DistanceFromVec2( ObjectData:GetPointVec2() )
|
||||
if Distance < ClosestDistance then
|
||||
NearestObject = ObjectData
|
||||
ClosestDistance = Distance
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return NearestObject
|
||||
end
|
||||
|
||||
|
||||
|
||||
----- Private method that registers all alive players in the mission.
|
||||
@ -325,7 +390,7 @@ end
|
||||
-- @param #SET_BASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
function SET_BASE:_EventOnDeadOrCrash( Event )
|
||||
self:F3( { Event } )
|
||||
self:F2( { Event } )
|
||||
|
||||
if Event.IniDCSUnit then
|
||||
local ObjectName, Object = self:FindInDatabase( Event )
|
||||
@ -390,18 +455,20 @@ function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArgumen
|
||||
IteratorFunction( Object, unpack( arg ) )
|
||||
end
|
||||
Count = Count + 1
|
||||
if Count % self.YieldInterval == 0 then
|
||||
coroutine.yield( false )
|
||||
end
|
||||
-- if Count % self.YieldInterval == 0 then
|
||||
-- coroutine.yield( false )
|
||||
-- end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local co = coroutine.create( CoRoutine )
|
||||
-- local co = coroutine.create( CoRoutine )
|
||||
local co = CoRoutine
|
||||
|
||||
local function Schedule()
|
||||
|
||||
local status, res = coroutine.resume( co )
|
||||
-- local status, res = coroutine.resume( co )
|
||||
local status, res = co()
|
||||
self:T3( { status, res } )
|
||||
|
||||
if status == false then
|
||||
@ -420,7 +487,7 @@ function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArgumen
|
||||
end
|
||||
|
||||
|
||||
----- Interate the SET_BASE and call an interator function for each **alive** unit, providing the Unit and optional parameters.
|
||||
----- Iterate the SET_BASE and call an interator function for each **alive** unit, providing the Unit and optional parameters.
|
||||
---- @param #SET_BASE self
|
||||
---- @param #function IteratorFunction The function that will be called when there is an alive unit in the SET_BASE. The function needs to accept a UNIT parameter.
|
||||
---- @return #SET_BASE self
|
||||
@ -432,7 +499,7 @@ end
|
||||
-- return self
|
||||
--end
|
||||
--
|
||||
----- Interate the SET_BASE and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
|
||||
----- Iterate the SET_BASE and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
|
||||
---- @param #SET_BASE self
|
||||
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_BASE. The function needs to accept a UNIT parameter.
|
||||
---- @return #SET_BASE self
|
||||
@ -445,7 +512,7 @@ end
|
||||
--end
|
||||
--
|
||||
--
|
||||
----- Interate the SET_BASE and call an interator function for each client, providing the Client to the function and optional parameters.
|
||||
----- Iterate the SET_BASE and call an interator function for each client, providing the Client to the function and optional parameters.
|
||||
---- @param #SET_BASE self
|
||||
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_BASE. The function needs to accept a CLIENT parameter.
|
||||
---- @return #SET_BASE self
|
||||
@ -767,7 +834,7 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
|
||||
end
|
||||
|
||||
|
||||
----- Interate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
|
||||
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
|
||||
---- @param #SET_GROUP self
|
||||
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
|
||||
---- @return #SET_GROUP self
|
||||
@ -780,7 +847,7 @@ end
|
||||
--end
|
||||
--
|
||||
--
|
||||
----- Interate the SET_GROUP and call an interator function for each client, providing the Client to the function and optional parameters.
|
||||
----- Iterate the SET_GROUP and call an interator function for each client, providing the Client to the function and optional parameters.
|
||||
---- @param #SET_GROUP self
|
||||
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a CLIENT parameter.
|
||||
---- @return #SET_GROUP self
|
||||
@ -890,17 +957,35 @@ function SET_UNIT:New()
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, SET_BASE:New( _DATABASE.UNITS ) )
|
||||
|
||||
_EVENTDISPATCHER:OnBirth( self._EventOnBirth, self )
|
||||
_EVENTDISPATCHER:OnDead( self._EventOnDeadOrCrash, self )
|
||||
_EVENTDISPATCHER:OnCrash( self._EventOnDeadOrCrash, self )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add UNIT(s) to SET_UNIT.
|
||||
-- @param Set#SET_UNIT self
|
||||
-- @param #SET_UNIT self
|
||||
-- @param #string AddUnit A single UNIT.
|
||||
-- @return #SET_UNIT self
|
||||
function SET_UNIT:AddUnit( AddUnit )
|
||||
self:F2( AddUnit:GetName() )
|
||||
|
||||
self:Add( AddUnit:GetName(), AddUnit )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Add UNIT(s) to SET_UNIT.
|
||||
-- @param #SET_UNIT self
|
||||
-- @param #string AddUnitNames A single name or an array of UNIT names.
|
||||
-- @return self
|
||||
-- @return #SET_UNIT self
|
||||
function SET_UNIT:AddUnitsByName( AddUnitNames )
|
||||
|
||||
local AddUnitNamesArray = ( type( AddUnitNames ) == "table" ) and AddUnitNames or { AddUnitNames }
|
||||
|
||||
self:T( AddUnitNamesArray )
|
||||
for AddUnitID, AddUnitName in pairs( AddUnitNamesArray ) do
|
||||
self:Add( AddUnitName, UNIT:FindByName( AddUnitName ) )
|
||||
end
|
||||
@ -1071,10 +1156,11 @@ end
|
||||
function SET_UNIT:FindInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
self:E( { Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName] } )
|
||||
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
|
||||
end
|
||||
|
||||
--- Interate the SET_UNIT and call an interator function for each **alive** UNIT, providing the UNIT and optional parameters.
|
||||
--- Iterate the SET_UNIT and call an interator function for each **alive** UNIT, providing the UNIT and optional parameters.
|
||||
-- @param #SET_UNIT self
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter.
|
||||
-- @return #SET_UNIT self
|
||||
@ -1132,7 +1218,7 @@ end
|
||||
|
||||
|
||||
|
||||
----- Interate the SET_UNIT and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
|
||||
----- Iterate the SET_UNIT and call an interator function for each **alive** player, providing the Unit of the player and optional parameters.
|
||||
---- @param #SET_UNIT self
|
||||
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_UNIT. The function needs to accept a UNIT parameter.
|
||||
---- @return #SET_UNIT self
|
||||
@ -1145,7 +1231,7 @@ end
|
||||
--end
|
||||
--
|
||||
--
|
||||
----- Interate the SET_UNIT and call an interator function for each client, providing the Client to the function and optional parameters.
|
||||
----- Iterate the SET_UNIT and call an interator function for each client, providing the Client to the function and optional parameters.
|
||||
---- @param #SET_UNIT self
|
||||
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_UNIT. The function needs to accept a CLIENT parameter.
|
||||
---- @return #SET_UNIT self
|
||||
@ -1447,7 +1533,7 @@ function SET_CLIENT:FindInDatabase( Event )
|
||||
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
|
||||
end
|
||||
|
||||
--- Interate the SET_CLIENT and call an interator function for each **alive** CLIENT, providing the CLIENT and optional parameters.
|
||||
--- Iterate the SET_CLIENT and call an interator function for each **alive** CLIENT, providing the CLIENT and optional parameters.
|
||||
-- @param #SET_CLIENT self
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive CLIENT in the SET_CLIENT. The function needs to accept a CLIENT parameter.
|
||||
-- @return #SET_CLIENT self
|
||||
@ -1583,3 +1669,226 @@ function SET_CLIENT:IsIncludeObject( MClient )
|
||||
return MClientInclude
|
||||
end
|
||||
|
||||
--- SET_AIRBASE
|
||||
|
||||
--- SET_AIRBASE class
|
||||
-- @type SET_AIRBASE
|
||||
-- @extends Set#SET_BASE
|
||||
SET_AIRBASE = {
|
||||
ClassName = "SET_AIRBASE",
|
||||
Airbases = {},
|
||||
Filter = {
|
||||
Coalitions = nil,
|
||||
},
|
||||
FilterMeta = {
|
||||
Coalitions = {
|
||||
red = coalition.side.RED,
|
||||
blue = coalition.side.BLUE,
|
||||
neutral = coalition.side.NEUTRAL,
|
||||
},
|
||||
Categories = {
|
||||
airdrome = Airbase.Category.AIRDROME,
|
||||
helipad = Airbase.Category.HELIPAD,
|
||||
ship = Airbase.Category.SHIP,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
--- Creates a new SET_AIRBASE object, building a set of airbases belonging to a coalitions and categories.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @return #SET_AIRBASE self
|
||||
-- @usage
|
||||
-- -- Define a new SET_AIRBASE Object. The DatabaseSet will contain a reference to all Airbases.
|
||||
-- DatabaseSet = SET_AIRBASE:New()
|
||||
function SET_AIRBASE:New()
|
||||
-- Inherits from BASE
|
||||
local self = BASE:Inherit( self, SET_BASE:New( _DATABASE.AIRBASES ) )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add AIRBASEs to SET_AIRBASE.
|
||||
-- @param Set#SET_AIRBASE self
|
||||
-- @param #string AddAirbaseNames A single name or an array of AIRBASE names.
|
||||
-- @return self
|
||||
function SET_AIRBASE:AddAirbasesByName( AddAirbaseNames )
|
||||
|
||||
local AddAirbaseNamesArray = ( type( AddAirbaseNames ) == "table" ) and AddAirbaseNames or { AddAirbaseNames }
|
||||
|
||||
for AddAirbaseID, AddAirbaseName in pairs( AddAirbaseNamesArray ) do
|
||||
self:Add( AddAirbaseName, AIRBASE:FindByName( AddAirbaseName ) )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Remove AIRBASEs from SET_AIRBASE.
|
||||
-- @param Set#SET_AIRBASE self
|
||||
-- @param Airbase#AIRBASE RemoveAirbaseNames A single name or an array of AIRBASE names.
|
||||
-- @return self
|
||||
function SET_AIRBASE:RemoveAirbasesByName( RemoveAirbaseNames )
|
||||
|
||||
local RemoveAirbaseNamesArray = ( type( RemoveAirbaseNames ) == "table" ) and RemoveAirbaseNames or { RemoveAirbaseNames }
|
||||
|
||||
for RemoveAirbaseID, RemoveAirbaseName in pairs( RemoveAirbaseNamesArray ) do
|
||||
self:Remove( RemoveAirbaseName.AirbaseName )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Finds a Airbase based on the Airbase Name.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param #string AirbaseName
|
||||
-- @return Airbase#AIRBASE The found Airbase.
|
||||
function SET_AIRBASE:FindAirbase( AirbaseName )
|
||||
|
||||
local AirbaseFound = self.Set[AirbaseName]
|
||||
return AirbaseFound
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Builds a set of airbases of coalitions.
|
||||
-- Possible current coalitions are red, blue and neutral.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral".
|
||||
-- @return #SET_AIRBASE self
|
||||
function SET_AIRBASE:FilterCoalitions( Coalitions )
|
||||
if not self.Filter.Coalitions then
|
||||
self.Filter.Coalitions = {}
|
||||
end
|
||||
if type( Coalitions ) ~= "table" then
|
||||
Coalitions = { Coalitions }
|
||||
end
|
||||
for CoalitionID, Coalition in pairs( Coalitions ) do
|
||||
self.Filter.Coalitions[Coalition] = Coalition
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Builds a set of airbases out of categories.
|
||||
-- Possible current categories are plane, helicopter, ground, ship.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param #string Categories Can take the following values: "airdrome", "helipad", "ship".
|
||||
-- @return #SET_AIRBASE self
|
||||
function SET_AIRBASE:FilterCategories( Categories )
|
||||
if not self.Filter.Categories then
|
||||
self.Filter.Categories = {}
|
||||
end
|
||||
if type( Categories ) ~= "table" then
|
||||
Categories = { Categories }
|
||||
end
|
||||
for CategoryID, Category in pairs( Categories ) do
|
||||
self.Filter.Categories[Category] = Category
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Starts the filtering.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @return #SET_AIRBASE self
|
||||
function SET_AIRBASE:FilterStart()
|
||||
|
||||
if _DATABASE then
|
||||
self:_FilterStart()
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Handles the Database to check on an event (birth) that the Object was added in the Database.
|
||||
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @return #string The name of the AIRBASE
|
||||
-- @return #table The AIRBASE
|
||||
function SET_AIRBASE:AddInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
|
||||
end
|
||||
|
||||
--- Handles the Database to check on any event that Object exists in the Database.
|
||||
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Event#EVENTDATA Event
|
||||
-- @return #string The name of the AIRBASE
|
||||
-- @return #table The AIRBASE
|
||||
function SET_AIRBASE:FindInDatabase( Event )
|
||||
self:F3( { Event } )
|
||||
|
||||
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
|
||||
end
|
||||
|
||||
--- Iterate the SET_AIRBASE and call an interator function for each AIRBASE, providing the AIRBASE and optional parameters.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param #function IteratorFunction The function that will be called when there is an alive AIRBASE in the SET_AIRBASE. The function needs to accept a AIRBASE parameter.
|
||||
-- @return #SET_AIRBASE self
|
||||
function SET_AIRBASE:ForEachAirbase( IteratorFunction, ... )
|
||||
self:F2( arg )
|
||||
|
||||
self:ForEach( IteratorFunction, arg, self.Set )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_AIRBASE while identifying the nearest @{Airbase#AIRBASE} from a @{Point#POINT_VEC2}.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate the closest @{Airbase#AIRBASE}.
|
||||
-- @return Airbase#AIRBASE The closest @{Airbase#AIRBASE}.
|
||||
function SET_AIRBASE:FindNearestAirbaseFromPointVec2( PointVec2 )
|
||||
self:F2( PointVec2 )
|
||||
|
||||
local NearestAirbase = self:FindNearestObjectFromPointVec2( PointVec2 )
|
||||
return NearestAirbase
|
||||
end
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Airbase#AIRBASE MAirbase
|
||||
-- @return #SET_AIRBASE self
|
||||
function SET_AIRBASE:IsIncludeObject( MAirbase )
|
||||
self:F2( MAirbase )
|
||||
|
||||
local MAirbaseInclude = true
|
||||
|
||||
if MAirbase then
|
||||
local MAirbaseName = MAirbase:GetName()
|
||||
|
||||
if self.Filter.Coalitions then
|
||||
local MAirbaseCoalition = false
|
||||
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
|
||||
local AirbaseCoalitionID = _DATABASE:GetCoalitionFromAirbase( MAirbaseName )
|
||||
self:T3( { "Coalition:", AirbaseCoalitionID, self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
|
||||
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == AirbaseCoalitionID then
|
||||
MAirbaseCoalition = true
|
||||
end
|
||||
end
|
||||
self:T( { "Evaluated Coalition", MAirbaseCoalition } )
|
||||
MAirbaseInclude = MAirbaseInclude and MAirbaseCoalition
|
||||
end
|
||||
|
||||
if self.Filter.Categories then
|
||||
local MAirbaseCategory = false
|
||||
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
|
||||
local AirbaseCategoryID = _DATABASE:GetCategoryFromAirbase( MAirbaseName )
|
||||
self:T3( { "Category:", AirbaseCategoryID, self.FilterMeta.Categories[CategoryName], CategoryName } )
|
||||
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == AirbaseCategoryID then
|
||||
MAirbaseCategory = true
|
||||
end
|
||||
end
|
||||
self:T( { "Evaluated Category", MAirbaseCategory } )
|
||||
MAirbaseInclude = MAirbaseInclude and MAirbaseCategory
|
||||
end
|
||||
end
|
||||
|
||||
self:T2( MAirbaseInclude )
|
||||
return MAirbaseInclude
|
||||
end
|
||||
|
||||
@ -644,7 +644,7 @@ function SPAWN:SpawnInZone( Zone, ZoneRandomize, SpawnIndex )
|
||||
local ZonePoint
|
||||
|
||||
if ZoneRandomize == true then
|
||||
ZonePoint = Zone:GetRandomPointVec2()
|
||||
ZonePoint = Zone:GetRandomVec2()
|
||||
else
|
||||
ZonePoint = Zone:GetPointVec2()
|
||||
end
|
||||
@ -654,7 +654,7 @@ function SPAWN:SpawnInZone( Zone, ZoneRandomize, SpawnIndex )
|
||||
|
||||
-- Apply SpawnFormation
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
local ZonePointUnit = Zone:GetRandomPointVec2()
|
||||
local ZonePointUnit = Zone:GetRandomVec2()
|
||||
SpawnTemplate.units[UnitID].x = ZonePointUnit.x
|
||||
SpawnTemplate.units[UnitID].y = ZonePointUnit.y
|
||||
self:T( 'SpawnTemplate.units['..UnitID..'].x = ' .. SpawnTemplate.units[UnitID].x .. ', SpawnTemplate.units['..UnitID..'].y = ' .. SpawnTemplate.units[UnitID].y )
|
||||
|
||||
@ -736,6 +736,29 @@ function UNIT:GetCategoryName()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the DCS Unit heading.
|
||||
-- @param Unit#UNIT self
|
||||
-- @return #number The DCS Unit heading
|
||||
function UNIT:GetHeading()
|
||||
local DCSUnit = self:GetDCSUnit()
|
||||
|
||||
if DCSUnit then
|
||||
|
||||
local UnitPosition = DCSUnit:getPosition()
|
||||
if UnitPosition then
|
||||
local UnitHeading = math.atan2( UnitPosition.x.z, UnitPosition.x.x )
|
||||
if UnitHeading < 0 then
|
||||
UnitHeading = UnitHeading + 2 * math.pi
|
||||
end
|
||||
self:T2( UnitHeading )
|
||||
return UnitHeading
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Signal a flare at the position of the UNIT.
|
||||
-- @param #UNIT self
|
||||
function UNIT:Flare( FlareColor )
|
||||
|
||||
@ -77,6 +77,15 @@ ZONE_BASE = {
|
||||
ClassName = "ZONE_BASE",
|
||||
}
|
||||
|
||||
|
||||
--- The ZONE_BASE.BoundingSquare
|
||||
-- @type ZONE_BASE.BoundingSquare
|
||||
-- @field DCSTypes#Distance x1 The lower x coordinate (left down)
|
||||
-- @field DCSTypes#Distance y1 The lower y coordinate (left down)
|
||||
-- @field DCSTypes#Distance x2 The higher x coordinate (right up)
|
||||
-- @field DCSTypes#Distance y2 The higher y coordinate (right up)
|
||||
|
||||
|
||||
--- ZONE_BASE constructor
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param #string ZoneName Name of the zone.
|
||||
@ -91,7 +100,7 @@ function ZONE_BASE:New( ZoneName )
|
||||
end
|
||||
|
||||
--- Returns if a location is within the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param DCSTypes#Vec2 PointVec2 The location to test.
|
||||
-- @return #boolean true if the location is within the zone.
|
||||
function ZONE_BASE:IsPointVec2InZone( PointVec2 )
|
||||
@ -101,7 +110,7 @@ function ZONE_BASE:IsPointVec2InZone( PointVec2 )
|
||||
end
|
||||
|
||||
--- Returns if a point is within the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param DCSTypes#Vec3 PointVec3 The point to test.
|
||||
-- @return #boolean true if the point is within the zone.
|
||||
function ZONE_BASE:IsPointVec3InZone( PointVec3 )
|
||||
@ -112,6 +121,21 @@ function ZONE_BASE:IsPointVec3InZone( PointVec3 )
|
||||
return InZone
|
||||
end
|
||||
|
||||
--- Define a random @{DCSTypes#Vec2} within the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @return DCSTypes#Vec2 The Vec2 coordinates.
|
||||
function ZONE_BASE:GetRandomVec2()
|
||||
return { x = 0, y = 0 }
|
||||
end
|
||||
|
||||
--- Get the bounding square the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @return #ZONE_BASE.BoundingSquare The bounding square.
|
||||
function ZONE_BASE:GetBoundingSquare()
|
||||
return { x1 = 0, y1 = 0, x2 = 0, y2 = 0 }
|
||||
end
|
||||
|
||||
|
||||
--- Smokes the zone boundaries in a color.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param SmokeColor The smoke color.
|
||||
@ -297,7 +321,7 @@ end
|
||||
--- Returns a random location within the zone.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @return DCSTypes#Vec2 The random location within the zone.
|
||||
function ZONE_RADIUS:GetRandomPointVec2()
|
||||
function ZONE_RADIUS:GetRandomVec2()
|
||||
self:F( self.ZoneName )
|
||||
|
||||
local Point = {}
|
||||
@ -495,6 +519,55 @@ function ZONE_POLYGON_BASE:IsPointVec2InZone( PointVec2 )
|
||||
return c
|
||||
end
|
||||
|
||||
--- Define a random @{DCSTypes#Vec2} within the zone.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @return DCSTypes#Vec2 The Vec2 coordinate.
|
||||
function ZONE_POLYGON_BASE:GetRandomVec2()
|
||||
self:F2()
|
||||
|
||||
--- It is a bit tricky to find a random point within a polygon. Right now i am doing it the dirty and inefficient way...
|
||||
local Vec2Found = false
|
||||
local Vec2
|
||||
local BS = self:GetBoundingSquare()
|
||||
|
||||
self:T2( BS )
|
||||
|
||||
while Vec2Found == false do
|
||||
Vec2 = { x = math.random( BS.x1, BS.x2 ), y = math.random( BS.y1, BS.y2 ) }
|
||||
self:T2( Vec2 )
|
||||
if self:IsPointVec2InZone( Vec2 ) then
|
||||
Vec2Found = true
|
||||
end
|
||||
end
|
||||
|
||||
self:T2( Vec2 )
|
||||
|
||||
return Vec2
|
||||
end
|
||||
|
||||
--- Get the bounding square the zone.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @return #ZONE_POLYGON_BASE.BoundingSquare The bounding square.
|
||||
function ZONE_POLYGON_BASE:GetBoundingSquare()
|
||||
|
||||
local x1 = self.Polygon[1].x
|
||||
local y1 = self.Polygon[1].y
|
||||
local x2 = self.Polygon[1].x
|
||||
local y2 = self.Polygon[1].y
|
||||
|
||||
for i = 2, #self.Polygon do
|
||||
self:T2( { self.Polygon[i], x1, y1, x2, y2 } )
|
||||
x1 = ( x1 > self.Polygon[i].x ) and self.Polygon[i].x or x1
|
||||
x2 = ( x2 < self.Polygon[i].x ) and self.Polygon[i].x or x2
|
||||
y1 = ( y1 > self.Polygon[i].y ) and self.Polygon[i].y or y1
|
||||
y2 = ( y2 < self.Polygon[i].y ) and self.Polygon[i].y or y2
|
||||
|
||||
end
|
||||
|
||||
return { x1 = x1, y1 = y1, x2 = x2, y2 = y2 }
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -48,6 +48,7 @@ COPY /b Moose.lua + %1\Unit.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Zone.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Client.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Static.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Airbase.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Database.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Set.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Point.lua Moose.lua
|
||||
@ -73,7 +74,10 @@ COPY /b Moose.lua + %1\Movement.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Sead.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Escort.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\MissileTrainer.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\PatrolZone.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\AIBalancer.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\AirbasePolice.lua Moose.lua
|
||||
COPY /b Moose.lua + %1\Detection.lua Moose.lua
|
||||
|
||||
COPY /b Moose.lua + "Moose Create Static\Moose_Trace_Off.lua" Moose.lua
|
||||
|
||||
|
||||
@ -1,8 +1,24 @@
|
||||
|
||||
local US_PlanesClientSet = SET_CLIENT:New():FilterCountries( "USA" ):FilterCategories( "plane" ):FilterStart()
|
||||
local US_PlanesSpawn = SPAWN:New( "AI US" )
|
||||
local RU_AIBalancer = AIBALANCER:New( US_PlanesClientSet, US_PlanesSpawn )
|
||||
local US_PlanesSpawn1 = SPAWN:New( "AI US 1" )
|
||||
local US_PlanesSpawn2 = SPAWN:New( "AI US 2" )
|
||||
local US_AIBalancer = AIBALANCER:New( US_PlanesClientSet, { US_PlanesSpawn1, US_PlanesSpawn2 } )
|
||||
|
||||
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ):FilterStart()
|
||||
local RU_PlanesSpawn = SPAWN:New( "AI RU" )
|
||||
local RU_AIBalancer = AIBALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
|
||||
|
||||
local RU_AirbasesSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
|
||||
RU_AirbasesSet:Flush()
|
||||
RU_AIBalancer:ReturnToNearestAirbases( 10000, RU_AirbasesSet )
|
||||
--RU_AIBalancer:ReturnToHomeAirbase( 10000 )
|
||||
|
||||
local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Blue" )
|
||||
local PatrolZoneBlue = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
|
||||
local PatrolZoneB = PATROLZONE:New( PatrolZoneBlue, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 )
|
||||
US_AIBalancer:SetPatrolZone( PatrolZoneB )
|
||||
|
||||
local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Red" )
|
||||
local PatrolZoneRed = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
|
||||
local PatrolZoneR = PATROLZONE:New( PatrolZoneRed, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 )
|
||||
RU_AIBalancer:SetPatrolZone( PatrolZoneR )
|
||||
|
||||
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.
@ -0,0 +1,4 @@
|
||||
|
||||
local FACGroup = GROUP:FindByName( "FAC Group" )
|
||||
|
||||
local FACDetection = DETECTION_BASE:New( FACGroup, 1000, 250 )
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
|
||||
local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone" )
|
||||
local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
|
||||
|
||||
local PatrolGroup = GROUP:FindByName( "Patrol Group" )
|
||||
|
||||
local Patrol = PATROLZONE:New( PatrolGroup, PatrolZone, 3000, 6000, 300, 600 )
|
||||
Patrol:ManageFuel( 0.2, 60 )
|
||||
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
|
||||
local BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart()
|
||||
|
||||
local RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
|
||||
|
||||
local RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart()
|
||||
|
||||
local BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart()
|
||||
|
||||
BlueAirbaseSet:Flush()
|
||||
|
||||
RedAirbaseSet:Flush()
|
||||
|
||||
RedAirbaseHelipadSet:Flush()
|
||||
|
||||
BlueAirbaseShipSet:Flush()
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -120,19 +120,24 @@ Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
|
||||
:Array( 0, 5, 8, 8 )
|
||||
:SpawnScheduled( 10, 0.2 )
|
||||
|
||||
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
|
||||
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
|
||||
-- The vehicles will drive to waypoint 1, where it will spawn infantry that will walk to a certain point.
|
||||
-- ---------------------------------------------------------------------------------------------
|
||||
-- local InfantryGroup = Spawn_Infantry:SpawnFromUnit( GROUP:Find(...):GetUnit(1), 100, 5 )
|
||||
-- local InfantryRoute = InfantryGroup:CopyRoute( 1, 0, true, 1000 )
|
||||
-- InfantryGroup:Route( InfantryRoute )
|
||||
-- ---------------------------------------------------------------------------------------------
|
||||
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
|
||||
:Limit( 10, 10 )
|
||||
|
||||
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
|
||||
-- and the vehicle will drive to a random location within the defined zone.
|
||||
-- For this, the following code is activated within the mission on waypoint 3:
|
||||
--
|
||||
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:Find( ... ):GetUnit(1) )
|
||||
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
|
||||
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
|
||||
--
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------------
|
||||
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:Find( ... ):GetUnit(1) )
|
||||
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
|
||||
-- InfantryDropGroup:TaskRouteToZone( ZONE:New( "Target Zone" ), true, 80 )
|
||||
-- ------------------------------------------------------------------------------------------------------
|
||||
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
|
||||
:Limit( 10, 10 )
|
||||
:SpawnScheduled( 60, 0.2 )
|
||||
|
||||
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.
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -90,9 +91,30 @@ There will be as many AI GROUPS spawned as there at CLIENTS in SET</em>CLIENT no
|
||||
<li><a href="##(AIBALANCER).New">AIBALANCER.New</a>: Creates a new AIBALANCER object.</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.2) AIBALANCER returns AI to Airbases:</h2>
|
||||
<p>You can configure to have the AI to return to:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(AIBALANCER).ReturnToHomeAirbase">AIBALANCER.ReturnToHomeAirbase</a>: Returns the AI to the home <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</li>
|
||||
<li><a href="##(AIBALANCER).ReturnToNearestAirbases">AIBALANCER.ReturnToNearestAirbases</a>: Returns the AI to the nearest friendly <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.3) AIBALANCER allows AI to patrol specific zones:</h2>
|
||||
<p>Use <a href="AIBalancer.html##(AIBALANCER).SetPatrolZone">AIBalancer#AIBALANCER.SetPatrolZone</a>() to specify a zone where the AI needs to patrol.</p>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>CREDITS</h1>
|
||||
<p><strong>Dutch_Baron (James)</strong> Who you can search on the Eagle Dynamics Forums.
|
||||
Working together with James has resulted in the creation of the AIBALANCER class.
|
||||
James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)</p>
|
||||
|
||||
<p><strong>SNAFU</strong>
|
||||
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 AIBALANCER moose class.</p>
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
@ -105,6 +127,12 @@ There will be as many AI GROUPS spawned as there at CLIENTS in SET</em>CLIENT no
|
||||
<h2><a id="#(AIBALANCER)">Type <code>AIBALANCER</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).AIGroups">AIBALANCER.AIGroups</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ClassName">AIBALANCER.ClassName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
@ -114,18 +142,72 @@ There will be as many AI GROUPS spawned as there at CLIENTS in SET</em>CLIENT no
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).New">AIBALANCER:New(SetClient, SpawnAI)</a></td>
|
||||
<td class="summary">
|
||||
<p>Creates a new AIBALANCER object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).PatrolZone">AIBALANCER.PatrolZone</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).PatrolZones">AIBALANCER.PatrolZones</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ReturnAirbaseSet">AIBALANCER.ReturnAirbaseSet</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ReturnToHomeAirbase">AIBALANCER:ReturnToHomeAirbase(ReturnTresholdRange)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns the AI to the home <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ReturnToNearestAirbases">AIBALANCER:ReturnToNearestAirbases(ReturnTresholdRange, ReturnAirbaseSet)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns the AI to the nearest friendly <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ReturnTresholdRange">AIBALANCER.ReturnTresholdRange</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).SetClient">AIBALANCER.SetClient</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).SetPatrolZone">AIBALANCER:SetPatrolZone(PatrolZone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Let the AI patrol a <a href="Zone.html">Zone</a> with a given Speed range and Altitude range.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).SpawnAI">AIBALANCER.SpawnAI</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ToHomeAirbase">AIBALANCER.ToHomeAirbase</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ToNearestAirbase">AIBALANCER.ToNearestAirbase</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -161,6 +243,20 @@ There will be as many AI GROUPS spawned as there at CLIENTS in SET</em>CLIENT no
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(AIBALANCER).AIGroups" >
|
||||
<strong>AIBALANCER.AIGroups</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#string</em>
|
||||
<a id="#(AIBALANCER).ClassName" >
|
||||
<strong>AIBALANCER.ClassName</strong>
|
||||
@ -203,6 +299,112 @@ A SPAWN object that will spawn the AI units required, balancing the SetClient.</
|
||||
<p><em><a href="##(AIBALANCER)">#AIBALANCER</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="PatrolZone.html##(PATROLZONE)">PatrolZone#PATROLZONE</a></em>
|
||||
<a id="#(AIBALANCER).PatrolZone" >
|
||||
<strong>AIBALANCER.PatrolZone</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(AIBALANCER).PatrolZones" >
|
||||
<strong>AIBALANCER.PatrolZones</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a></em>
|
||||
<a id="#(AIBALANCER).ReturnAirbaseSet" >
|
||||
<strong>AIBALANCER.ReturnAirbaseSet</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(AIBALANCER).ReturnToHomeAirbase" >
|
||||
<strong>AIBALANCER:ReturnToHomeAirbase(ReturnTresholdRange)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns the AI to the home <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a> ReturnTresholdRange </em></code>:
|
||||
If there is an enemy <a href="Client.html##(CLIENT)">Client#CLIENT</a> within the ReturnTresholdRange given in meters, the AI will not return to the nearest <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(AIBALANCER).ReturnToNearestAirbases" >
|
||||
<strong>AIBALANCER:ReturnToNearestAirbases(ReturnTresholdRange, ReturnAirbaseSet)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns the AI to the nearest friendly <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a> ReturnTresholdRange </em></code>:
|
||||
If there is an enemy <a href="Client.html##(CLIENT)">Client#CLIENT</a> within the ReturnTresholdRange given in meters, the AI will not return to the nearest <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a> ReturnAirbaseSet </em></code>:
|
||||
The SET of <a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a>s to evaluate where to return to.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a></em>
|
||||
<a id="#(AIBALANCER).ReturnTresholdRange" >
|
||||
<strong>AIBALANCER.ReturnTresholdRange</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -217,6 +419,33 @@ self</p>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(AIBALANCER).SetPatrolZone" >
|
||||
<strong>AIBALANCER:SetPatrolZone(PatrolZone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Let the AI patrol a <a href="Zone.html">Zone</a> with a given Speed range and Altitude range.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="PatrolZone.html##(PATROLZONE)">PatrolZone#PATROLZONE</a> PatrolZone </em></code>:
|
||||
The <a href="PatrolZone.html">PatrolZone</a> where the AI needs to patrol.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="PatrolZone.html##(PATROLZONE)">PatrolZone#PATROLZONE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -231,6 +460,34 @@ self</p>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#boolean</em>
|
||||
<a id="#(AIBALANCER).ToHomeAirbase" >
|
||||
<strong>AIBALANCER.ToHomeAirbase</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#boolean</em>
|
||||
<a id="#(AIBALANCER).ToNearestAirbase" >
|
||||
<strong>AIBALANCER.ToNearestAirbase</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -73,22 +74,22 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Airbase</code></h1>
|
||||
|
||||
<p>AIRBASE Class</p>
|
||||
<p>This module contains the AIRBASE classes.</p>
|
||||
|
||||
<h1><a href="AIRBASE.html">AIRBASE</a> class</h1>
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>1) <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
<p>The <a href="AIRBASE.html">AIRBASE</a> class is a wrapper class to handle the DCS Airbase objects:</p>
|
||||
|
||||
<ul>
|
||||
<li>Support all DCS Airbase APIs.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Enhance with Airbase specific APIs not in the DCS Airbase API set.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h1>AIRBASE reference methods</h1>
|
||||
<h2>1.1) AIRBASE reference methods</h2>
|
||||
<p>For each DCS Airbase object alive within a running mission, a AIRBASE wrapper object (instance) will be created within the _<a href="DATABASE.html">DATABASE</a> object.
|
||||
This is done at the beginning of the mission (when the mission starts).</p>
|
||||
|
||||
@ -108,7 +109,7 @@ If the DCS Airbase object does not exist or is nil, the AIRBASE methods will ret
|
||||
|
||||
<p>IMPORTANT: ONE SHOULD NEVER SANATIZE these AIRBASE OBJECT REFERENCES! (make the AIRBASE object references nil).</p>
|
||||
|
||||
<h1>DCS AIRBASE APIs</h1>
|
||||
<h2>1.2) DCS AIRBASE APIs</h2>
|
||||
<p>The DCS Airbase APIs are used extensively within MOOSE. The AIRBASE class has for each DCS Airbase API a corresponding method.
|
||||
To be able to distinguish easily in your code the difference between a AIRBASE API call and a DCS Airbase API call,
|
||||
the first letter of the method is also capitalized. So, by example, the DCS Airbase method <a href="DCSAirbase.html##(Airbase).getName">DCSAirbase#Airbase.getName</a>()
|
||||
@ -157,6 +158,12 @@ is implemented in the AIRBASE class as <a href="##(AIRBASE).GetName">AIRBASE.Get
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIRBASE).GetCallSign">AIRBASE:GetCallSign()</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns the Airbase's callsign - the localized string.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(AIRBASE).GetCategory">AIRBASE:GetCategory()</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns the DCS Airbase category as defined within the DCS Airbase Descriptor.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -362,6 +369,24 @@ The DCS Airbase is not existing or alive. </p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(AIRBASE).GetCategory" >
|
||||
<strong>AIRBASE:GetCategory()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns the DCS Airbase category as defined within the DCS Airbase Descriptor.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="DCSAirbase.html##(Airbase.Category)">DCSAirbase#Airbase.Category</a>:</em>
|
||||
The DCS Airbase Category</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(AIRBASE).GetCategoryName" >
|
||||
<strong>AIRBASE:GetCategoryName()</strong>
|
||||
</a>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -73,28 +74,30 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Database</code></h1>
|
||||
|
||||
<p>Manage the mission database.</p>
|
||||
<p>This module contains the DATABASE class, managing the database of mission objects.</p>
|
||||
|
||||
|
||||
|
||||
<h1><a href="##(DATABASE)">#DATABASE</a> class</h1>
|
||||
<hr/>
|
||||
|
||||
<h1>1) <a href="Database.html##(DATABASE)">Database#DATABASE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
<p>Mission designers can use the DATABASE class to refer to:</p>
|
||||
|
||||
<ul>
|
||||
<li>UNITS</li>
|
||||
<li>GROUPS</li>
|
||||
<li>players</li>
|
||||
<li>alive players</li>
|
||||
<li>CLIENTS</li>
|
||||
<li>alive CLIENTS</li>
|
||||
<li>AIRPORTS</li>
|
||||
<li>PLAYERSJOINED</li>
|
||||
<li>PLAYERS</li>
|
||||
</ul>
|
||||
|
||||
<p>On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Gruop templates as defined within the Mission Editor.</p>
|
||||
<p>On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Group TEMPLATES as defined within the Mission Editor.</p>
|
||||
|
||||
<p>Moose will automatically create one instance of the DATABASE class into the <strong>global</strong> object _DATABASE.
|
||||
Moose refers to _DATABASE within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.</p>
|
||||
|
||||
<h1>DATABASE iterators:</h1>
|
||||
<h2>1.1) DATABASE iterators</h2>
|
||||
<p>You can iterate the database with the available iterator methods.
|
||||
The iterator methods will walk the DATABASE set, and call for each element within the set a function that you provide.
|
||||
The following iterator methods are currently available within the DATABASE:</p>
|
||||
@ -102,13 +105,15 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<ul>
|
||||
<li><a href="##(DATABASE).ForEachUnit">DATABASE.ForEachUnit</a>: Calls a function for each <a href="UNIT.html">UNIT</a> it finds within the DATABASE.</li>
|
||||
<li><a href="##(DATABASE).ForEachGroup">DATABASE.ForEachGroup</a>: Calls a function for each <a href="GROUP.html">GROUP</a> it finds within the DATABASE.</li>
|
||||
<li><a href="##(DATABASE).ForEachPlayer">DATABASE.ForEachPlayer</a>: Calls a function for each player it finds within the DATABASE.</li>
|
||||
<li><a href="##(DATABASE).ForEachPlayerAlive">DATABASE.ForEachPlayerAlive</a>: Calls a function for each alive player it finds within the DATABASE.</li>
|
||||
<li><a href="##(DATABASE).ForEachPlayer">DATABASE.ForEachPlayer</a>: Calls a function for each alive player it finds within the DATABASE.</li>
|
||||
<li><a href="##(DATABASE).ForEachPlayerJoined">DATABASE.ForEachPlayerJoined</a>: Calls a function for each joined player it finds within the DATABASE.</li>
|
||||
<li><a href="##(DATABASE).ForEachClient">DATABASE.ForEachClient</a>: Calls a function for each <a href="CLIENT.html">CLIENT</a> it finds within the DATABASE.</li>
|
||||
<li><a href="##(DATABASE).ForEachClientAlive">DATABASE.ForEachClientAlive</a>: Calls a function for each alive <a href="CLIENT.html">CLIENT</a> it finds within the DATABASE.
|
||||
</li>
|
||||
<li><a href="##(DATABASE).ForEachClientAlive">DATABASE.ForEachClientAlive</a>: Calls a function for each alive <a href="CLIENT.html">CLIENT</a> it finds within the DATABASE.</li>
|
||||
</ul>
|
||||
|
||||
<hr/>
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
@ -121,6 +126,18 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<h2><a id="#(DATABASE)">Type <code>DATABASE</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).AIRBASES">DATABASE.AIRBASES</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).AddAirbase">DATABASE:AddAirbase(DCSAirbaseName)</a></td>
|
||||
<td class="summary">
|
||||
<p>Adds a Airbase based on the Airbase Name in the DATABASE.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).AddClient">DATABASE:AddClient(ClientName)</a></td>
|
||||
<td class="summary">
|
||||
<p>Adds a CLIENT based on the ClientName in the DATABASE.</p>
|
||||
@ -157,15 +174,15 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).CLIENTSALIVE">DATABASE.CLIENTSALIVE</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ClassName">DATABASE.ClassName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ClassName">DATABASE.ClassName</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).DeleteAirbase">DATABASE:DeleteAirbase(DCSAirbaseName)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
<p>Deletes a Airbase from the DATABASE based on the Airbase Name.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -184,6 +201,12 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).DeleteUnit">DATABASE:DeleteUnit(DCSUnitName)</a></td>
|
||||
<td class="summary">
|
||||
<p>Deletes a Unit from the DATABASE based on the Unit Name.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).FindAirbase">DATABASE:FindAirbase(AirbaseName)</a></td>
|
||||
<td class="summary">
|
||||
<p>Finds a AIRBASE based on the AirbaseName.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -211,7 +234,7 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEach">DATABASE:ForEach(IteratorFunction, arg, Set)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEach">DATABASE:ForEach(IteratorFunction, FinalizeFunction, arg, Set)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the DATABASE and call an iterator function for the given set, providing the Object for each element within the set and optional parameters.</p>
|
||||
</td>
|
||||
@ -220,12 +243,6 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachClient">DATABASE:ForEachClient(IteratorFunction, ...)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachClientAlive">DATABASE:ForEachClientAlive(IteratorFunction, ...)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the DATABASE and call an iterator function for each <strong>ALIVE</strong> CLIENT, providing the CLIENT to the function and optional parameters.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -237,17 +254,17 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachPlayer">DATABASE:ForEachPlayer(IteratorFunction, ...)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the DATABASE and call an iterator function for each player, providing the player name and optional parameters.</p>
|
||||
<p>Iterate the DATABASE and call an iterator function for each <strong>ALIVE</strong> player, providing the player name and optional parameters.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachPlayerAlive">DATABASE:ForEachPlayerAlive(IteratorFunction, ...)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachPlayerJoined">DATABASE:ForEachPlayerJoined(IteratorFunction, ...)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> player, providing the Unit of the player and optional parameters.</p>
|
||||
<p>Iterate the DATABASE and call an iterator function for each player who has joined the mission, providing the Unit of the player and optional parameters.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachUnit">DATABASE:ForEachUnit(IteratorFunction, ...)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).ForEachUnit">DATABASE:ForEachUnit(IteratorFunction, FinalizeFunction, ...)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
|
||||
</td>
|
||||
@ -256,12 +273,24 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).GROUPS">DATABASE.GROUPS</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).GetCategoryFromAirbase">DATABASE:GetCategoryFromAirbase(AirbaseName)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).GetCategoryFromClientTemplate">DATABASE:GetCategoryFromClientTemplate(ClientName)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).GetCoalitionFromAirbase">DATABASE:GetCoalitionFromAirbase(AirbaseName)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -301,7 +330,7 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).PLAYERSALIVE">DATABASE.PLAYERSALIVE</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE).PLAYERSJOINED">DATABASE.PLAYERSJOINED</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
@ -358,6 +387,12 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._EventOnPlayerLeaveUnit">DATABASE:_EventOnPlayerLeaveUnit(Event)</a></td>
|
||||
<td class="summary">
|
||||
<p>Handles the OnPlayerLeaveUnit event to clean the active players table.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(DATABASE)._RegisterAirbases">DATABASE:_RegisterAirbases()</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -423,6 +458,41 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(DATABASE).AIRBASES" >
|
||||
<strong>DATABASE.AIRBASES</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).AddAirbase" >
|
||||
<strong>DATABASE:AddAirbase(DCSAirbaseName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Adds a Airbase based on the Airbase Name in the DATABASE.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> DCSAirbaseName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).AddClient" >
|
||||
<strong>DATABASE:AddClient(ClientName)</strong>
|
||||
</a>
|
||||
@ -547,9 +617,9 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(DATABASE).CLIENTSALIVE" >
|
||||
<strong>DATABASE.CLIENTSALIVE</strong>
|
||||
<em>#string</em>
|
||||
<a id="#(DATABASE).ClassName" >
|
||||
<strong>DATABASE.ClassName</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -561,15 +631,22 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#string</em>
|
||||
<a id="#(DATABASE).ClassName" >
|
||||
<strong>DATABASE.ClassName</strong>
|
||||
<a id="#(DATABASE).DeleteAirbase" >
|
||||
<strong>DATABASE:DeleteAirbase(DCSAirbaseName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Deletes a Airbase from the DATABASE based on the Airbase Name.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> DCSAirbaseName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -638,6 +715,32 @@ The following iterator methods are currently available within the DATABASE:</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).FindAirbase" >
|
||||
<strong>DATABASE:FindAirbase(AirbaseName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Finds a AIRBASE based on the AirbaseName.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string AirbaseName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>:</em>
|
||||
The found AIRBASE.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).FindClient" >
|
||||
<strong>DATABASE:FindClient(ClientName)</strong>
|
||||
</a>
|
||||
@ -743,7 +846,7 @@ The found Unit.</p>
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).ForEach" >
|
||||
<strong>DATABASE:ForEach(IteratorFunction, arg, Set)</strong>
|
||||
<strong>DATABASE:ForEach(IteratorFunction, FinalizeFunction, arg, Set)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -760,6 +863,11 @@ The function that will be called when there is an alive player in the database.<
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> FinalizeFunction </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> arg </em></code>: </p>
|
||||
|
||||
</li>
|
||||
@ -811,38 +919,6 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).ForEachClientAlive" >
|
||||
<strong>DATABASE:ForEachClientAlive(IteratorFunction, ...)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the DATABASE and call an iterator function for each <strong>ALIVE</strong> CLIENT, providing the CLIENT to the function and optional parameters.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#function IteratorFunction </em></code>:
|
||||
The function that will be called when there is an alive CLIENT in the database. The function needs to accept a CLIENT parameter.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> ... </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(DATABASE)">#DATABASE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).ForEachGroup" >
|
||||
<strong>DATABASE:ForEachGroup(IteratorFunction, ...)</strong>
|
||||
</a>
|
||||
@ -881,7 +957,7 @@ self</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the DATABASE and call an iterator function for each player, providing the player name and optional parameters.</p>
|
||||
<p>Iterate the DATABASE and call an iterator function for each <strong>ALIVE</strong> player, providing the player name and optional parameters.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -907,20 +983,20 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).ForEachPlayerAlive" >
|
||||
<strong>DATABASE:ForEachPlayerAlive(IteratorFunction, ...)</strong>
|
||||
<a id="#(DATABASE).ForEachPlayerJoined" >
|
||||
<strong>DATABASE:ForEachPlayerJoined(IteratorFunction, ...)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the DATABASE and call an iterator function for each <strong>alive</strong> player, providing the Unit of the player and optional parameters.</p>
|
||||
<p>Iterate the DATABASE and call an iterator function for each player who has joined the mission, providing the Unit of the player and optional parameters.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#function IteratorFunction </em></code>:
|
||||
The function that will be called when there is an alive player in the database. The function needs to accept a UNIT parameter.</p>
|
||||
The function that will be called when there is was a player in the database. The function needs to accept a UNIT parameter.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
@ -940,7 +1016,7 @@ self</p>
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).ForEachUnit" >
|
||||
<strong>DATABASE:ForEachUnit(IteratorFunction, ...)</strong>
|
||||
<strong>DATABASE:ForEachUnit(IteratorFunction, FinalizeFunction, ...)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -957,6 +1033,11 @@ The function that will be called when there is an alive UNIT in the database. Th
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> FinalizeFunction </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> ... </em></code>: </p>
|
||||
|
||||
</li>
|
||||
@ -980,6 +1061,27 @@ self</p>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).GetCategoryFromAirbase" >
|
||||
<strong>DATABASE:GetCategoryFromAirbase(AirbaseName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> AirbaseName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -1006,6 +1108,27 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).GetCoalitionFromAirbase" >
|
||||
<strong>DATABASE:GetCoalitionFromAirbase(AirbaseName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> AirbaseName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE).GetCoalitionFromClientTemplate" >
|
||||
<strong>DATABASE:GetCoalitionFromClientTemplate(ClientName)</strong>
|
||||
</a>
|
||||
@ -1120,8 +1243,8 @@ DBObject = DATABASE:New()</code></pre>
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(DATABASE).PLAYERSALIVE" >
|
||||
<strong>DATABASE.PLAYERSALIVE</strong>
|
||||
<a id="#(DATABASE).PLAYERSJOINED" >
|
||||
<strong>DATABASE.PLAYERSJOINED</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -1311,6 +1434,19 @@ self</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(DATABASE)._RegisterAirbases" >
|
||||
<strong>DATABASE:_RegisterAirbases()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -320,6 +321,18 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(EVENTDATA).IniDCSUnitName">EVENTDATA.IniDCSUnitName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(EVENTDATA).IniUnit">EVENTDATA.IniUnit</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(EVENTDATA).IniUnitName">EVENTDATA.IniUnitName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -344,6 +357,18 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(EVENTDATA).TgtDCSUnitName">EVENTDATA.TgtDCSUnitName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(EVENTDATA).TgtUnit">EVENTDATA.TgtUnit</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(EVENTDATA).TgtUnitName">EVENTDATA.TgtUnitName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -1591,6 +1616,34 @@ The self instance of the class for which the event is.</p>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="Unit.html##(UNIT)">Unit#UNIT</a></em>
|
||||
<a id="#(EVENTDATA).IniUnit" >
|
||||
<strong>EVENTDATA.IniUnit</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#string</em>
|
||||
<a id="#(EVENTDATA).IniUnitName" >
|
||||
<strong>EVENTDATA.IniUnitName</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -1643,6 +1696,34 @@ The self instance of the class for which the event is.</p>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="Unit.html##(UNIT)">Unit#UNIT</a></em>
|
||||
<a id="#(EVENTDATA).TgtUnit" >
|
||||
<strong>EVENTDATA.TgtUnit</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#string</em>
|
||||
<a id="#(EVENTDATA).TgtUnitName" >
|
||||
<strong>EVENTDATA.TgtUnitName</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -143,6 +144,7 @@ This is different from the EnRoute tasks, where the targets of the task need to
|
||||
<li><a href="##(GROUP).TaskRouteToVec2">GROUP.TaskRouteToVec2</a>: (AIR + GROUND) Make the Group move to a given point.</li>
|
||||
<li><a href="##(GROUP).TaskRouteToVec3">GROUP.TaskRouteToVec3</a>: (AIR + GROUND) Make the Group move to a given point.</li>
|
||||
<li><a href="##(GROUP).TaskRouteToZone">GROUP.TaskRouteToZone</a>: (AIR + GROUND) Route the group to a given zone.</li>
|
||||
<li><a href="##(GROUP).TaskReturnToBase">GROUP.TaskReturnToBase</a>: (AIR) Route the group to an airbase.</li>
|
||||
</ul>
|
||||
|
||||
<h3>1.2.2) EnRoute task methods</h3>
|
||||
@ -281,6 +283,12 @@ Use the following Zone validation methods on the group:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).CommandDoScript">GROUP:CommandDoScript(DoScript)</a></td>
|
||||
<td class="summary">
|
||||
<p>Do Script command</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).CommandStopRoute">GROUP:CommandStopRoute(StopRoute, Index)</a></td>
|
||||
<td class="summary">
|
||||
<p>Perform stop route command</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -493,6 +501,12 @@ Use the following Zone validation methods on the group:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).GetTaskRoute">GROUP:GetTaskRoute()</a></td>
|
||||
<td class="summary">
|
||||
<p>Return the mission route of the group.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).GetTemplate">GROUP:GetTemplate()</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -727,12 +741,25 @@ Use the following Zone validation methods on the group:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).Register">GROUP:Register(GroupName)</a></td>
|
||||
<td class="summary">
|
||||
<p>Create a new GROUP from a DCSGroup</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).Respawn">GROUP:Respawn(Template)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).Route">GROUP:Route(GoPoints)</a></td>
|
||||
<td class="summary">
|
||||
<p>Make the group to follow a given route.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).RouteReturnToAirbase">GROUP:RouteReturnToAirbase(ReturnAirbase, Speed)</a></td>
|
||||
<td class="summary">
|
||||
<p>(AIR) Return the Group to an <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>
|
||||
A speed can be given in km/h.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -934,7 +961,7 @@ Use the following Zone validation methods on the group:</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).WayPointInitialize">GROUP:WayPointInitialize()</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).WayPointInitialize">GROUP:WayPointInitialize(WayPoints)</a></td>
|
||||
<td class="summary">
|
||||
<p> Retrieve the group mission and allow to place function hooks within the mission waypoint plan.</p>
|
||||
</td>
|
||||
@ -1070,6 +1097,37 @@ All units on the ground result.</p>
|
||||
<p><em><a href="##(DCSCommand)">#DCSCommand</a>:</em></p>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).CommandStopRoute" >
|
||||
<strong>GROUP:CommandStopRoute(StopRoute, Index)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Perform stop route command</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#boolean StopRoute </em></code>: </p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Index </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="DCSTask.html##(Task)">DCSTask#Task</a>:</em></p>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -1973,6 +2031,19 @@ The MissionTemplate</p>
|
||||
<p><em>#table:</em>
|
||||
The mission route defined by points.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).GetTemplate" >
|
||||
<strong>GROUP:GetTemplate()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2815,6 +2886,27 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).Respawn" >
|
||||
<strong>GROUP:Respawn(Template)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> Template </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).Route" >
|
||||
<strong>GROUP:Route(GoPoints)</strong>
|
||||
</a>
|
||||
@ -2842,6 +2934,43 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).RouteReturnToAirbase" >
|
||||
<strong>GROUP:RouteReturnToAirbase(ReturnAirbase, Speed)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>(AIR) Return the Group to an <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>
|
||||
A speed can be given in km/h.</p>
|
||||
|
||||
|
||||
<p>A given formation can be given.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> ReturnAirbase </em></code>:
|
||||
The <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> to return to.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number Speed </em></code>:
|
||||
(optional) The speed.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#string:</em>
|
||||
The route</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).SetCommand" >
|
||||
<strong>GROUP:SetCommand(DCSCommand)</strong>
|
||||
</a>
|
||||
@ -4103,7 +4232,7 @@ The waypoint function to be called when the group moves over the waypoint. The w
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).WayPointInitialize" >
|
||||
<strong>GROUP:WayPointInitialize()</strong>
|
||||
<strong>GROUP:WayPointInitialize(WayPoints)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -4115,6 +4244,15 @@ The waypoint function to be called when the group moves over the waypoint. The w
|
||||
Use the method @{Group@GROUP:WayPointExecute) to start the execution of the new mission plan.
|
||||
Note that when WayPointInitialize is called, the Mission of the group is RESTARTED!</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#table WayPoints </em></code>:
|
||||
If WayPoints is given, then use the route.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(GROUP)">#GROUP</a>:</em></p>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li>Mission</li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -73,11 +74,13 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>MissileTrainer</code></h1>
|
||||
|
||||
<p>Provides missile training functions.</p>
|
||||
<p>This module contains the MISSILETRAINER class.</p>
|
||||
|
||||
|
||||
|
||||
<h1><a href="##(MISSILETRAINER)">#MISSILETRAINER</a> class</h1>
|
||||
<hr/>
|
||||
|
||||
<h1>1) <a href="MissileTrainer.html##(MISSILETRAINER)">MissileTrainer#MISSILETRAINER</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
<p>The <a href="##(MISSILETRAINER)">#MISSILETRAINER</a> class uses the DCS world messaging system to be alerted of any missiles fired, and when a missile would hit your aircraft,
|
||||
the class will destroy the missile within a certain range, to avoid damage to your aircraft.
|
||||
It suports the following functionality:</p>
|
||||
@ -133,7 +136,7 @@ It suports the following functionality:</p>
|
||||
</ul>
|
||||
|
||||
|
||||
<h1>MISSILETRAINER construction methods:</h1>
|
||||
<h2>1.1) MISSILETRAINER construction methods:</h2>
|
||||
<p>Create a new MISSILETRAINER object with the <a href="##(MISSILETRAINER).New">MISSILETRAINER.New</a> method:</p>
|
||||
|
||||
<ul>
|
||||
@ -142,7 +145,7 @@ It suports the following functionality:</p>
|
||||
|
||||
<p>MISSILETRAINER will collect each unit declared in the mission with a skill level "Client" and "Player", and will monitor the missiles shot at those.</p>
|
||||
|
||||
<h1>MISSILETRAINER initialization methods:</h1>
|
||||
<h2>1.2) MISSILETRAINER initialization methods:</h2>
|
||||
<p>A MISSILETRAINER object will behave differently based on the usage of initialization methods:</p>
|
||||
|
||||
<ul>
|
||||
@ -158,6 +161,14 @@ It suports the following functionality:</p>
|
||||
<li><a href="##(MISSILETRAINER).InitMenusOnOff">MISSILETRAINER.InitMenusOnOff</a>: Allows to configure the options through the radio menu.</li>
|
||||
</ul>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>CREDITS</h1>
|
||||
<p><strong>Stuka (Danny)</strong> Who you can search on the Eagle Dynamics Forums.
|
||||
Working together with Danny has resulted in the MISSILETRAINER class.
|
||||
Danny has shared his ideas and together we made a design.
|
||||
Together with the <strong>476 virtual team</strong>, we tested the MISSILETRAINER class, and got much positive feedback!</p>
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li>NOTASK</li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li>PICKUPTASK</li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
679
Moose Training/Documentation/PatrolZone.html
Normal file
679
Moose Training/Documentation/PatrolZone.html
Normal file
@ -0,0 +1,679 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div>
|
||||
<div id="main">
|
||||
<div id="navigation">
|
||||
<h2>Modules</h2>
|
||||
<ul><li>
|
||||
<a href="index.html">index</a>
|
||||
</li></ul>
|
||||
<ul>
|
||||
<li><a href="AIBalancer.html">AIBalancer</a></li>
|
||||
<li><a href="Airbase.html">Airbase</a></li>
|
||||
<li><a href="AirbasePolice.html">AirbasePolice</a></li>
|
||||
<li><a href="Base.html">Base</a></li>
|
||||
<li><a href="CARGO.html">CARGO</a></li>
|
||||
<li><a href="CleanUp.html">CleanUp</a></li>
|
||||
<li><a href="Client.html">Client</a></li>
|
||||
<li><a href="DCSAirbase.html">DCSAirbase</a></li>
|
||||
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
|
||||
<li><a href="DCSCommand.html">DCSCommand</a></li>
|
||||
<li><a href="DCSController.html">DCSController</a></li>
|
||||
<li><a href="DCSGroup.html">DCSGroup</a></li>
|
||||
<li><a href="DCSObject.html">DCSObject</a></li>
|
||||
<li><a href="DCSTask.html">DCSTask</a></li>
|
||||
<li><a href="DCSTypes.html">DCSTypes</a></li>
|
||||
<li><a href="DCSUnit.html">DCSUnit</a></li>
|
||||
<li><a href="DCSWorld.html">DCSWorld</a></li>
|
||||
<li><a href="DCStimer.html">DCStimer</a></li>
|
||||
<li><a href="DEPLOYTASK.html">DEPLOYTASK</a></li>
|
||||
<li><a href="DESTROYBASETASK.html">DESTROYBASETASK</a></li>
|
||||
<li><a href="DESTROYGROUPSTASK.html">DESTROYGROUPSTASK</a></li>
|
||||
<li><a href="DESTROYRADARSTASK.html">DESTROYRADARSTASK</a></li>
|
||||
<li><a href="DESTROYUNITTYPESTASK.html">DESTROYUNITTYPESTASK</a></li>
|
||||
<li><a href="Database.html">Database</a></li>
|
||||
<li><a href="Escort.html">Escort</a></li>
|
||||
<li><a href="Event.html">Event</a></li>
|
||||
<li><a href="GOHOMETASK.html">GOHOMETASK</a></li>
|
||||
<li><a href="Group.html">Group</a></li>
|
||||
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
|
||||
<li><a href="Menu.html">Menu</a></li>
|
||||
<li><a href="Message.html">Message</a></li>
|
||||
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li>PatrolZone</li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
<li><a href="Scheduler.html">Scheduler</a></li>
|
||||
<li><a href="Scoring.html">Scoring</a></li>
|
||||
<li><a href="Sead.html">Sead</a></li>
|
||||
<li><a href="Set.html">Set</a></li>
|
||||
<li><a href="Spawn.html">Spawn</a></li>
|
||||
<li><a href="Static.html">Static</a></li>
|
||||
<li><a href="StaticObject.html">StaticObject</a></li>
|
||||
<li><a href="TASK.html">TASK</a></li>
|
||||
<li><a href="Unit.html">Unit</a></li>
|
||||
<li><a href="Zone.html">Zone</a></li>
|
||||
<li><a href="env.html">env</a></li>
|
||||
<li><a href="land.html">land</a></li>
|
||||
<li><a href="routines.html">routines</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Module <code>PatrolZone</code></h1>
|
||||
|
||||
<p>This module contains the PATROLZONE class.</p>
|
||||
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>1) <a href="Patrol.html##(PATROLZONE)">Patrol#PATROLZONE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
<p>The <a href="Patrol.html##(PATROLZONE)">Patrol#PATROLZONE</a> class implements the core functions to patrol a <a href="Zone.html">Zone</a>.</p>
|
||||
|
||||
<h2>1.1) PATROLZONE constructor:</h2>
|
||||
<p><a href="PatrolZone.html##(PATROLZONE).New">PatrolZone#PATROLZONE.New</a>(): Creates a new PATROLZONE object.</p>
|
||||
|
||||
<h2>1.2) Modify the PATROLZONE parameters:</h2>
|
||||
<p>The following methods are available to modify the parameters of a PATROLZONE object:</p>
|
||||
|
||||
<pre><code>* <a href="PatrolZone.html##(PATROLZONE).SetGroup">PatrolZone#PATROLZONE.SetGroup</a>(): Set the AI Patrol Group.
|
||||
* <a href="PatrolZone.html##(PATROLZONE).SetSpeed">PatrolZone#PATROLZONE.SetSpeed</a>(): Set the patrol speed of the AI, for the next patrol.
|
||||
* <a href="PatrolZone.html##(PATROLZONE).SetAltitude">PatrolZone#PATROLZONE.SetAltitude</a>(): Set altitude of the AI, for the next patrol.
|
||||
</code></pre>
|
||||
|
||||
<h2>1.3) Manage the out of fuel in the PATROLZONE:</h2>
|
||||
<p>When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.
|
||||
Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
|
||||
When the fuel treshold is reached, the PatrolGroup will continue for a given time its patrol task in orbit, while a new PatrolGroup is targetted to the PATROLZONE.
|
||||
Once the time is finished, the old PatrolGroup will return to the base.
|
||||
Use the method <a href="PatrolZone.html##(PATROLZONE).ManageFuel">PatrolZone#PATROLZONE.ManageFuel</a>() to have this proces in place.</p>
|
||||
|
||||
<hr/>
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="#PATROLZONE">PATROLZONE</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="#_NewPatrolRoute">_NewPatrolRoute(PatrolGroup)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a id="#(PATROLZONE)">Type <code>PATROLZONE</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).ClassName">PATROLZONE.ClassName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).ManageFuel">PATROLZONE:ManageFuel(PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime)</a></td>
|
||||
<td class="summary">
|
||||
<p>When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).New">PATROLZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed)</a></td>
|
||||
<td class="summary">
|
||||
<p>Creates a new PATROLZONE object, taking a <a href="Group.html">Group</a> object as a parameter.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).NewPatrolRoute">PATROLZONE:NewPatrolRoute()</a></td>
|
||||
<td class="summary">
|
||||
<p>Defines a new patrol route using the <a href="PatrolZone.html">PatrolZone</a> parameters and settings.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolCeilingAltitude">PATROLZONE.PatrolCeilingAltitude</a></td>
|
||||
<td class="summary">
|
||||
<p>The highest altitude in meters where to execute the patrol.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolFloorAltitude">PATROLZONE.PatrolFloorAltitude</a></td>
|
||||
<td class="summary">
|
||||
<p>The lowest altitude in meters where to execute the patrol.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolFuelTresholdPercentage">PATROLZONE.PatrolFuelTresholdPercentage</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolGroup">PATROLZONE.PatrolGroup</a></td>
|
||||
<td class="summary">
|
||||
<p>The <a href="Group.html">Group</a> patrolling.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolGroupTemplateName">PATROLZONE.PatrolGroupTemplateName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolManageFuel">PATROLZONE.PatrolManageFuel</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolMaxSpeed">PATROLZONE.PatrolMaxSpeed</a></td>
|
||||
<td class="summary">
|
||||
<p>The maximum speed of the <a href="Group.html">Group</a> in km/h.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolMinSpeed">PATROLZONE.PatrolMinSpeed</a></td>
|
||||
<td class="summary">
|
||||
<p>The minimum speed of the <a href="Group.html">Group</a> in km/h.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolOutOfFuelMonitor">PATROLZONE.PatrolOutOfFuelMonitor</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolOutOfFuelOrbitTime">PATROLZONE.PatrolOutOfFuelOrbitTime</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).PatrolZone">PATROLZONE.PatrolZone</a></td>
|
||||
<td class="summary">
|
||||
<p>The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).SetAltitude">PATROLZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)</a></td>
|
||||
<td class="summary">
|
||||
<p>Sets the floor and ceiling altitude of the patrol.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).SetGroup">PATROLZONE:SetGroup(PatrolGroup)</a></td>
|
||||
<td class="summary">
|
||||
<p>Set the <a href="Group.html">Group</a> to act as the Patroller.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).SetSpeed">PATROLZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)</a></td>
|
||||
<td class="summary">
|
||||
<p>Sets (modifies) the minimum and maximum speed of the patrol.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(PATROLZONE).SpawnPatrolGroup">PATROLZONE.SpawnPatrolGroup</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="##(PATROLZONE)">#PATROLZONE</a></em>
|
||||
<a id="PATROLZONE" >
|
||||
<strong>PATROLZONE</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="_NewPatrolRoute" >
|
||||
<strong>_NewPatrolRoute(PatrolGroup)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Group.html##(GROUP)">Group#GROUP</a> PatrolGroup </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<h2><a id="#(PatrolZone)" >Type <code>PatrolZone</code></a></h2>
|
||||
|
||||
<h2><a id="#(PATROLZONE)" >Type <code>PATROLZONE</code></a></h2>
|
||||
|
||||
<p>PATROLZONE class</p>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#string</em>
|
||||
<a id="#(PATROLZONE).ClassName" >
|
||||
<strong>PATROLZONE.ClassName</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(PATROLZONE).ManageFuel" >
|
||||
<strong>PATROLZONE:ManageFuel(PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.</p>
|
||||
|
||||
|
||||
<p>Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
|
||||
When the fuel treshold is reached, the PatrolGroup will continue for a given time its patrol task in orbit, while a new PatrolGroup is targetted to the PATROLZONE.
|
||||
Once the time is finished, the old PatrolGroup will return to the base.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number PatrolFuelTresholdPercentage </em></code>:
|
||||
The treshold in percentage (between 0 and 1) when the PatrolGroup is considered to get out of fuel.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number PatrolOutOfFuelOrbitTime </em></code>:
|
||||
The amount of seconds the out of fuel PatrolGroup will orbit before returning to the base.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(PATROLZONE).New" >
|
||||
<strong>PATROLZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Creates a new PATROLZONE object, taking a <a href="Group.html">Group</a> object as a parameter.</p>
|
||||
|
||||
|
||||
<p>The GROUP needs to be alive.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a> PatrolZone </em></code>:
|
||||
The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a> PatrolFloorAltitude </em></code>:
|
||||
The lowest altitude in meters where to execute the patrol.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a> PatrolCeilingAltitude </em></code>:
|
||||
The highest altitude in meters where to execute the patrol.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> PatrolMinSpeed </em></code>:
|
||||
The minimum speed of the <a href="Group.html">Group</a> in km/h.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> PatrolMaxSpeed </em></code>:
|
||||
The maximum speed of the <a href="Group.html">Group</a> in km/h.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
|
||||
self</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>-- Define a new PATROLZONE Object. This PatrolArea will patrol a group within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
|
||||
PatrolZone = ZONE:New( 'PatrolZone' )
|
||||
PatrolGroup = GROUP:FindByName( "Patrol Group" )
|
||||
PatrolArea = PATROLZONE:New( PatrolGroup, PatrolZone, 3000, 6000, 600, 900 )</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(PATROLZONE).NewPatrolRoute" >
|
||||
<strong>PATROLZONE:NewPatrolRoute()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Defines a new patrol route using the <a href="PatrolZone.html">PatrolZone</a> parameters and settings.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a></em>
|
||||
<a id="#(PATROLZONE).PatrolCeilingAltitude" >
|
||||
<strong>PATROLZONE.PatrolCeilingAltitude</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The highest altitude in meters where to execute the patrol.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a></em>
|
||||
<a id="#(PATROLZONE).PatrolFloorAltitude" >
|
||||
<strong>PATROLZONE.PatrolFloorAltitude</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The lowest altitude in meters where to execute the patrol.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(PATROLZONE).PatrolFuelTresholdPercentage" >
|
||||
<strong>PATROLZONE.PatrolFuelTresholdPercentage</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="Group.html##(GROUP)">Group#GROUP</a></em>
|
||||
<a id="#(PATROLZONE).PatrolGroup" >
|
||||
<strong>PATROLZONE.PatrolGroup</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The <a href="Group.html">Group</a> patrolling.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(PATROLZONE).PatrolGroupTemplateName" >
|
||||
<strong>PATROLZONE.PatrolGroupTemplateName</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#boolean</em>
|
||||
<a id="#(PATROLZONE).PatrolManageFuel" >
|
||||
<strong>PATROLZONE.PatrolManageFuel</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a></em>
|
||||
<a id="#(PATROLZONE).PatrolMaxSpeed" >
|
||||
<strong>PATROLZONE.PatrolMaxSpeed</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The maximum speed of the <a href="Group.html">Group</a> in km/h.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a></em>
|
||||
<a id="#(PATROLZONE).PatrolMinSpeed" >
|
||||
<strong>PATROLZONE.PatrolMinSpeed</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The minimum speed of the <a href="Group.html">Group</a> in km/h.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(PATROLZONE).PatrolOutOfFuelMonitor" >
|
||||
<strong>PATROLZONE.PatrolOutOfFuelMonitor</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(PATROLZONE).PatrolOutOfFuelOrbitTime" >
|
||||
<strong>PATROLZONE.PatrolOutOfFuelOrbitTime</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></em>
|
||||
<a id="#(PATROLZONE).PatrolZone" >
|
||||
<strong>PATROLZONE.PatrolZone</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(PATROLZONE).SetAltitude" >
|
||||
<strong>PATROLZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Sets the floor and ceiling altitude of the patrol.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a> PatrolFloorAltitude </em></code>:
|
||||
The lowest altitude in meters where to execute the patrol.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Altitude)">DCSTypes#Altitude</a> PatrolCeilingAltitude </em></code>:
|
||||
The highest altitude in meters where to execute the patrol.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(PATROLZONE).SetGroup" >
|
||||
<strong>PATROLZONE:SetGroup(PatrolGroup)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Set the <a href="Group.html">Group</a> to act as the Patroller.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Group.html##(GROUP)">Group#GROUP</a> PatrolGroup </em></code>:
|
||||
The <a href="Group.html">Group</a> patrolling.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(PATROLZONE).SetSpeed" >
|
||||
<strong>PATROLZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Sets (modifies) the minimum and maximum speed of the patrol.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> PatrolMinSpeed </em></code>:
|
||||
The minimum speed of the <a href="Group.html">Group</a> in km/h.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> PatrolMaxSpeed </em></code>:
|
||||
The maximum speed of the <a href="Group.html">Group</a> in km/h.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(PATROLZONE)">#PATROLZONE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(PATROLZONE).SpawnPatrolGroup" >
|
||||
<strong>PATROLZONE.SpawnPatrolGroup</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li>Point</li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -121,12 +122,30 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC2).ClassName">POINT_VEC2.ClassName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC2).DistanceFromPointVec2">POINT_VEC2:DistanceFromPointVec2(PointVec2Reference)</a></td>
|
||||
<td class="summary">
|
||||
<p>Calculate the distance from a reference <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC2).DistanceFromVec2">POINT_VEC2:DistanceFromVec2(Vec2Reference)</a></td>
|
||||
<td class="summary">
|
||||
<p>Calculate the distance from a reference <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC2).New">POINT_VEC2:New(x, y, LandHeightAdd)</a></td>
|
||||
<td class="summary">
|
||||
<p>Create a new POINT_VEC2 object.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC2).PointVec2">POINT_VEC2.PointVec2</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -179,6 +198,30 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).New">POINT_VEC3:New(x, y, z)</a></td>
|
||||
<td class="summary">
|
||||
<p>Create a new POINT_VEC3 object.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).RoutePointAction">POINT_VEC3.RoutePointAction</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).RoutePointAir">POINT_VEC3:RoutePointAir(AltType, Type, Action, Speed, SpeedLocked)</a></td>
|
||||
<td class="summary">
|
||||
<p>Build an air type route point.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).RoutePointAltType">POINT_VEC3.RoutePointAltType</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).RoutePointType">POINT_VEC3.RoutePointType</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -249,6 +292,36 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3.FlareColor).Yellow">POINT_VEC3.FlareColor.Yellow</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2><a id="#(POINT_VEC3.RoutePointAction)">Type <code>POINT_VEC3.RoutePointAction</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3.RoutePointAction).TurningPoint">POINT_VEC3.RoutePointAction.TurningPoint</a></td>
|
||||
<td class="summary">
|
||||
<p>"Turning Point"</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2><a id="#(POINT_VEC3.RoutePointAltType)">Type <code>POINT_VEC3.RoutePointAltType</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3.RoutePointAltType).BARO">POINT_VEC3.RoutePointAltType.BARO</a></td>
|
||||
<td class="summary">
|
||||
<p>"BARO"</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2><a id="#(POINT_VEC3.RoutePointType)">Type <code>POINT_VEC3.RoutePointType</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3.RoutePointType).TurningPoint">POINT_VEC3.RoutePointType.TurningPoint</a></td>
|
||||
<td class="summary">
|
||||
<p>"Turning Point"</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -335,6 +408,60 @@
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(POINT_VEC2).DistanceFromPointVec2" >
|
||||
<strong>POINT_VEC2:DistanceFromPointVec2(PointVec2Reference)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Calculate the distance from a reference <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(POINT_VEC2)">#POINT_VEC2</a> PointVec2Reference </em></code>:
|
||||
The reference <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a>.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a>:</em>
|
||||
The distance from the reference <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> in meters.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(POINT_VEC2).DistanceFromVec2" >
|
||||
<strong>POINT_VEC2:DistanceFromVec2(Vec2Reference)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Calculate the distance from a reference <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> Vec2Reference </em></code>:
|
||||
The reference <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a>:</em>
|
||||
The distance from the reference <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> in meters.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -374,6 +501,20 @@ The y coordinate of the Vec3 point, pointing to the Right.</p>
|
||||
<p><em><a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a>:</em></p>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a></em>
|
||||
<a id="#(POINT_VEC2).PointVec2" >
|
||||
<strong>POINT_VEC2.PointVec2</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
@ -584,7 +725,100 @@ The z coordinate of the Vec3 point, pointing to the Right.</p>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="Point.html##(POINT_VEC3)">Point#POINT_VEC3</a>:</em></p>
|
||||
<p><em><a href="Point.html##(POINT_VEC3)">Point#POINT_VEC3</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="##(POINT_VEC3.RoutePointAction)">#POINT_VEC3.RoutePointAction</a></em>
|
||||
<a id="#(POINT_VEC3).RoutePointAction" >
|
||||
<strong>POINT_VEC3.RoutePointAction</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(POINT_VEC3).RoutePointAir" >
|
||||
<strong>POINT_VEC3:RoutePointAir(AltType, Type, Action, Speed, SpeedLocked)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Build an air type route point.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(POINT_VEC3.RoutePointAltType)">#POINT_VEC3.RoutePointAltType</a> AltType </em></code>:
|
||||
The altitude type.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(POINT_VEC3.RoutePointType)">#POINT_VEC3.RoutePointType</a> Type </em></code>:
|
||||
The route point type.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(POINT_VEC3.RoutePointAction)">#POINT_VEC3.RoutePointAction</a> Action </em></code>:
|
||||
The route point action.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="DCSTypes.html##(Speed)">DCSTypes#Speed</a> Speed </em></code>:
|
||||
Airspeed in km/h.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#boolean SpeedLocked </em></code>:
|
||||
true means the speed is locked.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#table:</em>
|
||||
The route point.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="##(POINT_VEC3.RoutePointAltType)">#POINT_VEC3.RoutePointAltType</a></em>
|
||||
<a id="#(POINT_VEC3).RoutePointAltType" >
|
||||
<strong>POINT_VEC3.RoutePointAltType</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="##(POINT_VEC3.RoutePointType)">#POINT_VEC3.RoutePointType</a></em>
|
||||
<a id="#(POINT_VEC3).RoutePointType" >
|
||||
<strong>POINT_VEC3.RoutePointType</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
@ -745,6 +979,63 @@ The z coordinate of the Vec3 point, pointing to the Right.</p>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a id="#(POINT_VEC3.RoutePointAction)" >Type <code>POINT_VEC3.RoutePointAction</code></a></h2>
|
||||
|
||||
<p>RoutePoint Actions</p>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(POINT_VEC3.RoutePointAction).TurningPoint" >
|
||||
<strong>POINT_VEC3.RoutePointAction.TurningPoint</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>"Turning Point"</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a id="#(POINT_VEC3.RoutePointAltType)" >Type <code>POINT_VEC3.RoutePointAltType</code></a></h2>
|
||||
|
||||
<p>RoutePoint AltTypes</p>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(POINT_VEC3.RoutePointAltType).BARO" >
|
||||
<strong>POINT_VEC3.RoutePointAltType.BARO</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>"BARO"</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a id="#(POINT_VEC3.RoutePointType)" >Type <code>POINT_VEC3.RoutePointType</code></a></h2>
|
||||
|
||||
<p>RoutePoint Types</p>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(POINT_VEC3.RoutePointType).TurningPoint" >
|
||||
<strong>POINT_VEC3.RoutePointType.TurningPoint</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>"Turning Point"</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li>ROUTETASK</li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li>STAGE</li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -87,7 +88,7 @@
|
||||
<li><a href="Scheduler.html##(SCHEDULER).New">Scheduler#SCHEDULER.New</a>: Setup a new scheduler and start it with the specified parameters.</li>
|
||||
</ul>
|
||||
|
||||
<h2>SCHEDULER timer stop and start</h2>
|
||||
<h2>1.2) SCHEDULER timer stop and start</h2>
|
||||
<p>The SCHEDULER can be stopped and restarted with the following methods:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -89,7 +90,7 @@ The default <strong>"time interval"</strong> is after 0.001 seconds.</p>
|
||||
<h2>1.1) Add or remove objects from the SET</h2>
|
||||
<p>Some key core functions are <a href="Set.html##(SET_BASE).Add">Set#SET_BASE.Add</a> and <a href="Set.html##(SET_BASE).Remove">Set#SET_BASE.Remove</a> to add or remove objects from the SET in your logic.</p>
|
||||
|
||||
<h2>1.2) Define the SET iterator <strong>"yield interval"</strong> and the <strong>"time interval"</strong>.</h2>
|
||||
<h2>1.2) Define the SET iterator <strong>"yield interval"</strong> and the <strong>"time interval"</strong></h2>
|
||||
<p>Modify the iterator intervals with the <a href="Set.html##(SET_BASE).SetInteratorIntervals">Set#SET_BASE.SetInteratorIntervals</a> method.
|
||||
You can set the <strong>"yield interval"</strong>, and the <strong>"time interval"</strong>. (See above).</p>
|
||||
|
||||
@ -218,6 +219,8 @@ The following iterator methods are currently available within the SET</em>UNIT:<
|
||||
<li><a href="##(SET_UNIT).ForEachUnitNotInZone">SET_UNIT.ForEachUnitNotInZone</a>: Iterate and call an iterator function for each <strong>alive</strong> UNIT presence not in a <a href="Zone.html">Zone</a>, providing the UNIT and optional parameters to the called function.</li>
|
||||
</ul>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>4) <a href="Set.html##(SET_CLIENT)">Set#SET_CLIENT</a> class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
|
||||
<p>Mission designers can use the <a href="Set.html##(SET_CLIENT)">Set#SET_CLIENT</a> class to build sets of units belonging to certain:</p>
|
||||
|
||||
@ -273,11 +276,60 @@ The following iterator methods are currently available within the SET</em>CLIENT
|
||||
<li><a href="##(SET_CLIENT).ForEachClient">SET_CLIENT.ForEachClient</a>: Calls a function for each alive client it finds within the SET_CLIENT.</li>
|
||||
</ul>
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>5) <a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a> class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
|
||||
<p>Mission designers can use the <a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a> class to build sets of airbases optionally belonging to certain:</p>
|
||||
|
||||
<ul>
|
||||
<li>Coalitions</li>
|
||||
</ul>
|
||||
|
||||
<h2>5.1) SET_AIRBASE construction</h2>
|
||||
<p>Create a new SET_AIRBASE object with the <a href="##(SET_AIRBASE).New">SET_AIRBASE.New</a> method:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(SET_AIRBASE).New">SET_AIRBASE.New</a>: Creates a new SET_AIRBASE object.</li>
|
||||
</ul>
|
||||
|
||||
<h2>5.2) Add or Remove AIRBASEs from SET_AIRBASE </h2>
|
||||
<p>AIRBASEs can be added and removed using the <a href="Set.html##(SET_AIRBASE).AddAirbasesByName">Set#SET_AIRBASE.AddAirbasesByName</a> and <a href="Set.html##(SET_AIRBASE).RemoveAirbasesByName">Set#SET_AIRBASE.RemoveAirbasesByName</a> respectively.
|
||||
These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.</p>
|
||||
|
||||
<h2>5.3) SET_AIRBASE filter criteria </h2>
|
||||
<p>You can set filter criteria to define the set of clients within the SET_AIRBASE.
|
||||
Filter criteria are defined by:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(SET_AIRBASE).FilterCoalitions">SET_AIRBASE.FilterCoalitions</a>: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).</li>
|
||||
</ul>
|
||||
|
||||
<p>Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(SET_AIRBASE).FilterStart">SET_AIRBASE.FilterStart</a>: Starts the filtering of the airbases within the SET_AIRBASE.</li>
|
||||
</ul>
|
||||
|
||||
<h2>5.4) SET_AIRBASE iterators:</h2>
|
||||
<p>Once the filters have been defined and the SET<em>AIRBASE has been built, you can iterate the SET</em>AIRBASE with the available iterator methods.
|
||||
The iterator methods will walk the SET<em>AIRBASE set, and call for each airbase within the set a function that you provide.
|
||||
The following iterator methods are currently available within the SET</em>AIRBASE:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(SET_AIRBASE).ForEachAirbase">SET_AIRBASE.ForEachAirbase</a>: Calls a function for each airbase it finds within the SET_AIRBASE.</li>
|
||||
</ul>
|
||||
|
||||
<hr/>
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="#SET_AIRBASE">SET_AIRBASE</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="#SET_BASE">SET_BASE</a></td>
|
||||
<td class="summary">
|
||||
@ -303,6 +355,106 @@ The following iterator methods are currently available within the SET</em>CLIENT
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a id="#(SET_AIRBASE)">Type <code>SET_AIRBASE</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).AddAirbasesByName">SET_AIRBASE:AddAirbasesByName(AddAirbaseNames)</a></td>
|
||||
<td class="summary">
|
||||
<p>Add AIRBASEs to SET_AIRBASE.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).AddInDatabase">SET_AIRBASE:AddInDatabase(Event)</a></td>
|
||||
<td class="summary">
|
||||
<p>Handles the Database to check on an event (birth) that the Object was added in the Database.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).Airbases">SET_AIRBASE.Airbases</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).ClassName">SET_AIRBASE.ClassName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).Filter">SET_AIRBASE.Filter</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).FilterCategories">SET_AIRBASE:FilterCategories(Categories)</a></td>
|
||||
<td class="summary">
|
||||
<p>Builds a set of airbases out of categories.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).FilterCoalitions">SET_AIRBASE:FilterCoalitions(Coalitions)</a></td>
|
||||
<td class="summary">
|
||||
<p>Builds a set of airbases of coalitions.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).FilterMeta">SET_AIRBASE.FilterMeta</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).FilterStart">SET_AIRBASE:FilterStart()</a></td>
|
||||
<td class="summary">
|
||||
<p>Starts the filtering.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).FindAirbase">SET_AIRBASE:FindAirbase(AirbaseName)</a></td>
|
||||
<td class="summary">
|
||||
<p>Finds a Airbase based on the Airbase Name.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).FindInDatabase">SET_AIRBASE:FindInDatabase(Event)</a></td>
|
||||
<td class="summary">
|
||||
<p>Handles the Database to check on any event that Object exists in the Database.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).FindNearestAirbaseFromPointVec2">SET_AIRBASE:FindNearestAirbaseFromPointVec2(PointVec2)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_AIRBASE while identifying the nearest <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> from a <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).ForEachAirbase">SET_AIRBASE:ForEachAirbase(IteratorFunction, ...)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_AIRBASE and call an interator function for each AIRBASE, providing the AIRBASE and optional parameters.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).IsIncludeObject">SET_AIRBASE:IsIncludeObject(MAirbase)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).New">SET_AIRBASE:New()</a></td>
|
||||
<td class="summary">
|
||||
<p>Creates a new SET_AIRBASE object, building a set of airbases belonging to a coalitions and categories.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_AIRBASE).RemoveAirbasesByName">SET_AIRBASE:RemoveAirbasesByName(RemoveAirbaseNames)</a></td>
|
||||
<td class="summary">
|
||||
<p>Remove AIRBASEs from SET_AIRBASE.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2><a id="#(SET_BASE)">Type <code>SET_BASE</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
@ -315,6 +467,12 @@ The following iterator methods are currently available within the SET</em>CLIENT
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_BASE).ClassName">SET_BASE.ClassName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_BASE).FindNearestObjectFromPointVec2">SET_BASE:FindNearestObjectFromPointVec2(PointVec2)</a></td>
|
||||
<td class="summary">
|
||||
<p>Iterate the SET_BASE while identifying the nearest object from a <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -486,7 +644,7 @@ The following iterator methods are currently available within the SET</em>CLIENT
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_CLIENT).ForEachClient">SET_CLIENT:ForEachClient(IteratorFunction, ...)</a></td>
|
||||
<td class="summary">
|
||||
<p>Interate the SET_CLIENT and call an interator function for each <strong>alive</strong> CLIENT, providing the CLIENT and optional parameters.</p>
|
||||
<p>Iterate the SET_CLIENT and call an interator function for each <strong>alive</strong> CLIENT, providing the CLIENT and optional parameters.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -722,7 +880,7 @@ The following iterator methods are currently available within the SET</em>CLIENT
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SET_UNIT).ForEachUnit">SET_UNIT:ForEachUnit(IteratorFunction, ...)</a></td>
|
||||
<td class="summary">
|
||||
<p>Interate the SET_UNIT and call an interator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
|
||||
<p>Iterate the SET_UNIT and call an interator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -767,6 +925,20 @@ The following iterator methods are currently available within the SET</em>CLIENT
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="##(SET_AIRBASE)">#SET_AIRBASE</a></em>
|
||||
<a id="SET_AIRBASE" >
|
||||
<strong>SET_AIRBASE</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="##(SET_BASE)">#SET_BASE</a></em>
|
||||
<a id="SET_BASE" >
|
||||
<strong>SET_BASE</strong>
|
||||
@ -822,6 +994,411 @@ The following iterator methods are currently available within the SET</em>CLIENT
|
||||
</dl>
|
||||
<h2><a id="#(Set)" >Type <code>Set</code></a></h2>
|
||||
|
||||
<h2><a id="#(SET_AIRBASE)" >Type <code>SET_AIRBASE</code></a></h2>
|
||||
|
||||
<p>SET_AIRBASE class</p>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).AddAirbasesByName" >
|
||||
<strong>SET_AIRBASE:AddAirbasesByName(AddAirbaseNames)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Add AIRBASEs to SET_AIRBASE.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string AddAirbaseNames </em></code>:
|
||||
A single name or an array of AIRBASE names.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
|
||||
<p>self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).AddInDatabase" >
|
||||
<strong>SET_AIRBASE:AddInDatabase(Event)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Handles the Database to check on an event (birth) that the Object was added in the Database.</p>
|
||||
|
||||
|
||||
<p>This is required, because sometimes the <em>DATABASE birth event gets called later than the SET</em>BASE birth event!</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Event.html##(EVENTDATA)">Event#EVENTDATA</a> Event </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return values</h3>
|
||||
<ol>
|
||||
<li>
|
||||
|
||||
<p><em>#string:</em>
|
||||
The name of the AIRBASE</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><em>#table:</em>
|
||||
The AIRBASE</p>
|
||||
|
||||
</li>
|
||||
</ol>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(SET_AIRBASE).Airbases" >
|
||||
<strong>SET_AIRBASE.Airbases</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#string</em>
|
||||
<a id="#(SET_AIRBASE).ClassName" >
|
||||
<strong>SET_AIRBASE.ClassName</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(SET_AIRBASE).Filter" >
|
||||
<strong>SET_AIRBASE.Filter</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).FilterCategories" >
|
||||
<strong>SET_AIRBASE:FilterCategories(Categories)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Builds a set of airbases out of categories.</p>
|
||||
|
||||
|
||||
<p>Possible current categories are plane, helicopter, ground, ship.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string Categories </em></code>:
|
||||
Can take the following values: "airdrome", "helipad", "ship".</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(SET_AIRBASE)">#SET_AIRBASE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).FilterCoalitions" >
|
||||
<strong>SET_AIRBASE:FilterCoalitions(Coalitions)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Builds a set of airbases of coalitions.</p>
|
||||
|
||||
|
||||
<p>Possible current coalitions are red, blue and neutral.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string Coalitions </em></code>:
|
||||
Can take the following values: "red", "blue", "neutral".</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(SET_AIRBASE)">#SET_AIRBASE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(SET_AIRBASE).FilterMeta" >
|
||||
<strong>SET_AIRBASE.FilterMeta</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).FilterStart" >
|
||||
<strong>SET_AIRBASE:FilterStart()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Starts the filtering.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(SET_AIRBASE)">#SET_AIRBASE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).FindAirbase" >
|
||||
<strong>SET_AIRBASE:FindAirbase(AirbaseName)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Finds a Airbase based on the Airbase Name.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string AirbaseName </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>:</em>
|
||||
The found Airbase.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).FindInDatabase" >
|
||||
<strong>SET_AIRBASE:FindInDatabase(Event)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Handles the Database to check on any event that Object exists in the Database.</p>
|
||||
|
||||
|
||||
<p>This is required, because sometimes the <em>DATABASE event gets called later than the SET</em>BASE event or vise versa!</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Event.html##(EVENTDATA)">Event#EVENTDATA</a> Event </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return values</h3>
|
||||
<ol>
|
||||
<li>
|
||||
|
||||
<p><em>#string:</em>
|
||||
The name of the AIRBASE</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><em>#table:</em>
|
||||
The AIRBASE</p>
|
||||
|
||||
</li>
|
||||
</ol>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).FindNearestAirbaseFromPointVec2" >
|
||||
<strong>SET_AIRBASE:FindNearestAirbaseFromPointVec2(PointVec2)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_AIRBASE while identifying the nearest <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> from a <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> PointVec2 </em></code>:
|
||||
A <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> object from where to evaluate the closest <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>:</em>
|
||||
The closest <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).ForEachAirbase" >
|
||||
<strong>SET_AIRBASE:ForEachAirbase(IteratorFunction, ...)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_AIRBASE and call an interator function for each AIRBASE, providing the AIRBASE and optional parameters.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#function IteratorFunction </em></code>:
|
||||
The function that will be called when there is an alive AIRBASE in the SET_AIRBASE. The function needs to accept a AIRBASE parameter.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> ... </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(SET_AIRBASE)">#SET_AIRBASE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).IsIncludeObject" >
|
||||
<strong>SET_AIRBASE:IsIncludeObject(MAirbase)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> MAirbase </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(SET_AIRBASE)">#SET_AIRBASE</a>:</em>
|
||||
self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).New" >
|
||||
<strong>SET_AIRBASE:New()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Creates a new SET_AIRBASE object, building a set of airbases belonging to a coalitions and categories.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(SET_AIRBASE)">#SET_AIRBASE</a>:</em>
|
||||
self</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code>-- Define a new SET_AIRBASE Object. The DatabaseSet will contain a reference to all Airbases.
|
||||
DatabaseSet = SET_AIRBASE:New()</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_AIRBASE).RemoveAirbasesByName" >
|
||||
<strong>SET_AIRBASE:RemoveAirbasesByName(RemoveAirbaseNames)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Remove AIRBASEs from SET_AIRBASE.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> RemoveAirbaseNames </em></code>:
|
||||
A single name or an array of AIRBASE names.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
|
||||
<p>self</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a id="#(SET_BASE)" >Type <code>SET_BASE</code></a></h2>
|
||||
|
||||
<p>SET_BASE class</p>
|
||||
@ -870,6 +1447,33 @@ The added BASE Object.</p>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(SET_BASE).FindNearestObjectFromPointVec2" >
|
||||
<strong>SET_BASE:FindNearestObjectFromPointVec2(PointVec2)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Iterate the SET_BASE while identifying the nearest object from a <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> PointVec2 </em></code>:
|
||||
A <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> object from where to evaluate the closest object in the set.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="Base.html##(BASE)">Base#BASE</a>:</em>
|
||||
The closest object.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -1548,7 +2152,7 @@ The CLIENT</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Interate the SET_CLIENT and call an interator function for each <strong>alive</strong> CLIENT, providing the CLIENT and optional parameters.</p>
|
||||
<p>Iterate the SET_CLIENT and call an interator function for each <strong>alive</strong> CLIENT, providing the CLIENT and optional parameters.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -2616,7 +3220,7 @@ The found Unit.</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Interate the SET_UNIT and call an interator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
|
||||
<p>Iterate the SET_UNIT and call an interator function for each <strong>alive</strong> UNIT, providing the UNIT and optional parameters.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -269,6 +270,12 @@ If you want to obtain the complete <strong>3D position</strong> including ori
|
||||
<td class="name" nowrap="nowrap"><a href="##(UNIT).GetGroup">UNIT:GetGroup()</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns the unit's group if it exist and nil otherwise.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(UNIT).GetHeading">UNIT:GetHeading()</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns the DCS Unit heading.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -974,6 +981,24 @@ The DCS Unit is not existing or alive. </p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(UNIT).GetHeading" >
|
||||
<strong>UNIT:GetHeading()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns the DCS Unit heading.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#number:</em>
|
||||
The DCS Unit heading</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(UNIT).GetID" >
|
||||
<strong>UNIT:GetID()</strong>
|
||||
</a>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -200,6 +201,18 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).ClassName">ZONE_BASE.ClassName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).GetBoundingSquare">ZONE_BASE:GetBoundingSquare()</a></td>
|
||||
<td class="summary">
|
||||
<p>Get the bounding square the zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).GetRandomVec2">ZONE_BASE:GetRandomVec2()</a></td>
|
||||
<td class="summary">
|
||||
<p>Define a random <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> within the zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -230,6 +243,34 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).ZoneName">ZONE_BASE.ZoneName</a></td>
|
||||
<td class="summary">
|
||||
<p>Name of the zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2><a id="#(ZONE_BASE.BoundingSquare)">Type <code>ZONE_BASE.BoundingSquare</code></a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE.BoundingSquare).x1">ZONE_BASE.BoundingSquare.x1</a></td>
|
||||
<td class="summary">
|
||||
<p>The lower x coordinate (left down)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE.BoundingSquare).x2">ZONE_BASE.BoundingSquare.x2</a></td>
|
||||
<td class="summary">
|
||||
<p>The higher x coordinate (right up)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE.BoundingSquare).y1">ZONE_BASE.BoundingSquare.y1</a></td>
|
||||
<td class="summary">
|
||||
<p>The lower y coordinate (left down)</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE.BoundingSquare).y2">ZONE_BASE.BoundingSquare.y2</a></td>
|
||||
<td class="summary">
|
||||
<p>The higher y coordinate (right up)</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -262,6 +303,18 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON_BASE).Flush">ZONE_POLYGON_BASE:Flush()</a></td>
|
||||
<td class="summary">
|
||||
<p>Flush polygon coordinates as a table in DCS.log.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON_BASE).GetBoundingSquare">ZONE_POLYGON_BASE:GetBoundingSquare()</a></td>
|
||||
<td class="summary">
|
||||
<p>Get the bounding square the zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON_BASE).GetRandomVec2">ZONE_POLYGON_BASE:GetRandomVec2()</a></td>
|
||||
<td class="summary">
|
||||
<p>Define a random <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> within the zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -323,7 +376,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).GetRandomPointVec2">ZONE_RADIUS:GetRandomPointVec2()</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).GetRandomVec2">ZONE_RADIUS:GetRandomVec2()</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns a random location within the zone.</p>
|
||||
</td>
|
||||
@ -564,6 +617,42 @@ The name of the zone as defined within the mission editor.</p>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(ZONE_BASE).GetBoundingSquare" >
|
||||
<strong>ZONE_BASE:GetBoundingSquare()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Get the bounding square the zone.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(ZONE_BASE.BoundingSquare)">#ZONE_BASE.BoundingSquare</a>:</em>
|
||||
The bounding square.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(ZONE_BASE).GetRandomVec2" >
|
||||
<strong>ZONE_BASE:GetRandomVec2()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Define a random <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> within the zone.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>:</em>
|
||||
The Vec2 coordinates.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -681,6 +770,68 @@ The smoke color.</p>
|
||||
|
||||
<p>Name of the zone.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a id="#(ZONE_BASE.BoundingSquare)" >Type <code>ZONE_BASE.BoundingSquare</code></a></h2>
|
||||
|
||||
<p>The ZONE_BASE.BoundingSquare</p>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a></em>
|
||||
<a id="#(ZONE_BASE.BoundingSquare).x1" >
|
||||
<strong>ZONE_BASE.BoundingSquare.x1</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The lower x coordinate (left down)</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a></em>
|
||||
<a id="#(ZONE_BASE.BoundingSquare).x2" >
|
||||
<strong>ZONE_BASE.BoundingSquare.x2</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The higher x coordinate (right up)</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a></em>
|
||||
<a id="#(ZONE_BASE.BoundingSquare).y1" >
|
||||
<strong>ZONE_BASE.BoundingSquare.y1</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The lower y coordinate (left down)</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a></em>
|
||||
<a id="#(ZONE_BASE.BoundingSquare).y2" >
|
||||
<strong>ZONE_BASE.BoundingSquare.y2</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>The higher y coordinate (right up)</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
@ -780,6 +931,42 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(ZONE_POLYGON_BASE).GetBoundingSquare" >
|
||||
<strong>ZONE_POLYGON_BASE:GetBoundingSquare()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Get the bounding square the zone.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(ZONE_POLYGON_BASE.BoundingSquare)">#ZONE<em>POLYGON</em>BASE.BoundingSquare</a>:</em>
|
||||
The bounding square.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(ZONE_POLYGON_BASE).GetRandomVec2" >
|
||||
<strong>ZONE_POLYGON_BASE:GetRandomVec2()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Define a random <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> within the zone.</p>
|
||||
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>:</em>
|
||||
The Vec2 coordinate.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(ZONE_POLYGON_BASE).IsPointVec2InZone" >
|
||||
<strong>ZONE_POLYGON_BASE:IsPointVec2InZone(PointVec2)</strong>
|
||||
</a>
|
||||
@ -882,6 +1069,8 @@ self</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a id="#(ZONE_POLYGON_BASE.BoundingSquare)" >Type <code>ZONE_POLYGON_BASE.BoundingSquare</code></a></h2>
|
||||
|
||||
<h2><a id="#(ZONE_POLYGON_BASE.ListVec2)" >Type <code>ZONE_POLYGON_BASE.ListVec2</code></a></h2>
|
||||
|
||||
<p>A points array.</p>
|
||||
@ -1011,8 +1200,8 @@ The radius of the zone.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(ZONE_RADIUS).GetRandomPointVec2" >
|
||||
<strong>ZONE_RADIUS:GetRandomPointVec2()</strong>
|
||||
<a id="#(ZONE_RADIUS).GetRandomVec2" >
|
||||
<strong>ZONE_RADIUS:GetRandomVec2()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
@ -82,14 +83,7 @@
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Airbase.html">Airbase</a></td>
|
||||
<td class="summary">
|
||||
<p>AIRBASE Class</p>
|
||||
|
||||
<h1><a href="AIRBASE.html">AIRBASE</a> class</h1>
|
||||
<p>The <a href="AIRBASE.html">AIRBASE</a> class is a wrapper class to handle the DCS Airbase objects:</p>
|
||||
|
||||
<ul>
|
||||
<li>Support all DCS Airbase APIs.</li>
|
||||
</ul>
|
||||
<p>This module contains the AIRBASE classes.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -221,7 +215,7 @@
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Database.html">Database</a></td>
|
||||
<td class="summary">
|
||||
<p>Manage the mission database.</p>
|
||||
<p>This module contains the DATABASE class, managing the database of mission objects.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -269,7 +263,7 @@
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="MissileTrainer.html">MissileTrainer</a></td>
|
||||
<td class="summary">
|
||||
<p>Provides missile training functions.</p>
|
||||
<p>This module contains the MISSILETRAINER class.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -288,6 +282,12 @@
|
||||
<td class="name" nowrap="nowrap"><a href="PICKUPTASK.html">PICKUPTASK</a></td>
|
||||
<td class="summary">
|
||||
<p>A PICKUPTASK orchestrates the loading of CARGO at a specific landing zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="PatrolZone.html">PatrolZone</a></td>
|
||||
<td class="summary">
|
||||
<p>This module contains the PATROLZONE class.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
<li><a href="Mission.html">Mission</a></li>
|
||||
<li><a href="NOTASK.html">NOTASK</a></li>
|
||||
<li><a href="PICKUPTASK.html">PICKUPTASK</a></li>
|
||||
<li><a href="PatrolZone.html">PatrolZone</a></li>
|
||||
<li><a href="Point.html">Point</a></li>
|
||||
<li><a href="ROUTETASK.html">ROUTETASK</a></li>
|
||||
<li><a href="STAGE.html">STAGE</a></li>
|
||||
|
||||
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