Working Version!

This commit is contained in:
FlightControl 2017-05-11 11:47:30 +02:00
parent b9c51ffc75
commit b7d37c42af
10 changed files with 1348 additions and 127 deletions

View File

@ -67,7 +67,15 @@
-- --
-- The following menus are created within the RADIO MENU of an active unit hosted by a player: -- The following menus are created within the RADIO MENU of an active unit hosted by a player:
-- --
-- * @{Follow#AI_FORMATION.SetFormation}(): Set a Vec3 position for a GroupName within the GroupSet following. -- * @{AI_Formation#AI_FORMATION.FormationRandom}(): Form a randomized formation (can cause crashed of planes :-)).
-- * @{AI_Formation#AI_FORMATION.FormationLeftLine}(): Form a left line formation.
-- * @{AI_Formation#AI_FORMATION.FormationRightLine}(): Form a right line formation.
-- * @{AI_Formation#AI_FORMATION.FormationRightWing}(): Form a right wing formation.
-- * @{AI_Formation#AI_FORMATION.FormationLeftWing}(): Form a left wing formation.
-- * @{AI_Formation#AI_FORMATION.FormationCenterLine}(): Form a center line formation.
-- * @{AI_Formation#AI_FORMATION.FormationCenterWing}(): Form a center wing formation.
-- * @{AI_Formation#AI_FORMATION.FormationCenterBoxed}(): Form a center boxed formation.
--
-- --
-- @usage -- @usage
-- -- Declare a new FollowPlanes object as follows: -- -- Declare a new FollowPlanes object as follows:
@ -110,7 +118,7 @@ AI_FORMATION = {
--- AI_FORMATION class constructor for an AI group --- AI_FORMATION class constructor for an AI group
-- @param #AI_FORMATION self -- @param #AI_FORMATION self
-- @param Unit#UNIT FollowUnit The UNIT leading the FolllowGroupSet. -- @param Unit#UNIT FollowUnit The UNIT leading the FolllowGroupSet.
-- @param Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit. -- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string FollowName Name of the escort. -- @param #string FollowName Name of the escort.
-- @return #AI_FORMATION self -- @return #AI_FORMATION self
function AI_FORMATION:New( FollowUnit, FollowGroupSet, FollowName, FollowBriefing ) function AI_FORMATION:New( FollowUnit, FollowGroupSet, FollowName, FollowBriefing )
@ -126,23 +134,151 @@ function AI_FORMATION:New( FollowUnit, FollowGroupSet, FollowName, FollowBriefin
self:AddTransition( "None", "Start", "Following" ) self:AddTransition( "None", "Start", "Following" )
self:AddTransition( "*", "Follow", "Following" ) self:AddTransition( "*", "FormationLeftLine", "*" )
FollowGroupSet:ForEachGroup( --- FormationLeftLine Handler OnBefore for AI_FORMATION
--- @param Group#GROUP FollowGroup -- @function [parent=#AI_FORMATION] OnBeforeFormationLeftLine
function( FollowGroup, FollowName, FollowUnit ) -- @param #AI_FORMATION self
local Vec3 = { x = math.random( -20, -150 ), y = math.random( -50, 50 ), z = math.random( -800, 800 ) } -- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
FollowGroup:SetState( self, "Vec3", Vec3 ) -- @param #string From
FollowGroup:OptionROTPassiveDefense() -- @param #string Event
FollowGroup:OptionROEReturnFire() -- @param #string To
--FollowGroup:MessageToClient( FollowGroup:GetCategoryName() .. " '" .. FollowName .. "' (" .. FollowGroup:GetCallsign() .. ") reporting! " .. -- @param #number XSpace The space on the X-axis in meters between each group.
-- "We're following your flight. ", -- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- 60, FollowUnit -- @param #number ZSpace The start position on the Z-axis in meters for each group.
--) -- @return #boolean
end,
FollowName, self.FollowUnit --- FormationLeftLine Handler OnAfter for AI_FORMATION
) -- @function [parent=#AI_FORMATION] OnAfterFormationLeftLine
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
--- FormationLeftLine Trigger for AI_FORMATION
-- @function [parent=#AI_FORMATION] FormationLeftLine
-- @param #AI_FORMATION self
--- FormationLeftLine Asynchronous Trigger for AI_FORMATION
-- @function [parent=#AI_FORMATION] __FormationLeftLine
-- @param #AI_FORMATION self
-- @param #number Delay
self:AddTransition( "*", "FormationRightLine", "*" )
--- FormationRightLine Handler OnBefore for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnBeforeFormationRightLine
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
-- @return #boolean
--- FormationRightLine Handler OnAfter for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnAfterFormationRightLine
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
--- FormationRightLine Trigger for AI_FORMATION
-- @function [parent=#AI_FORMATION] FormationRightLine
-- @param #AI_FORMATION self
--- FormationRightLine Asynchronous Trigger for AI_FORMATION
-- @function [parent=#AI_FORMATION] __FormationRightLine
-- @param #AI_FORMATION self
-- @param #number Delay
self:AddTransition( "*", "FormationLeftWing", "*" )
--- FormationLeftWing Handler OnBefore for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnBeforeFormationLeftWing
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
-- @return #boolean
--- FormationLeftWing Handler OnAfter for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnAfterFormationLeftWing
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
--- FormationLeftWing Trigger for AI_FORMATION
-- @function [parent=#AI_FORMATION] FormationLeftWing
-- @param #AI_FORMATION self
--- FormationLeftWing Asynchronous Trigger for AI_FORMATION
-- @function [parent=#AI_FORMATION] __FormationLeftWing
-- @param #AI_FORMATION self
-- @param #number Delay
self:AddTransition( "*", "FormationRightWing", "*" )
--- FormationRightWing Handler OnBefore for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnBeforeFormationRightWing
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
-- @return #boolean
--- FormationRightWing Handler OnAfter for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnAfterFormationRightWing
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
--- FormationRightWing Trigger for AI_FORMATION
-- @function [parent=#AI_FORMATION] FormationRightWing
-- @param #AI_FORMATION self
--- FormationRightWing Asynchronous Trigger for AI_FORMATION
-- @function [parent=#AI_FORMATION] __FormationRightWing
-- @param #AI_FORMATION self
-- @param #number Delay
self:AddTransition( "*", "Follow", "Following" )
self:FormationLeftLine( 50, 0, 100 )
self.FollowName = FollowName self.FollowName = FollowName
self.FollowBriefing = FollowBriefing self.FollowBriefing = FollowBriefing
@ -160,11 +296,150 @@ end
-- This allows to visualize where the escort is flying to. -- This allows to visualize where the escort is flying to.
-- @param #AI_FORMATION self -- @param #AI_FORMATION self
-- @param #boolean SmokeDirection If true, then the direction vector will be smoked. -- @param #boolean SmokeDirection If true, then the direction vector will be smoked.
-- @return #AI_FORMATION
function AI_FORMATION:TestSmokeDirectionVector( SmokeDirection ) function AI_FORMATION:TestSmokeDirectionVector( SmokeDirection )
self.SmokeDirectionVector = ( SmokeDirection == true ) and true or false self.SmokeDirectionVector = ( SmokeDirection == true ) and true or false
return self return self
end end
--- FormationLeftLine Handler OnAfter for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnAfterFormationLeftLine
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
function AI_FORMATION:onafterFormationLeftLine( FollowGroupSet, From , Event , To, XSpace, YSpace, ZSpace )
self:E( { FollowGroupSet, From , Event , To, XSpace, YSpace, ZSpace } )
FollowGroupSet:Flush()
local FollowSet = FollowGroupSet:GetSet()
local i = 0
for FollowID, FollowGroup in pairs( FollowSet ) do
local PointVec3 = POINT_VEC3:New()
PointVec3:SetX( -XSpace )
PointVec3:SetY( YSpace )
PointVec3:SetZ( i * ZSpace )
local Vec3 = PointVec3:GetVec3()
self:E( Vec3 )
FollowGroup:SetState( self, "Vec3", Vec3 )
FollowGroup:OptionROTPassiveDefense()
FollowGroup:OptionROEReturnFire()
i = i + 1
end
end
--- FormationRightLine Handler OnAfter for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnAfterFormationLeftLine
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
function AI_FORMATION:onafterFormationRightLine( FollowGroupSet, From , Event , To, XSpace, YSpace, ZSpace )
local FollowSet = FollowGroupSet:GetSet()
local i = 0
for FollowID, FollowGroup in pairs( FollowSet ) do
local PointVec3 = POINT_VEC3:New()
PointVec3:SetX( i * XSpace )
PointVec3:SetY( YSpace )
PointVec3:SetZ( -ZSpace )
local Vec3 = PointVec3:GetVec3()
self:E( Vec3 )
FollowGroup:SetState( self, "Vec3", Vec3 )
FollowGroup:OptionROTPassiveDefense()
FollowGroup:OptionROEReturnFire()
i = i + 1
end
end
--- FormationLeftWing Handler OnAfter for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnAfterFormationLeftWing
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
function AI_FORMATION:onafterFormationLeftWing( FollowGroupSet, From , Event , To, XSpace, YSpace, ZSpace )
local FollowSet = FollowGroupSet:GetSet()
local i = 0
for FollowID, FollowGroup in pairs( FollowSet ) do
local PointVec3 = POINT_VEC3:New()
PointVec3:SetX( -i * XSpace )
PointVec3:SetY( i * YSpace )
PointVec3:SetZ( -ZSpace )
local Vec3 = PointVec3:GetVec3()
self:E( Vec3 )
FollowGroup:SetState( self, "Vec3", Vec3 )
FollowGroup:OptionROTPassiveDefense()
FollowGroup:OptionROEReturnFire()
i = i + 1
end
end
--- FormationRightWing Handler OnAfter for AI_FORMATION
-- @function [parent=#AI_FORMATION] OnAfterFormationLeftWing
-- @param #AI_FORMATION self
-- @param Core.Set#SET_GROUP FollowGroupSet The group AI escorting the FollowUnit.
-- @param #string From
-- @param #string Event
-- @param #string To
-- @param #number XSpace The space on the X-axis in meters between each group.
-- @param #nubmer YSpace The start position on the Y-axis in meters for each group.
-- @param #number ZSpace The start position on the Z-axis in meters for each group.
function AI_FORMATION:onafterFormationRightWing( FollowGroupSet, From , Event , To, XSpace, YSpace, ZSpace )
local FollowSet = FollowGroupSet:GetSet()
local i = 0
for FollowID, FollowGroup in pairs( FollowSet ) do
local PointVec3 = POINT_VEC3:New()
PointVec3:SetX( i * XSpace )
PointVec3:SetY( i * YSpace )
PointVec3:SetZ( -ZSpace )
local Vec3 = PointVec3:GetVec3()
self:E( Vec3 )
FollowGroup:SetState( self, "Vec3", Vec3 )
FollowGroup:OptionROTPassiveDefense()
FollowGroup:OptionROEReturnFire()
i = i + 1
end
end
--- @param Follow#AI_FORMATION self --- @param Follow#AI_FORMATION self
function AI_FORMATION:onenterFollowing( FollowGroupSet ) function AI_FORMATION:onenterFollowing( FollowGroupSet )
@ -194,111 +469,108 @@ function AI_FORMATION:onenterFollowing( FollowGroupSet )
end end
FollowGroupSet:ForEachGroup( FollowGroupSet:ForEachGroup(
--- @param Group#GROUP FollowGroup --- @param Wrapper.Group#GROUP FollowGroup
-- @param Unit#UNIT ClientUnit -- @param Wrapper.Unit#UNIT ClientUnit
function( FollowGroup, ClientUnit, CT1, CV1, CT2, CV2 ) function( FollowGroup, ClientUnit, CT1, CV1, CT2, CV2 )
local GroupUnit = FollowGroup:GetUnit( 1 ) local GroupUnit = FollowGroup:GetUnit( 1 )
local FollowFormation = FollowGroup:GetState( self, "Vec3" ) local FollowFormation = FollowGroup:GetState( self, "Vec3" )
self:T( FollowFormation ) if FollowFormation then
local FollowDistance = FollowFormation.x local FollowDistance = FollowFormation.x
self:T( {ClientUnit.UnitName, GroupUnit.UnitName } )
local GT1 = GroupUnit:GetState( self, "GT1" )
if CT1 == nil or CT1 == 0 or GT1 == nil or GT1 == 0 then
GroupUnit:SetState( self, "GV1", GroupUnit:GetPointVec3() )
GroupUnit:SetState( self, "GT1", timer.getTime() )
else
local CD = ( ( CV2.x - CV1.x )^2 + ( CV2.y - CV1.y )^2 + ( CV2.z - CV1.z )^2 ) ^ 0.5
local CT = CT2 - CT1
local CS = ( 3600 / CT ) * ( CD / 1000 )
self:T2( { "Client:", CS, CD, CT, CV2, CV1, CT2, CT1 } )
local GT1 = GroupUnit:GetState( self, "GT1" ) local GT1 = GroupUnit:GetState( self, "GT1" )
local GT2 = timer.getTime()
local GV1 = GroupUnit:GetState( self, "GV1" ) if CT1 == nil or CT1 == 0 or GT1 == nil or GT1 == 0 then
local GV2 = GroupUnit:GetPointVec3() GroupUnit:SetState( self, "GV1", GroupUnit:GetPointVec3() )
GroupUnit:SetState( self, "GT1", GT2 ) GroupUnit:SetState( self, "GT1", timer.getTime() )
GroupUnit:SetState( self, "GV1", GV2 ) else
local CD = ( ( CV2.x - CV1.x )^2 + ( CV2.y - CV1.y )^2 + ( CV2.z - CV1.z )^2 ) ^ 0.5
local GD = ( ( GV2.x - GV1.x )^2 + ( GV2.y - GV1.y )^2 + ( GV2.z - GV1.z )^2 ) ^ 0.5 local CT = CT2 - CT1
local GT = GT2 - GT1
local CS = ( 3600 / CT ) * ( CD / 1000 )
local GS = ( 3600 / GT ) * ( GD / 1000 )
self:T2( { "Client:", CS, CD, CT, CV2, CV1, CT2, CT1 } )
self:T2( { "Group:", GS, GD, GT, GV2, GV1, GT2, GT1 } )
local GT1 = GroupUnit:GetState( self, "GT1" )
-- Calculate the group direction vector local GT2 = timer.getTime()
local GV = { x = GV2.x - CV2.x, y = GV2.y - CV2.y, z = GV2.z - CV2.z } local GV1 = GroupUnit:GetState( self, "GV1" )
local GV2 = GroupUnit:GetPointVec3()
-- Calculate GH2, GH2 with the same height as CV2. GroupUnit:SetState( self, "GT1", GT2 )
local GH2 = { x = GV2.x, y = CV2.y, z = GV2.z } GroupUnit:SetState( self, "GV1", GV2 )
-- Calculate the angle of GV to the orthonormal plane local GD = ( ( GV2.x - GV1.x )^2 + ( GV2.y - GV1.y )^2 + ( GV2.z - GV1.z )^2 ) ^ 0.5
local alpha = math.atan2( GV.z, GV.x ) local GT = GT2 - GT1
-- Now we calculate the intersecting vector between the circle around CV2 with radius FollowDistance and GH2. local GS = ( 3600 / GT ) * ( GD / 1000 )
-- From the GeoGebra model: CVI = (x(CV2) + FollowDistance cos(alpha), y(GH2) + FollowDistance sin(alpha), z(CV2))
local CVI = { x = CV2.x + FollowDistance * math.cos(alpha), --self:E( { "Group:", GS = GS,GD = GD, GT = GT, GV2 = GV2, GV1 = GV1, GT2 = GT2, GT1 = GT1 } )
y = GH2.y + FollowFormation.y,
z = CV2.z + FollowDistance * math.sin(alpha), -- Calculate the group direction vector
} local GV = { x = GV2.x - CV2.x + FollowFormation.x, y = GV2.y - CV2.y, z = GV2.z - CV2.z + FollowFormation.z }
-- Calculate the direction vector DV of the escort group. We use CVI as the base and CV2 as the direction. -- Calculate GH2, GH2 with the same height as CV2.
local DV = { x = CV2.x - CVI.x, y = CV2.y - CVI.y, z = CV2.z - CVI.z } local GH2 = { x = GV2.x, y = CV2.y, z = GV2.z }
-- We now calculate the unary direction vector DVu, so that we can multiply DVu with the speed, which is expressed in meters / s. -- Calculate the angle of GV to the orthonormal plane
-- We need to calculate this vector to predict the point the escort group needs to fly to according its speed. local alpha = math.atan2( GV.z, GV.x )
-- The distance of the destination point should be far enough not to have the aircraft starting to swipe left to right...
local DVu = { x = DV.x / FollowDistance, y = DV.y / FollowDistance, z = DV.z / FollowDistance } -- Now we calculate the intersecting vector between the circle around CV2 with radius FollowDistance and GH2.
-- From the GeoGebra model: CVI = (x(CV2) + FollowDistance cos(alpha), y(GH2) + FollowDistance sin(alpha), z(CV2))
-- Now we can calculate the group destination vector GDV. local CVI = { x = CV2.x + FollowDistance * math.cos(alpha),
local GDV = { x = DVu.x * CS * 8 + CVI.x, y = CVI.y, z = DVu.z * CS * 8 + CVI.z } y = GH2.y, -- + FollowFormation.y,
z = CV2.z + FollowDistance * math.sin(alpha),
local GDV_Formation = { }
x = GDV.x + ( FollowFormation.x * math.cos(alpha) - FollowFormation.z * math.sin(alpha) ),
y = GDV.y, -- Calculate the direction vector DV of the escort group. We use CVI as the base and CV2 as the direction.
z = GDV.z + ( FollowFormation.z * math.cos(alpha) + FollowFormation.x * math.sin(alpha) ) local DV = { x = CV2.x - CVI.x, y = CV2.y - CVI.y, z = CV2.z - CVI.z }
}
-- We now calculate the unary direction vector DVu, so that we can multiply DVu with the speed, which is expressed in meters / s.
if self.SmokeDirectionVector == true then -- We need to calculate this vector to predict the point the escort group needs to fly to according its speed.
trigger.action.smoke( GDV, trigger.smokeColor.Green ) -- The distance of the destination point should be far enough not to have the aircraft starting to swipe left to right...
trigger.action.smoke( GDV_Formation, trigger.smokeColor.White ) local DVu = { x = DV.x / FollowDistance, y = DV.y, z = DV.z / FollowDistance }
-- Now we can calculate the group destination vector GDV.
local GDV = { x = DVu.x * CS * 10 + CVI.x, y = CVI.y, z = DVu.z * CS * 10 + CVI.z }
local ADDx = FollowFormation.x * math.cos(alpha) - FollowFormation.z * math.sin(alpha)
local ADDz = FollowFormation.z * math.cos(alpha) + FollowFormation.x * math.sin(alpha)
self:E( { ALPHA = alpha, GDVx = GDV.x, GDVz = GDV.z, ADDx = ADDx, ADDz = ADDz, FOLLOWx = FollowFormation.x, FOLLOWz = FollowFormation.z } )
-- local GDV_Formation = GDV
local GDV_Formation = {
x = GDV.x + ADDx,
y = GDV.y,
z = GDV.z + ADDz
}
if self.SmokeDirectionVector == true then
trigger.action.smoke( GDV, trigger.smokeColor.Green )
trigger.action.smoke( GDV_Formation, trigger.smokeColor.White )
end
-- Measure distance between client and group
local CatchUpDistance = ( ( GDV_Formation.x - GV2.x )^2 + ( GDV_Formation.y - GV2.y )^2 + ( GDV_Formation.z - GV2.z )^2 ) ^ 0.5
-- The calculation of the Speed would simulate that the group would take 30 seconds to overcome
-- the requested Distance).
local Time = 10
local CatchUpSpeed = ( CatchUpDistance - ( CS * 20 ) ) / Time
local Speed = CS + CatchUpSpeed
if Speed < 0 then
Speed = 0
end
-- Now route the escort to the desired point with the desired speed.
FollowGroup:RouteToVec3( GDV_Formation, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second)
end end
self:T3( { "CV2:", CV2 } )
self:T3( { "CVI:", CVI } )
self:T2( { "GDV:", GDV } )
-- Measure distance between client and group
local CatchUpDistance = ( ( GDV_Formation.x - GV2.x )^2 + ( GDV_Formation.y - GV2.y )^2 + ( GDV_Formation.z - GV2.z )^2 ) ^ 0.5
-- The calculation of the Speed would simulate that the group would take 30 seconds to overcome
-- the requested Distance).
local Time = 20
local CatchUpSpeed = ( CatchUpDistance - ( CS * 9.5 ) ) / Time
local Speed = CS + CatchUpSpeed
if Speed < 0 then
Speed = 0
end
self:T({CatchUpDistance, CatchUpSpeed})
self:T3( { "Client Speed, Follow Speed, Speed, FollowDistance, Time:", CS, GS, Speed, FollowDistance, Time } )
-- Now route the escort to the desired point with the desired speed.
FollowGroup:RouteToVec3( GDV_Formation, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second)
end end
end, end,
ClientUnit, CT1, CV1, CT2, CV2 ClientUnit, CT1, CV1, CT2, CV2
) )
self:__Follow( -0.5 ) self:__Follow( -10 )
end end
end end

View File

@ -197,12 +197,84 @@
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).FollowUnit">AI_FORMATION.FollowUnit</a></td> <td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).FollowUnit">AI_FORMATION.FollowUnit</a></td>
<td class="summary"> <td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).FormationLeftLine">AI_FORMATION:FormationLeftLine()</a></td>
<td class="summary">
<p>FormationLeftLine Trigger for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).FormationLeftWing">AI_FORMATION:FormationLeftWing()</a></td>
<td class="summary">
<p>FormationLeftWing Trigger for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).FormationRightLine">AI_FORMATION:FormationRightLine()</a></td>
<td class="summary">
<p>FormationRightLine Trigger for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).FormationRightWing">AI_FORMATION:FormationRightWing()</a></td>
<td class="summary">
<p>FormationRightWing Trigger for AI_FORMATION</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).New">AI_FORMATION:New(FollowUnit, FollowGroupSet, FollowName, FollowBriefing)</a></td> <td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).New">AI_FORMATION:New(FollowUnit, FollowGroupSet, FollowName, FollowBriefing)</a></td>
<td class="summary"> <td class="summary">
<p>AI_FORMATION class constructor for an AI group</p> <p>AI_FORMATION class constructor for an AI group</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).OnAfterFormationLeftLine">AI_FORMATION:OnAfterFormationLeftLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
<p>FormationRightLine Handler OnAfter for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).OnAfterFormationLeftWing">AI_FORMATION:OnAfterFormationLeftWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
<p>FormationRightWing Handler OnAfter for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).OnAfterFormationRightLine">AI_FORMATION:OnAfterFormationRightLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
<p>FormationRightLine Handler OnAfter for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).OnAfterFormationRightWing">AI_FORMATION:OnAfterFormationRightWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
<p>FormationRightWing Handler OnAfter for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).OnBeforeFormationLeftLine">AI_FORMATION:OnBeforeFormationLeftLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
<p>FormationLeftLine Handler OnBefore for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).OnBeforeFormationLeftWing">AI_FORMATION:OnBeforeFormationLeftWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
<p>FormationLeftWing Handler OnBefore for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).OnBeforeFormationRightLine">AI_FORMATION:OnBeforeFormationRightLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
<p>FormationRightLine Handler OnBefore for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).OnBeforeFormationRightWing">AI_FORMATION:OnBeforeFormationRightWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
<p>FormationRightWing Handler OnBefore for AI_FORMATION</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -227,6 +299,54 @@
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).TestSmokeDirectionVector">AI_FORMATION:TestSmokeDirectionVector(SmokeDirection)</a></td> <td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).TestSmokeDirectionVector">AI_FORMATION:TestSmokeDirectionVector(SmokeDirection)</a></td>
<td class="summary"> <td class="summary">
<p>This function is for test, it will put on the frequency of the FollowScheduler a red smoke at the direction vector calculated for the escort to fly to.</p> <p>This function is for test, it will put on the frequency of the FollowScheduler a red smoke at the direction vector calculated for the escort to fly to.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).__FormationLeftLine">AI_FORMATION:__FormationLeftLine(Delay)</a></td>
<td class="summary">
<p>FormationLeftLine Asynchronous Trigger for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).__FormationLeftWing">AI_FORMATION:__FormationLeftWing(Delay)</a></td>
<td class="summary">
<p>FormationLeftWing Asynchronous Trigger for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).__FormationRightLine">AI_FORMATION:__FormationRightLine(Delay)</a></td>
<td class="summary">
<p>FormationRightLine Asynchronous Trigger for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).__FormationRightWing">AI_FORMATION:__FormationRightWing(Delay)</a></td>
<td class="summary">
<p>FormationRightWing Asynchronous Trigger for AI_FORMATION</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).onafterFormationLeftLine">AI_FORMATION:onafterFormationLeftLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).onafterFormationLeftWing">AI_FORMATION:onafterFormationLeftWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).onafterFormationRightLine">AI_FORMATION:onafterFormationRightLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_FORMATION).onafterFormationRightWing">AI_FORMATION:onafterFormationRightWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</a></td>
<td class="summary">
</td> </td>
</tr> </tr>
<tr> <tr>
@ -311,10 +431,18 @@
<p>The following menus are created within the RADIO MENU of an active unit hosted by a player:</p> <p>The following menus are created within the RADIO MENU of an active unit hosted by a player:</p>
<ul> <ul>
<li><a href="Follow.html##(AI_FORMATION).SetFormation">Follow#AI_FORMATION.SetFormation</a>(): Set a Vec3 position for a GroupName within the GroupSet following.</li> <li><a href="AI_Formation.html##(AI_FORMATION).FormationRandom">AI<em>Formation#AI</em>FORMATION.FormationRandom</a>(): Form a randomized formation (can cause crashed of planes :-)).</li>
<li><a href="AI_Formation.html##(AI_FORMATION).FormationLeftLine">AI<em>Formation#AI</em>FORMATION.FormationLeftLine</a>(): Form a left line formation.</li>
<li><a href="AI_Formation.html##(AI_FORMATION).FormationRightLine">AI<em>Formation#AI</em>FORMATION.FormationRightLine</a>(): Form a right line formation.</li>
<li><a href="AI_Formation.html##(AI_FORMATION).FormationRightWing">AI<em>Formation#AI</em>FORMATION.FormationRightWing</a>(): Form a right wing formation.</li>
<li><a href="AI_Formation.html##(AI_FORMATION).FormationLeftWing">AI<em>Formation#AI</em>FORMATION.FormationLeftWing</a>(): Form a left wing formation.</li>
<li><a href="AI_Formation.html##(AI_FORMATION).FormationCenterLine">AI<em>Formation#AI</em>FORMATION.FormationCenterLine</a>(): Form a center line formation.</li>
<li><a href="AI_Formation.html##(AI_FORMATION).FormationCenterWing">AI<em>Formation#AI</em>FORMATION.FormationCenterWing</a>(): Form a center wing formation.</li>
<li><a href="AI_Formation.html##(AI_FORMATION).FormationCenterBoxed">AI<em>Formation#AI</em>FORMATION.FormationCenterBoxed</a>(): Form a center boxed formation.</li>
</ul> </ul>
<h3>Usage:</h3> <h3>Usage:</h3>
<pre class="example"><code>-- Declare a new FollowPlanes object as follows: <pre class="example"><code>-- Declare a new FollowPlanes object as follows:
@ -431,6 +559,58 @@ FollowPlanes = AI_FORMATION:New( FollowUnit, FollowGroup, "Desert", "Welcome to
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).FormationLeftLine" >
<strong>AI_FORMATION:FormationLeftLine()</strong>
</a>
</dt>
<dd>
<p>FormationLeftLine Trigger for AI_FORMATION</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).FormationLeftWing" >
<strong>AI_FORMATION:FormationLeftWing()</strong>
</a>
</dt>
<dd>
<p>FormationLeftWing Trigger for AI_FORMATION</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).FormationRightLine" >
<strong>AI_FORMATION:FormationRightLine()</strong>
</a>
</dt>
<dd>
<p>FormationRightLine Trigger for AI_FORMATION</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).FormationRightWing" >
<strong>AI_FORMATION:FormationRightWing()</strong>
</a>
</dt>
<dd>
<p>FormationRightWing Trigger for AI_FORMATION</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -454,7 +634,7 @@ The UNIT leading the FolllowGroupSet.</p>
</li> </li>
<li> <li>
<p><code><em><a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a> FollowGroupSet </em></code>: <p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p> The group AI escorting the FollowUnit.</p>
</li> </li>
@ -475,6 +655,466 @@ Name of the escort.</p>
<p><em><a href="##(AI_FORMATION)">#AI_FORMATION</a>:</em> <p><em><a href="##(AI_FORMATION)">#AI_FORMATION</a>:</em>
self</p> self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).OnAfterFormationLeftLine" >
<strong>AI_FORMATION:OnAfterFormationLeftLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<p>FormationRightLine Handler OnAfter for AI_FORMATION</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em>#number XSpace </em></code>:
The space on the X-axis in meters between each group.</p>
</li>
<li>
<p><code><em><a href="##(nubmer)">#nubmer</a> YSpace </em></code>:
The start position on the Y-axis in meters for each group.</p>
</li>
<li>
<p><code><em>#number ZSpace </em></code>:
The start position on the Z-axis in meters for each group.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).OnAfterFormationLeftWing" >
<strong>AI_FORMATION:OnAfterFormationLeftWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<p>FormationRightWing Handler OnAfter for AI_FORMATION</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em>#number XSpace </em></code>:
The space on the X-axis in meters between each group.</p>
</li>
<li>
<p><code><em><a href="##(nubmer)">#nubmer</a> YSpace </em></code>:
The start position on the Y-axis in meters for each group.</p>
</li>
<li>
<p><code><em>#number ZSpace </em></code>:
The start position on the Z-axis in meters for each group.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).OnAfterFormationRightLine" >
<strong>AI_FORMATION:OnAfterFormationRightLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<p>FormationRightLine Handler OnAfter for AI_FORMATION</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em>#number XSpace </em></code>:
The space on the X-axis in meters between each group.</p>
</li>
<li>
<p><code><em><a href="##(nubmer)">#nubmer</a> YSpace </em></code>:
The start position on the Y-axis in meters for each group.</p>
</li>
<li>
<p><code><em>#number ZSpace </em></code>:
The start position on the Z-axis in meters for each group.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).OnAfterFormationRightWing" >
<strong>AI_FORMATION:OnAfterFormationRightWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<p>FormationRightWing Handler OnAfter for AI_FORMATION</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em>#number XSpace </em></code>:
The space on the X-axis in meters between each group.</p>
</li>
<li>
<p><code><em><a href="##(nubmer)">#nubmer</a> YSpace </em></code>:
The start position on the Y-axis in meters for each group.</p>
</li>
<li>
<p><code><em>#number ZSpace </em></code>:
The start position on the Z-axis in meters for each group.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).OnBeforeFormationLeftLine" >
<strong>AI_FORMATION:OnBeforeFormationLeftLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<p>FormationLeftLine Handler OnBefore for AI_FORMATION</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em>#number XSpace </em></code>:
The space on the X-axis in meters between each group.</p>
</li>
<li>
<p><code><em><a href="##(nubmer)">#nubmer</a> YSpace </em></code>:
The start position on the Y-axis in meters for each group.</p>
</li>
<li>
<p><code><em>#number ZSpace </em></code>:
The start position on the Z-axis in meters for each group.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).OnBeforeFormationLeftWing" >
<strong>AI_FORMATION:OnBeforeFormationLeftWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<p>FormationLeftWing Handler OnBefore for AI_FORMATION</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em>#number XSpace </em></code>:
The space on the X-axis in meters between each group.</p>
</li>
<li>
<p><code><em><a href="##(nubmer)">#nubmer</a> YSpace </em></code>:
The start position on the Y-axis in meters for each group.</p>
</li>
<li>
<p><code><em>#number ZSpace </em></code>:
The start position on the Z-axis in meters for each group.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).OnBeforeFormationRightLine" >
<strong>AI_FORMATION:OnBeforeFormationRightLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<p>FormationRightLine Handler OnBefore for AI_FORMATION</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em>#number XSpace </em></code>:
The space on the X-axis in meters between each group.</p>
</li>
<li>
<p><code><em><a href="##(nubmer)">#nubmer</a> YSpace </em></code>:
The start position on the Y-axis in meters for each group.</p>
</li>
<li>
<p><code><em>#number ZSpace </em></code>:
The start position on the Z-axis in meters for each group.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).OnBeforeFormationRightWing" >
<strong>AI_FORMATION:OnBeforeFormationRightWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<p>FormationRightWing Handler OnBefore for AI_FORMATION</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> FollowGroupSet </em></code>:
The group AI escorting the FollowUnit.</p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em>#number XSpace </em></code>:
The space on the X-axis in meters between each group.</p>
</li>
<li>
<p><code><em><a href="##(nubmer)">#nubmer</a> YSpace </em></code>:
The start position on the Y-axis in meters for each group.</p>
</li>
<li>
<p><code><em>#number ZSpace </em></code>:
The start position on the Z-axis in meters for each group.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em></p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -546,6 +1186,294 @@ If true, then the direction vector will be smoked.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<a id="#(AI_FORMATION).__FormationLeftLine" >
<strong>AI_FORMATION:__FormationLeftLine(Delay)</strong>
</a>
</dt>
<dd>
<p>FormationLeftLine Asynchronous Trigger for AI_FORMATION</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).__FormationLeftWing" >
<strong>AI_FORMATION:__FormationLeftWing(Delay)</strong>
</a>
</dt>
<dd>
<p>FormationLeftWing Asynchronous Trigger for AI_FORMATION</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).__FormationRightLine" >
<strong>AI_FORMATION:__FormationRightLine(Delay)</strong>
</a>
</dt>
<dd>
<p>FormationRightLine Asynchronous Trigger for AI_FORMATION</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).__FormationRightWing" >
<strong>AI_FORMATION:__FormationRightWing(Delay)</strong>
</a>
</dt>
<dd>
<p>FormationRightWing Asynchronous Trigger for AI_FORMATION</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).onafterFormationLeftLine" >
<strong>AI_FORMATION:onafterFormationLeftLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> FollowGroupSet </em></code>: </p>
</li>
<li>
<p><code><em> From </em></code>: </p>
</li>
<li>
<p><code><em> Event </em></code>: </p>
</li>
<li>
<p><code><em> To </em></code>: </p>
</li>
<li>
<p><code><em> XSpace </em></code>: </p>
</li>
<li>
<p><code><em> YSpace </em></code>: </p>
</li>
<li>
<p><code><em> ZSpace </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).onafterFormationLeftWing" >
<strong>AI_FORMATION:onafterFormationLeftWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> FollowGroupSet </em></code>: </p>
</li>
<li>
<p><code><em> From </em></code>: </p>
</li>
<li>
<p><code><em> Event </em></code>: </p>
</li>
<li>
<p><code><em> To </em></code>: </p>
</li>
<li>
<p><code><em> XSpace </em></code>: </p>
</li>
<li>
<p><code><em> YSpace </em></code>: </p>
</li>
<li>
<p><code><em> ZSpace </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).onafterFormationRightLine" >
<strong>AI_FORMATION:onafterFormationRightLine(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> FollowGroupSet </em></code>: </p>
</li>
<li>
<p><code><em> From </em></code>: </p>
</li>
<li>
<p><code><em> Event </em></code>: </p>
</li>
<li>
<p><code><em> To </em></code>: </p>
</li>
<li>
<p><code><em> XSpace </em></code>: </p>
</li>
<li>
<p><code><em> YSpace </em></code>: </p>
</li>
<li>
<p><code><em> ZSpace </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).onafterFormationRightWing" >
<strong>AI_FORMATION:onafterFormationRightWing(FollowGroupSet, From, Event, To, XSpace, YSpace, ZSpace)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> FollowGroupSet </em></code>: </p>
</li>
<li>
<p><code><em> From </em></code>: </p>
</li>
<li>
<p><code><em> Event </em></code>: </p>
</li>
<li>
<p><code><em> To </em></code>: </p>
</li>
<li>
<p><code><em> XSpace </em></code>: </p>
</li>
<li>
<p><code><em> YSpace </em></code>: </p>
</li>
<li>
<p><code><em> ZSpace </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_FORMATION).onenterFollowing" > <a id="#(AI_FORMATION).onenterFollowing" >
<strong>AI_FORMATION:onenterFollowing(FollowGroupSet)</strong> <strong>AI_FORMATION:onenterFollowing(FollowGroupSet)</strong>
</a> </a>
@ -663,6 +1591,8 @@ If true, then the direction vector will be smoked.</p>
</dd> </dd>
</dl> </dl>
<h2><a id="#(nubmer)" >Type <code>nubmer</code></a></h2>
</div> </div>
</div> </div>

View File

@ -953,6 +953,9 @@ 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> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">

View File

@ -3046,7 +3046,6 @@ The range till cargo will board.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(CARGO_UNIT).RunCount" > <a id="#(CARGO_UNIT).RunCount" >
<strong>CARGO_UNIT.RunCount</strong> <strong>CARGO_UNIT.RunCount</strong>
</a> </a>

View File

@ -2337,7 +2337,6 @@ The index of the DetectedItem.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemMax" > <a id="#(DETECTION_BASE).DetectedItemMax" >
<strong>DETECTION_BASE.DetectedItemMax</strong> <strong>DETECTION_BASE.DetectedItemMax</strong>
</a> </a>

View File

@ -1624,7 +1624,7 @@ A string defining the start state.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#string</em> <em></em>
<a id="#(FSM)._StartState" > <a id="#(FSM)._StartState" >
<strong>FSM._StartState</strong> <strong>FSM._StartState</strong>
</a> </a>
@ -1923,6 +1923,7 @@ A string defining the start state.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(FSM).current" > <a id="#(FSM).current" >
<strong>FSM.current</strong> <strong>FSM.current</strong>
</a> </a>

View File

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

View File

@ -772,6 +772,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="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
<td class="summary"> <td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
<td class="summary">
</td> </td>
</tr> </tr>
</table> </table>
@ -2529,9 +2535,6 @@ when nothing was spawned.</p>
<p> Overwrite unit names by default with group name.</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -2546,9 +2549,6 @@ when nothing was spawned.</p>
<p> By default, no InitLimit</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -2584,7 +2584,7 @@ when nothing was spawned.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em> <em></em>
<a id="#(SPAWN).SpawnMaxGroups" > <a id="#(SPAWN).SpawnMaxGroups" >
<strong>SPAWN.SpawnMaxGroups</strong> <strong>SPAWN.SpawnMaxGroups</strong>
</a> </a>
@ -2601,7 +2601,7 @@ when nothing was spawned.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em> <em></em>
<a id="#(SPAWN).SpawnMaxUnitsAlive" > <a id="#(SPAWN).SpawnMaxUnitsAlive" >
<strong>SPAWN.SpawnMaxUnitsAlive</strong> <strong>SPAWN.SpawnMaxUnitsAlive</strong>
</a> </a>
@ -2929,7 +2929,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em>#boolean</em>
<a id="#(SPAWN).SpawnUnControlled" > <a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong> <strong>SPAWN.SpawnUnControlled</strong>
</a> </a>
@ -3519,6 +3519,20 @@ True = Continue Scheduler</p>
</li> </li>
</ul> </ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).uncontrolled" >
<strong>SPAWN.uncontrolled</strong>
</a>
</dt>
<dd>
</dd> </dd>
</dl> </dl>

View File

@ -446,7 +446,6 @@ ptional) The name of the new static.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(SPAWNSTATIC).SpawnIndex" > <a id="#(SPAWNSTATIC).SpawnIndex" >
<strong>SPAWNSTATIC.SpawnIndex</strong> <strong>SPAWNSTATIC.SpawnIndex</strong>
</a> </a>

View File

@ -503,7 +503,7 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em><a href="Core.Cargo.html##(CARGO_GROUP)">Core.Cargo#CARGO_GROUP</a></em>
<a id="#(FSM_PROCESS).Cargo" > <a id="#(FSM_PROCESS).Cargo" >
<strong>FSM_PROCESS.Cargo</strong> <strong>FSM_PROCESS.Cargo</strong>
</a> </a>