mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Various Fixes
-- Documentation fixes with links not working. -- MENU_CLIENT_COMMAND had a small glitch, fixed that one too. -- Implemented new Event Dispatcher. --
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Functional.AirbasePolice#AIRBASEPOLICE_BASE} class, extends @{Core.Base#BASE}
|
||||
-- 1) @{AirbasePolice#AIRBASEPOLICE_BASE} class, extends @{Base#BASE}
|
||||
-- ==================================================================
|
||||
-- The @{Functional.AirbasePolice#AIRBASEPOLICE_BASE} class provides the main methods to monitor CLIENT behaviour at airbases.
|
||||
-- The @{AirbasePolice#AIRBASEPOLICE_BASE} class provides the main methods to monitor CLIENT behaviour at airbases.
|
||||
-- CLIENTS should not be allowed to:
|
||||
--
|
||||
-- * Don't taxi faster than 40 km/h.
|
||||
@@ -12,7 +12,7 @@
|
||||
-- * Avoid to hit other planes on the airbase.
|
||||
-- * Obey ground control orders.
|
||||
--
|
||||
-- 2) @{Functional.AirbasePolice#AIRBASEPOLICE_CAUCASUS} class, extends @{Functional.AirbasePolice#AIRBASEPOLICE_BASE}
|
||||
-- 2) @{AirbasePolice#AIRBASEPOLICE_CAUCASUS} class, extends @{AirbasePolice#AIRBASEPOLICE_BASE}
|
||||
-- =============================================================================================
|
||||
-- All the airbases on the caucasus map can be monitored using this class.
|
||||
-- If you want to monitor specific airbases, you need to use the @{#AIRBASEPOLICE_BASE.Monitor}() method, which takes a table or airbase names.
|
||||
@@ -39,7 +39,7 @@
|
||||
-- * TbilisiLochini
|
||||
-- * Vaziani
|
||||
--
|
||||
-- 3) @{Functional.AirbasePolice#AIRBASEPOLICE_NEVADA} class, extends @{Functional.AirbasePolice#AIRBASEPOLICE_BASE}
|
||||
-- 3) @{AirbasePolice#AIRBASEPOLICE_NEVADA} class, extends @{AirbasePolice#AIRBASEPOLICE_BASE}
|
||||
-- =============================================================================================
|
||||
-- All the airbases on the NEVADA map can be monitored using this class.
|
||||
-- If you want to monitor specific airbases, you need to use the @{#AIRBASEPOLICE_BASE.Monitor}() method, which takes a table or airbase names.
|
||||
|
||||
@@ -62,7 +62,7 @@ function CLEANUP:_DestroyGroup( GroupObject, CleanUpGroupName )
|
||||
end
|
||||
end
|
||||
|
||||
--- Destroys a @{Dcs.DCSWrapper.Unit#Unit} from the simulator, but checks first if it is still existing!
|
||||
--- Destroys a @{DCSWrapper.Unit#Unit} from the simulator, but checks first if it is still existing!
|
||||
-- @param #CLEANUP self
|
||||
-- @param Dcs.DCSWrapper.Unit#Unit CleanUpUnit The object to be destroyed.
|
||||
-- @param #string CleanUpUnitName The Unit name ...
|
||||
@@ -199,7 +199,7 @@ function CLEANUP:_EventHitCleanUp( Event )
|
||||
end
|
||||
end
|
||||
|
||||
--- Add the @{Dcs.DCSWrapper.Unit#Unit} to the CleanUpList for CleanUp.
|
||||
--- Add the @{DCSWrapper.Unit#Unit} to the CleanUpList for CleanUp.
|
||||
function CLEANUP:_AddForCleanUp( CleanUpUnit, CleanUpUnitName )
|
||||
self:F( { CleanUpUnit, CleanUpUnitName } )
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Functional.Detection#DETECTION_BASE} class, extends @{Core.Base#BASE}
|
||||
-- 1) @{Detection#DETECTION_BASE} class, extends @{Base#BASE}
|
||||
-- ==========================================================
|
||||
-- The @{Functional.Detection#DETECTION_BASE} class defines the core functions to administer detected objects.
|
||||
-- The @{Functional.Detection#DETECTION_BASE} class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
-- The @{Detection#DETECTION_BASE} class defines the core functions to administer detected objects.
|
||||
-- The @{Detection#DETECTION_BASE} class will detect objects within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s).
|
||||
--
|
||||
-- 1.1) DETECTION_BASE constructor
|
||||
-- -------------------------------
|
||||
-- Construct a new DETECTION_BASE instance using the @{Functional.Detection#DETECTION_BASE.New}() method.
|
||||
-- Construct a new DETECTION_BASE instance using the @{Detection#DETECTION_BASE.New}() method.
|
||||
--
|
||||
-- 1.2) DETECTION_BASE initialization
|
||||
-- ----------------------------------
|
||||
@@ -20,46 +20,46 @@
|
||||
--
|
||||
-- Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:
|
||||
--
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{Functional.Detection#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectVisual}(): Detected using Visual.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectOptical}(): Detected using Optical.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectRadar}(): Detected using Radar.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectIRST}(): Detected using IRST.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectRWR}(): Detected using RWR.
|
||||
-- * @{Detection#DETECTION_BASE.InitDetectDLINK}(): Detected using DLINK.
|
||||
--
|
||||
-- 1.3) Obtain objects detected by DETECTION_BASE
|
||||
-- ----------------------------------------------
|
||||
-- DETECTION_BASE builds @{Set}s of objects detected. These @{Core.Set#SET_BASE}s can be retrieved using the method @{Functional.Detection#DETECTION_BASE.GetDetectedSets}().
|
||||
-- The method will return a list (table) of @{Core.Set#SET_BASE} objects.
|
||||
-- DETECTION_BASE builds @{Set}s of objects detected. These @{Set#SET_BASE}s can be retrieved using the method @{Detection#DETECTION_BASE.GetDetectedSets}().
|
||||
-- The method will return a list (table) of @{Set#SET_BASE} objects.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 2) @{Functional.Detection#DETECTION_AREAS} class, extends @{Functional.Detection#DETECTION_BASE}
|
||||
-- 2) @{Detection#DETECTION_AREAS} class, extends @{Detection#DETECTION_BASE}
|
||||
-- ===============================================================================
|
||||
-- The @{Functional.Detection#DETECTION_AREAS} class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Core.Set#SET_UNIT}s containing the @{Wrapper.Unit#UNIT}s detected.
|
||||
-- The @{Detection#DETECTION_AREAS} class will detect units within the battle zone for a list of @{Group}s detecting targets following (a) detection method(s),
|
||||
-- and will build a list (table) of @{Set#SET_UNIT}s containing the @{Unit#UNIT}s detected.
|
||||
-- The class is group the detected units within zones given a DetectedZoneRange parameter.
|
||||
-- A set with multiple detected zones will be created as there are groups of units detected.
|
||||
--
|
||||
-- 2.1) Retrieve the Detected Unit sets and Detected Zones
|
||||
-- -------------------------------------------------------
|
||||
-- The DetectedUnitSets methods are implemented in @{Functional.Detection#DECTECTION_BASE} and the DetectedZones methods is implemented in @{Functional.Detection#DETECTION_AREAS}.
|
||||
-- The DetectedUnitSets methods are implemented in @{Detection#DECTECTION_BASE} and the DetectedZones methods is implemented in @{Detection#DETECTION_AREAS}.
|
||||
--
|
||||
-- Retrieve the DetectedUnitSets with the method @{Functional.Detection#DETECTION_BASE.GetDetectedSets}(). A table will be return of @{Core.Set#SET_UNIT}s.
|
||||
-- To understand the amount of sets created, use the method @{Functional.Detection#DETECTION_BASE.GetDetectedSetCount}().
|
||||
-- If you want to obtain a specific set from the DetectedSets, use the method @{Functional.Detection#DETECTION_BASE.GetDetectedSet}() with a given index.
|
||||
-- Retrieve the DetectedUnitSets with the method @{Detection#DETECTION_BASE.GetDetectedSets}(). A table will be return of @{Set#SET_UNIT}s.
|
||||
-- To understand the amount of sets created, use the method @{Detection#DETECTION_BASE.GetDetectedSetCount}().
|
||||
-- If you want to obtain a specific set from the DetectedSets, use the method @{Detection#DETECTION_BASE.GetDetectedSet}() with a given index.
|
||||
--
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Functional.Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Functional.Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Functional.Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
-- Retrieve the formed @{Zone@ZONE_UNIT}s as a result of the grouping the detected units within the DetectionZoneRange, use the method @{Detection#DETECTION_BASE.GetDetectionZones}().
|
||||
-- To understand the amount of zones created, use the method @{Detection#DETECTION_BASE.GetDetectionZoneCount}().
|
||||
-- If you want to obtain a specific zone from the DetectedZones, use the method @{Detection#DETECTION_BASE.GetDetectionZone}() with a given index.
|
||||
--
|
||||
-- 1.4) Flare or Smoke detected units
|
||||
-- ----------------------------------
|
||||
-- Use the methods @{Functional.Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Functional.Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedUnits}() or @{Detection#DETECTION_AREAS.SmokeDetectedUnits}() to flare or smoke the detected units when a new detection has taken place.
|
||||
--
|
||||
-- 1.5) Flare or Smoke detected zones
|
||||
-- ----------------------------------
|
||||
-- Use the methods @{Functional.Detection#DETECTION_AREAS.FlareDetectedZones}() or @{Functional.Detection#DETECTION_AREAS.SmokeDetectedZones}() to flare or smoke the detected zones when a new detection has taken place.
|
||||
-- Use the methods @{Detection#DETECTION_AREAS.FlareDetectedZones}() or @{Detection#DETECTION_AREAS.SmokeDetectedZones}() to flare or smoke the detected zones when a new detection has taken place.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@@ -245,7 +245,7 @@ function DETECTION_BASE:GetDetectedObject( ObjectName )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Get the detected @{Core.Set#SET_BASE}s.
|
||||
--- Get the detected @{Set#SET_BASE}s.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @return #DETECTION_BASE.DetectedSets DetectedSets
|
||||
function DETECTION_BASE:GetDetectedSets()
|
||||
@@ -308,12 +308,12 @@ function DETECTION_BASE:Schedule( DelayTime, RepeatInterval )
|
||||
self.ScheduleDelayTime = DelayTime
|
||||
self.ScheduleRepeatInterval = RepeatInterval
|
||||
|
||||
self.DetectionScheduler = SCHEDULER:New(self, self._DetectionScheduler, { self, "Detection" }, DelayTime, RepeatInterval )
|
||||
self.DetectionScheduler = SCHEDULER:New( self, self._DetectionScheduler, { self, "Detection" }, DelayTime, RepeatInterval )
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Form @{Set}s of detected @{Wrapper.Unit#UNIT}s in an array of @{Core.Set#SET_BASE}s.
|
||||
--- Form @{Set}s of detected @{Unit#UNIT}s in an array of @{Set#SET_BASE}s.
|
||||
-- @param #DETECTION_BASE self
|
||||
function DETECTION_BASE:_DetectionScheduler( SchedulerName )
|
||||
self:F2( { SchedulerName } )
|
||||
@@ -433,7 +433,7 @@ function DETECTION_AREAS:New( DetectionSetGroup, DetectionRange, DetectionZoneRa
|
||||
self._SmokeDetectedZones = false
|
||||
self._FlareDetectedZones = false
|
||||
|
||||
self:Schedule( 0, 30 )
|
||||
self:Schedule( 10, 10 )
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -487,7 +487,7 @@ function DETECTION_AREAS:GetDetectedAreaCount()
|
||||
return DetectedAreaCount
|
||||
end
|
||||
|
||||
--- Get the @{Core.Set#SET_UNIT} of a detecttion area using a given numeric index.
|
||||
--- Get the @{Set#SET_UNIT} of a detecttion area using a given numeric index.
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param #number Index
|
||||
-- @return Core.Set#SET_UNIT DetectedSet
|
||||
@@ -501,7 +501,7 @@ function DETECTION_AREAS:GetDetectedSet( Index )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Get the @{Core.Zone#ZONE_UNIT} of a detection area using a given numeric index.
|
||||
--- Get the @{Zone#ZONE_UNIT} of a detection area using a given numeric index.
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param #number Index
|
||||
-- @return Core.Zone#ZONE_UNIT DetectedZone
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
-- ============================
|
||||
-- Create a new SPAWN object with the @{#ESCORT.New} method:
|
||||
--
|
||||
-- * @{#ESCORT.New}: Creates a new ESCORT object from a @{Wrapper.Group#GROUP} for a @{Wrapper.Client#CLIENT}, with an optional briefing text.
|
||||
-- * @{#ESCORT.New}: Creates a new ESCORT object from a @{Group#GROUP} for a @{Client#CLIENT}, with an optional briefing text.
|
||||
--
|
||||
-- ESCORT initialization methods.
|
||||
-- ==============================
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 1) @{Functional.MissileTrainer#MISSILETRAINER} class, extends @{Core.Base#BASE}
|
||||
-- 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.
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
--- This module contains the SPAWN class.
|
||||
--- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**All** --
|
||||
-- **Spawn groups of units dynamically in your missions.**
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # 1) @{Functional.Spawn#SPAWN} class, extends @{Core.Base#BASE}
|
||||
-- ===
|
||||
--
|
||||
-- # 1) @{#SPAWN} class, extends @{Base#BASE}
|
||||
--
|
||||
-- The @{#SPAWN} class allows to spawn dynamically new groups, based on pre-defined initialization settings, modifying the behaviour when groups are spawned.
|
||||
-- For each group to be spawned, within the mission editor, a group has to be created with the "late activation flag" set. We call this group the *"Spawn Template"* of the SPAWN object.
|
||||
@@ -42,7 +47,7 @@
|
||||
-- * @{#SPAWN.InitLimit}(): Limits the amount of groups that can be alive at the same time and that can be dynamically spawned.
|
||||
-- * @{#SPAWN.InitRandomizeRoute}(): Randomize the routes of spawned groups, and for air groups also optionally the height.
|
||||
-- * @{#SPAWN.InitRandomizeTemplate}(): Randomize the group templates so that when a new group is spawned, a random group template is selected from one of the templates defined.
|
||||
-- * @{#SPAWN.InitUncontrolled}(): Spawn plane groups uncontrolled.
|
||||
-- * @{#SPAWN.InitUnControlled}(): Spawn plane groups uncontrolled.
|
||||
-- * @{#SPAWN.InitArray}(): Make groups visible before they are actually activated, and order these groups like a batallion in an array.
|
||||
-- * @{#SPAWN.InitRepeat}(): Re-spawn groups when they land at the home base. Similar methods are @{#SPAWN.InitRepeatOnLanding} and @{#SPAWN.InitRepeatOnEngineShutDown}.
|
||||
-- * @{#SPAWN.InitRandomizeUnits}(): Randomizes the @{Unit}s in the @{Group} that is spawned within a **radius band**, given an Outer and Inner radius.
|
||||
@@ -112,6 +117,8 @@
|
||||
--
|
||||
-- Hereby the change log:
|
||||
--
|
||||
-- 2017-02-04: SPAWN:InitUnControlled( **UnControlled** ) replaces SPAWN:InitUnControlled().
|
||||
--
|
||||
-- 2017-01-24: SPAWN:**InitAIOnOff( AIOnOff )** added.
|
||||
--
|
||||
-- 2017-01-24: SPAWN:**InitAIOn()** added.
|
||||
@@ -646,6 +653,10 @@ function SPAWN:SpawnWithIndex( SpawnIndex )
|
||||
self:T( 'SpawnTemplate.units['..UnitID..'].x = ' .. SpawnTemplate.units[UnitID].x .. ', SpawnTemplate.units['..UnitID..'].y = ' .. SpawnTemplate.units[UnitID].y )
|
||||
end
|
||||
end
|
||||
|
||||
if SpawnTemplate.CategoryID == Group.Category.HELICOPTER or SpawnTemplate.CategoryID == Group.Category.AIRPLANE then
|
||||
SpawnTemplate.uncontrolled = self.SpawnUnControlled
|
||||
end
|
||||
end
|
||||
|
||||
_EVENTDISPATCHER:OnBirthForTemplate( SpawnTemplate, self._OnBirth, self )
|
||||
@@ -734,7 +745,7 @@ end
|
||||
|
||||
--- Allows to place a CallFunction hook when a new group spawns.
|
||||
-- The provided method will be called when a new group is spawned, including its given parameters.
|
||||
-- The first parameter of the SpawnFunction is the @{Wrapper.Group#GROUP} that was spawned.
|
||||
-- The first parameter of the SpawnFunction is the @{Group#GROUP} that was spawned.
|
||||
-- @param #SPAWN self
|
||||
-- @param #function SpawnCallBackFunction The function to be called when a group spawns.
|
||||
-- @param SpawnFunctionArguments A random amount of arguments to be provided to the function when the group spawns.
|
||||
@@ -874,7 +885,7 @@ function SPAWN:SpawnFromStatic( HostStatic, SpawnIndex )
|
||||
end
|
||||
|
||||
--- Will spawn a Group within a given @{Zone}.
|
||||
-- The @{Zone} can be of any type derived from @{Core.Zone#ZONE_BASE}.
|
||||
-- The @{Zone} can be of any type derived from @{Zone#ZONE_BASE}.
|
||||
-- Once the @{Group} is spawned within the zone, the @{Group} will continue on its route.
|
||||
-- The **first waypoint** (where the group is spawned) is replaced with the zone location coordinates.
|
||||
-- @param #SPAWN self
|
||||
@@ -897,17 +908,20 @@ function SPAWN:SpawnInZone( Zone, RandomizeGroup, SpawnIndex )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- (AIR) Will spawn a plane group in uncontrolled mode...
|
||||
--- (**AIR**) Will spawn a plane group in UnControlled or Controlled mode...
|
||||
-- This will be similar to the uncontrolled flag setting in the ME.
|
||||
-- You can use UnControlled mode to simulate planes startup and ready for take-off but aren't moving (yet).
|
||||
-- ReSpawn the plane in Controlled mode, and the plane will move...
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean UnControlled true if UnControlled, false if Controlled.
|
||||
-- @return #SPAWN self
|
||||
function SPAWN:InitUnControlled()
|
||||
self:F( { self.SpawnTemplatePrefix } )
|
||||
function SPAWN:InitUnControlled( UnControlled )
|
||||
self:F2( { self.SpawnTemplatePrefix, UnControlled } )
|
||||
|
||||
self.SpawnUnControlled = true
|
||||
self.SpawnUnControlled = UnControlled
|
||||
|
||||
for SpawnGroupID = 1, self.SpawnMaxGroups do
|
||||
self.SpawnGroups[SpawnGroupID].UnControlled = true
|
||||
self.SpawnGroups[SpawnGroupID].UnControlled = UnControlled
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -1227,9 +1241,6 @@ function SPAWN:_Prepare( SpawnTemplatePrefix, SpawnIndex )
|
||||
SpawnTemplate.visible = false
|
||||
end
|
||||
|
||||
if SpawnTemplate.CategoryID == Group.Category.HELICOPTER or SpawnTemplate.CategoryID == Group.Category.AIRPLANE then
|
||||
SpawnTemplate.uncontrolled = false
|
||||
end
|
||||
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
SpawnTemplate.units[UnitID].name = string.format( SpawnTemplate.name .. '-%02d', UnitID )
|
||||
|
||||
Reference in New Issue
Block a user