Merge remote-tracking branch 'refs/remotes/origin/master' into master-353-task-cargo-transport

This commit is contained in:
FlightControl 2017-04-17 18:47:22 +02:00
commit 59c89cab39
35 changed files with 1798 additions and 1525 deletions

View File

@ -4,62 +4,22 @@
--
-- ![Banner Image](..\Presentations\AI_Balancer\Dia1.JPG)
--
-- ===
-- ====
--
-- # 1) @{AI_Balancer#AI_BALANCER} class, extends @{Fsm#FSM_SET}
-- # Demo Missions
--
-- The @{AI_Balancer#AI_BALANCER} class monitors and manages as many replacement AI groups as there are
-- CLIENTS in a SET_CLIENT collection, which are not occupied by human players.
-- In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI in multi player missions.
-- ### [AI_BALANCER Demo Missions source code](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/AIB%20-%20AI%20Balancing)
--
-- The parent class @{Fsm#FSM_SET} manages the functionality to control the Finite State Machine (FSM).
-- The mission designer can tailor the behaviour of the AI_BALANCER, by defining event and state transition methods.
-- An explanation about state and event transition methods can be found in the @{FSM} module documentation.
-- ### [AI_BALANCER Demo Missions, only for beta testers](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/AIB%20-%20AI%20Balancing)
--
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases)
--
-- The mission designer can tailor the AI_BALANCER behaviour, by implementing a state or event handling method for the following:
-- ====
--
-- * **@{#AI_BALANCER.OnAfterSpawned}**( AISet, From, Event, To, AIGroup ): Define to add extra logic when an AI is spawned.
-- # YouTube Channel
--
-- ## 1.1) AI_BALANCER construction
-- ### [AI_BALANCER YouTube Channel](https://www.youtube.com/playlist?list=PL7ZUrU4zZUl2CJVIrL1TdAumuVS8n64B7)
--
-- Create a new AI_BALANCER object with the @{#AI_BALANCER.New}() method:
--
-- ## 1.2) AI_BALANCER is a FSM
--
-- ![Process](..\Presentations\AI_Balancer\Dia13.JPG)
--
-- ### 1.2.1) AI_BALANCER States
--
-- * **Monitoring** ( Set ): Monitoring the Set if all AI is spawned for the Clients.
-- * **Spawning** ( Set, ClientName ): There is a new AI group spawned with ClientName as the name of reference.
-- * **Spawned** ( Set, AIGroup ): A new AI has been spawned. You can handle this event to customize the AI behaviour with other AI FSMs or own processes.
-- * **Destroying** ( Set, AIGroup ): The AI is being destroyed.
-- * **Returning** ( Set, AIGroup ): The AI is returning to the airbase specified by the ReturnToAirbase methods. Handle this state to customize the return behaviour of the AI, if any.
--
-- ### 1.2.2) AI_BALANCER Events
--
-- * **Monitor** ( Set ): Every 10 seconds, the Monitor event is triggered to monitor the Set.
-- * **Spawn** ( Set, ClientName ): Triggers when there is a new AI group to be spawned with ClientName as the name of reference.
-- * **Spawned** ( Set, AIGroup ): Triggers when a new AI has been spawned. You can handle this event to customize the AI behaviour with other AI FSMs or own processes.
-- * **Destroy** ( Set, AIGroup ): The AI is being destroyed.
-- * **Return** ( Set, AIGroup ): The AI is returning to the airbase specified by the ReturnToAirbase methods.
--
-- ## 1.3) AI_BALANCER spawn interval for replacement AI
--
-- Use the method @{#AI_BALANCER.InitSpawnInterval}() to set the earliest and latest interval in seconds that is waited until a new replacement AI is spawned.
--
-- ## 1.4) AI_BALANCER returns AI to Airbases
--
-- By default, When a human player joins a slot that is AI_BALANCED, the AI group will be destroyed by default.
-- However, there are 2 additional options that you can use to customize the destroy behaviour.
-- When a human player joins a slot, you can configure to let the AI return to:
--
-- * @{#AI_BALANCER.ReturnToHomeAirbase}: Returns the AI to the **home** @{Airbase#AIRBASE}.
-- * @{#AI_BALANCER.ReturnToNearestAirbases}: Returns the AI to the **nearest friendly** @{Airbase#AIRBASE}.
--
-- Note that when AI returns to an airbase, the AI_BALANCER will trigger the **Return** event and the AI will return,
-- otherwise the AI_BALANCER will trigger a **Destroy** event, and the AI will be destroyed.
--
-- ===
--
-- # **API CHANGE HISTORY**
@ -90,12 +50,68 @@
--
-- @module AI_Balancer
--- AI_BALANCER class
-- @type AI_BALANCER
--- @type AI_BALANCER
-- @field Core.Set#SET_CLIENT SetClient
-- @field Functional.Spawn#SPAWN SpawnAI
-- @field Wrapper.Group#GROUP Test
-- @extends Core.Fsm#FSM_SET
--- # AI_BALANCER class, extends @{Fsm#FSM_SET}
--
-- The AI_BALANCER class monitors and manages as many replacement AI groups as there are
-- CLIENTS in a SET_CLIENT collection, which are not occupied by human players.
-- In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI in multi player missions.
--
-- The parent class @{Fsm#FSM_SET} manages the functionality to control the Finite State Machine (FSM).
-- The mission designer can tailor the behaviour of the AI_BALANCER, by defining event and state transition methods.
-- An explanation about state and event transition methods can be found in the @{FSM} module documentation.
--
-- The mission designer can tailor the AI_BALANCER behaviour, by implementing a state or event handling method for the following:
--
-- * @{#AI_BALANCER.OnAfterSpawned}( AISet, From, Event, To, AIGroup ): Define to add extra logic when an AI is spawned.
--
-- ## 1. AI_BALANCER construction
--
-- Create a new AI_BALANCER object with the @{#AI_BALANCER.New}() method:
--
-- ## 2. AI_BALANCER is a FSM
--
-- ![Process](..\Presentations\AI_Balancer\Dia13.JPG)
--
-- ### 2.1. AI_BALANCER States
--
-- * **Monitoring** ( Set ): Monitoring the Set if all AI is spawned for the Clients.
-- * **Spawning** ( Set, ClientName ): There is a new AI group spawned with ClientName as the name of reference.
-- * **Spawned** ( Set, AIGroup ): A new AI has been spawned. You can handle this event to customize the AI behaviour with other AI FSMs or own processes.
-- * **Destroying** ( Set, AIGroup ): The AI is being destroyed.
-- * **Returning** ( Set, AIGroup ): The AI is returning to the airbase specified by the ReturnToAirbase methods. Handle this state to customize the return behaviour of the AI, if any.
--
-- ### 2.2. AI_BALANCER Events
--
-- * **Monitor** ( Set ): Every 10 seconds, the Monitor event is triggered to monitor the Set.
-- * **Spawn** ( Set, ClientName ): Triggers when there is a new AI group to be spawned with ClientName as the name of reference.
-- * **Spawned** ( Set, AIGroup ): Triggers when a new AI has been spawned. You can handle this event to customize the AI behaviour with other AI FSMs or own processes.
-- * **Destroy** ( Set, AIGroup ): The AI is being destroyed.
-- * **Return** ( Set, AIGroup ): The AI is returning to the airbase specified by the ReturnToAirbase methods.
--
-- ## 3. AI_BALANCER spawn interval for replacement AI
--
-- Use the method @{#AI_BALANCER.InitSpawnInterval}() to set the earliest and latest interval in seconds that is waited until a new replacement AI is spawned.
--
-- ## 4. AI_BALANCER returns AI to Airbases
--
-- By default, When a human player joins a slot that is AI_BALANCED, the AI group will be destroyed by default.
-- However, there are 2 additional options that you can use to customize the destroy behaviour.
-- When a human player joins a slot, you can configure to let the AI return to:
--
-- * @{#AI_BALANCER.ReturnToHomeAirbase}: Returns the AI to the **home** @{Airbase#AIRBASE}.
-- * @{#AI_BALANCER.ReturnToNearestAirbases}: Returns the AI to the **nearest friendly** @{Airbase#AIRBASE}.
--
-- Note that when AI returns to an airbase, the AI_BALANCER will trigger the **Return** event and the AI will return,
-- otherwise the AI_BALANCER will trigger a **Destroy** event, and the AI will be destroyed.
--
-- @field #AI_BALANCER
AI_BALANCER = {
ClassName = "AI_BALANCER",
PatrolZones = {},

View File

@ -11,6 +11,22 @@
-- * @{#AI_CAP_ZONE}: Perform a CAP in a zone.
--
-- ====
--
-- # Demo Missions
--
-- ### [AI_CAP Demo Missions source code](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/CAP%20-%20Combat%20Air%20Patrol)
--
-- ### [AI_CAP Demo Missions, only for beta testers](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/CAP%20-%20Combat%20Air%20Patrol)
--
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases)
--
-- ====
--
-- # YouTube Channel
--
-- ### [AI_CAP YouTube Channel](https://www.youtube.com/playlist?list=PL7ZUrU4zZUl1YCyPxJgoZn-CfhwyeW65L)
--
-- ====
--
-- # **API CHANGE HISTORY**
--
@ -48,9 +64,9 @@
-- @extends AI.AI_Patrol#AI_PATROL_ZONE
--- # 1) @{#AI_CAP_ZONE} class, extends @{AI_CAP#AI_PATROL_ZONE}
--- # AI_CAP_ZONE class, extends @{AI_CAP#AI_PATROL_ZONE}
--
-- The @{#AI_CAP_ZONE} class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}
-- The AI_CAP_ZONE class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
--
-- ![Process](..\Presentations\AI_CAP\Dia3.JPG)
@ -81,22 +97,22 @@
--
-- ![Process](..\Presentations\AI_CAP\Dia13.JPG)
--
-- ## 1.1) AI_CAP_ZONE constructor
-- ## 1. AI_CAP_ZONE constructor
--
-- * @{#AI_CAP_ZONE.New}(): Creates a new AI_CAP_ZONE object.
--
-- ## 1.2) AI_CAP_ZONE is a FSM
-- ## 2. AI_CAP_ZONE is a FSM
--
-- ![Process](..\Presentations\AI_CAP\Dia2.JPG)
--
-- ### 1.2.1) AI_CAP_ZONE States
-- ### 2.1 AI_CAP_ZONE States
--
-- * **None** ( Group ): The process is not started yet.
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
-- * **Engaging** ( Group ): The AI is engaging the bogeys.
-- * **Returning** ( Group ): The AI is returning to Base..
--
-- ### 1.2.2) AI_CAP_ZONE Events
-- ### 2.2 AI_CAP_ZONE Events
--
-- * **@{AI_Patrol#AI_PATROL_ZONE.Start}**: Start the process.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Route}**: Route the AI to a new random 3D point within the Patrol Zone.
@ -109,7 +125,7 @@
-- * **@{#AI_CAP_ZONE.Destroyed}**: The AI has destroyed all bogeys @{Unit}s assigned in the CAS task.
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
--
-- ## 1.3) Set the Range of Engagement
-- ## 3. Set the Range of Engagement
--
-- ![Range](..\Presentations\AI_CAP\Dia11.JPG)
--
@ -119,7 +135,7 @@
-- The range is applied at the position of the AI.
-- Use the method @{AI_CAP#AI_CAP_ZONE.SetEngageRange}() to define that range.
--
-- ## 1.4) Set the Zone of Engagement
-- ## 4. Set the Zone of Engagement
--
-- ![Zone](..\Presentations\AI_CAP\Dia12.JPG)
--
@ -129,8 +145,7 @@
--
-- ===
--
-- @field #AI_CAP_ZONE AI_CAP_ZONE
--
-- @field #AI_CAP_ZONE
AI_CAP_ZONE = {
ClassName = "AI_CAP_ZONE",
}

View File

@ -10,6 +10,22 @@
--
-- * @{#AI_CAS_ZONE}: Perform a CAS in a zone.
--
-- ====
--
-- # Demo Missions
--
-- ### [AI_CAS Demo Missions source code](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/CAS%20-%20Close%20Air%20Support)
--
-- ### [AI_CAS Demo Missions, only for beta testers](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/CAS%20-%20Close%20Air%20Support)
--
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases)
--
-- ====
--
-- # YouTube Channel
--
-- ### [AI_CAS YouTube Channel](https://www.youtube.com/playlist?list=PL7ZUrU4zZUl3JBO1WDqqpyYRRmIkR2ir2)
--
-- ===
--
-- # **API CHANGE HISTORY**
@ -46,11 +62,11 @@
-- @field Core.Zone#ZONE_BASE TargetZone The @{Zone} where the patrol needs to be executed.
-- @extends AI.AI_Patrol#AI_PATROL_ZONE
--- # 1) @{#AI_CAS_ZONE} class, extends @{AI_Patrol#AI_PATROL_ZONE}
--- # AI_CAS_ZONE class, extends @{AI_Patrol#AI_PATROL_ZONE}
--
-- @{#AI_CAS_ZONE} derives from the @{AI_Patrol#AI_PATROL_ZONE}, inheriting its methods and behaviour.
-- AI_CAS_ZONE derives from the @{AI_Patrol#AI_PATROL_ZONE}, inheriting its methods and behaviour.
--
-- The @{#AI_CAS_ZONE} class implements the core functions to provide Close Air Support in an Engage @{Zone} by an AIR @{Controllable} or @{Group}.
-- The AI_CAS_ZONE class implements the core functions to provide Close Air Support in an Engage @{Zone} by an AIR @{Controllable} or @{Group}.
-- The AI_CAS_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.
--
-- ![HoldAndEngage](..\Presentations\AI_CAS\Dia3.JPG)
@ -104,22 +120,22 @@
--
-- ![Engage Event](..\Presentations\AI_CAS\Dia12.JPG)
--
-- # 1.1) AI_CAS_ZONE constructor
-- # 1. AI_CAS_ZONE constructor
--
-- * @{#AI_CAS_ZONE.New}(): Creates a new AI_CAS_ZONE object.
--
-- ## 1.2) AI_CAS_ZONE is a FSM
-- ## 2. AI_CAS_ZONE is a FSM
--
-- ![Process](..\Presentations\AI_CAS\Dia2.JPG)
--
-- ### 1.2.1) AI_CAS_ZONE States
-- ### 2.1. AI_CAS_ZONE States
--
-- * **None** ( Group ): The process is not started yet.
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
-- * **Engaging** ( Group ): The AI is engaging the targets in the Engage Zone, executing CAS.
-- * **Returning** ( Group ): The AI is returning to Base..
--
-- ### 1.2.2) AI_CAS_ZONE Events
-- ### 2.2. AI_CAS_ZONE Events
--
-- * **@{AI_Patrol#AI_PATROL_ZONE.Start}**: Start the process.
-- * **@{AI_Patrol#AI_PATROL_ZONE.Route}**: Route the AI to a new random 3D point within the Patrol Zone.
@ -134,8 +150,7 @@
--
-- ===
--
-- @field #AI_CAS_ZONE AI_CAS_ZONE
--
-- @field #AI_CAS_ZONE
AI_CAS_ZONE = {
ClassName = "AI_CAS_ZONE",
}

View File

@ -12,6 +12,22 @@
--
-- ====
--
-- # Demo Missions
--
-- ### [AI_PATROL Demo Missions source code](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/PAT%20-%20Patrolling)
--
-- ### [AI_PATROL Demo Missions, only for beta testers](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/PAT%20-%20Patrolling)
--
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases)
--
-- ====
--
-- # YouTube Channel
--
-- ### [AI_PATROL YouTube Channel](https://www.youtube.com/playlist?list=PL7ZUrU4zZUl35HvYZKA6G22WMt7iI3zky)
--
-- ====
--
-- # **OPEN ISSUES**
--
-- 2017-01-17: When Spawned AI is located at an airbase, it will be routed first back to the airbase after take-off.
@ -64,9 +80,9 @@
-- @field Functional.Spawn#SPAWN CoordTest
-- @extends Core.Fsm#FSM_CONTROLLABLE
--- # 1) @{#AI_PATROL_ZONE} class, extends @{Fsm#FSM_CONTROLLABLE}
--- # AI_PATROL_ZONE class, extends @{Fsm#FSM_CONTROLLABLE}
--
-- The @{#AI_PATROL_ZONE} class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}.
-- The AI_PATROL_ZONE class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}.
--
-- ![Process](..\Presentations\AI_PATROL\Dia3.JPG)
--
@ -97,15 +113,15 @@
--
-- ![Process](..\Presentations\AI_PATROL\Dia11.JPG)
--
-- ## 1.1) AI_PATROL_ZONE constructor
-- ## 1. AI_PATROL_ZONE constructor
--
-- * @{#AI_PATROL_ZONE.New}(): Creates a new AI_PATROL_ZONE object.
--
-- ## 1.2) AI_PATROL_ZONE is a FSM
-- ## 2. AI_PATROL_ZONE is a FSM
--
-- ![Process](..\Presentations\AI_PATROL\Dia2.JPG)
--
-- ### 1.2.1) AI_PATROL_ZONE States
-- ### 2.1. AI_PATROL_ZONE States
--
-- * **None** ( Group ): The process is not started yet.
-- * **Patrolling** ( Group ): The AI is patrolling the Patrol Zone.
@ -113,7 +129,7 @@
-- * **Stopped** ( Group ): The process is stopped.
-- * **Crashed** ( Group ): The AI has crashed or is dead.
--
-- ### 1.2.2) AI_PATROL_ZONE Events
-- ### 2.2. AI_PATROL_ZONE Events
--
-- * **Start** ( Group ): Start the process.
-- * **Stop** ( Group ): Stop the process.
@ -123,17 +139,17 @@
-- * **Detected** ( Group ): The AI has detected new targets.
-- * **Status** ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.
--
-- ## 1.3) Set or Get the AI controllable
-- ## 3. Set or Get the AI controllable
--
-- * @{#AI_PATROL_ZONE.SetControllable}(): Set the AIControllable.
-- * @{#AI_PATROL_ZONE.GetControllable}(): Get the AIControllable.
--
-- ## 1.4) Set the Speed and Altitude boundaries of the AI controllable
-- ## 4. Set the Speed and Altitude boundaries of the AI controllable
--
-- * @{#AI_PATROL_ZONE.SetSpeed}(): Set the patrol speed boundaries of the AI, for the next patrol.
-- * @{#AI_PATROL_ZONE.SetAltitude}(): Set altitude boundaries of the AI, for the next patrol.
--
-- ## 1.5) Manage the detection process of the AI controllable
-- ## 5. Manage the detection process of the AI controllable
--
-- The detection process of the AI controllable can be manipulated.
-- Detection requires an amount of CPU power, which has an impact on your mission performance.
@ -150,7 +166,7 @@
-- Note that when the zone is too far away, or the AI is not heading towards the zone, or the AI is too high, no targets may be detected
-- according the weather conditions.
--
-- ## 1.6) Manage the "out of fuel" in the AI_PATROL_ZONE
-- ## 6. Manage the "out of fuel" in the AI_PATROL_ZONE
--
-- When the AI is out of fuel, it is required that a new AI is started, before the old AI 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.
@ -159,7 +175,7 @@
-- Once the time is finished, the old AI will return to the base.
-- Use the method @{#AI_PATROL_ZONE.ManageFuel}() to have this proces in place.
--
-- ## 1.7) Manage "damage" behaviour of the AI in the AI_PATROL_ZONE
-- ## 7. Manage "damage" behaviour of the AI in the AI_PATROL_ZONE
--
-- When the AI is damaged, it is required that a new AIControllable is started. However, damage cannon be foreseen early on.
-- Therefore, when the damage treshold is reached, the AI will return immediately to the home base (RTB).
@ -167,8 +183,7 @@
--
-- ===
--
-- @field #AI_PATROL_ZONE AI_PATROL_ZONE
--
-- @field #AI_PATROL_ZONE
AI_PATROL_ZONE = {
ClassName = "AI_PATROL_ZONE",
}

View File

@ -5,6 +5,8 @@
--
-- ===
--
-- A Finite State Machine (FSM) models a process flow that transitions between various **States** through triggered **Events**.
--
-- A FSM can only be in one of a finite number of states.
-- The machine is in only one state at a time; the state it is in at any given time is called the **current state**.
-- It can change from one state to another when initiated by an **__internal__ or __external__ triggering event**, which is called a **transition**.
@ -90,8 +92,43 @@ do -- FSM
-- @extends Core.Base#BASE
--- # 1) FSM class, extends @{Base#BASE}
--- # FSM class, extends @{Base#BASE}
--
-- A Finite State Machine (FSM) models a process flow that transitions between various **States** through triggered **Events**.
--
-- A FSM can only be in one of a finite number of states.
-- The machine is in only one state at a time; the state it is in at any given time is called the **current state**.
-- It can change from one state to another when initiated by an **__internal__ or __external__ triggering event**, which is called a **transition**.
-- An **FSM implementation** is defined by **a list of its states**, **its initial state**, and **the triggering events** for **each possible transition**.
-- An FSM implementation is composed out of **two parts**, a set of **state transition rules**, and an implementation set of **state transition handlers**, implementing those transitions.
--
-- The FSM class supports a **hierarchical implementation of a Finite State Machine**,
-- that is, it allows to **embed existing FSM implementations in a master FSM**.
-- FSM hierarchies allow for efficient FSM re-use, **not having to re-invent the wheel every time again** when designing complex processes.
--
-- ![Workflow Example](..\Presentations\FSM\Dia2.JPG)
--
-- The above diagram shows a graphical representation of a FSM implementation for a **Task**, which guides a Human towards a Zone,
-- orders him to destroy x targets and account the results.
-- Other examples of ready made FSM could be:
--
-- * route a plane to a zone flown by a human
-- * detect targets by an AI and report to humans
-- * account for destroyed targets by human players
-- * handle AI infantry to deploy from or embark to a helicopter or airplane or vehicle
-- * let an AI patrol a zone
--
-- The **MOOSE framework** uses extensively the FSM class and derived FSM\_ classes,
-- because **the goal of MOOSE is to simplify mission design complexity for mission building**.
-- By efficiently utilizing the FSM class and derived classes, MOOSE allows mission designers to quickly build processes.
-- **Ready made FSM-based implementations classes** exist within the MOOSE framework that **can easily be re-used,
-- and tailored** by mission designers through **the implementation of Transition Handlers**.
-- Each of these FSM implementation classes start either with:
--
-- * an acronym **AI\_**, which indicates an FSM implementation directing **AI controlled** @{GROUP} and/or @{UNIT}. These AI\_ classes derive the @{#FSM_CONTROLLABLE} class.
-- * an acronym **TASK\_**, which indicates an FSM implementation executing a @{TASK} executed by Groups of players. These TASK\_ classes derive the @{#FSM_TASK} class.
-- * an acronym **ACT\_**, which indicates an Sub-FSM implementation, directing **Humans actions** that need to be done in a @{TASK}, seated in a @{CLIENT} (slot) or a @{UNIT} (CA join). These ACT\_ classes derive the @{#FSM_PROCESS} class.
--
-- ![Transition Rules and Transition Handlers and Event Triggers](..\Presentations\FSM\Dia3.JPG)
--
-- The FSM class is the base class of all FSM\_ derived classes. It implements the main functionality to define and execute Finite State Machines.
@ -114,13 +151,13 @@ do -- FSM
-- As explained above, a FSM supports **Linear State Transitions** and **Hierarchical State Transitions**, and both can be mixed to make a comprehensive FSM implementation.
-- The below documentation has a seperate chapter explaining both transition modes, taking into account the **Transition Rules**, **Transition Handlers** and **Event Triggers**.
--
-- ## 1.1) FSM Linear Transitions
-- ## FSM Linear Transitions
--
-- Linear Transitions are Transition Rules allowing an FSM to transition from one or multiple possible **From** state(s) towards a **To** state upon a Triggered **Event**.
-- The Lineair transition rule evaluation will always be done from the **current state** of the FSM.
-- If no valid Transition Rule can be found in the FSM, the FSM will log an error and stop.
--
-- ### 1.1.1) FSM Transition Rules
-- ### FSM Transition Rules
--
-- The FSM has transition rules that it follows and validates, as it walks the process.
-- These rules define when an FSM can transition from a specific state towards an other specific state upon a triggered event.
@ -145,7 +182,7 @@ do -- FSM
-- * It can be switched **Off** by triggering event **SwitchOff**.
-- * Note that once the Switch is **On** or **Middle**, it can only be switched **Off**.
--
-- ### Some additional comments:
-- #### Some additional comments:
--
-- Note that Linear Transition Rules **can be declared in a few variations**:
--
@ -156,7 +193,7 @@ do -- FSM
--
-- FsmSwitch:AddTransition( { "On", "Middle" }, "SwitchOff", "Off" )
--
-- ### 1.1.2) Transition Handling
-- ### Transition Handling
--
-- ![Transition Handlers](..\Presentations\FSM\Dia4.JPG)
--
@ -178,7 +215,7 @@ do -- FSM
--
-- On top, each of these methods can have a variable amount of parameters passed. See the example in section [1.1.3](#1.1.3\)-event-triggers).
--
-- ### 1.1.3) Event Triggers
-- ### Event Triggers
--
-- ![Event Triggers](..\Presentations\FSM\Dia5.JPG)
--
@ -216,7 +253,7 @@ do -- FSM
--
-- Because ... When Event was asynchronously processed after 5 seconds, Amount was set to 2. So be careful when processing and passing values and objects in asynchronous processing!
--
-- ### 1.1.4) Linear Transition Example
-- ### Linear Transition Example
--
-- This example is fully implemented in the MOOSE test mission on GITHUB: [FSM-100 - Transition Explanation](https://github.com/FlightControl-Master/MOOSE/blob/master/Moose%20Test%20Missions/FSM%20-%20Finite%20State%20Machine/FSM-100%20-%20Transition%20Explanation/FSM-100%20-%20Transition%20Explanation.lua)
--
@ -298,7 +335,7 @@ do -- FSM
-- So... When FsmDemo:Stop() is being triggered, the state of FsmDemo will transition from Red or Green to Stopped.
-- And there is no transition handling method defined for that transition, thus, no new event is being triggered causing the FsmDemo process flow to halt.
--
-- ## 1.5) FSM Hierarchical Transitions
-- ## FSM Hierarchical Transitions
--
-- Hierarchical Transitions allow to re-use readily available and implemented FSMs.
-- This becomes in very useful for mission building, where mission designers build complex processes and workflows,

View File

@ -27,109 +27,26 @@
--
-- ===
--
-- The above menus classes **are derived** from 2 main **abstract** classes defined within the MOOSE framework (so don't use these):
-- # **AUTHORS and CONTRIBUTIONS**
--
-- 1) MENU_ BASE abstract base classes (don't use them)
-- ====================================================
-- The underlying base menu classes are **NOT** to be used within your missions.
-- These are simply abstract base classes defining a couple of fields that are used by the
-- derived MENU_ classes to manage menus.
-- ### Contributions:
--
-- 1.1) @{#MENU_BASE} class, extends @{Base#BASE}
-- --------------------------------------------------
-- The @{#MENU_BASE} class defines the main MENU class where other MENU classes are derived from.
--
-- 1.2) @{#MENU_COMMAND_BASE} class, extends @{Base#BASE}
-- ----------------------------------------------------------
-- The @{#MENU_COMMAND_BASE} class defines the main MENU class where other MENU COMMAND_ classes are derived from, in order to set commands.
--
-- ===
--
-- **The next menus define the MENU classes that you can use within your missions.**
--
-- 2) MENU MISSION classes
-- ======================
-- The underlying classes manage the menus for a complete mission file.
--
-- 2.1) @{#MENU_MISSION} class, extends @{Menu#MENU_BASE}
-- ---------------------------------------------------------
-- The @{Menu#MENU_MISSION} class manages the main menus for a complete mission.
-- You can add menus with the @{#MENU_MISSION.New} method, which constructs a MENU_MISSION object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_MISSION.Remove}.
--
-- 2.2) @{#MENU_MISSION_COMMAND} class, extends @{Menu#MENU_COMMAND_BASE}
-- -------------------------------------------------------------------------
-- The @{Menu#MENU_MISSION_COMMAND} class manages the command menus for a complete mission, which allow players to execute functions during mission execution.
-- You can add menus with the @{#MENU_MISSION_COMMAND.New} method, which constructs a MENU_MISSION_COMMAND object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_MISSION_COMMAND.Remove}.
--
-- ===
--
-- 3) MENU COALITION classes
-- =========================
-- The underlying classes manage the menus for whole coalitions.
--
-- 3.1) @{#MENU_COALITION} class, extends @{Menu#MENU_BASE}
-- ------------------------------------------------------------
-- The @{Menu#MENU_COALITION} class manages the main menus for coalitions.
-- You can add menus with the @{#MENU_COALITION.New} method, which constructs a MENU_COALITION object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_COALITION.Remove}.
--
-- 3.2) @{Menu#MENU_COALITION_COMMAND} class, extends @{Menu#MENU_COMMAND_BASE}
-- ----------------------------------------------------------------------------
-- The @{Menu#MENU_COALITION_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
-- You can add menus with the @{#MENU_COALITION_COMMAND.New} method, which constructs a MENU_COALITION_COMMAND object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_COALITION_COMMAND.Remove}.
--
-- ===
--
-- 4) MENU GROUP classes
-- =====================
-- The underlying classes manage the menus for groups. Note that groups can be inactive, alive or can be destroyed.
--
-- 4.1) @{Menu#MENU_GROUP} class, extends @{Menu#MENU_BASE}
-- --------------------------------------------------------
-- The @{Menu#MENU_GROUP} class manages the main menus for coalitions.
-- You can add menus with the @{#MENU_GROUP.New} method, which constructs a MENU_GROUP object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_GROUP.Remove}.
--
-- 4.2) @{Menu#MENU_GROUP_COMMAND} class, extends @{Menu#MENU_COMMAND_BASE}
-- ------------------------------------------------------------------------
-- The @{Menu#MENU_GROUP_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
-- You can add menus with the @{#MENU_GROUP_COMMAND.New} method, which constructs a MENU_GROUP_COMMAND object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_GROUP_COMMAND.Remove}.
--
-- ===
--
-- 5) MENU CLIENT classes
-- ======================
-- The underlying classes manage the menus for units with skill level client or player.
--
-- 5.1) @{Menu#MENU_CLIENT} class, extends @{Menu#MENU_BASE}
-- ---------------------------------------------------------
-- The @{Menu#MENU_CLIENT} class manages the main menus for coalitions.
-- You can add menus with the @{#MENU_CLIENT.New} method, which constructs a MENU_CLIENT object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_CLIENT.Remove}.
--
-- 5.2) @{Menu#MENU_CLIENT_COMMAND} class, extends @{Menu#MENU_COMMAND_BASE}
-- -------------------------------------------------------------------------
-- The @{Menu#MENU_CLIENT_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
-- You can add menus with the @{#MENU_CLIENT_COMMAND.New} method, which constructs a MENU_CLIENT_COMMAND object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_CLIENT_COMMAND.Remove}.
--
-- ===
--
-- ### Contributions: -
-- ### Authors: FlightControl : Design & Programming
-- ### Authors:
--
-- * **FlightControl**: Design & Programming
--
-- @module Menu
do -- MENU_BASE
--- The MENU_BASE class
-- @type MENU_BASE
--- @type MENU_BASE
-- @extends Base#BASE
--- # MENU_BASE class, extends @{Base#BASE}
-- The MENU_BASE class defines the main MENU class where other MENU classes are derived from.
-- This is an abstract class, so don't use it.
-- @field #MENU_BASE
MENU_BASE = {
ClassName = "MENU_BASE",
MenuPath = nil,
@ -193,10 +110,15 @@ end
do -- MENU_COMMAND_BASE
--- The MENU_COMMAND_BASE class
-- @type MENU_COMMAND_BASE
--- @type MENU_COMMAND_BASE
-- @field #function MenuCallHandler
-- @extends Core.Menu#MENU_BASE
--- # MENU_COMMAND_BASE class, extends @{Base#BASE}
-- ----------------------------------------------------------
-- The MENU_COMMAND_BASE class defines the main MENU class where other MENU COMMAND_
-- classes are derived from, in order to set commands.
-- @field #MENU_COMMAND_BASE
MENU_COMMAND_BASE = {
ClassName = "MENU_COMMAND_BASE",
CommandMenuFunction = nil,
@ -224,9 +146,15 @@ end
do -- MENU_MISSION
--- The MENU_MISSION class
-- @type MENU_MISSION
--- @type MENU_MISSION
-- @extends Core.Menu#MENU_BASE
--- # MENU_MISSION class, extends @{Menu#MENU_BASE}
--
-- The MENU_MISSION class manages the main menus for a complete mission.
-- You can add menus with the @{#MENU_MISSION.New} method, which constructs a MENU_MISSION object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_MISSION.Remove}.
-- @field #MENU_MISSION
MENU_MISSION = {
ClassName = "MENU_MISSION"
}
@ -291,9 +219,16 @@ end
do -- MENU_MISSION_COMMAND
--- The MENU_MISSION_COMMAND class
-- @type MENU_MISSION_COMMAND
--- @type MENU_MISSION_COMMAND
-- @extends Core.Menu#MENU_COMMAND_BASE
--- # MENU_MISSION_COMMAND class, extends @{Menu#MENU_COMMAND_BASE}
--
-- The MENU_MISSION_COMMAND class manages the command menus for a complete mission, which allow players to execute functions during mission execution.
-- You can add menus with the @{#MENU_MISSION_COMMAND.New} method, which constructs a MENU_MISSION_COMMAND object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_MISSION_COMMAND.Remove}.
--
-- @field #MENU_MISSION_COMMAND
MENU_MISSION_COMMAND = {
ClassName = "MENU_MISSION_COMMAND"
}
@ -341,9 +276,16 @@ end
do -- MENU_COALITION
--- The MENU_COALITION class
-- @type MENU_COALITION
--- @type MENU_COALITION
-- @extends Core.Menu#MENU_BASE
--- # MENU_COALITION class, extends @{Menu#MENU_BASE}
--
-- The @{Menu#MENU_COALITION} class manages the main menus for coalitions.
-- You can add menus with the @{#MENU_COALITION.New} method, which constructs a MENU_COALITION object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_COALITION.Remove}.
--
--
-- @usage
-- -- This demo creates a menu structure for the planes within the red coalition.
-- -- To test, join the planes, then look at the other radio menus (Option F10).
@ -380,6 +322,8 @@ do -- MENU_COALITION
--
-- local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
-- local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
--
-- @field #MENU_COALITION
MENU_COALITION = {
ClassName = "MENU_COALITION"
}
@ -446,9 +390,16 @@ end
do -- MENU_COALITION_COMMAND
--- The MENU_COALITION_COMMAND class
-- @type MENU_COALITION_COMMAND
--- @type MENU_COALITION_COMMAND
-- @extends Core.Menu#MENU_COMMAND_BASE
--- # MENU_COALITION_COMMAND class, extends @{Menu#MENU_COMMAND_BASE}
--
-- The MENU_COALITION_COMMAND class manages the command menus for coalitions, which allow players to execute functions during mission execution.
-- You can add menus with the @{#MENU_COALITION_COMMAND.New} method, which constructs a MENU_COALITION_COMMAND object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_COALITION_COMMAND.Remove}.
--
-- @field #MENU_COALITION_COMMAND
MENU_COALITION_COMMAND = {
ClassName = "MENU_COALITION_COMMAND"
}
@ -506,6 +457,14 @@ do -- MENU_CLIENT
--- MENU_COALITION constructor. Creates a new radio command item for a coalition, which can invoke a function with parameters.
-- @type MENU_CLIENT
-- @extends Core.Menu#MENU_BASE
--- # MENU_CLIENT class, extends @{Menu#MENU_BASE}
--
-- The MENU_CLIENT class manages the main menus for coalitions.
-- You can add menus with the @{#MENU_CLIENT.New} method, which constructs a MENU_CLIENT object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_CLIENT.Remove}.
--
-- @usage
-- -- This demo creates a menu structure for the two clients of planes.
-- -- Each client will receive a different menu structure.
@ -555,6 +514,8 @@ do -- MENU_CLIENT
-- MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneClient )
-- end
-- end, {}, 10, 10 )
--
-- @field #MENU_CLIENT
MENU_CLIENT = {
ClassName = "MENU_CLIENT"
}
@ -644,9 +605,16 @@ do -- MENU_CLIENT
end
--- The MENU_CLIENT_COMMAND class
-- @type MENU_CLIENT_COMMAND
--- @type MENU_CLIENT_COMMAND
-- @extends Core.Menu#MENU_COMMAND
--- # MENU_CLIENT_COMMAND class, extends @{Menu#MENU_COMMAND_BASE}
--
-- The MENU_CLIENT_COMMAND class manages the command menus for coalitions, which allow players to execute functions during mission execution.
-- You can add menus with the @{#MENU_CLIENT_COMMAND.New} method, which constructs a MENU_CLIENT_COMMAND object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_CLIENT_COMMAND.Remove}.
--
-- @field #MENU_CLIENT_COMMAND
MENU_CLIENT_COMMAND = {
ClassName = "MENU_CLIENT_COMMAND"
}
@ -730,9 +698,16 @@ do
-- These menu classes are handling this logic with this variable.
local _MENUGROUPS = {}
--- The MENU_GROUP class
-- @type MENU_GROUP
--- @type MENU_GROUP
-- @extends Core.Menu#MENU_BASE
--- #MENU_GROUP class, extends @{Menu#MENU_BASE}
--
-- The MENU_GROUP class manages the main menus for coalitions.
-- You can add menus with the @{#MENU_GROUP.New} method, which constructs a MENU_GROUP object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_GROUP.Remove}.
--
-- @usage
-- -- This demo creates a menu structure for the two groups of planes.
-- -- Each group will receive a different menu structure.
@ -783,6 +758,7 @@ do
-- end
-- end, {}, 10, 10 )
--
-- @field #MENU_GROUP
MENU_GROUP = {
ClassName = "MENU_GROUP"
}
@ -876,9 +852,16 @@ do
end
--- The MENU_GROUP_COMMAND class
-- @type MENU_GROUP_COMMAND
--- @type MENU_GROUP_COMMAND
-- @extends Core.Menu#MENU_BASE
--- # MENU_GROUP_COMMAND class, extends @{Menu#MENU_COMMAND_BASE}
--
-- The @{Menu#MENU_GROUP_COMMAND} class manages the command menus for coalitions, which allow players to execute functions during mission execution.
-- You can add menus with the @{#MENU_GROUP_COMMAND.New} method, which constructs a MENU_GROUP_COMMAND object and returns you the object reference.
-- Using this object reference, you can then remove ALL the menus and submenus underlying automatically with @{#MENU_GROUP_COMMAND.Remove}.
--
-- @field #MENU_GROUP_COMMAND
MENU_GROUP_COMMAND = {
ClassName = "MENU_GROUP_COMMAND"
}

View File

@ -4,18 +4,24 @@
--
-- ===
--
-- # 1) @{Message#MESSAGE} class, extends @{Base#BASE}
-- @module Message
--- The MESSAGE class
-- @type MESSAGE
-- @extends Core.Base#BASE
--- # MESSAGE class, extends @{Base#BASE}
--
-- Message System to display Messages to Clients, Coalitions or All.
-- Messages are shown on the display panel for an amount of seconds, and will then disappear.
-- Messages can contain a category which is indicating the category of the message.
--
-- ## 1.1) MESSAGE construction
-- ## MESSAGE construction
--
-- Messages are created with @{Message#MESSAGE.New}. Note that when the MESSAGE object is created, no message is sent yet.
-- To send messages, you need to use the To functions.
--
-- ## 1.2) Send messages to an audience
-- ## Send messages to an audience
--
-- Messages are sent:
--
@ -26,19 +32,14 @@
-- * To the blue coalition using @{Message#MESSAGE.ToBlue}().
-- * To all Players using @{Message#MESSAGE.ToAll}().
--
-- ## 1.3) Send conditionally to an audience
-- ## Send conditionally to an audience
--
-- Messages can be sent conditionally to an audience (when a condition is true):
--
-- * To all players using @{Message#MESSAGE.ToAllIf}().
-- * To a coalition using @{Message#MESSAGE.ToCoalitionIf}().
--
--
-- @module Message
--- The MESSAGE class
-- @type MESSAGE
-- @extends Core.Base#BASE
-- @field #MESSAGE
MESSAGE = {
ClassName = "MESSAGE",
MessageCategory = 0,

View File

@ -1,91 +1,22 @@
--- **Core** - **POINT\_VEC** classes define an **extensive API** to **manage 3D points** in the simulation space.
--
-- 1) @{Point#POINT_VEC3} class, extends @{Base#BASE}
-- ==================================================
-- The @{Point#POINT_VEC3} class defines a 3D point in the simulator.
--
-- **Important Note:** Most of the functions in this section were taken from MIST, and reworked to OO concepts.
-- In order to keep the credibility of the the author, I want to emphasize that the of the MIST framework was created by Grimes, who you can find on the Eagle Dynamics Forums.
--
-- ## 1.1) POINT_VEC3 constructor
--
-- A new POINT_VEC3 instance can be created with:
--
-- * @{Point#POINT_VEC3.New}(): a 3D point.
-- * @{Point#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}.
--
-- ## 1.2) Manupulate the X, Y, Z coordinates of the point
--
-- A POINT_VEC3 class works in 3D space. It contains internally an X, Y, Z coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Y, Z axis can be retrieved with the methods @{#POINT_VEC3.GetX}(), @{#POINT_VEC3.GetY}(), @{#POINT_VEC3.GetZ}() respectively.
-- The methods @{#POINT_VEC3.SetX}(), @{#POINT_VEC3.SetY}(), @{#POINT_VEC3.SetZ}() change the respective axis with a new value.
-- The current axis values can be changed by using the methods @{#POINT_VEC3.AddX}(), @{#POINT_VEC3.AddY}(), @{#POINT_VEC3.AddZ}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC3 object, so these manipulation methods can be chained... For example:
--
-- local Vec3 = PointVec3:AddX( 100 ):AddZ( 150 ):GetVec3()
--
-- ## 1.3) Create waypoints for routes
--
-- A POINT_VEC3 can prepare waypoints for Ground, Air and Naval groups to be embedded into a Route.
--
--
-- ## 1.5) Smoke, flare, explode, illuminate
--
-- At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods:
--
-- ### 1.5.1) Smoke
--
-- * @{#POINT_VEC3.Smoke}(): To smoke the point in a certain color.
-- * @{#POINT_VEC3.SmokeBlue}(): To smoke the point in blue.
-- * @{#POINT_VEC3.SmokeRed}(): To smoke the point in red.
-- * @{#POINT_VEC3.SmokeOrange}(): To smoke the point in orange.
-- * @{#POINT_VEC3.SmokeWhite}(): To smoke the point in white.
-- * @{#POINT_VEC3.SmokeGreen}(): To smoke the point in green.
--
-- ### 1.5.2) Flare
--
-- * @{#POINT_VEC3.Flare}(): To flare the point in a certain color.
-- * @{#POINT_VEC3.FlareRed}(): To flare the point in red.
-- * @{#POINT_VEC3.FlareYellow}(): To flare the point in yellow.
-- * @{#POINT_VEC3.FlareWhite}(): To flare the point in white.
-- * @{#POINT_VEC3.FlareGreen}(): To flare the point in green.
--
-- ### 1.5.3) Explode
--
-- * @{#POINT_VEC3.Explosion}(): To explode the point with a certain intensity.
--
-- ### 1.5.4) Illuminate
--
-- * @{#POINT_VEC3.IlluminationBomb}(): To illuminate the point.
--
--
-- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3}
-- =========================================================
-- The @{Point#POINT_VEC2} class defines a 2D point in the simulator. The height coordinate (if needed) will be the land height + an optional added height specified.
-- ![Banner Image](..\Presentations\POINT\Dia1.JPG)
--
-- ====
--
-- 2.1) POINT_VEC2 constructor
-- ---------------------------
-- A new POINT_VEC2 instance can be created with:
-- # Demo Missions
--
-- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter.
-- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}.
-- ### [POINT_VEC Demo Missions source code]()
--
-- ## 1.2) Manupulate the X, Altitude, Y coordinates of the 2D point
-- ### [POINT_VEC Demo Missions, only for beta testers]()
--
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases)
--
-- A POINT_VEC2 class works in 2D space, with an altitude setting. It contains internally an X, Altitude, Y coordinate.
-- Methods exist to manupulate these coordinates.
-- ====
--
-- The current X, Altitude, Y axis can be retrieved with the methods @{#POINT_VEC2.GetX}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetY}() respectively.
-- The methods @{#POINT_VEC2.SetX}(), @{#POINT_VEC2.SetAlt}(), @{#POINT_VEC2.SetY}() change the respective axis with a new value.
-- The current Lat(itude), Alt(itude), Lon(gitude) values can also be retrieved with the methods @{#POINT_VEC2.GetLat}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetLon}() respectively.
-- The current axis values can be changed by using the methods @{#POINT_VEC2.AddX}(), @{#POINT_VEC2.AddAlt}(), @{#POINT_VEC2.AddY}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:
-- # YouTube Channel
--
-- local Vec2 = PointVec2:AddX( 100 ):AddY( 2000 ):GetVec2()
-- ### [POINT_VEC YouTube Channel]()
--
-- ===
--
@ -133,6 +64,126 @@
-- @field #POINT_VEC3.RoutePointType RoutePointType
-- @field #POINT_VEC3.RoutePointAction RoutePointAction
-- @extends Core.Base#BASE
--- # POINT_VEC3 class, extends @{Base#BASE}
--
-- POINT_VEC3 defines a 3D point in the simulator and with its methods, you can use or manipulate the point in 3D space.
--
-- **Important Note:** Most of the functions in this section were taken from MIST, and reworked to OO concepts.
-- In order to keep the credibility of the the author,
-- I want to emphasize that the formulas embedded in the MIST framework were created by Grimes or previous authors,
-- who you can find on the Eagle Dynamics Forums.
--
--
-- ## POINT_VEC3 constructor
--
-- A new POINT_VEC3 object can be created with:
--
-- * @{#POINT_VEC3.New}(): a 3D point.
-- * @{#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}.
--
--
-- ## Manupulate the X, Y, Z coordinates of the POINT_VEC3
--
-- A POINT_VEC3 class works in 3D space. It contains internally an X, Y, Z coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Y, Z axis can be retrieved with the methods @{#POINT_VEC3.GetX}(), @{#POINT_VEC3.GetY}(), @{#POINT_VEC3.GetZ}() respectively.
-- The methods @{#POINT_VEC3.SetX}(), @{#POINT_VEC3.SetY}(), @{#POINT_VEC3.SetZ}() change the respective axis with a new value.
-- The current axis values can be changed by using the methods @{#POINT_VEC3.AddX}(), @{#POINT_VEC3.AddY}(), @{#POINT_VEC3.AddZ}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC3 object, so these manipulation methods can be chained... For example:
--
-- local Vec3 = PointVec3:AddX( 100 ):AddZ( 150 ):GetVec3()
--
--
-- ## Create waypoints for routes
--
-- A POINT_VEC3 can prepare waypoints for Ground and Air groups to be embedded into a Route.
--
-- * @{#POINT_VEC3.RoutePointAir}(): Build an air route point.
-- * @{#POINT_VEC3.RoutePointGround}(): Build a ground route point.
--
-- Route points can be used in the Route methods of the @{Group#GROUP} class.
--
--
-- ## Smoke, flare, explode, illuminate
--
-- At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods:
--
-- ### Smoke
--
-- * @{#POINT_VEC3.Smoke}(): To smoke the point in a certain color.
-- * @{#POINT_VEC3.SmokeBlue}(): To smoke the point in blue.
-- * @{#POINT_VEC3.SmokeRed}(): To smoke the point in red.
-- * @{#POINT_VEC3.SmokeOrange}(): To smoke the point in orange.
-- * @{#POINT_VEC3.SmokeWhite}(): To smoke the point in white.
-- * @{#POINT_VEC3.SmokeGreen}(): To smoke the point in green.
--
-- ### Flare
--
-- * @{#POINT_VEC3.Flare}(): To flare the point in a certain color.
-- * @{#POINT_VEC3.FlareRed}(): To flare the point in red.
-- * @{#POINT_VEC3.FlareYellow}(): To flare the point in yellow.
-- * @{#POINT_VEC3.FlareWhite}(): To flare the point in white.
-- * @{#POINT_VEC3.FlareGreen}(): To flare the point in green.
--
-- ### Explode
--
-- * @{#POINT_VEC3.Explosion}(): To explode the point with a certain intensity.
--
-- ### Illuminate
--
-- * @{#POINT_VEC3.IlluminationBomb}(): To illuminate the point.
--
--
-- ## 3D calculation methods
--
-- Various calculation methods exist to use or manipulate 3D space. Find below a short description of each method:
--
-- ### Distance
--
-- * @{#POINT_VEC3.Get3DDistance}(): Obtain the distance from the current 3D point to the provided 3D point in 3D space.
-- * @{#POINT_VEC3.Get2DDistance}(): Obtain the distance from the current 3D point to the provided 3D point in 2D space.
--
-- ### Angle
--
-- * @{#POINT_VEC3.GetAngleDegrees}(): Obtain the angle in degrees from the current 3D point with the provided 3D direction vector.
-- * @{#POINT_VEC3.GetAngleRadians}(): Obtain the angle in radians from the current 3D point with the provided 3D direction vector.
-- * @{#POINT_VEC3.GetDirectionVec3}(): Obtain the 3D direction vector from the current 3D point to the provided 3D point.
--
-- ### Translation
--
-- * @{#POINT_VEC3.Translate}(): Translate the current 3D point towards an other 3D point using the given Distance and Angle.
--
-- ### Get the North correction of the current location
--
-- * @{#POINT_VEC3.GetNorthCorrection}(): Obtains the north correction at the current 3D point.
--
--
-- ## Point Randomization
--
-- Various methods exist to calculate random locations around a given 3D point.
--
-- * @{#POINT_VEC3.GetRandomPointVec2InRadius}(): Provides a random 2D point around the current 3D point, in the given inner to outer band.
-- * @{#POINT_VEC3.GetRandomPointVec3InRadius}(): Provides a random 3D point around the current 3D point, in the given inner to outer band.
-- * @{#POINT_VEC3.GetRandomVec2InRadius}(): Provides a random 2D vector around the current 3D point, in the given inner to outer band.
-- * @{#POINT_VEC3.GetRandomVec3InRadius}(): Provides a random 3D vector around the current 3D point, in the given inner to outer band.
--
--
-- ## Metric system
--
-- * @{#POINT_VEC3.IsMetric}(): Returns if the 3D point is Metric or Nautical Miles.
-- * @{#POINT_VEC3.SetMetric}(): Sets the 3D point to Metric or Nautical Miles.
--
--
-- ## Coorinate text generation
--
-- * @{#POINT_VEC3.ToStringBR}(): Generates a Bearing & Range text in the format of DDD for DI where DDD is degrees and DI is distance.
-- * @{#POINT_VEC3.ToStringLL}(): Generates a Latutude & Longutude text.
--
-- @field #POINT_VEC3 POINT_VEC3
--
POINT_VEC3 = {
ClassName = "POINT_VEC3",
Metric = true,
@ -149,11 +200,38 @@ POINT_VEC3 = {
},
}
--- The POINT_VEC2 class
-- @type POINT_VEC2
--- @type POINT_VEC2
-- @field Dcs.DCSTypes#Distance x The x coordinate in meters.
-- @field Dcs.DCSTypes#Distance y the y coordinate in meters.
-- @extends Core.Point#POINT_VEC3
--- # POINT_VEC2 class, extends @{Point#POINT_VEC3}
--
-- The @{Point#POINT_VEC2} class defines a 2D point in the simulator. The height coordinate (if needed) will be the land height + an optional added height specified.
--
-- ## POINT_VEC2 constructor
--
-- A new POINT_VEC2 instance can be created with:
--
-- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter.
-- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}.
--
-- ## Manupulate the X, Altitude, Y coordinates of the 2D point
--
-- A POINT_VEC2 class works in 2D space, with an altitude setting. It contains internally an X, Altitude, Y coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Altitude, Y axis can be retrieved with the methods @{#POINT_VEC2.GetX}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetY}() respectively.
-- The methods @{#POINT_VEC2.SetX}(), @{#POINT_VEC2.SetAlt}(), @{#POINT_VEC2.SetY}() change the respective axis with a new value.
-- The current Lat(itude), Alt(itude), Lon(gitude) values can also be retrieved with the methods @{#POINT_VEC2.GetLat}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetLon}() respectively.
-- The current axis values can be changed by using the methods @{#POINT_VEC2.AddX}(), @{#POINT_VEC2.AddAlt}(), @{#POINT_VEC2.AddY}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:
--
-- local Vec2 = PointVec2:AddX( 100 ):AddY( 2000 ):GetVec2()
--
-- @field #POINT_VEC2 POINT_VEC2
--
POINT_VEC2 = {
ClassName = "POINT_VEC2",
}

View File

@ -4,31 +4,30 @@
--
-- ===
--
-- # 1) @{Scheduler#SCHEDULER} class, extends @{Base#BASE}
-- SCHEDULER manages the **scheduling of functions**:
--
-- The @{Scheduler#SCHEDULER} class creates schedule.
--
-- ## 1.1) SCHEDULER constructor
--
-- The SCHEDULER class is quite easy to use, but note that the New constructor has variable parameters:
--
-- * @{Scheduler#SCHEDULER.New}( nil ): Setup a new SCHEDULER object, which is persistently executed after garbage collection.
-- * @{Scheduler#SCHEDULER.New}( Object ): Setup a new SCHEDULER object, which is linked to the Object. When the Object is nillified or destroyed, the SCHEDULER object will also be destroyed and stopped after garbage collection.
-- * @{Scheduler#SCHEDULER.New}( nil, Function, FunctionArguments, Start, ... ): Setup a new persistent SCHEDULER object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
-- * @{Scheduler#SCHEDULER.New}( Object, Function, FunctionArguments, Start, ... ): Setup a new SCHEDULER object, linked to Object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
--
-- ## 1.2) SCHEDULER timer stopping and (re-)starting.
--
-- The SCHEDULER can be stopped and restarted with the following methods:
--
-- * @{Scheduler#SCHEDULER.Start}(): (Re-)Start the schedules within the SCHEDULER object. If a CallID is provided to :Start(), only the schedule referenced by CallID will be (re-)started.
-- * @{Scheduler#SCHEDULER.Stop}(): Stop the schedules within the SCHEDULER object. If a CallID is provided to :Stop(), then only the schedule referenced by CallID will be stopped.
--
-- ## 1.3) Create a new schedule
--
-- With @{Scheduler#SCHEDULER.Schedule}() a new time event can be scheduled. This function is used by the :New() constructor when a new schedule is planned.
-- * optionally in an optional specified time interval,
-- * optionally **repeating** with a specified time repeat interval,
-- * optionally **randomizing** with a specified time interval randomization factor,
-- * optionally **stop** the repeating after a specified time interval.
--
-- ===
--
-- # Demo Missions
--
-- ### [SCHEDULER Demo Missions source code](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/SCH%20-%20Scheduler)
--
-- ### [SCHEDULER Demo Missions, only for beta testers](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/SCH%20-%20Scheduler)
--
-- ### [ALL Demo Missions pack of the last release](https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases)
--
-- ====
--
-- # YouTube Channel
--
-- ### [SCHEDULER YouTube Channel (none)]()
--
-- ====
--
-- ### Contributions:
--
@ -38,10 +37,6 @@
--
-- * FlightControl : Design & Programming
--
-- ### Test Missions:
--
-- * SCH - Scheduler
--
-- ===
--
-- @module Scheduler
@ -51,6 +46,153 @@
-- @type SCHEDULER
-- @field #number ScheduleID the ID of the scheduler.
-- @extends Core.Base#BASE
--- # SCHEDULER class, extends @{Base#BASE}
--
-- The SCHEDULER class creates schedule.
--
-- A SCHEDULER can manage **multiple** (repeating) schedules. Each planned or executing schedule has a unique **ScheduleID**.
-- The ScheduleID is returned when the method @{#SCHEDULER.Schedule}() is called.
-- It is recommended to store the ScheduleID in a variable, as it is used in the methods @{SCHEDULER.Start}() and @{SCHEDULER.Stop}(),
-- which can start and stop specific repeating schedules respectively within a SCHEDULER object.
--
-- ## SCHEDULER constructor
--
-- The SCHEDULER class is quite easy to use, but note that the New constructor has variable parameters:
--
-- The @{#SCHEDULER.New}() method returns 2 variables:
--
-- 1. The SCHEDULER object reference.
-- 2. The first schedule planned in the SCHEDULER object.
--
-- To clarify the different appliances, lets have a look at the following examples:
--
-- ### Construct a SCHEDULER object without a persistent schedule.
--
-- * @{#SCHEDULER.New}( nil ): Setup a new SCHEDULER object, which is persistently executed after garbage collection.
--
-- SchedulerObject = SCHEDULER:New()
-- SchedulerID = SchedulerObject:Schedule( nil, ScheduleFunction, {} )
--
-- The above example creates a new SchedulerObject, but does not schedule anything.
-- A separate schedule is created by using the SchedulerObject using the method :Schedule..., which returns a ScheduleID
--
-- ### Construct a SCHEDULER object without a volatile schedule, but volatile to the Object existence...
--
-- * @{#SCHEDULER.New}( Object ): Setup a new SCHEDULER object, which is linked to the Object. When the Object is nillified or destroyed, the SCHEDULER object will also be destroyed and stopped after garbage collection.
--
-- ZoneObject = ZONE:New( "ZoneName" )
-- SchedulerObject = SCHEDULER:New( ZoneObject )
-- SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
-- ...
-- ZoneObject = nil
-- garbagecollect()
--
-- The above example creates a new SchedulerObject, but does not schedule anything, and is bound to the existence of ZoneObject, which is a ZONE.
-- A separate schedule is created by using the SchedulerObject using the method :Schedule()..., which returns a ScheduleID
-- Later in the logic, the ZoneObject is put to nil, and garbage is collected.
-- As a result, the ScheduleObject will cancel any planned schedule.
--
-- ### Construct a SCHEDULER object with a persistent schedule.
--
-- * @{#SCHEDULER.New}( nil, Function, FunctionArguments, Start, ... ): Setup a new persistent SCHEDULER object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
--
-- SchedulerObject, SchedulerID = SCHEDULER:New( nil, ScheduleFunction, {} )
--
-- The above example creates a new SchedulerObject, and does schedule the first schedule as part of the call.
-- Note that 2 variables are returned here: SchedulerObject, ScheduleID...
--
-- ### Construct a SCHEDULER object without a schedule, but volatile to the Object existence...
--
-- * @{#SCHEDULER.New}( Object, Function, FunctionArguments, Start, ... ): Setup a new SCHEDULER object, linked to Object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
--
-- ZoneObject = ZONE:New( "ZoneName" )
-- SchedulerObject, SchedulerID = SCHEDULER:New( ZoneObject, ScheduleFunction, {} )
-- SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
-- ...
-- ZoneObject = nil
-- garbagecollect()
--
-- The above example creates a new SchedulerObject, and schedules a method call (ScheduleFunction),
-- and is bound to the existence of ZoneObject, which is a ZONE object (ZoneObject).
-- Both a ScheduleObject and a SchedulerID variable are returned.
-- Later in the logic, the ZoneObject is put to nil, and garbage is collected.
-- As a result, the ScheduleObject will cancel the planned schedule.
--
-- ## SCHEDULER timer stopping and (re-)starting.
--
-- The SCHEDULER can be stopped and restarted with the following methods:
--
-- * @{#SCHEDULER.Start}(): (Re-)Start the schedules within the SCHEDULER object. If a CallID is provided to :Start(), only the schedule referenced by CallID will be (re-)started.
-- * @{#SCHEDULER.Stop}(): Stop the schedules within the SCHEDULER object. If a CallID is provided to :Stop(), then only the schedule referenced by CallID will be stopped.
--
-- ZoneObject = ZONE:New( "ZoneName" )
-- SchedulerObject, SchedulerID = SCHEDULER:New( ZoneObject, ScheduleFunction, {} )
-- SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 10 )
-- ...
-- SchedulerObject:Stop( SchedulerID )
-- ...
-- SchedulerObject:Start( SchedulerID )
--
-- The above example creates a new SchedulerObject, and does schedule the first schedule as part of the call.
-- Note that 2 variables are returned here: SchedulerObject, ScheduleID...
-- Later in the logic, the repeating schedule with SchedulerID is stopped.
-- A bit later, the repeating schedule with SchedulerId is (re)-started.
--
-- ## Create a new schedule
--
-- With the method @{#SCHEDULER.Schedule}() a new time event can be scheduled.
-- This method is used by the :New() constructor when a new schedule is planned.
--
-- Consider the following code fragment of the SCHEDULER object creation.
--
-- ZoneObject = ZONE:New( "ZoneName" )
-- SchedulerObject = SCHEDULER:New( ZoneObject )
--
-- Several parameters can be specified that influence the behaviour of a Schedule.
--
-- ### A single schedule, immediately executed
--
-- SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
--
-- The above example schedules a new ScheduleFunction call to be executed asynchronously, within milleseconds ...
--
-- ### A single schedule, planned over time
--
-- SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10 )
--
-- The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds ...
--
-- ### A schedule with a repeating time interval, planned over time
--
-- SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60 )
--
-- The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
-- and repeating 60 every seconds ...
--
-- ### A schedule with a repeating time interval, planned over time, with time interval randomization
--
-- SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60, 0.5 )
--
-- The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
-- and repeating 60 seconds, with a 50% time interval randomization ...
-- So the repeating time interval will be randomized using the **0.5**,
-- and will calculate between **60 - ( 60 * 0.5 )** and **60 + ( 60 * 0.5 )** for each repeat,
-- which is in this example between **30** and **90** seconds.
--
-- ### A schedule with a repeating time interval, planned over time, with time interval randomization, and stop after a time interval
--
-- SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60, 0.5, 300 )
--
-- The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
-- The schedule will repeat every 60 seconds.
-- So the repeating time interval will be randomized using the **0.5**,
-- and will calculate between **60 - ( 60 * 0.5 )** and **60 + ( 60 * 0.5 )** for each repeat,
-- which is in this example between **30** and **90** seconds.
-- The schedule will stop after **300** seconds.
--
-- @field #SCHEDULER
SCHEDULER = {
ClassName = "SCHEDULER",
Schedules = {},

View File

@ -66,8 +66,7 @@
-- @module Zone
--- The ZONE_BASE class
-- @type ZONE_BASE
--- @type ZONE_BASE
-- @field #string ZoneName Name of the zone.
-- @field #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability.
-- @extends Core.Base#BASE
@ -83,19 +82,26 @@
--
-- ## Each zone implements two polymorphic functions defined in @{Zone#ZONE_BASE}:
--
-- * @{#ZONE_BASE.IsVec2InZone}(): Returns if a Vec2 is within the zone.
-- * @{#ZONE_BASE.IsVec3InZone}(): Returns if a Vec3 is within the zone.
-- * @{#ZONE_BASE.IsVec2InZone}(): Returns if a 2D vector is within the zone.
-- * @{#ZONE_BASE.IsVec3InZone}(): Returns if a 3D vector is within the zone.
-- * @{#ZONE_BASE.IsPointVec2InZone}(): Returns if a 2D point vector is within the zone.
-- * @{#ZONE_BASE.IsPointVec3InZone}(): Returns if a 3D point vector is within the zone.
--
-- ## A zone has a probability factor that can be set to randomize a selection between zones:
--
-- * @{#ZONE_BASE.SetRandomizeProbability}(): Set the randomization probability of a zone to be selected, taking a value between 0 and 1 ( 0 = 0%, 1 = 100% )
-- * @{#ZONE_BASE.GetRandomizeProbability}(): Get the randomization probability of a zone to be selected, passing a value between 0 and 1 ( 0 = 0%, 1 = 100% )
-- * @{#ZONE_BASE.SetZoneProbability}(): Set the randomization probability of a zone to be selected, taking a value between 0 and 1 ( 0 = 0%, 1 = 100% )
-- * @{#ZONE_BASE.GetZoneProbability}(): Get the randomization probability of a zone to be selected, passing a value between 0 and 1 ( 0 = 0%, 1 = 100% )
-- * @{#ZONE_BASE.GetZoneMaybe}(): Get the zone taking into account the randomization probability. nil is returned if this zone is not a candidate.
--
-- ## A zone manages Vectors:
-- ## A zone manages vectors:
--
-- * @{#ZONE_BASE.GetVec2}(): Returns the @{DCSTypes#Vec2} coordinate of the zone.
-- * @{#ZONE_BASE.GetRandomVec2}(): Define a random @{DCSTypes#Vec2} within the zone.
-- * @{#ZONE_BASE.GetVec2}(): Returns the 2D vector coordinate of the zone.
-- * @{#ZONE_BASE.GetVec3}(): Returns the 3D vector coordinate of the zone.
-- * @{#ZONE_BASE.GetPointVec2}(): Returns the 2D point vector coordinate of the zone.
-- * @{#ZONE_BASE.GetPointVec3}(): Returns the 3D point vector coordinate of the zone.
-- * @{#ZONE_BASE.GetRandomVec2}(): Define a random 2D vector within the zone.
-- * @{#ZONE_BASE.GetRandomPointVec2}(): Define a random 2D point vector within the zone.
-- * @{#ZONE_BASE.GetRandomPointVec3}(): Define a random 3D point vector within the zone.
--
-- ## A zone has a bounding square:
--
@ -106,8 +112,7 @@
-- * @{#ZONE_BASE.SmokeZone}(): Smokes the zone boundaries in a color.
-- * @{#ZONE_BASE.FlareZone}(): Flares the zone boundaries in a color.
--
-- @field #ZONE_BASE ZONE_BASE
--
-- @field #ZONE_BASE
ZONE_BASE = {
ClassName = "ZONE_BASE",
ZoneName = "",
@ -366,8 +371,7 @@ end
-- * @{#ZONE_RADIUS.GetRandomPointVec2}(): Gets a @{Point#POINT_VEC2} object representing a random 2D point in the zone.
-- * @{#ZONE_RADIUS.GetRandomPointVec3}(): Gets a @{Point#POINT_VEC3} object representing a random 3D point in the zone. Note that the height of the point is at landheight.
--
-- @field #ZONE_RADIUS ZONE_RADIUS
--
-- @field #ZONE_RADIUS
ZONE_RADIUS = {
ClassName="ZONE_RADIUS",
}
@ -648,8 +652,7 @@ end
-- The ZONE class, defined by the zone name as defined within the Mission Editor.
-- This class implements the inherited functions from @{#ZONE_RADIUS} taking into account the own zone format and properties.
--
-- @field #ZONE ZONE
--
-- @field #ZONE
ZONE = {
ClassName="ZONE",
}
@ -686,8 +689,7 @@ end
-- The ZONE_UNIT class defined by a zone around a @{Unit#UNIT} with a radius.
-- This class implements the inherited functions from @{#ZONE_RADIUS} taking into account the own zone format and properties.
--
-- @field #ZONE_UNIT ZONE_UNIT
--
-- @field #ZONE_UNIT
ZONE_UNIT = {
ClassName="ZONE_UNIT",
}
@ -769,7 +771,6 @@ function ZONE_UNIT:GetVec3( Height )
end
--- @type ZONE_GROUP
-- @field Wrapper.Group#GROUP ZoneGROUP
-- @extends #ZONE_RADIUS
@ -778,8 +779,7 @@ end
-- The ZONE_GROUP class defines by a zone around a @{Group#GROUP} with a radius. The current leader of the group defines the center of the zone.
-- This class implements the inherited functions from @{Zone#ZONE_RADIUS} taking into account the own zone format and properties.
--
-- @field #ZONE_GROUP ZONE_GROUP
--
-- @field #ZONE_GROUP
ZONE_GROUP = {
ClassName="ZONE_GROUP",
}
@ -794,7 +794,7 @@ function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneGROUP:GetVec2(), Radius ) )
self:F( { ZoneName, ZoneGROUP:GetVec2(), Radius } )
self.ZoneGROUP = ZoneGROUP
self._.ZoneGROUP = ZoneGROUP
return self
end
@ -806,7 +806,7 @@ end
function ZONE_GROUP:GetVec2()
self:F( self.ZoneName )
local ZoneVec2 = self.ZoneGROUP:GetVec2()
local ZoneVec2 = self._.ZoneGROUP:GetVec2()
self:T( { ZoneVec2 } )
@ -820,7 +820,7 @@ function ZONE_GROUP:GetRandomVec2()
self:F( self.ZoneName )
local Point = {}
local Vec2 = self.ZoneGROUP:GetVec2()
local Vec2 = self._.ZoneGROUP:GetVec2()
local angle = math.random() * math.pi*2;
Point.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius();
@ -834,7 +834,7 @@ end
--- @type ZONE_POLYGON_BASE
-- @field #ZONE_POLYGON_BASE.ListVec2 Polygon The polygon defined by an array of @{DCSTypes#Vec2}.
-- --@field #ZONE_POLYGON_BASE.ListVec2 Polygon The polygon defined by an array of @{DCSTypes#Vec2}.
-- @extends #ZONE_BASE
@ -852,8 +852,7 @@ end
-- * @{#ZONE_POLYGON_BASE.GetRandomPointVec2}(): Return a @{Point#POINT_VEC2} object representing a random 2D point within the zone.
-- * @{#ZONE_POLYGON_BASE.GetRandomPointVec3}(): Return a @{Point#POINT_VEC3} object representing a random 3D point at landheight within the zone.
--
-- @field #ZONE_POLYGON_BASE ZONE_POLYGON_BASE
--
-- @field #ZONE_POLYGON_BASE
ZONE_POLYGON_BASE = {
ClassName="ZONE_POLYGON_BASE",
}
@ -874,12 +873,12 @@ function ZONE_POLYGON_BASE:New( ZoneName, PointsArray )
local i = 0
self.Polygon = {}
self._.Polygon = {}
for i = 1, #PointsArray do
self.Polygon[i] = {}
self.Polygon[i].x = PointsArray[i].x
self.Polygon[i].y = PointsArray[i].y
self._.Polygon[i] = {}
self._.Polygon[i].x = PointsArray[i].x
self._.Polygon[i].y = PointsArray[i].y
end
return self
@ -902,7 +901,7 @@ end
function ZONE_POLYGON_BASE:Flush()
self:F2()
self:E( { Polygon = self.ZoneName, Coordinates = self.Polygon } )
self:E( { Polygon = self.ZoneName, Coordinates = self._.Polygon } )
return self
end
@ -918,17 +917,17 @@ function ZONE_POLYGON_BASE:BoundZone( UnBound )
local Segments = 10
i = 1
j = #self.Polygon
j = #self._.Polygon
while i <= #self.Polygon do
self:T( { i, j, self.Polygon[i], self.Polygon[j] } )
while i <= #self._.Polygon do
self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
local DeltaX = self.Polygon[j].x - self.Polygon[i].x
local DeltaY = self.Polygon[j].y - self.Polygon[i].y
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
for Segment = 0, Segments do -- We divide each line in 5 segments and smoke a point on the line.
local PointX = self.Polygon[i].x + ( Segment * DeltaX / Segments )
local PointY = self.Polygon[i].y + ( Segment * DeltaY / Segments )
local PointX = self._.Polygon[i].x + ( Segment * DeltaX / Segments )
local PointY = self._.Polygon[i].y + ( Segment * DeltaY / Segments )
local Tire = {
["country"] = "USA",
["category"] = "Fortifications",
@ -968,17 +967,17 @@ function ZONE_POLYGON_BASE:SmokeZone( SmokeColor )
local Segments = 10
i = 1
j = #self.Polygon
j = #self._.Polygon
while i <= #self.Polygon do
self:T( { i, j, self.Polygon[i], self.Polygon[j] } )
while i <= #self._.Polygon do
self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } )
local DeltaX = self.Polygon[j].x - self.Polygon[i].x
local DeltaY = self.Polygon[j].y - self.Polygon[i].y
local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x
local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y
for Segment = 0, Segments do -- We divide each line in 5 segments and smoke a point on the line.
local PointX = self.Polygon[i].x + ( Segment * DeltaX / Segments )
local PointY = self.Polygon[i].y + ( Segment * DeltaY / Segments )
local PointX = self._.Polygon[i].x + ( Segment * DeltaX / Segments )
local PointY = self._.Polygon[i].y + ( Segment * DeltaY / Segments )
POINT_VEC2:New( PointX, PointY ):Smoke( SmokeColor )
end
j = i
@ -1004,12 +1003,12 @@ function ZONE_POLYGON_BASE:IsVec2InZone( Vec2 )
local InPolygon = false
Next = 1
Prev = #self.Polygon
Prev = #self._.Polygon
while Next <= #self.Polygon do
self:T( { Next, Prev, self.Polygon[Next], self.Polygon[Prev] } )
if ( ( ( self.Polygon[Next].y > Vec2.y ) ~= ( self.Polygon[Prev].y > Vec2.y ) ) and
( Vec2.x < ( self.Polygon[Prev].x - self.Polygon[Next].x ) * ( Vec2.y - self.Polygon[Next].y ) / ( self.Polygon[Prev].y - self.Polygon[Next].y ) + self.Polygon[Next].x )
while Next <= #self._.Polygon do
self:T( { Next, Prev, self._.Polygon[Next], self._.Polygon[Prev] } )
if ( ( ( self._.Polygon[Next].y > Vec2.y ) ~= ( self._.Polygon[Prev].y > Vec2.y ) ) and
( Vec2.x < ( self._.Polygon[Prev].x - self._.Polygon[Next].x ) * ( Vec2.y - self._.Polygon[Next].y ) / ( self._.Polygon[Prev].y - self._.Polygon[Next].y ) + self._.Polygon[Next].x )
) then
InPolygon = not InPolygon
end
@ -1080,17 +1079,17 @@ end
-- @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
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
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
@ -1107,8 +1106,7 @@ end
-- The ZONE_POLYGON class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
-- This class implements the inherited functions from @{Zone#ZONE_RADIUS} taking into account the own zone format and properties.
--
-- @field #ZONE_POLYGON ZONE_POLYGON
--
-- @field #ZONE_POLYGON
ZONE_POLYGON = {
ClassName="ZONE_POLYGON",
}
@ -1124,7 +1122,7 @@ function ZONE_POLYGON:New( ZoneName, ZoneGroup )
local GroupPoints = ZoneGroup:GetTaskRoute()
local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( ZoneName, GroupPoints ) )
self:F( { ZoneName, ZoneGroup, self.Polygon } )
self:F( { ZoneName, ZoneGroup, self._.Polygon } )
return self
end

View File

@ -72,6 +72,8 @@ do -- TASK_A2G_DISPATCHER
self.Detection = Detection
self.Mission = Mission
self.Detection:FilterCategories( Unit.Category.GROUND_UNIT, Unit.Category.SHIP )
self:AddTransition( "Started", "Assign", "Started" )
--- OnAfter Transition Handler for Event Assign.

View File

@ -640,7 +640,7 @@ function UNIT:GetThreatLevel()
"Bomber",
"Strategic Bomber",
"Attack Helicopter",
"Interceptor",
"Battleplane",
"Multirole Fighter",
"Fighter"
}

View File

@ -101,75 +101,28 @@ even when there are hardly any players in the mission.</strong></p>
<hr/>
<h1>1) <a href="AI_Balancer.html##(AI_BALANCER)">AI<em>Balancer#AI</em>BALANCER</a> class, extends <a href="Fsm.html##(FSM_SET)">Fsm#FSM_SET</a></h1>
<h1>Demo Missions</h1>
<p>The <a href="AI_Balancer.html##(AI_BALANCER)">AI<em>Balancer#AI</em>BALANCER</a> class monitors and manages as many replacement AI groups as there are
CLIENTS in a SET_CLIENT collection, which are not occupied by human players.</p>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/AIB%20-%20AI%20Balancing">AI_BALANCER Demo Missions source code</a></h3>
<p>In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI in multi player missions.</p>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/AIB%20-%20AI%20Balancing">AI_BALANCER Demo Missions, only for beta testers</a></h3>
<p>The parent class <a href="Fsm.html##(FSM_SET)">Fsm#FSM_SET</a> manages the functionality to control the Finite State Machine (FSM).
The mission designer can tailor the behaviour of the AI_BALANCER, by defining event and state transition methods.
An explanation about state and event transition methods can be found in the <a href="FSM.html">FSM</a> module documentation.</p>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<p>The mission designer can tailor the AI_BALANCER behaviour, by implementing a state or event handling method for the following:</p>
<hr/>
<ul>
<li>**<a href="##(AI_BALANCER).OnAfterSpawned">AI_BALANCER.OnAfterSpawned</a>**( AISet, From, Event, To, AIGroup ): Define to add extra logic when an AI is spawned.</li>
</ul>
<h1>YouTube Channel</h1>
<h2>1.1) AI_BALANCER construction</h2>
<p>Create a new AI_BALANCER object with the <a href="##(AI_BALANCER).New">AI_BALANCER.New</a>() method:</p>
<h2>1.2) AI_BALANCER is a FSM</h2>
<p><img src="..\Presentations\AI_Balancer\Dia13.JPG" alt="Process"/></p>
<h3>1.2.1) AI_BALANCER States</h3>
<ul>
<li><strong>Monitoring</strong> ( Set ): Monitoring the Set if all AI is spawned for the Clients.</li>
<li><strong>Spawning</strong> ( Set, ClientName ): There is a new AI group spawned with ClientName as the name of reference.</li>
<li><strong>Spawned</strong> ( Set, AIGroup ): A new AI has been spawned. You can handle this event to customize the AI behaviour with other AI FSMs or own processes.</li>
<li><strong>Destroying</strong> ( Set, AIGroup ): The AI is being destroyed.</li>
<li><strong>Returning</strong> ( Set, AIGroup ): The AI is returning to the airbase specified by the ReturnToAirbase methods. Handle this state to customize the return behaviour of the AI, if any.</li>
</ul>
<h3>1.2.2) AI_BALANCER Events</h3>
<ul>
<li><strong>Monitor</strong> ( Set ): Every 10 seconds, the Monitor event is triggered to monitor the Set.</li>
<li><strong>Spawn</strong> ( Set, ClientName ): Triggers when there is a new AI group to be spawned with ClientName as the name of reference.</li>
<li><strong>Spawned</strong> ( Set, AIGroup ): Triggers when a new AI has been spawned. You can handle this event to customize the AI behaviour with other AI FSMs or own processes.</li>
<li><strong>Destroy</strong> ( Set, AIGroup ): The AI is being destroyed.</li>
<li><strong>Return</strong> ( Set, AIGroup ): The AI is returning to the airbase specified by the ReturnToAirbase methods.</li>
</ul>
<h2>1.3) AI_BALANCER spawn interval for replacement AI</h2>
<p>Use the method <a href="##(AI_BALANCER).InitSpawnInterval">AI_BALANCER.InitSpawnInterval</a>() to set the earliest and latest interval in seconds that is waited until a new replacement AI is spawned.</p>
<h2>1.4) AI_BALANCER returns AI to Airbases</h2>
<p>By default, When a human player joins a slot that is AI_BALANCED, the AI group will be destroyed by default.
However, there are 2 additional options that you can use to customize the destroy behaviour.
When a human player joins a slot, you can configure to let the AI return to:</p>
<ul>
<li><a href="##(AI_BALANCER).ReturnToHomeAirbase">AI_BALANCER.ReturnToHomeAirbase</a>: Returns the AI to the <strong>home</strong> <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</li>
<li><a href="##(AI_BALANCER).ReturnToNearestAirbases">AI_BALANCER.ReturnToNearestAirbases</a>: Returns the AI to the <strong>nearest friendly</strong> <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</li>
</ul>
<p>Note that when AI returns to an airbase, the AI<em>BALANCER will trigger the <strong>Return</strong> event and the AI will return,
otherwise the AI</em>BALANCER will trigger a <strong>Destroy</strong> event, and the AI will be destroyed.</p>
<h3><a href="https://www.youtube.com/playlist?list=PL7ZUrU4zZUl2CJVIrL1TdAumuVS8n64B7">AI_BALANCER YouTube Channel</a></h3>
<hr/>
<h1><strong>API CHANGE HISTORY</strong></h1>
<p>The underlying change log documents the API changes. Please read this carefully. The following notation is used:</p>
<p>The underlying change log documents the API changes.</p>
<p>Please read this carefully. The following notation is used:</p>
<ul>
<li><strong>Added</strong> parts are expressed in bold type face.</li>
@ -205,25 +158,16 @@ otherwise the AI</em>BALANCER will trigger a <strong>Destroy</strong> event, and
<tr>
<td class="name" nowrap="nowrap"><a href="#AI_BALANCER">AI_BALANCER</a></td>
<td class="summary">
<h1>AI_BALANCER class, extends <a href="Fsm.html##(FSM_SET)">Fsm#FSM_SET</a></h1>
<p>The AI<em>BALANCER class monitors and manages as many replacement AI groups as there are
CLIENTS in a SET</em>CLIENT collection, which are not occupied by human players.</p>
</td>
</tr>
</table>
<h2><a id="#(AI_BALANCER)">Type <code>AI_BALANCER</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BALANCER).AIGroups">AI_BALANCER.AIGroups</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BALANCER).ClassName">AI_BALANCER.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BALANCER).Earliest">AI_BALANCER.Earliest</a></td>
<td class="summary">
@ -245,12 +189,6 @@ otherwise the AI</em>BALANCER will trigger a <strong>Destroy</strong> event, and
<td class="name" nowrap="nowrap"><a href="##(AI_BALANCER).New">AI_BALANCER:New(SetClient, SpawnAI)</a></td>
<td class="summary">
<p>Creates a new AI_BALANCER object</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BALANCER).PatrolZones">AI_BALANCER.PatrolZones</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -344,6 +282,69 @@ otherwise the AI</em>BALANCER will trigger a <strong>Destroy</strong> event, and
</dt>
<dd>
<h1>AI_BALANCER class, extends <a href="Fsm.html##(FSM_SET)">Fsm#FSM_SET</a></h1>
<p>The AI<em>BALANCER class monitors and manages as many replacement AI groups as there are
CLIENTS in a SET</em>CLIENT collection, which are not occupied by human players.</p>
<p>In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI in multi player missions.</p>
<p>The parent class <a href="Fsm.html##(FSM_SET)">Fsm#FSM_SET</a> manages the functionality to control the Finite State Machine (FSM).
The mission designer can tailor the behaviour of the AI_BALANCER, by defining event and state transition methods.
An explanation about state and event transition methods can be found in the <a href="FSM.html">FSM</a> module documentation.</p>
<p>The mission designer can tailor the AI_BALANCER behaviour, by implementing a state or event handling method for the following:</p>
<ul>
<li><a href="##(AI_BALANCER).OnAfterSpawned">AI_BALANCER.OnAfterSpawned</a>( AISet, From, Event, To, AIGroup ): Define to add extra logic when an AI is spawned.</li>
</ul>
<h2>1. AI_BALANCER construction</h2>
<p>Create a new AI_BALANCER object with the <a href="##(AI_BALANCER).New">AI_BALANCER.New</a>() method:</p>
<h2>2. AI_BALANCER is a FSM</h2>
<p><img src="..\Presentations\AI_Balancer\Dia13.JPG" alt="Process"/></p>
<h3>2.1. AI_BALANCER States</h3>
<ul>
<li><strong>Monitoring</strong> ( Set ): Monitoring the Set if all AI is spawned for the Clients.</li>
<li><strong>Spawning</strong> ( Set, ClientName ): There is a new AI group spawned with ClientName as the name of reference.</li>
<li><strong>Spawned</strong> ( Set, AIGroup ): A new AI has been spawned. You can handle this event to customize the AI behaviour with other AI FSMs or own processes.</li>
<li><strong>Destroying</strong> ( Set, AIGroup ): The AI is being destroyed.</li>
<li><strong>Returning</strong> ( Set, AIGroup ): The AI is returning to the airbase specified by the ReturnToAirbase methods. Handle this state to customize the return behaviour of the AI, if any.</li>
</ul>
<h3>2.2. AI_BALANCER Events</h3>
<ul>
<li><strong>Monitor</strong> ( Set ): Every 10 seconds, the Monitor event is triggered to monitor the Set.</li>
<li><strong>Spawn</strong> ( Set, ClientName ): Triggers when there is a new AI group to be spawned with ClientName as the name of reference.</li>
<li><strong>Spawned</strong> ( Set, AIGroup ): Triggers when a new AI has been spawned. You can handle this event to customize the AI behaviour with other AI FSMs or own processes.</li>
<li><strong>Destroy</strong> ( Set, AIGroup ): The AI is being destroyed.</li>
<li><strong>Return</strong> ( Set, AIGroup ): The AI is returning to the airbase specified by the ReturnToAirbase methods.</li>
</ul>
<h2>3. AI_BALANCER spawn interval for replacement AI</h2>
<p>Use the method <a href="##(AI_BALANCER).InitSpawnInterval">AI_BALANCER.InitSpawnInterval</a>() to set the earliest and latest interval in seconds that is waited until a new replacement AI is spawned.</p>
<h2>4. AI_BALANCER returns AI to Airbases</h2>
<p>By default, When a human player joins a slot that is AI_BALANCED, the AI group will be destroyed by default.
However, there are 2 additional options that you can use to customize the destroy behaviour.
When a human player joins a slot, you can configure to let the AI return to:</p>
<ul>
<li><a href="##(AI_BALANCER).ReturnToHomeAirbase">AI_BALANCER.ReturnToHomeAirbase</a>: Returns the AI to the <strong>home</strong> <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</li>
<li><a href="##(AI_BALANCER).ReturnToNearestAirbases">AI_BALANCER.ReturnToNearestAirbases</a>: Returns the AI to the <strong>nearest friendly</strong> <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</li>
</ul>
<p>Note that when AI returns to an airbase, the AI<em>BALANCER will trigger the <strong>Return</strong> event and the AI will return,
otherwise the AI</em>BALANCER will trigger a <strong>Destroy</strong> event, and the AI will be destroyed.</p>
</dd>
@ -351,38 +352,7 @@ otherwise the AI</em>BALANCER will trigger a <strong>Destroy</strong> event, and
<h2><a id="#(AI_Balancer)" >Type <code>AI_Balancer</code></a></h2>
<h2><a id="#(AI_BALANCER)" >Type <code>AI_BALANCER</code></a></h2>
<p>AI_BALANCER class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_BALANCER).AIGroups" >
<strong>AI_BALANCER.AIGroups</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(AI_BALANCER).ClassName" >
<strong>AI_BALANCER.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h3>Field(s)</h3>
<dl class="function">
<dt>
@ -478,20 +448,6 @@ The default Spawn object to spawn new AI Groups when needed.</p>
<p><em><a href="##(AI_BALANCER)">#AI_BALANCER</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_BALANCER).PatrolZones" >
<strong>AI_BALANCER.PatrolZones</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">

View File

@ -111,6 +111,22 @@
<hr/>
<h1>Demo Missions</h1>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/CAP%20-%20Combat%20Air%20Patrol">AI_CAP Demo Missions source code</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/CAP%20-%20Combat%20Air%20Patrol">AI_CAP Demo Missions, only for beta testers</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<hr/>
<h1>YouTube Channel</h1>
<h3><a href="https://www.youtube.com/playlist?list=PL7ZUrU4zZUl1YCyPxJgoZn-CfhwyeW65L">AI_CAP YouTube Channel</a></h3>
<hr/>
<h1><strong>API CHANGE HISTORY</strong></h1>
<p>The underlying change log documents the API changes. Please read this carefully. The following notation is used:</p>
@ -150,9 +166,9 @@
<tr>
<td class="name" nowrap="nowrap"><a href="#AI_CAP_ZONE">AI_CAP_ZONE</a></td>
<td class="summary">
<h1>1) <a href="##(AI_CAP_ZONE)">#AI<em>CAP</em>ZONE</a> class, extends <a href="AI_CAP.html##(AI_PATROL_ZONE)">AI<em>CAP#AI</em>PATROL_ZONE</a></h1>
<h1>AI<em>CAP</em>ZONE class, extends <a href="AI_CAP.html##(AI_PATROL_ZONE)">AI<em>CAP#AI</em>PATROL_ZONE</a></h1>
<p>The <a href="##(AI_CAP_ZONE)">#AI<em>CAP</em>ZONE</a> class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>
<p>The AI<em>CAP</em>ZONE class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>
and automatically engage any airborne enemies that are within a certain range or within a certain zone.</p>
</td>
</tr>
@ -412,9 +428,9 @@ and automatically engage any airborne enemies that are within a certain range or
</dt>
<dd>
<h1>1) <a href="##(AI_CAP_ZONE)">#AI<em>CAP</em>ZONE</a> class, extends <a href="AI_CAP.html##(AI_PATROL_ZONE)">AI<em>CAP#AI</em>PATROL_ZONE</a></h1>
<h1>AI<em>CAP</em>ZONE class, extends <a href="AI_CAP.html##(AI_PATROL_ZONE)">AI<em>CAP#AI</em>PATROL_ZONE</a></h1>
<p>The <a href="##(AI_CAP_ZONE)">#AI<em>CAP</em>ZONE</a> class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>
<p>The AI<em>CAP</em>ZONE class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>
and automatically engage any airborne enemies that are within a certain range or within a certain zone.</p>
@ -447,17 +463,17 @@ When the fuel treshold has been reached, the airplane will fly towards the neare
<p><img src="..\Presentations\AI_CAP\Dia13.JPG" alt="Process"/></p>
<h2>1.1) AI<em>CAP</em>ZONE constructor</h2>
<h2>1. AI<em>CAP</em>ZONE constructor</h2>
<ul>
<li><a href="##(AI_CAP_ZONE).New">AI<em>CAP</em>ZONE.New</a>(): Creates a new AI<em>CAP</em>ZONE object.</li>
</ul>
<h2>1.2) AI<em>CAP</em>ZONE is a FSM</h2>
<h2>2. AI<em>CAP</em>ZONE is a FSM</h2>
<p><img src="..\Presentations\AI_CAP\Dia2.JPG" alt="Process"/></p>
<h3>1.2.1) AI<em>CAP</em>ZONE States</h3>
<h3>2.1 AI<em>CAP</em>ZONE States</h3>
<ul>
<li><strong>None</strong> ( Group ): The process is not started yet.</li>
@ -466,7 +482,7 @@ When the fuel treshold has been reached, the airplane will fly towards the neare
<li><strong>Returning</strong> ( Group ): The AI is returning to Base..</li>
</ul>
<h3>1.2.2) AI<em>CAP</em>ZONE Events</h3>
<h3>2.2 AI<em>CAP</em>ZONE Events</h3>
<ul>
<li>**<a href="AI_Patrol.html##(AI_PATROL_ZONE).Start">AI<em>Patrol#AI</em>PATROL_ZONE.Start</a>**: Start the process.</li>
@ -481,7 +497,7 @@ When the fuel treshold has been reached, the airplane will fly towards the neare
<li><strong>Status</strong> ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.</li>
</ul>
<h2>1.3) Set the Range of Engagement</h2>
<h2>3. Set the Range of Engagement</h2>
<p><img src="..\Presentations\AI_CAP\Dia11.JPG" alt="Range"/></p>
@ -491,7 +507,7 @@ The range can be beyond or smaller than the range of the Patrol Zone.
The range is applied at the position of the AI.
Use the method <a href="AI_CAP.html##(AI_CAP_ZONE).SetEngageRange">AI<em>CAP#AI</em>CAP_ZONE.SetEngageRange</a>() to define that range.</p>
<h2>1.4) Set the Zone of Engagement</h2>
<h2>4. Set the Zone of Engagement</h2>
<p><img src="..\Presentations\AI_CAP\Dia12.JPG" alt="Zone"/></p>

View File

@ -111,6 +111,22 @@
<hr/>
<h1>Demo Missions</h1>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/CAS%20-%20Close%20Air%20Support">AI_CAS Demo Missions source code</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/CAS%20-%20Close%20Air%20Support">AI_CAS Demo Missions, only for beta testers</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<hr/>
<h1>YouTube Channel</h1>
<h3><a href="https://www.youtube.com/playlist?list=PL7ZUrU4zZUl3JBO1WDqqpyYRRmIkR2ir2">AI_CAS YouTube Channel</a></h3>
<hr/>
<h1><strong>API CHANGE HISTORY</strong></h1>
<p>The underlying change log documents the API changes. Please read this carefully. The following notation is used:</p>
@ -148,9 +164,9 @@
<tr>
<td class="name" nowrap="nowrap"><a href="#AI_CAS_ZONE">AI_CAS_ZONE</a></td>
<td class="summary">
<h1>1) <a href="##(AI_CAS_ZONE)">#AI<em>CAS</em>ZONE</a> class, extends <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a></h1>
<h1>AI<em>CAS</em>ZONE class, extends <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a></h1>
<p><a href="##(AI_CAS_ZONE)">#AI<em>CAS</em>ZONE</a> derives from the <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a>, inheriting its methods and behaviour.</p>
<p>AI<em>CAS</em>ZONE derives from the <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a>, inheriting its methods and behaviour.</p>
</td>
</tr>
<tr>
@ -421,13 +437,13 @@
</dt>
<dd>
<h1>1) <a href="##(AI_CAS_ZONE)">#AI<em>CAS</em>ZONE</a> class, extends <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a></h1>
<h1>AI<em>CAS</em>ZONE class, extends <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a></h1>
<p><a href="##(AI_CAS_ZONE)">#AI<em>CAS</em>ZONE</a> derives from the <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a>, inheriting its methods and behaviour.</p>
<p>AI<em>CAS</em>ZONE derives from the <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a>, inheriting its methods and behaviour.</p>
<p>
The <a href="##(AI_CAS_ZONE)">#AI<em>CAS</em>ZONE</a> class implements the core functions to provide Close Air Support in an Engage <a href="Zone.html">Zone</a> by an AIR <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.
The AI<em>CAS</em>ZONE class implements the core functions to provide Close Air Support in an Engage <a href="Zone.html">Zone</a> by an AIR <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.
The AI<em>CAS</em>ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.</p>
<p><img src="..\Presentations\AI_CAS\Dia3.JPG" alt="HoldAndEngage"/></p>
@ -483,17 +499,17 @@ It can be notified to go RTB through the <strong>RTB</strong> event.</p>
<p><img src="..\Presentations\AI_CAS\Dia12.JPG" alt="Engage Event"/></p>
<h1>1.1) AI<em>CAS</em>ZONE constructor</h1>
<h1>1. AI<em>CAS</em>ZONE constructor</h1>
<ul>
<li><a href="##(AI_CAS_ZONE).New">AI<em>CAS</em>ZONE.New</a>(): Creates a new AI<em>CAS</em>ZONE object.</li>
</ul>
<h2>1.2) AI<em>CAS</em>ZONE is a FSM</h2>
<h2>2. AI<em>CAS</em>ZONE is a FSM</h2>
<p><img src="..\Presentations\AI_CAS\Dia2.JPG" alt="Process"/></p>
<h3>1.2.1) AI<em>CAS</em>ZONE States</h3>
<h3>2.1. AI<em>CAS</em>ZONE States</h3>
<ul>
<li><strong>None</strong> ( Group ): The process is not started yet.</li>
@ -502,7 +518,7 @@ It can be notified to go RTB through the <strong>RTB</strong> event.</p>
<li><strong>Returning</strong> ( Group ): The AI is returning to Base..</li>
</ul>
<h3>1.2.2) AI<em>CAS</em>ZONE Events</h3>
<h3>2.2. AI<em>CAS</em>ZONE Events</h3>
<ul>
<li>**<a href="AI_Patrol.html##(AI_PATROL_ZONE).Start">AI<em>Patrol#AI</em>PATROL_ZONE.Start</a>**: Start the process.</li>

View File

@ -111,6 +111,22 @@
<hr/>
<h1>Demo Missions</h1>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/PAT%20-%20Patrolling">AI_PATROL Demo Missions source code</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/PAT%20-%20Patrolling">AI_PATROL Demo Missions, only for beta testers</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<hr/>
<h1>YouTube Channel</h1>
<h3><a href="https://www.youtube.com/playlist?list=PL7ZUrU4zZUl35HvYZKA6G22WMt7iI3zky">AI_PATROL YouTube Channel</a></h3>
<hr/>
<h1><strong>OPEN ISSUES</strong></h1>
<p>2017-01-17: When Spawned AI is located at an airbase, it will be routed first back to the airbase after take-off.</p>
@ -162,9 +178,9 @@
<tr>
<td class="name" nowrap="nowrap"><a href="#AI_PATROL_ZONE">AI_PATROL_ZONE</a></td>
<td class="summary">
<h1>1) <a href="##(AI_PATROL_ZONE)">#AI<em>PATROL</em>ZONE</a> class, extends <a href="Fsm.html##(FSM_CONTROLLABLE)">Fsm#FSM_CONTROLLABLE</a></h1>
<h1>AI<em>PATROL</em>ZONE class, extends <a href="Fsm.html##(FSM_CONTROLLABLE)">Fsm#FSM_CONTROLLABLE</a></h1>
<p>The <a href="##(AI_PATROL_ZONE)">#AI<em>PATROL</em>ZONE</a> class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.</p>
<p>The AI<em>PATROL</em>ZONE class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.</p>
</td>
</tr>
</table>
@ -657,9 +673,9 @@
</dt>
<dd>
<h1>1) <a href="##(AI_PATROL_ZONE)">#AI<em>PATROL</em>ZONE</a> class, extends <a href="Fsm.html##(FSM_CONTROLLABLE)">Fsm#FSM_CONTROLLABLE</a></h1>
<h1>AI<em>PATROL</em>ZONE class, extends <a href="Fsm.html##(FSM_CONTROLLABLE)">Fsm#FSM_CONTROLLABLE</a></h1>
<p>The <a href="##(AI_PATROL_ZONE)">#AI<em>PATROL</em>ZONE</a> class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.</p>
<p>The AI<em>PATROL</em>ZONE class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.</p>
@ -692,17 +708,17 @@ When the fuel treshold has been reached, the airplane will fly towards the neare
<p><img src="..\Presentations\AI_PATROL\Dia11.JPG" alt="Process"/></p>
<h2>1.1) AI<em>PATROL</em>ZONE constructor</h2>
<h2>1. AI<em>PATROL</em>ZONE constructor</h2>
<ul>
<li><a href="##(AI_PATROL_ZONE).New">AI<em>PATROL</em>ZONE.New</a>(): Creates a new AI<em>PATROL</em>ZONE object.</li>
</ul>
<h2>1.2) AI<em>PATROL</em>ZONE is a FSM</h2>
<h2>2. AI<em>PATROL</em>ZONE is a FSM</h2>
<p><img src="..\Presentations\AI_PATROL\Dia2.JPG" alt="Process"/></p>
<h3>1.2.1) AI<em>PATROL</em>ZONE States</h3>
<h3>2.1. AI<em>PATROL</em>ZONE States</h3>
<ul>
<li><strong>None</strong> ( Group ): The process is not started yet.</li>
@ -712,7 +728,7 @@ When the fuel treshold has been reached, the airplane will fly towards the neare
<li><strong>Crashed</strong> ( Group ): The AI has crashed or is dead.</li>
</ul>
<h3>1.2.2) AI<em>PATROL</em>ZONE Events</h3>
<h3>2.2. AI<em>PATROL</em>ZONE Events</h3>
<ul>
<li><strong>Start</strong> ( Group ): Start the process.</li>
@ -724,21 +740,21 @@ When the fuel treshold has been reached, the airplane will fly towards the neare
<li><strong>Status</strong> ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.</li>
</ul>
<h2>1.3) Set or Get the AI controllable</h2>
<h2>3. Set or Get the AI controllable</h2>
<ul>
<li><a href="##(AI_PATROL_ZONE).SetControllable">AI<em>PATROL</em>ZONE.SetControllable</a>(): Set the AIControllable.</li>
<li><a href="##(AI_PATROL_ZONE).GetControllable">AI<em>PATROL</em>ZONE.GetControllable</a>(): Get the AIControllable.</li>
</ul>
<h2>1.4) Set the Speed and Altitude boundaries of the AI controllable</h2>
<h2>4. Set the Speed and Altitude boundaries of the AI controllable</h2>
<ul>
<li><a href="##(AI_PATROL_ZONE).SetSpeed">AI<em>PATROL</em>ZONE.SetSpeed</a>(): Set the patrol speed boundaries of the AI, for the next patrol.</li>
<li><a href="##(AI_PATROL_ZONE).SetAltitude">AI<em>PATROL</em>ZONE.SetAltitude</a>(): Set altitude boundaries of the AI, for the next patrol.</li>
</ul>
<h2>1.5) Manage the detection process of the AI controllable</h2>
<h2>5. Manage the detection process of the AI controllable</h2>
<p>The detection process of the AI controllable can be manipulated.
Detection requires an amount of CPU power, which has an impact on your mission performance.
@ -757,7 +773,7 @@ Use the method <a href="##(AI_PATROL_ZONE).SetDetectionZone">AI<em>PATROL</em>ZO
Note that when the zone is too far away, or the AI is not heading towards the zone, or the AI is too high, no targets may be detected
according the weather conditions.</p>
<h2>1.6) Manage the "out of fuel" in the AI<em>PATROL</em>ZONE</h2>
<h2>6. Manage the "out of fuel" in the AI<em>PATROL</em>ZONE</h2>
<p>When the AI is out of fuel, it is required that a new AI is started, before the old AI 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.
@ -766,7 +782,7 @@ while a new AI is targetted to the AI<em>PATROL</em>ZONE.
Once the time is finished, the old AI will return to the base.
Use the method <a href="##(AI_PATROL_ZONE).ManageFuel">AI<em>PATROL</em>ZONE.ManageFuel</a>() to have this proces in place.</p>
<h2>1.7) Manage "damage" behaviour of the AI in the AI<em>PATROL</em>ZONE</h2>
<h2>7. Manage "damage" behaviour of the AI in the AI<em>PATROL</em>ZONE</h2>
<p>When the AI is damaged, it is required that a new AIControllable is started. However, damage cannon be foreseen early on.
Therefore, when the damage treshold is reached, the AI will return immediately to the home base (RTB).
@ -933,9 +949,6 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<p> This table contains the targets detected during patrol.</p>
</dd>
</dl>
<dl class="function">

View File

@ -198,6 +198,12 @@
<td class="name" nowrap="nowrap"><a href="##(CARGO).CargoObject">CARGO.CargoObject</a></td>
<td class="summary">
<p>The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CARGO).CargoScheduler">CARGO.CargoScheduler</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -583,13 +589,7 @@
<h2><a id="#(CARGO_REPRESENTABLE)">Type <code>CARGO_REPRESENTABLE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(CARGO_REPRESENTABLE).ClassName">CARGO_REPRESENTABLE.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CARGO_REPRESENTABLE).New">CARGO_REPRESENTABLE:New(CargoObject, Type, Name, Weight, ReportRadius, NearRadius)</a></td>
<td class="name" nowrap="nowrap"><a href="##(CARGO_REPRESENTABLE).New">CARGO_REPRESENTABLE:New(Type, Name, Weight, ReportRadius, NearRadius, CargoObject)</a></td>
<td class="summary">
<p>CARGO_REPRESENTABLE Constructor.</p>
</td>
@ -598,6 +598,12 @@
<td class="name" nowrap="nowrap"><a href="##(CARGO_REPRESENTABLE).RouteTo">CARGO_REPRESENTABLE:RouteTo(ToPointVec2, Speed)</a></td>
<td class="summary">
<p>Route a cargo unit to a PointVec2.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CARGO_REPRESENTABLE).test">CARGO_REPRESENTABLE.test</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -911,6 +917,20 @@ The radius when the cargo will board the Carrier (to avoid collision).</p>
<p>The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(CARGO).CargoScheduler" >
<strong>CARGO.CargoScheduler</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -2696,22 +2716,8 @@ The range till cargo will board.</p>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(CARGO_REPRESENTABLE).ClassName" >
<strong>CARGO_REPRESENTABLE.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CARGO_REPRESENTABLE).New" >
<strong>CARGO_REPRESENTABLE:New(CargoObject, Type, Name, Weight, ReportRadius, NearRadius)</strong>
<strong>CARGO_REPRESENTABLE:New(Type, Name, Weight, ReportRadius, NearRadius, CargoObject)</strong>
</a>
</dt>
<dd>
@ -2722,11 +2728,6 @@ The range till cargo will board.</p>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(Controllable)">Wrapper.Controllable#Controllable</a> CargoObject </em></code>: </p>
</li>
<li>
<p><code><em>#string Type </em></code>: </p>
</li>
@ -2751,6 +2752,11 @@ The range till cargo will board.</p>
<p><code><em>#number NearRadius </em></code>:
(optional)</p>
</li>
<li>
<p><code><em> CargoObject </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
@ -2789,11 +2795,27 @@ The range till cargo will board.</p>
<p><em><a href="##(CARGO_REPRESENTABLE)">#CARGO_REPRESENTABLE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CARGO_REPRESENTABLE).test" >
<strong>CARGO_REPRESENTABLE.test</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(CARGO_UNIT)" >Type <code>CARGO_UNIT</code></a></h2>
<h3>Field(s)</h3>
<p>Hello </p>
<h3>Field(s)</h3>
<dl class="function">
<dt>

View File

@ -2172,7 +2172,6 @@ self</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemCount" >
<strong>DETECTION_BASE.DetectedItemCount</strong>
</a>
@ -2186,7 +2185,6 @@ self</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemMax" >
<strong>DETECTION_BASE.DetectedItemMax</strong>
</a>
@ -2300,7 +2298,7 @@ self</p>
<dl class="function">
<dt>
<em>#number</em>
<em></em>
<a id="#(DETECTION_BASE).DetectionInterval" >
<strong>DETECTION_BASE.DetectionInterval</strong>
</a>

View File

@ -102,6 +102,8 @@ are design patterns allowing efficient (long-lasting) processes and workflows.</
<hr/>
<p>A Finite State Machine (FSM) models a process flow that transitions between various <strong>States</strong> through triggered <strong>Events</strong>.</p>
<p>A FSM can only be in one of a finite number of states.
The machine is in only one state at a time; the state it is in at any given time is called the <strong>current state</strong>.
It can change from one state to another when initiated by an <strong><strong>internal</strong> or <strong>external</strong> triggering event</strong>, which is called a <strong>transition</strong>.
@ -199,11 +201,9 @@ YYYY-MM-DD: CLASS:<strong>NewFunction( Params )</strong> added</p>
<tr>
<td class="name" nowrap="nowrap"><a href="#FSM">FSM</a></td>
<td class="summary">
<h1>1) FSM class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<h1>FSM class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p><img src="..\Presentations\FSM\Dia3.JPG" alt="Transition Rules and Transition Handlers and Event Triggers"/></p>
<p>The FSM class is the base class of all FSM_ derived classes.</p>
<p>A Finite State Machine (FSM) models a process flow that transitions between various <strong>States</strong> through triggered <strong>Events</strong>.</p>
</td>
</tr>
<tr>
@ -726,14 +726,52 @@ YYYY-MM-DD: CLASS:<strong>NewFunction( Params )</strong> added</p>
</dt>
<dd>
<h1>1) FSM class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<h1>FSM class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>A Finite State Machine (FSM) models a process flow that transitions between various <strong>States</strong> through triggered <strong>Events</strong>.</p>
<p>A FSM can only be in one of a finite number of states.
The machine is in only one state at a time; the state it is in at any given time is called the <strong>current state</strong>.
It can change from one state to another when initiated by an <strong><strong>internal</strong> or <strong>external</strong> triggering event</strong>, which is called a <strong>transition</strong>.
An <strong>FSM implementation</strong> is defined by <strong>a list of its states</strong>, <strong>its initial state</strong>, and <strong>the triggering events</strong> for <strong>each possible transition</strong>.
An FSM implementation is composed out of <strong>two parts</strong>, a set of <strong>state transition rules</strong>, and an implementation set of <strong>state transition handlers</strong>, implementing those transitions.</p>
<p>The FSM class supports a <strong>hierarchical implementation of a Finite State Machine</strong>,
that is, it allows to <strong>embed existing FSM implementations in a master FSM</strong>.
FSM hierarchies allow for efficient FSM re-use, <strong>not having to re-invent the wheel every time again</strong> when designing complex processes.</p>
<p><img src="..\Presentations\FSM\Dia2.JPG" alt="Workflow Example"/></p>
<p>The above diagram shows a graphical representation of a FSM implementation for a <strong>Task</strong>, which guides a Human towards a Zone,
orders him to destroy x targets and account the results.
Other examples of ready made FSM could be: </p>
<ul>
<li>route a plane to a zone flown by a human</li>
<li>detect targets by an AI and report to humans</li>
<li>account for destroyed targets by human players</li>
<li>handle AI infantry to deploy from or embark to a helicopter or airplane or vehicle </li>
<li>let an AI patrol a zone</li>
</ul>
<p>The <strong>MOOSE framework</strong> uses extensively the FSM class and derived FSM_ classes,
because <strong>the goal of MOOSE is to simplify mission design complexity for mission building</strong>.
By efficiently utilizing the FSM class and derived classes, MOOSE allows mission designers to quickly build processes.
<strong>Ready made FSM-based implementations classes</strong> exist within the MOOSE framework that <strong>can easily be re-used,
and tailored</strong> by mission designers through <strong>the implementation of Transition Handlers</strong>.
Each of these FSM implementation classes start either with:</p>
<ul>
<li>an acronym <strong>AI_</strong>, which indicates an FSM implementation directing <strong>AI controlled</strong> <a href="GROUP.html">GROUP</a> and/or <a href="UNIT.html">UNIT</a>. These AI_ classes derive the <a href="##(FSM_CONTROLLABLE)">#FSM_CONTROLLABLE</a> class.</li>
<li>an acronym <strong>TASK_</strong>, which indicates an FSM implementation executing a <a href="TASK.html">TASK</a> executed by Groups of players. These TASK_ classes derive the <a href="##(FSM_TASK)">#FSM_TASK</a> class.</li>
<li>an acronym <strong>ACT_</strong>, which indicates an Sub-FSM implementation, directing <strong>Humans actions</strong> that need to be done in a <a href="TASK.html">TASK</a>, seated in a <a href="CLIENT.html">CLIENT</a> (slot) or a <a href="UNIT.html">UNIT</a> (CA join). These ACT_ classes derive the <a href="##(FSM_PROCESS)">#FSM_PROCESS</a> class.</li>
</ul>
<p><img src="..\Presentations\FSM\Dia3.JPG" alt="Transition Rules and Transition Handlers and Event Triggers"/></p>
<p>The FSM class is the base class of all FSM_ derived classes.</p>
<p>It implements the main functionality to define and execute Finite State Machines.
<p>The FSM class is the base class of all FSM_ derived classes. It implements the main functionality to define and execute Finite State Machines.
The derived FSM_ classes extend the Finite State Machine functionality to run a workflow process for a specific purpose or component.</p>
<p>Finite State Machines have <strong>Transition Rules</strong>, <strong>Transition Handlers</strong> and <strong>Event Triggers</strong>.</p>
@ -753,13 +791,13 @@ Most of the time, these Event Triggers are used within the Transition Handler me
<p>As explained above, a FSM supports <strong>Linear State Transitions</strong> and <strong>Hierarchical State Transitions</strong>, and both can be mixed to make a comprehensive FSM implementation.
The below documentation has a seperate chapter explaining both transition modes, taking into account the <strong>Transition Rules</strong>, <strong>Transition Handlers</strong> and <strong>Event Triggers</strong>.</p>
<h2>1.1) FSM Linear Transitions</h2>
<h2>FSM Linear Transitions</h2>
<p>Linear Transitions are Transition Rules allowing an FSM to transition from one or multiple possible <strong>From</strong> state(s) towards a <strong>To</strong> state upon a Triggered <strong>Event</strong>.
The Lineair transition rule evaluation will always be done from the <strong>current state</strong> of the FSM.
If no valid Transition Rule can be found in the FSM, the FSM will log an error and stop.</p>
<h3>1.1.1) FSM Transition Rules</h3>
<h3>FSM Transition Rules</h3>
<p>The FSM has transition rules that it follows and validates, as it walks the process.
These rules define when an FSM can transition from a specific state towards an other specific state upon a triggered event.</p>
@ -787,7 +825,7 @@ These rules define when an FSM can transition from a specific state towards an o
<li>Note that once the Switch is <strong>On</strong> or <strong>Middle</strong>, it can only be switched <strong>Off</strong>.</li>
</ul>
<h3>Some additional comments:</h3>
<h4>Some additional comments:</h4>
<p>Note that Linear Transition Rules <strong>can be declared in a few variations</strong>:</p>
@ -801,7 +839,7 @@ These rules define when an FSM can transition from a specific state towards an o
<pre><code> FsmSwitch:AddTransition( { "On", "Middle" }, "SwitchOff", "Off" )
</code></pre>
<h3>1.1.2) Transition Handling</h3>
<h3>Transition Handling</h3>
<p><img src="..\Presentations\FSM\Dia4.JPG" alt="Transition Handlers"/></p>
@ -827,7 +865,7 @@ These parameters are on the correct order: From, Event, To:</p>
<p>On top, each of these methods can have a variable amount of parameters passed. See the example in section <a href="#1.1.3)-event-triggers">1.1.3</a>.</p>
<h3>1.1.3) Event Triggers</h3>
<h3>Event Triggers</h3>
<p><img src="..\Presentations\FSM\Dia5.JPG" alt="Event Triggers"/></p>
@ -870,7 +908,7 @@ Event will be processed after 5 seconds, and Amount is given as a parameter.</p>
<p>Because ... When Event was asynchronously processed after 5 seconds, Amount was set to 2. So be careful when processing and passing values and objects in asynchronous processing!</p>
<h3>1.1.4) Linear Transition Example</h3>
<h3>Linear Transition Example</h3>
<p>This example is fully implemented in the MOOSE test mission on GITHUB: <a href="https://github.com/FlightControl-Master/MOOSE/blob/master/Moose%20Test%20Missions/FSM%20-%20Finite%20State%20Machine/FSM-100%20-%20Transition%20Explanation/FSM-100%20-%20Transition%20Explanation.lua">FSM-100 - Transition Explanation</a></p>
@ -960,7 +998,7 @@ The transition for event Stop can be executed if the current state of the FSM is
<p>So... When FsmDemo:Stop() is being triggered, the state of FsmDemo will transition from Red or Green to Stopped.
And there is no transition handling method defined for that transition, thus, no new event is being triggered causing the FsmDemo process flow to halt.</p>
<h2>1.5) FSM Hierarchical Transitions</h2>
<h2>FSM Hierarchical Transitions</h2>
<p>Hierarchical Transitions allow to re-use readily available and implemented FSMs.
This becomes in very useful for mission building, where mission designers build complex processes and workflows,
@ -1582,7 +1620,7 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em>#string</em>
<em></em>
<a id="#(FSM)._StartState" >
<strong>FSM._StartState</strong>
</a>
@ -1881,6 +1919,7 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(FSM).current" >
<strong>FSM.current</strong>
</a>

File diff suppressed because it is too large Load Diff

View File

@ -101,71 +101,21 @@
<hr/>
<h1>1) <a href="Message.html##(MESSAGE)">Message#MESSAGE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>Message System to display Messages to Clients, Coalitions or All.
Messages are shown on the display panel for an amount of seconds, and will then disappear.
Messages can contain a category which is indicating the category of the message.</p>
<h2>1.1) MESSAGE construction</h2>
<p>Messages are created with <a href="Message.html##(MESSAGE).New">Message#MESSAGE.New</a>. Note that when the MESSAGE object is created, no message is sent yet.
To send messages, you need to use the To functions.</p>
<h2>1.2) Send messages to an audience</h2>
<p>Messages are sent:</p>
<ul>
<li>To a <a href="Client.html">Client</a> using <a href="Message.html##(MESSAGE).ToClient">Message#MESSAGE.ToClient</a>().</li>
<li>To a <a href="Group.html">Group</a> using <a href="Message.html##(MESSAGE).ToGroup">Message#MESSAGE.ToGroup</a>()</li>
<li>To a coalition using <a href="Message.html##(MESSAGE).ToCoalition">Message#MESSAGE.ToCoalition</a>().</li>
<li>To the red coalition using <a href="Message.html##(MESSAGE).ToRed">Message#MESSAGE.ToRed</a>().</li>
<li>To the blue coalition using <a href="Message.html##(MESSAGE).ToBlue">Message#MESSAGE.ToBlue</a>().</li>
<li>To all Players using <a href="Message.html##(MESSAGE).ToAll">Message#MESSAGE.ToAll</a>().</li>
</ul>
<h2>1.3) Send conditionally to an audience</h2>
<p>Messages can be sent conditionally to an audience (when a condition is true):</p>
<ul>
<li>To all players using <a href="Message.html##(MESSAGE).ToAllIf">Message#MESSAGE.ToAllIf</a>().</li>
<li>To a coalition using <a href="Message.html##(MESSAGE).ToCoalitionIf">Message#MESSAGE.ToCoalitionIf</a>().</li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#MESSAGE">MESSAGE</a></td>
<td class="summary">
<h1>MESSAGE class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>Message System to display Messages to Clients, Coalitions or All.</p>
</td>
</tr>
</table>
<h2><a id="#(MESSAGE)">Type <code>MESSAGE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).ClassName">MESSAGE.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).MessageCategory">MESSAGE.MessageCategory</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).MessageID">MESSAGE.MessageID</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).New">MESSAGE:New(MessageText, MessageDuration, MessageCategory)</a></td>
<td class="summary">
<p>Creates a new MESSAGE object.</p>
@ -232,6 +182,40 @@ To send messages, you need to use the To functions.</p>
</dt>
<dd>
<h1>MESSAGE class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>Message System to display Messages to Clients, Coalitions or All.</p>
<p>Messages are shown on the display panel for an amount of seconds, and will then disappear.
Messages can contain a category which is indicating the category of the message.</p>
<h2>MESSAGE construction</h2>
<p>Messages are created with <a href="Message.html##(MESSAGE).New">Message#MESSAGE.New</a>. Note that when the MESSAGE object is created, no message is sent yet.
To send messages, you need to use the To functions.</p>
<h2>Send messages to an audience</h2>
<p>Messages are sent:</p>
<ul>
<li>To a <a href="Client.html">Client</a> using <a href="Message.html##(MESSAGE).ToClient">Message#MESSAGE.ToClient</a>().</li>
<li>To a <a href="Group.html">Group</a> using <a href="Message.html##(MESSAGE).ToGroup">Message#MESSAGE.ToGroup</a>()</li>
<li>To a coalition using <a href="Message.html##(MESSAGE).ToCoalition">Message#MESSAGE.ToCoalition</a>().</li>
<li>To the red coalition using <a href="Message.html##(MESSAGE).ToRed">Message#MESSAGE.ToRed</a>().</li>
<li>To the blue coalition using <a href="Message.html##(MESSAGE).ToBlue">Message#MESSAGE.ToBlue</a>().</li>
<li>To all Players using <a href="Message.html##(MESSAGE).ToAll">Message#MESSAGE.ToAll</a>().</li>
</ul>
<h2>Send conditionally to an audience</h2>
<p>Messages can be sent conditionally to an audience (when a condition is true):</p>
<ul>
<li>To all players using <a href="Message.html##(MESSAGE).ToAllIf">Message#MESSAGE.ToAllIf</a>().</li>
<li>To a coalition using <a href="Message.html##(MESSAGE).ToCoalitionIf">Message#MESSAGE.ToCoalitionIf</a>().</li>
</ul>
</dd>
@ -246,48 +230,6 @@ To send messages, you need to use the To functions.</p>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(MESSAGE).ClassName" >
<strong>MESSAGE.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(MESSAGE).MessageCategory" >
<strong>MESSAGE.MessageCategory</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(MESSAGE).MessageID" >
<strong>MESSAGE.MessageID</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MESSAGE).New" >
<strong>MESSAGE:New(MessageText, MessageDuration, MessageCategory)</strong>
</a>

View File

@ -211,6 +211,7 @@ on defined intervals (currently every minute).</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(MOVEMENT).AliveUnits" >
<strong>MOVEMENT.AliveUnits</strong>
</a>
@ -219,6 +220,9 @@ on defined intervals (currently every minute).</p>
<p> Contains the counter how many units are currently alive</p>
</dd>
</dl>
<dl class="function">

View File

@ -97,103 +97,23 @@
<h1>1) <a href="Point.html##(POINT_VEC3)">Point#POINT_VEC3</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>The <a href="Point.html##(POINT_VEC3)">Point#POINT_VEC3</a> class defines a 3D point in the simulator.</p>
<p><img src="..\Presentations\POINT\Dia1.JPG" alt="Banner Image"/></p>
<p><strong>Important Note:</strong> Most of the functions in this section were taken from MIST, and reworked to OO concepts.
In order to keep the credibility of the the author, I want to emphasize that the of the MIST framework was created by Grimes, who you can find on the Eagle Dynamics Forums.</p>
<hr/>
<h2>1.1) POINT_VEC3 constructor</h2>
<h1>Demo Missions</h1>
<p>A new POINT_VEC3 instance can be created with:</p>
<h3><a href="">POINT_VEC Demo Missions source code</a></h3>
<ul>
<li><a href="Point.html##(POINT_VEC3).New">Point#POINT_VEC3.New</a>(): a 3D point.</li>
<li><a href="Point.html##(POINT_VEC3).NewFromVec3">Point#POINT_VEC3.NewFromVec3</a>(): a 3D point created from a <a href="DCSTypes.html##(Vec3)">DCSTypes#Vec3</a>.</li>
</ul>
<h3><a href="">POINT_VEC Demo Missions, only for beta testers</a></h3>
<h2>1.2) Manupulate the X, Y, Z coordinates of the point</h2>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<p>A POINT_VEC3 class works in 3D space. It contains internally an X, Y, Z coordinate.
Methods exist to manupulate these coordinates.</p>
<hr/>
<p>The current X, Y, Z axis can be retrieved with the methods <a href="##(POINT_VEC3).GetX">POINT_VEC3.GetX</a>(), <a href="##(POINT_VEC3).GetY">POINT_VEC3.GetY</a>(), <a href="##(POINT_VEC3).GetZ">POINT_VEC3.GetZ</a>() respectively.
The methods <a href="##(POINT_VEC3).SetX">POINT_VEC3.SetX</a>(), <a href="##(POINT_VEC3).SetY">POINT_VEC3.SetY</a>(), <a href="##(POINT_VEC3).SetZ">POINT_VEC3.SetZ</a>() change the respective axis with a new value.
The current axis values can be changed by using the methods <a href="##(POINT_VEC3).AddX">POINT_VEC3.AddX</a>(), <a href="##(POINT_VEC3).AddY">POINT_VEC3.AddY</a>(), <a href="##(POINT_VEC3).AddZ">POINT_VEC3.AddZ</a>()
to add or substract a value from the current respective axis value.
Note that the Set and Add methods return the current POINT_VEC3 object, so these manipulation methods can be chained... For example:</p>
<h1>YouTube Channel</h1>
<pre><code> local Vec3 = PointVec3:AddX( 100 ):AddZ( 150 ):GetVec3()
</code></pre>
<h2>1.3) Create waypoints for routes</h2>
<p>A POINT_VEC3 can prepare waypoints for Ground, Air and Naval groups to be embedded into a Route.</p>
<h2>1.5) Smoke, flare, explode, illuminate</h2>
<p>At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods:</p>
<h3>1.5.1) Smoke</h3>
<ul>
<li><a href="##(POINT_VEC3).Smoke">POINT_VEC3.Smoke</a>(): To smoke the point in a certain color.</li>
<li><a href="##(POINT_VEC3).SmokeBlue">POINT_VEC3.SmokeBlue</a>(): To smoke the point in blue.</li>
<li><a href="##(POINT_VEC3).SmokeRed">POINT_VEC3.SmokeRed</a>(): To smoke the point in red.</li>
<li><a href="##(POINT_VEC3).SmokeOrange">POINT_VEC3.SmokeOrange</a>(): To smoke the point in orange.</li>
<li><a href="##(POINT_VEC3).SmokeWhite">POINT_VEC3.SmokeWhite</a>(): To smoke the point in white.</li>
<li><a href="##(POINT_VEC3).SmokeGreen">POINT_VEC3.SmokeGreen</a>(): To smoke the point in green.</li>
</ul>
<h3>1.5.2) Flare</h3>
<ul>
<li><a href="##(POINT_VEC3).Flare">POINT_VEC3.Flare</a>(): To flare the point in a certain color.</li>
<li><a href="##(POINT_VEC3).FlareRed">POINT_VEC3.FlareRed</a>(): To flare the point in red.</li>
<li><a href="##(POINT_VEC3).FlareYellow">POINT_VEC3.FlareYellow</a>(): To flare the point in yellow.</li>
<li><a href="##(POINT_VEC3).FlareWhite">POINT_VEC3.FlareWhite</a>(): To flare the point in white.</li>
<li><a href="##(POINT_VEC3).FlareGreen">POINT_VEC3.FlareGreen</a>(): To flare the point in green.</li>
</ul>
<h3>1.5.3) Explode</h3>
<ul>
<li><a href="##(POINT_VEC3).Explosion">POINT_VEC3.Explosion</a>(): To explode the point with a certain intensity.</li>
</ul>
<h3>1.5.4) Illuminate</h3>
<ul>
<li><a href="##(POINT_VEC3).IlluminationBomb">POINT_VEC3.IlluminationBomb</a>(): To illuminate the point.</li>
</ul>
<h1>2) <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> class, extends <a href="Point.html##(POINT_VEC3)">Point#POINT_VEC3</a></h1>
<p>The <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> class defines a 2D point in the simulator. The height coordinate (if needed) will be the land height + an optional added height specified.</p>
<h2>2.1) POINT_VEC2 constructor</h2>
<p>A new POINT_VEC2 instance can be created with:</p>
<ul>
<li><a href="Point.html##(POINT_VEC2).New">Point#POINT_VEC2.New</a>(): a 2D point, taking an additional height parameter.</li>
<li><a href="Point.html##(POINT_VEC2).NewFromVec2">Point#POINT_VEC2.NewFromVec2</a>(): a 2D point created from a <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>.</li>
</ul>
<h2>1.2) Manupulate the X, Altitude, Y coordinates of the 2D point</h2>
<p>A POINT_VEC2 class works in 2D space, with an altitude setting. It contains internally an X, Altitude, Y coordinate.
Methods exist to manupulate these coordinates.</p>
<p>The current X, Altitude, Y axis can be retrieved with the methods <a href="##(POINT_VEC2).GetX">POINT_VEC2.GetX</a>(), <a href="##(POINT_VEC2).GetAlt">POINT_VEC2.GetAlt</a>(), <a href="##(POINT_VEC2).GetY">POINT_VEC2.GetY</a>() respectively.
The methods <a href="##(POINT_VEC2).SetX">POINT_VEC2.SetX</a>(), <a href="##(POINT_VEC2).SetAlt">POINT_VEC2.SetAlt</a>(), <a href="##(POINT_VEC2).SetY">POINT_VEC2.SetY</a>() change the respective axis with a new value.
The current Lat(itude), Alt(itude), Lon(gitude) values can also be retrieved with the methods <a href="##(POINT_VEC2).GetLat">POINT_VEC2.GetLat</a>(), <a href="##(POINT_VEC2).GetAlt">POINT_VEC2.GetAlt</a>(), <a href="##(POINT_VEC2).GetLon">POINT_VEC2.GetLon</a>() respectively.
The current axis values can be changed by using the methods <a href="##(POINT_VEC2).AddX">POINT_VEC2.AddX</a>(), <a href="##(POINT_VEC2).AddAlt">POINT_VEC2.AddAlt</a>(), <a href="##(POINT_VEC2).AddY">POINT_VEC2.AddY</a>()
to add or substract a value from the current respective axis value.
Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:</p>
<pre><code> local Vec2 = PointVec2:AddX( 100 ):AddY( 2000 ):GetVec2()
</code></pre>
<h3><a href="">POINT_VEC YouTube Channel</a></h3>
<hr/>
@ -238,13 +158,17 @@ Note that the Set and Add methods return the current POINT_VEC2 object, so these
<tr>
<td class="name" nowrap="nowrap"><a href="#POINT_VEC2">POINT_VEC2</a></td>
<td class="summary">
<h1>POINT_VEC2 class, extends <a href="Point.html##(POINT_VEC3)">Point#POINT_VEC3</a></h1>
<p>The <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> class defines a 2D point in the simulator.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#POINT_VEC3">POINT_VEC3</a></td>
<td class="summary">
<h1>POINT_VEC3 class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>POINT_VEC3 defines a 3D point in the simulator and with its methods, you can use or manipulate the point in 3D space.</p>
</td>
</tr>
</table>
@ -266,12 +190,6 @@ Note that the Set and Add methods return the current POINT_VEC2 object, so these
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC2).AddY">POINT_VEC2:AddY(y)</a></td>
<td class="summary">
<p>Add to the y coordinate of the POINT_VEC2.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC2).ClassName">POINT_VEC2.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -414,12 +332,6 @@ Note that the Set and Add methods return the current POINT_VEC2 object, so these
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).AddZ">POINT_VEC3:AddZ(z)</a></td>
<td class="summary">
<p>Add to the z coordinate of the POINT_VEC3.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).ClassName">POINT_VEC3.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -483,15 +395,21 @@ Note that the Set and Add methods return the current POINT_VEC2 object, so these
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).GetBRText">POINT_VEC3:GetBRText(TargetPointVec3)</a></td>
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).GetAngleDegrees">POINT_VEC3:GetAngleDegrees(DirectionVec3)</a></td>
<td class="summary">
<p>Return a BR string from a POINT<em>VEC3 to the POINT</em>VEC3.</p>
<p>Return an angle in degrees from the POINT_VEC3 using a direction vector in Vec3 format.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).GetDirectionRadians">POINT_VEC3:GetDirectionRadians(DirectionVec3)</a></td>
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).GetAngleRadians">POINT_VEC3:GetAngleRadians(DirectionVec3)</a></td>
<td class="summary">
<p>Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format.</p>
<p>Return an angle in radians from the POINT_VEC3 using a direction vector in Vec3 format.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(POINT_VEC3).GetBRText">POINT_VEC3:GetBRText(TargetPointVec3)</a></td>
<td class="summary">
<p>Return a BR string from a POINT<em>VEC3 to the POINT</em>VEC3.</p>
</td>
</tr>
<tr>
@ -783,7 +701,37 @@ Note that the Set and Add methods return the current POINT_VEC2 object, so these
</dt>
<dd>
<h1>POINT_VEC2 class, extends <a href="Point.html##(POINT_VEC3)">Point#POINT_VEC3</a></h1>
<p>The <a href="Point.html##(POINT_VEC2)">Point#POINT_VEC2</a> class defines a 2D point in the simulator.</p>
<p>The height coordinate (if needed) will be the land height + an optional added height specified.</p>
<h2>POINT_VEC2 constructor</h2>
<p>A new POINT_VEC2 instance can be created with:</p>
<ul>
<li><a href="Point.html##(POINT_VEC2).New">Point#POINT_VEC2.New</a>(): a 2D point, taking an additional height parameter.</li>
<li><a href="Point.html##(POINT_VEC2).NewFromVec2">Point#POINT_VEC2.NewFromVec2</a>(): a 2D point created from a <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>.</li>
</ul>
<h2>Manupulate the X, Altitude, Y coordinates of the 2D point</h2>
<p>A POINT_VEC2 class works in 2D space, with an altitude setting. It contains internally an X, Altitude, Y coordinate.
Methods exist to manupulate these coordinates.</p>
<p>The current X, Altitude, Y axis can be retrieved with the methods <a href="##(POINT_VEC2).GetX">POINT_VEC2.GetX</a>(), <a href="##(POINT_VEC2).GetAlt">POINT_VEC2.GetAlt</a>(), <a href="##(POINT_VEC2).GetY">POINT_VEC2.GetY</a>() respectively.
The methods <a href="##(POINT_VEC2).SetX">POINT_VEC2.SetX</a>(), <a href="##(POINT_VEC2).SetAlt">POINT_VEC2.SetAlt</a>(), <a href="##(POINT_VEC2).SetY">POINT_VEC2.SetY</a>() change the respective axis with a new value.
The current Lat(itude), Alt(itude), Lon(gitude) values can also be retrieved with the methods <a href="##(POINT_VEC2).GetLat">POINT_VEC2.GetLat</a>(), <a href="##(POINT_VEC2).GetAlt">POINT_VEC2.GetAlt</a>(), <a href="##(POINT_VEC2).GetLon">POINT_VEC2.GetLon</a>() respectively.
The current axis values can be changed by using the methods <a href="##(POINT_VEC2).AddX">POINT_VEC2.AddX</a>(), <a href="##(POINT_VEC2).AddAlt">POINT_VEC2.AddAlt</a>(), <a href="##(POINT_VEC2).AddY">POINT_VEC2.AddY</a>()
to add or substract a value from the current respective axis value.
Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:</p>
<pre><code> local Vec2 = PointVec2:AddX( 100 ):AddY( 2000 ):GetVec2()
</code></pre>
</dd>
</dl>
@ -797,17 +745,159 @@ Note that the Set and Add methods return the current POINT_VEC2 object, so these
</dt>
<dd>
<h1>POINT_VEC3 class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>POINT_VEC3 defines a 3D point in the simulator and with its methods, you can use or manipulate the point in 3D space.</p>
<p><strong>Important Note:</strong> Most of the functions in this section were taken from MIST, and reworked to OO concepts.
In order to keep the credibility of the the author,
I want to emphasize that the formulas embedded in the MIST framework were created by Grimes or previous authors,
who you can find on the Eagle Dynamics Forums.</p>
<h2>POINT_VEC3 constructor</h2>
<p>A new POINT_VEC3 object can be created with:</p>
<ul>
<li><a href="##(POINT_VEC3).New">POINT_VEC3.New</a>(): a 3D point.</li>
<li><a href="##(POINT_VEC3).NewFromVec3">POINT_VEC3.NewFromVec3</a>(): a 3D point created from a <a href="DCSTypes.html##(Vec3)">DCSTypes#Vec3</a>.</li>
</ul>
<h2>Manupulate the X, Y, Z coordinates of the POINT_VEC3</h2>
<p>A POINT_VEC3 class works in 3D space. It contains internally an X, Y, Z coordinate.
Methods exist to manupulate these coordinates.</p>
<p>The current X, Y, Z axis can be retrieved with the methods <a href="##(POINT_VEC3).GetX">POINT_VEC3.GetX</a>(), <a href="##(POINT_VEC3).GetY">POINT_VEC3.GetY</a>(), <a href="##(POINT_VEC3).GetZ">POINT_VEC3.GetZ</a>() respectively.
The methods <a href="##(POINT_VEC3).SetX">POINT_VEC3.SetX</a>(), <a href="##(POINT_VEC3).SetY">POINT_VEC3.SetY</a>(), <a href="##(POINT_VEC3).SetZ">POINT_VEC3.SetZ</a>() change the respective axis with a new value.
The current axis values can be changed by using the methods <a href="##(POINT_VEC3).AddX">POINT_VEC3.AddX</a>(), <a href="##(POINT_VEC3).AddY">POINT_VEC3.AddY</a>(), <a href="##(POINT_VEC3).AddZ">POINT_VEC3.AddZ</a>()
to add or substract a value from the current respective axis value.
Note that the Set and Add methods return the current POINT_VEC3 object, so these manipulation methods can be chained... For example:</p>
<pre><code> local Vec3 = PointVec3:AddX( 100 ):AddZ( 150 ):GetVec3()
</code></pre>
<h2>Create waypoints for routes</h2>
<p>A POINT_VEC3 can prepare waypoints for Ground and Air groups to be embedded into a Route.</p>
<ul>
<li><a href="##(POINT_VEC3).RoutePointAir">POINT_VEC3.RoutePointAir</a>(): Build an air route point.</li>
<li><a href="##(POINT_VEC3).RoutePointGround">POINT_VEC3.RoutePointGround</a>(): Build a ground route point.</li>
</ul>
<p>Route points can be used in the Route methods of the <a href="Group.html##(GROUP)">Group#GROUP</a> class.</p>
<h2>Smoke, flare, explode, illuminate</h2>
<p>At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods:</p>
<h3>Smoke</h3>
<ul>
<li><a href="##(POINT_VEC3).Smoke">POINT_VEC3.Smoke</a>(): To smoke the point in a certain color.</li>
<li><a href="##(POINT_VEC3).SmokeBlue">POINT_VEC3.SmokeBlue</a>(): To smoke the point in blue.</li>
<li><a href="##(POINT_VEC3).SmokeRed">POINT_VEC3.SmokeRed</a>(): To smoke the point in red.</li>
<li><a href="##(POINT_VEC3).SmokeOrange">POINT_VEC3.SmokeOrange</a>(): To smoke the point in orange.</li>
<li><a href="##(POINT_VEC3).SmokeWhite">POINT_VEC3.SmokeWhite</a>(): To smoke the point in white.</li>
<li><a href="##(POINT_VEC3).SmokeGreen">POINT_VEC3.SmokeGreen</a>(): To smoke the point in green.</li>
</ul>
<h3>Flare</h3>
<ul>
<li><a href="##(POINT_VEC3).Flare">POINT_VEC3.Flare</a>(): To flare the point in a certain color.</li>
<li><a href="##(POINT_VEC3).FlareRed">POINT_VEC3.FlareRed</a>(): To flare the point in red.</li>
<li><a href="##(POINT_VEC3).FlareYellow">POINT_VEC3.FlareYellow</a>(): To flare the point in yellow.</li>
<li><a href="##(POINT_VEC3).FlareWhite">POINT_VEC3.FlareWhite</a>(): To flare the point in white.</li>
<li><a href="##(POINT_VEC3).FlareGreen">POINT_VEC3.FlareGreen</a>(): To flare the point in green.</li>
</ul>
<h3>Explode</h3>
<ul>
<li><a href="##(POINT_VEC3).Explosion">POINT_VEC3.Explosion</a>(): To explode the point with a certain intensity.</li>
</ul>
<h3>Illuminate</h3>
<ul>
<li><a href="##(POINT_VEC3).IlluminationBomb">POINT_VEC3.IlluminationBomb</a>(): To illuminate the point.</li>
</ul>
<h2>3D calculation methods</h2>
<p>Various calculation methods exist to use or manipulate 3D space. Find below a short description of each method:</p>
<h3>Distance</h3>
<ul>
<li><a href="##(POINT_VEC3).Get3DDistance">POINT_VEC3.Get3DDistance</a>(): Obtain the distance from the current 3D point to the provided 3D point in 3D space.</li>
<li><a href="##(POINT_VEC3).Get2DDistance">POINT_VEC3.Get2DDistance</a>(): Obtain the distance from the current 3D point to the provided 3D point in 2D space.</li>
</ul>
<h3>Angle</h3>
<ul>
<li><a href="##(POINT_VEC3).GetAngleDegrees">POINT_VEC3.GetAngleDegrees</a>(): Obtain the angle in degrees from the current 3D point with the provided 3D direction vector.</li>
<li><a href="##(POINT_VEC3).GetAngleRadians">POINT_VEC3.GetAngleRadians</a>(): Obtain the angle in radians from the current 3D point with the provided 3D direction vector.</li>
<li><a href="##(POINT_VEC3).GetDirectionVec3">POINT_VEC3.GetDirectionVec3</a>(): Obtain the 3D direction vector from the current 3D point to the provided 3D point.</li>
</ul>
<h3>Translation</h3>
<ul>
<li><a href="##(POINT_VEC3).Translate">POINT_VEC3.Translate</a>(): Translate the current 3D point towards an other 3D point using the given Distance and Angle.</li>
</ul>
<h3>Get the North correction of the current location</h3>
<ul>
<li><a href="##(POINT_VEC3).GetNorthCorrection">POINT_VEC3.GetNorthCorrection</a>(): Obtains the north correction at the current 3D point.</li>
</ul>
<h2>Point Randomization</h2>
<p>Various methods exist to calculate random locations around a given 3D point.</p>
<ul>
<li><a href="##(POINT_VEC3).GetRandomPointVec2InRadius">POINT_VEC3.GetRandomPointVec2InRadius</a>(): Provides a random 2D point around the current 3D point, in the given inner to outer band.</li>
<li><a href="##(POINT_VEC3).GetRandomPointVec3InRadius">POINT_VEC3.GetRandomPointVec3InRadius</a>(): Provides a random 3D point around the current 3D point, in the given inner to outer band.</li>
<li><a href="##(POINT_VEC3).GetRandomVec2InRadius">POINT_VEC3.GetRandomVec2InRadius</a>(): Provides a random 2D vector around the current 3D point, in the given inner to outer band.</li>
<li><a href="##(POINT_VEC3).GetRandomVec3InRadius">POINT_VEC3.GetRandomVec3InRadius</a>(): Provides a random 3D vector around the current 3D point, in the given inner to outer band.</li>
</ul>
<h2>Metric system</h2>
<ul>
<li><a href="##(POINT_VEC3).IsMetric">POINT_VEC3.IsMetric</a>(): Returns if the 3D point is Metric or Nautical Miles.</li>
<li><a href="##(POINT_VEC3).SetMetric">POINT_VEC3.SetMetric</a>(): Sets the 3D point to Metric or Nautical Miles.</li>
</ul>
<h2>Coorinate text generation</h2>
<ul>
<li><a href="##(POINT_VEC3).ToStringBR">POINT_VEC3.ToStringBR</a>(): Generates a Bearing &amp; Range text in the format of DDD for DI where DDD is degrees and DI is distance.</li>
<li><a href="##(POINT_VEC3).ToStringLL">POINT_VEC3.ToStringLL</a>(): Generates a Latutude &amp; Longutude text.
</li>
</ul>
</dd>
</dl>
<h2><a id="#(Point)" >Type <code>Point</code></a></h2>
<h2><a id="#(POINT_VEC2)" >Type <code>POINT_VEC2</code></a></h2>
<p>The POINT_VEC2 class</p>
<h3>Field(s)</h3>
<h3>Field(s)</h3>
<dl class="function">
<dt>
@ -887,20 +977,6 @@ The y coordinate.</p>
<p><em><a href="##(POINT_VEC2)">#POINT_VEC2</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(POINT_VEC2).ClassName" >
<strong>POINT_VEC2.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -1463,20 +1539,6 @@ The z coordinate value to add to the current z coodinate.</p>
<p><em><a href="##(POINT_VEC3)">#POINT_VEC3</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(POINT_VEC3).ClassName" >
<strong>POINT_VEC3.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -1723,6 +1785,60 @@ Altitude text.</p>
<dl class="function">
<dt>
<a id="#(POINT_VEC3).GetAngleDegrees" >
<strong>POINT_VEC3:GetAngleDegrees(DirectionVec3)</strong>
</a>
</dt>
<dd>
<p>Return an angle in degrees from the POINT_VEC3 using a direction vector in Vec3 format.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec3)">Dcs.DCSTypes#Vec3</a> DirectionVec3 </em></code>:
The direction vector in Vec3 format.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
DirectionRadians The angle in degrees.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(POINT_VEC3).GetAngleRadians" >
<strong>POINT_VEC3:GetAngleRadians(DirectionVec3)</strong>
</a>
</dt>
<dd>
<p>Return an angle in radians from the POINT_VEC3 using a direction vector in Vec3 format.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec3)">Dcs.DCSTypes#Vec3</a> DirectionVec3 </em></code>:
The direction vector in Vec3 format.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
DirectionRadians The angle in radians.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(POINT_VEC3).GetBRText" >
<strong>POINT_VEC3:GetBRText(TargetPointVec3)</strong>
</a>
@ -1750,33 +1866,6 @@ The BR text.</p>
<dl class="function">
<dt>
<a id="#(POINT_VEC3).GetDirectionRadians" >
<strong>POINT_VEC3:GetDirectionRadians(DirectionVec3)</strong>
</a>
</dt>
<dd>
<p>Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec3)">Dcs.DCSTypes#Vec3</a> DirectionVec3 </em></code>:
The direction vector in Vec3 format.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
DirectionRadians The direction in radians.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(POINT_VEC3).GetDirectionVec3" >
<strong>POINT_VEC3:GetDirectionVec3(TargetPointVec3)</strong>
</a>

View File

@ -101,33 +101,30 @@
<hr/>
<h1>1) <a href="Scheduler.html##(SCHEDULER)">Scheduler#SCHEDULER</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>The <a href="Scheduler.html##(SCHEDULER)">Scheduler#SCHEDULER</a> class creates schedule.</p>
<h2>1.1) SCHEDULER constructor</h2>
<p>The SCHEDULER class is quite easy to use, but note that the New constructor has variable parameters:</p>
<p>SCHEDULER manages the <strong>scheduling of functions</strong>:</p>
<ul>
<li><a href="Scheduler.html##(SCHEDULER).New">Scheduler#SCHEDULER.New</a>( nil ): Setup a new SCHEDULER object, which is persistently executed after garbage collection.</li>
<li><a href="Scheduler.html##(SCHEDULER).New">Scheduler#SCHEDULER.New</a>( Object ): Setup a new SCHEDULER object, which is linked to the Object. When the Object is nillified or destroyed, the SCHEDULER object will also be destroyed and stopped after garbage collection.</li>
<li><a href="Scheduler.html##(SCHEDULER).New">Scheduler#SCHEDULER.New</a>( nil, Function, FunctionArguments, Start, ... ): Setup a new persistent SCHEDULER object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.</li>
<li><a href="Scheduler.html##(SCHEDULER).New">Scheduler#SCHEDULER.New</a>( Object, Function, FunctionArguments, Start, ... ): Setup a new SCHEDULER object, linked to Object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.</li>
<li>optionally in an optional specified time interval, </li>
<li>optionally <strong>repeating</strong> with a specified time repeat interval, </li>
<li>optionally <strong>randomizing</strong> with a specified time interval randomization factor, </li>
<li>optionally <strong>stop</strong> the repeating after a specified time interval. </li>
</ul>
<h2>1.2) SCHEDULER timer stopping and (re-)starting.</h2>
<hr/>
<p>The SCHEDULER can be stopped and restarted with the following methods:</p>
<h1>Demo Missions</h1>
<ul>
<li><a href="Scheduler.html##(SCHEDULER).Start">Scheduler#SCHEDULER.Start</a>(): (Re-)Start the schedules within the SCHEDULER object. If a CallID is provided to :Start(), only the schedule referenced by CallID will be (re-)started.</li>
<li><a href="Scheduler.html##(SCHEDULER).Stop">Scheduler#SCHEDULER.Stop</a>(): Stop the schedules within the SCHEDULER object. If a CallID is provided to :Stop(), then only the schedule referenced by CallID will be stopped.</li>
</ul>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/SCH%20-%20Scheduler">SCHEDULER Demo Missions source code</a></h3>
<h2>1.3) Create a new schedule</h2>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/SCH%20-%20Scheduler">SCHEDULER Demo Missions, only for beta testers</a></h3>
<p>With <a href="Scheduler.html##(SCHEDULER).Schedule">Scheduler#SCHEDULER.Schedule</a>() a new time event can be scheduled. This function is used by the :New() constructor when a new schedule is planned.</p>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<hr/>
<h1>YouTube Channel</h1>
<h3><a href="">SCHEDULER YouTube Channel (none)</a></h3>
<hr/>
@ -143,12 +140,6 @@
<li>FlightControl : Design &amp; Programming</li>
</ul>
<h3>Test Missions:</h3>
<ul>
<li>SCH - Scheduler</li>
</ul>
<hr/>
@ -157,19 +148,15 @@
<tr>
<td class="name" nowrap="nowrap"><a href="#SCHEDULER">SCHEDULER</a></td>
<td class="summary">
<h1>SCHEDULER class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>The SCHEDULER class creates schedule.</p>
</td>
</tr>
</table>
<h2><a id="#(SCHEDULER)">Type <code>SCHEDULER</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).ClassName">SCHEDULER.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Clear">SCHEDULER:Clear()</a></td>
<td class="summary">
<p>Clears all pending schedules.</p>
@ -203,12 +190,6 @@
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).SchedulerObject">SCHEDULER.SchedulerObject</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Schedules">SCHEDULER.Schedules</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -236,6 +217,169 @@
</dt>
<dd>
<h1>SCHEDULER class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>The SCHEDULER class creates schedule.</p>
<p>A SCHEDULER can manage <strong>multiple</strong> (repeating) schedules. Each planned or executing schedule has a unique <strong>ScheduleID</strong>.
The ScheduleID is returned when the method <a href="##(SCHEDULER).Schedule">SCHEDULER.Schedule</a>() is called.
It is recommended to store the ScheduleID in a variable, as it is used in the methods <a href="SCHEDULER.Start.html">SCHEDULER.Start</a>() and <a href="SCHEDULER.Stop.html">SCHEDULER.Stop</a>(),
which can start and stop specific repeating schedules respectively within a SCHEDULER object.</p>
<h2>SCHEDULER constructor</h2>
<p>The SCHEDULER class is quite easy to use, but note that the New constructor has variable parameters:</p>
<p>The <a href="##(SCHEDULER).New">SCHEDULER.New</a>() method returns 2 variables:</p>
<ol>
<li>The SCHEDULER object reference.</li>
<li>The first schedule planned in the SCHEDULER object.</li>
</ol>
<p>To clarify the different appliances, lets have a look at the following examples: </p>
<h3>Construct a SCHEDULER object without a persistent schedule.</h3>
<ul>
<li><p><a href="##(SCHEDULER).New">SCHEDULER.New</a>( nil ): Setup a new SCHEDULER object, which is persistently executed after garbage collection.</p>
<p>SchedulerObject = SCHEDULER:New()
SchedulerID = SchedulerObject:Schedule( nil, ScheduleFunction, {} )</p></li>
</ul>
<p>The above example creates a new SchedulerObject, but does not schedule anything.
A separate schedule is created by using the SchedulerObject using the method :Schedule..., which returns a ScheduleID</p>
<h3>Construct a SCHEDULER object without a volatile schedule, but volatile to the Object existence...</h3>
<ul>
<li><p><a href="##(SCHEDULER).New">SCHEDULER.New</a>( Object ): Setup a new SCHEDULER object, which is linked to the Object. When the Object is nillified or destroyed, the SCHEDULER object will also be destroyed and stopped after garbage collection.</p>
<p>ZoneObject = ZONE:New( "ZoneName" )
SchedulerObject = SCHEDULER:New( ZoneObject )
SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
...
ZoneObject = nil
garbagecollect()</p></li>
</ul>
<p>The above example creates a new SchedulerObject, but does not schedule anything, and is bound to the existence of ZoneObject, which is a ZONE.
A separate schedule is created by using the SchedulerObject using the method :Schedule()..., which returns a ScheduleID
Later in the logic, the ZoneObject is put to nil, and garbage is collected.
As a result, the ScheduleObject will cancel any planned schedule.</p>
<h3>Construct a SCHEDULER object with a persistent schedule.</h3>
<ul>
<li><p><a href="##(SCHEDULER).New">SCHEDULER.New</a>( nil, Function, FunctionArguments, Start, ... ): Setup a new persistent SCHEDULER object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.</p>
<p>SchedulerObject, SchedulerID = SCHEDULER:New( nil, ScheduleFunction, {} )</p></li>
</ul>
<p>The above example creates a new SchedulerObject, and does schedule the first schedule as part of the call.
Note that 2 variables are returned here: SchedulerObject, ScheduleID...</p>
<h3>Construct a SCHEDULER object without a schedule, but volatile to the Object existence...</h3>
<ul>
<li><p><a href="##(SCHEDULER).New">SCHEDULER.New</a>( Object, Function, FunctionArguments, Start, ... ): Setup a new SCHEDULER object, linked to Object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.</p>
<p>ZoneObject = ZONE:New( "ZoneName" )
SchedulerObject, SchedulerID = SCHEDULER:New( ZoneObject, ScheduleFunction, {} )
SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
...
ZoneObject = nil
garbagecollect()</p></li>
</ul>
<p>The above example creates a new SchedulerObject, and schedules a method call (ScheduleFunction),
and is bound to the existence of ZoneObject, which is a ZONE object (ZoneObject).
Both a ScheduleObject and a SchedulerID variable are returned.
Later in the logic, the ZoneObject is put to nil, and garbage is collected.
As a result, the ScheduleObject will cancel the planned schedule.</p>
<h2>SCHEDULER timer stopping and (re-)starting.</h2>
<p>The SCHEDULER can be stopped and restarted with the following methods:</p>
<ul>
<li><p><a href="##(SCHEDULER).Start">SCHEDULER.Start</a>(): (Re-)Start the schedules within the SCHEDULER object. If a CallID is provided to :Start(), only the schedule referenced by CallID will be (re-)started.</p></li>
<li><p><a href="##(SCHEDULER).Stop">SCHEDULER.Stop</a>(): Stop the schedules within the SCHEDULER object. If a CallID is provided to :Stop(), then only the schedule referenced by CallID will be stopped.</p>
<p>ZoneObject = ZONE:New( "ZoneName" )
SchedulerObject, SchedulerID = SCHEDULER:New( ZoneObject, ScheduleFunction, {} )
SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 10 )
...
SchedulerObject:Stop( SchedulerID )
...
SchedulerObject:Start( SchedulerID )</p></li>
</ul>
<p>The above example creates a new SchedulerObject, and does schedule the first schedule as part of the call.
Note that 2 variables are returned here: SchedulerObject, ScheduleID... <br/>
Later in the logic, the repeating schedule with SchedulerID is stopped. <br/>
A bit later, the repeating schedule with SchedulerId is (re)-started. </p>
<h2>Create a new schedule</h2>
<p>With the method <a href="##(SCHEDULER).Schedule">SCHEDULER.Schedule</a>() a new time event can be scheduled.
This method is used by the :New() constructor when a new schedule is planned.</p>
<p>Consider the following code fragment of the SCHEDULER object creation.</p>
<pre><code>ZoneObject = ZONE:New( "ZoneName" )
SchedulerObject = SCHEDULER:New( ZoneObject )
</code></pre>
<p>Several parameters can be specified that influence the behaviour of a Schedule.</p>
<h3>A single schedule, immediately executed</h3>
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
</code></pre>
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within milleseconds ...</p>
<h3>A single schedule, planned over time</h3>
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10 )
</code></pre>
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds ...</p>
<h3>A schedule with a repeating time interval, planned over time</h3>
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60 )
</code></pre>
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
and repeating 60 every seconds ...</p>
<h3>A schedule with a repeating time interval, planned over time, with time interval randomization</h3>
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60, 0.5 )
</code></pre>
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
and repeating 60 seconds, with a 50% time interval randomization ...
So the repeating time interval will be randomized using the <strong>0.5</strong>, <br/>
and will calculate between <strong>60 - ( 60 * 0.5 )</strong> and <strong>60 + ( 60 * 0.5 )</strong> for each repeat,
which is in this example between <strong>30</strong> and <strong>90</strong> seconds.</p>
<h3>A schedule with a repeating time interval, planned over time, with time interval randomization, and stop after a time interval</h3>
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60, 0.5, 300 )
</code></pre>
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
The schedule will repeat every 60 seconds.
So the repeating time interval will be randomized using the <strong>0.5</strong>, <br/>
and will calculate between <strong>60 - ( 60 * 0.5 )</strong> and <strong>60 + ( 60 * 0.5 )</strong> for each repeat,
which is in this example between <strong>30</strong> and <strong>90</strong> seconds.
The schedule will stop after <strong>300</strong> seconds.</p>
</dd>
@ -250,20 +394,6 @@
<dl class="function">
<dt>
<em>#string</em>
<a id="#(SCHEDULER).ClassName" >
<strong>SCHEDULER.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SCHEDULER).Clear" >
<strong>SCHEDULER:Clear()</strong>
</a>
@ -461,20 +591,6 @@ The ScheduleID of the planned schedule.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SCHEDULER).Schedules" >
<strong>SCHEDULER.Schedules</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">

View File

@ -810,6 +810,12 @@ and any spaces before and after the resulting name are removed.</p>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -2111,9 +2117,6 @@ The group that was spawned. You can use this group for further actions.</p>
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
</dd>
</dl>
<dl class="function">
@ -2567,9 +2570,6 @@ when nothing was spawned.</p>
<p> Overwrite unit names by default with group name.</p>
</dd>
</dl>
<dl class="function">
@ -2967,7 +2967,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function">
<dt>
<em>#boolean</em>
<em></em>
<a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong>
</a>
@ -2991,7 +2991,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p>
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
</dd>
</dl>
@ -3557,6 +3557,20 @@ True = Continue Scheduler</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).uncontrolled" >
<strong>SPAWN.uncontrolled</strong>
</a>
</dt>
<dd>
</dd>
</dl>

View File

@ -1452,7 +1452,7 @@ self</p>
<p>Add a PlayerUnit to join the Task.</p>
<p>For each Group within the Task, the Unit is check if it can join the Task.
<p>For each Group within the Task, the Unit is checked if it can join the Task.
If the Unit was not part of the Task, false is returned.
If the Unit is part of the Task, true is returned.</p>

View File

@ -190,6 +190,18 @@ and various dedicated deployment zones.</p>
<td class="name" nowrap="nowrap"><a href="##(TASK_CARGO).DeployZones">TASK_CARGO.DeployZones</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(TASK_CARGO).GetCargoSet">TASK_CARGO:GetCargoSet()</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(TASK_CARGO).GetDeployZones">TASK_CARGO:GetDeployZones()</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -272,6 +284,12 @@ and various dedicated deployment zones.</p>
<td class="name" nowrap="nowrap"><a href="##(TASK_CARGO_TRANSPORT).ClassName">TASK_CARGO_TRANSPORT.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(TASK_CARGO_TRANSPORT).IsAllCargoTransported">TASK_CARGO_TRANSPORT:IsAllCargoTransported()</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -512,6 +530,42 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
<dl class="function">
<dt>
<a id="#(TASK_CARGO).GetCargoSet" >
<strong>TASK_CARGO:GetCargoSet()</strong>
</a>
</dt>
<dd>
<h3>Return value</h3>
<p><em><a href="Core.Set.html##(SET_CARGO)">Core.Set#SET_CARGO</a>:</em>
The Cargo Set.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(TASK_CARGO).GetDeployZones" >
<strong>TASK_CARGO:GetDeployZones()</strong>
</a>
</dt>
<dd>
<h3>Return value</h3>
<p><em><a href="##(list)">#list</a>:</em>
Core.Zone#ZONE_BASE> The Deployment Zones.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(TASK_CARGO).GetPlannedMenuText" >
<strong>TASK_CARGO:GetPlannedMenuText()</strong>
</a>
@ -889,6 +943,24 @@ The score in points.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(TASK_CARGO_TRANSPORT).IsAllCargoTransported" >
<strong>TASK_CARGO_TRANSPORT:IsAllCargoTransported()</strong>
</a>
</dt>
<dd>
<h3>Return value</h3>
<p><em>#boolean:</em></p>
</dd>
</dl>
<dl class="function">
@ -936,6 +1008,8 @@ self</p>
</dd>
</dl>
<h2><a id="#(list)" >Type <code>list</code></a></h2>
</div>
</div>

View File

@ -414,12 +414,6 @@
<td class="name" nowrap="nowrap"><a href="##(ZONE_GROUP).New">ZONE_GROUP:New(ZoneName, ZoneGROUP, Radius)</a></td>
<td class="summary">
<p>Constructor to create a ZONE_GROUP instance, taking the zone name, a zone <a href="Group.html##(GROUP)">Group#GROUP</a> and a radius.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_GROUP).ZoneGROUP">ZONE_GROUP.ZoneGROUP</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -488,12 +482,6 @@
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON_BASE).New">ZONE_POLYGON_BASE:New(ZoneName, PointsArray)</a></td>
<td class="summary">
<p>Constructor to create a ZONE<em>POLYGON</em>BASE instance, taking the zone name and an array of <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>, forming a polygon.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON_BASE).Polygon">ZONE_POLYGON_BASE.Polygon</a></td>
<td class="summary">
<p>The polygon defined by an array of <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>.</p>
</td>
</tr>
<tr>
@ -690,23 +678,30 @@
<h2>Each zone implements two polymorphic functions defined in <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>:</h2>
<ul>
<li><a href="##(ZONE_BASE).IsVec2InZone">ZONE_BASE.IsVec2InZone</a>(): Returns if a Vec2 is within the zone.</li>
<li><a href="##(ZONE_BASE).IsVec3InZone">ZONE_BASE.IsVec3InZone</a>(): Returns if a Vec3 is within the zone.</li>
<li><a href="##(ZONE_BASE).IsVec2InZone">ZONE_BASE.IsVec2InZone</a>(): Returns if a 2D vector is within the zone.</li>
<li><a href="##(ZONE_BASE).IsVec3InZone">ZONE_BASE.IsVec3InZone</a>(): Returns if a 3D vector is within the zone.</li>
<li><a href="##(ZONE_BASE).IsPointVec2InZone">ZONE_BASE.IsPointVec2InZone</a>(): Returns if a 2D point vector is within the zone.</li>
<li><a href="##(ZONE_BASE).IsPointVec3InZone">ZONE_BASE.IsPointVec3InZone</a>(): Returns if a 3D point vector is within the zone.</li>
</ul>
<h2>A zone has a probability factor that can be set to randomize a selection between zones:</h2>
<ul>
<li><a href="##(ZONE_BASE).SetRandomizeProbability">ZONE_BASE.SetRandomizeProbability</a>(): Set the randomization probability of a zone to be selected, taking a value between 0 and 1 ( 0 = 0%, 1 = 100% )</li>
<li><a href="##(ZONE_BASE).GetRandomizeProbability">ZONE_BASE.GetRandomizeProbability</a>(): Get the randomization probability of a zone to be selected, passing a value between 0 and 1 ( 0 = 0%, 1 = 100% )</li>
<li><a href="##(ZONE_BASE).SetZoneProbability">ZONE_BASE.SetZoneProbability</a>(): Set the randomization probability of a zone to be selected, taking a value between 0 and 1 ( 0 = 0%, 1 = 100% )</li>
<li><a href="##(ZONE_BASE).GetZoneProbability">ZONE_BASE.GetZoneProbability</a>(): Get the randomization probability of a zone to be selected, passing a value between 0 and 1 ( 0 = 0%, 1 = 100% )</li>
<li><a href="##(ZONE_BASE).GetZoneMaybe">ZONE_BASE.GetZoneMaybe</a>(): Get the zone taking into account the randomization probability. nil is returned if this zone is not a candidate.</li>
</ul>
<h2>A zone manages Vectors:</h2>
<h2>A zone manages vectors:</h2>
<ul>
<li><a href="##(ZONE_BASE).GetVec2">ZONE_BASE.GetVec2</a>(): Returns the <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> coordinate of the zone.</li>
<li><a href="##(ZONE_BASE).GetRandomVec2">ZONE_BASE.GetRandomVec2</a>(): Define a random <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> within the zone.</li>
<li><a href="##(ZONE_BASE).GetVec2">ZONE_BASE.GetVec2</a>(): Returns the 2D vector coordinate of the zone.</li>
<li><a href="##(ZONE_BASE).GetVec3">ZONE_BASE.GetVec3</a>(): Returns the 3D vector coordinate of the zone.</li>
<li><a href="##(ZONE_BASE).GetPointVec2">ZONE_BASE.GetPointVec2</a>(): Returns the 2D point vector coordinate of the zone.</li>
<li><a href="##(ZONE_BASE).GetPointVec3">ZONE_BASE.GetPointVec3</a>(): Returns the 3D point vector coordinate of the zone.</li>
<li><a href="##(ZONE_BASE).GetRandomVec2">ZONE_BASE.GetRandomVec2</a>(): Define a random 2D vector within the zone.</li>
<li><a href="##(ZONE_BASE).GetRandomPointVec2">ZONE_BASE.GetRandomPointVec2</a>(): Define a random 2D point vector within the zone.</li>
<li><a href="##(ZONE_BASE).GetRandomPointVec3">ZONE_BASE.GetRandomPointVec3</a>(): Define a random 3D point vector within the zone.</li>
</ul>
<h2>A zone has a bounding square:</h2>
@ -901,10 +896,7 @@ The name of the zone as defined within the mission editor.</p>
</dl>
<h2><a id="#(ZONE_BASE)" >Type <code>ZONE_BASE</code></a></h2>
<p>The ZONE_BASE class</p>
<h3>Field(s)</h3>
<h3>Field(s)</h3>
<dl class="function">
<dt>
@ -1498,20 +1490,6 @@ The radius of the zone.</p>
<p><em><a href="##(ZONE_GROUP)">#ZONE_GROUP</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a></em>
<a id="#(ZONE_GROUP).ZoneGROUP" >
<strong>ZONE_GROUP.ZoneGROUP</strong>
</a>
</dt>
<dd>
</dd>
</dl>
@ -1755,20 +1733,6 @@ An array of <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>, forming a polygon
<p><em><a href="##(ZONE_POLYGON_BASE)">#ZONE<em>POLYGON</em>BASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(ZONE_POLYGON_BASE.ListVec2)">#ZONE_POLYGON_BASE.ListVec2</a></em>
<a id="#(ZONE_POLYGON_BASE).Polygon" >
<strong>ZONE_POLYGON_BASE.Polygon</strong>
</a>
</dt>
<dd>
<p>The polygon defined by an array of <a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>.</p>
</dd>
</dl>
<dl class="function">

View File

@ -104,10 +104,25 @@ even when there are hardly any players in the mission.</strong></p>
<hr/>
<h1>1) <a href="AI_Balancer.html##(AI_BALANCER)">AI<em>Balancer#AI</em>BALANCER</a> class, extends <a href="Fsm.html##(FSM_SET)">Fsm#FSM_SET</a></h1>
<h1>Demo Missions</h1>
<p>The <a href="AI_Balancer.html##(AI_BALANCER)">AI<em>Balancer#AI</em>BALANCER</a> class monitors and manages as many replacement AI groups as there are
CLIENTS in a SET_CLIENT collection, which are not occupied by human players.</p>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/AIB%20-%20AI%20Balancing">AI_BALANCER Demo Missions source code</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/AIB%20-%20AI%20Balancing">AI_BALANCER Demo Missions, only for beta testers</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<hr/>
<h1>YouTube Channel</h1>
<h3><a href="https://www.youtube.com/playlist?list=PL7ZUrU4zZUl2CJVIrL1TdAumuVS8n64B7">AI_BALANCER YouTube Channel</a></h3>
<hr/>
<h1><strong>API CHANGE HISTORY</strong></h1>
<p>The underlying change log documents the API changes.</p>
</td>
</tr>
<tr>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 308 KiB

View File

@ -1 +1,2 @@
theme: jekyll-theme-architect
theme: jekyll-theme-architect
google_analytics: UA-97385487-1