mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Finetuned AIBALANCER documentation
This commit is contained in:
parent
c211f4f603
commit
87313a9204
@ -35,10 +35,10 @@
|
|||||||
-- @type AIBALANCER
|
-- @type AIBALANCER
|
||||||
-- @field Set#SET_CLIENT SetClient
|
-- @field Set#SET_CLIENT SetClient
|
||||||
-- @field Spawn#SPAWN SpawnAI
|
-- @field Spawn#SPAWN SpawnAI
|
||||||
-- @field #boolean ReturnToAirbase
|
-- @field #boolean ToNearestAirbase
|
||||||
-- @field Set#SET_AIRBASE ReturnAirbaseSet
|
-- @field Set#SET_AIRBASE ReturnAirbaseSet
|
||||||
-- @field DCSTypes#Distance ReturnTresholdRange
|
-- @field DCSTypes#Distance ReturnTresholdRange
|
||||||
-- @field #boolean ReturnToHomeAirbase
|
-- @field #boolean ToHomeAirbase
|
||||||
-- @extends Base#BASE
|
-- @extends Base#BASE
|
||||||
AIBALANCER = {
|
AIBALANCER = {
|
||||||
ClassName = "AIBALANCER",
|
ClassName = "AIBALANCER",
|
||||||
@ -76,7 +76,7 @@ function AIBALANCER:New( SetClient, SpawnAI )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self.ReturnToAirbase = false
|
self.ToNearestAirbase = false
|
||||||
self.ReturnHomeAirbase = false
|
self.ReturnHomeAirbase = false
|
||||||
|
|
||||||
self.AIMonitorSchedule = SCHEDULER:New( self, self._ClientAliveMonitorScheduler, {}, 1, 10, 0 )
|
self.AIMonitorSchedule = SCHEDULER:New( self, self._ClientAliveMonitorScheduler, {}, 1, 10, 0 )
|
||||||
@ -90,7 +90,7 @@ end
|
|||||||
-- @param Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Set#SET_AIRBASE}s to evaluate where to return to.
|
-- @param Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Set#SET_AIRBASE}s to evaluate where to return to.
|
||||||
function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseSet )
|
function AIBALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseSet )
|
||||||
|
|
||||||
self.ReturnToAirbase = true
|
self.ToNearestAirbase = true
|
||||||
self.ReturnTresholdRange = ReturnTresholdRange
|
self.ReturnTresholdRange = ReturnTresholdRange
|
||||||
self.ReturnAirbaseSet = ReturnAirbaseSet
|
self.ReturnAirbaseSet = ReturnAirbaseSet
|
||||||
end
|
end
|
||||||
@ -100,7 +100,7 @@ end
|
|||||||
-- @param DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Airbase#AIRBASE}.
|
-- @param DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Airbase#AIRBASE}.
|
||||||
function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
function AIBALANCER:ReturnToHomeAirbase( ReturnTresholdRange )
|
||||||
|
|
||||||
self.ReturnToHomeAirbase = true
|
self.ToHomeAirbase = true
|
||||||
self.ReturnTresholdRange = ReturnTresholdRange
|
self.ReturnTresholdRange = ReturnTresholdRange
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
|||||||
|
|
||||||
local AIGroup = Client:GetState( self, 'AIGroup' ) -- Group#GROUP
|
local AIGroup = Client:GetState( self, 'AIGroup' ) -- Group#GROUP
|
||||||
|
|
||||||
if self.ReturnToAirbase == false and self.ReturnToHomeAirbase == false then
|
if self.ToNearestAirbase == false and self.ToHomeAirbase == false then
|
||||||
AIGroup:Destroy()
|
AIGroup:Destroy()
|
||||||
else
|
else
|
||||||
-- We test if there is no other CLIENT within the self.ReturnTresholdRange of the first unit of the AI group.
|
-- We test if there is no other CLIENT within the self.ReturnTresholdRange of the first unit of the AI group.
|
||||||
@ -148,7 +148,7 @@ function AIBALANCER:_ClientAliveMonitorScheduler()
|
|||||||
function( RangeZone, AIGroup, ClientInZone )
|
function( RangeZone, AIGroup, ClientInZone )
|
||||||
local AIGroupTemplate = AIGroup:GetTemplate()
|
local AIGroupTemplate = AIGroup:GetTemplate()
|
||||||
if ClientInZone.Value == false then
|
if ClientInZone.Value == false then
|
||||||
if self.ReturnToHomeAirbase == true then
|
if self.ToHomeAirbase == true then
|
||||||
local WayPointCount = #AIGroupTemplate.route.points
|
local WayPointCount = #AIGroupTemplate.route.points
|
||||||
local SwitchWayPointCommand = AIGroup:CommandSwitchWayPoint( 1, WayPointCount, 1 )
|
local SwitchWayPointCommand = AIGroup:CommandSwitchWayPoint( 1, WayPointCount, 1 )
|
||||||
AIGroup:SetCommand( SwitchWayPointCommand )
|
AIGroup:SetCommand( SwitchWayPointCommand )
|
||||||
|
|||||||
@ -136,15 +136,9 @@ James has shared his ideas on balancing AI with air units, and together we made
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ReturnToAirbase">AIBALANCER.ReturnToAirbase</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ReturnToHomeAirbase">AIBALANCER:ReturnToHomeAirbase(ReturnTresholdRange)</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
|
<p>Returns the AI to the home <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ReturnToHomeAirbase">AIBALANCER.ReturnToHomeAirbase</a></td>
|
|
||||||
<td class="summary">
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -169,6 +163,18 @@ James has shared his ideas on balancing AI with air units, and together we made
|
|||||||
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).SpawnAI">AIBALANCER.SpawnAI</a></td>
|
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).SpawnAI">AIBALANCER.SpawnAI</a></td>
|
||||||
<td class="summary">
|
<td class="summary">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ToHomeAirbase">AIBALANCER.ToHomeAirbase</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap="nowrap"><a href="##(AIBALANCER).ToNearestAirbase">AIBALANCER.ToNearestAirbase</a></td>
|
||||||
|
<td class="summary">
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -265,29 +271,23 @@ self</p>
|
|||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt>
|
<dt>
|
||||||
|
|
||||||
<em>#boolean</em>
|
|
||||||
<a id="#(AIBALANCER).ReturnToAirbase" >
|
|
||||||
<strong>AIBALANCER.ReturnToAirbase</strong>
|
|
||||||
</a>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl class="function">
|
|
||||||
<dt>
|
|
||||||
|
|
||||||
<em>#boolean</em>
|
|
||||||
<a id="#(AIBALANCER).ReturnToHomeAirbase" >
|
<a id="#(AIBALANCER).ReturnToHomeAirbase" >
|
||||||
<strong>AIBALANCER.ReturnToHomeAirbase</strong>
|
<strong>AIBALANCER:ReturnToHomeAirbase(ReturnTresholdRange)</strong>
|
||||||
</a>
|
</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
|
<p>Returns the AI to the home <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||||
|
|
||||||
|
<h3>Parameter</h3>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<p><code><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a> ReturnTresholdRange </em></code>:
|
||||||
|
If there is an enemy <a href="Client.html##(CLIENT)">Client#CLIENT</a> within the ReturnTresholdRange given in meters, the AI will not return to the nearest <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
@ -358,6 +358,34 @@ The SET of <a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a>s to evaluate wh
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<em>#boolean</em>
|
||||||
|
<a id="#(AIBALANCER).ToHomeAirbase" >
|
||||||
|
<strong>AIBALANCER.ToHomeAirbase</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="function">
|
||||||
|
<dt>
|
||||||
|
|
||||||
|
<em>#boolean</em>
|
||||||
|
<a id="#(AIBALANCER).ToNearestAirbase" >
|
||||||
|
<strong>AIBALANCER.ToNearestAirbase</strong>
|
||||||
|
</a>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user