mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
FSM Documentation
This commit is contained in:
@@ -89,6 +89,7 @@
|
||||
|
||||
|
||||
<h1>1) <a href="Functional.Spawn.html##(SPAWN)">Functional.Spawn#SPAWN</a> class, extends <a href="Core.Base.html##(BASE)">Core.Base#BASE</a></h1>
|
||||
|
||||
<p>The <a href="##(SPAWN)">#SPAWN</a> class allows to spawn dynamically new groups, based on pre-defined initialization settings, modifying the behaviour when groups are spawned.
|
||||
For each group to be spawned, within the mission editor, a group has to be created with the "late activation flag" set. We call this group the <em>"Spawn Template"</em> of the SPAWN object.
|
||||
A reference to this Spawn Template needs to be provided when constructing the SPAWN object, by indicating the name of the group within the mission editor in the constructor methods.</p>
|
||||
@@ -116,6 +117,7 @@ Groups will follow the following naming structure when spawned at run-time:</p>
|
||||
</ul>
|
||||
|
||||
<h2>1.1) SPAWN construction methods</h2>
|
||||
|
||||
<p>Create a new SPAWN object with the <a href="##(SPAWN).New">SPAWN.New</a>() or the <a href="##(SPAWN).NewWithAlias">SPAWN.NewWithAlias</a>() methods:</p>
|
||||
|
||||
<ul>
|
||||
@@ -128,6 +130,7 @@ The initialization methods will modify this list of groups so that when a group
|
||||
So in principle, the group list will contain all parameters and configurations after initialization, and when groups get actually spawned, this spawning can be done quickly and efficient.</p>
|
||||
|
||||
<h2>1.2) SPAWN initialization methods</h2>
|
||||
|
||||
<p>A spawn object will behave differently based on the usage of <strong>initialization</strong> methods, which all start with the <strong>Init</strong> prefix: </p>
|
||||
|
||||
<ul>
|
||||
@@ -142,6 +145,7 @@ So in principle, the group list will contain all parameters and configurations a
|
||||
</ul>
|
||||
|
||||
<h2>1.3) SPAWN spawning methods</h2>
|
||||
|
||||
<p>Groups can be spawned at different times and methods:</p>
|
||||
|
||||
<ul>
|
||||
@@ -159,6 +163,7 @@ So in principle, the group list will contain all parameters and configurations a
|
||||
You can use the <a href="GROUP.html">GROUP</a> object to do further actions with the DCSGroup.</p>
|
||||
|
||||
<h2>1.4) Retrieve alive GROUPs spawned by the SPAWN object</h2>
|
||||
|
||||
<p>The SPAWN class administers which GROUPS it has reserved (in stock) or has created during mission execution.
|
||||
Every time a SPAWN object spawns a new GROUP object, a reference to the GROUP object is added to an internal table of GROUPS.
|
||||
SPAWN provides methods to iterate through that internal GROUP object reference table:</p>
|
||||
@@ -173,6 +178,7 @@ SPAWN provides methods to iterate through that internal GROUP object reference t
|
||||
The method <a href="##(SPAWN).GetGroupFromIndex">SPAWN.GetGroupFromIndex</a>() will return the GROUP object reference from the given Index, dead or alive...</p>
|
||||
|
||||
<h2>1.5) SPAWN object cleaning</h2>
|
||||
|
||||
<p>Sometimes, it will occur during a mission run-time, that ground or especially air objects get damaged, and will while being damged stop their activities, while remaining alive.
|
||||
In such cases, the SPAWN object will just sit there and wait until that group gets destroyed, but most of the time it won't,
|
||||
and it may occur that no new groups are or can be spawned as limits are reached.
|
||||
@@ -184,6 +190,7 @@ This models AI that has succesfully returned to their airbase, to restart their
|
||||
Check the <a href="##(SPAWN).InitCleanUp">SPAWN.InitCleanUp</a>() for further info.</p>
|
||||
|
||||
<h2>1.6) Catch the <a href="Group.html">Group</a> spawn event in a callback function!</h2>
|
||||
|
||||
<p>When using the SpawnScheduled method, new <a href="Group.html">Group</a>s are created following the schedule timing parameters.
|
||||
When a new <a href="Group.html">Group</a> is spawned, you maybe want to execute actions with that group spawned at the spawn event.
|
||||
To SPAWN class supports this functionality through the <a href="##(SPAWN).OnSpawnGroup">SPAWN.OnSpawnGroup</a>( <em>*function( SpawnedGroup ) end *</em> ) method, which takes a function as a parameter that you can define locally.
|
||||
@@ -297,7 +304,7 @@ A coding example is provided at the description of the <a href="##(SPAWN).OnSpaw
|
||||
|
||||
<hr/>
|
||||
|
||||
<h1>AUTHORS and CONTRIBUTIONS</h1>
|
||||
<h1><strong>AUTHORS and CONTRIBUTIONS</strong></h1>
|
||||
|
||||
<h3>Contributions:</h3>
|
||||
|
||||
@@ -312,7 +319,6 @@ A coding example is provided at the description of the <a href="##(SPAWN).OnSpaw
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
@@ -2496,7 +2502,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
|
||||
|
||||
|
||||
|
||||
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
|
||||
<p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Reference in New Issue
Block a user