diff --git a/Moose Development/Moose/AI/AI_Formation.lua b/Moose Development/Moose/AI/AI_Formation.lua index 100e9ca35..6dd2c55df 100644 --- a/Moose Development/Moose/AI/AI_Formation.lua +++ b/Moose Development/Moose/AI/AI_Formation.lua @@ -73,19 +73,16 @@ -- * @{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 --- -- Declare a new FollowPlanes object as follows: --- --- -- First find the GROUP object and the CLIENT object. --- local FollowUnit = CLIENT:FindByName( "Unit Name" ) -- The Unit Name is the name of the unit flagged with the skill Client in the mission editor. --- local FollowGroup = GROUP:FindByName( "Group Name" ) -- The Group Name is the name of the group that will escort the Follow Client. --- --- -- Now use these 2 objects to construct the new FollowPlanes object. --- FollowPlanes = AI_FORMATION:New( FollowUnit, FollowGroup, "Desert", "Welcome to the mission. You are escorted by a plane with code name 'Desert', which can be instructed through the F10 radio menu." ) +-- local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +-- FollowGroupSet:Flush() +-- local LeaderUnit = UNIT:FindByName( "Leader" ) +-- local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Center Wing Formation", "Briefing" ) +-- LargeFormation:FormationCenterWing( 500, 50, 0, 250, 250 ) +-- LargeFormation:__Start( 1 ) -- -- @field #AI_FORMATION AI_FORMATION = { @@ -320,6 +317,56 @@ function AI_FORMATION:New( FollowUnit, FollowGroupSet, FollowName, FollowBriefin -- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. + self:AddTransition( "*", "FormationCenterWing", "*" ) + + --- FormationCenterWing Handler OnBefore for AI_FORMATION + -- @function [parent=#AI_FORMATION] OnBeforeFormationCenterWing + -- @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 XStart The start position on the X-axis in meters for the first group. + -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. + -- @param #nubmer YStart The start position on the Y-axis in meters for the first group. + -- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. + -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. + -- @return #boolean + + --- FormationCenterWing Handler OnAfter for AI_FORMATION + -- @function [parent=#AI_FORMATION] OnAfterFormationCenterWing + -- @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 XStart The start position on the X-axis in meters for the first group. + -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. + -- @param #nubmer YStart The start position on the Y-axis in meters for the first group. + -- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. + -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. + + --- FormationCenterWing Trigger for AI_FORMATION + -- @function [parent=#AI_FORMATION] FormationCenterWing + -- @param #AI_FORMATION self + -- @param #number XStart The start position on the X-axis in meters for the first group. + -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. + -- @param #nubmer YStart The start position on the Y-axis in meters for the first group. + -- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. + -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. + + --- FormationCenterWing Asynchronous Trigger for AI_FORMATION + -- @function [parent=#AI_FORMATION] __FormationCenterWing + -- @param #AI_FORMATION self + -- @param #number Delay + -- @param #number XStart The start position on the X-axis in meters for the first group. + -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. + -- @param #nubmer YStart The start position on the Y-axis in meters for the first group. + -- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. + -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. + + + self:AddTransition( "*", "Follow", "Following" ) @@ -493,6 +540,47 @@ function AI_FORMATION:onafterFormationRightWing( FollowGroupSet, From , Event , end +--- FormationCenterWing Handler OnAfter for AI_FORMATION +-- @function [parent=#AI_FORMATION] OnAfterFormationCenterWing +-- @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 XStart The start position on the X-axis in meters for the first group. +-- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. +-- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. +function AI_FORMATION:onafterFormationCenterWing( FollowGroupSet, From , Event , To, XStart, XSpace, YStart, ZStart, ZSpace ) + + local FollowSet = FollowGroupSet:GetSet() + + local i = 0 + + for FollowID, FollowGroup in pairs( FollowSet ) do + + local PointVec3 = POINT_VEC3:New() + + local Side = ( i % 2 == 0 ) and 1 or -1 + local Row = i / 2 + 1 + + self:E(Side) + + PointVec3:SetX( XStart + Row * XSpace ) + PointVec3:SetY( YStart ) + PointVec3:SetZ( Side * ( ZStart + i * 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 diff --git a/docs/Documentation/AI_Formation.html b/docs/Documentation/AI_Formation.html index 29d15b7eb..289db76de 100644 --- a/docs/Documentation/AI_Formation.html +++ b/docs/Documentation/AI_Formation.html @@ -197,6 +197,12 @@ AI_FORMATION.FollowUnit + + + + AI_FORMATION:FormationCenterWing(XStart, XSpace, YStart, ZStart, ZSpace) + +

FormationCenterWing Trigger for AI_FORMATION

@@ -227,6 +233,12 @@ AI_FORMATION:New(FollowUnit, FollowGroupSet, FollowName, FollowBriefing)

AI_FORMATION class constructor for an AI group

+ + + + AI_FORMATION:OnAfterFormationCenterWing(FollowGroupSet, From, Event, To, XStart, XSpace, YStart, ZStart, ZSpace) + +

FormationCenterWing Handler OnAfter for AI_FORMATION

@@ -251,6 +263,12 @@ AI_FORMATION:OnAfterFormationRightWing(FollowGroupSet, From, Event, To, XStart, XSpace, YStart, ZStart, ZSpace)

FormationRightWing Handler OnAfter for AI_FORMATION

+ + + + AI_FORMATION:OnBeforeFormationCenterWing(FollowGroupSet, From, Event, To, XStart, XSpace, YStart, ZStart, ZSpace) + +

FormationCenterWing Handler OnBefore for AI_FORMATION

@@ -299,6 +317,12 @@ AI_FORMATION:TestSmokeDirectionVector(SmokeDirection)

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.

+ + + + AI_FORMATION:__FormationCenterWing(Delay, XStart, XSpace, YStart, ZStart, ZSpace) + +

FormationCenterWing Asynchronous Trigger for AI_FORMATION

@@ -323,6 +347,12 @@ AI_FORMATION:__FormationRightWing(Delay, XStart, XSpace, YStart, ZStart, ZSpace)

FormationRightWing Asynchronous Trigger for AI_FORMATION

+ + + + AI_FORMATION:onafterFormationCenterWing(FollowGroupSet, From, Event, To, XStart, XSpace, YStart, ZStart, ZSpace) + + @@ -437,21 +467,18 @@
  • AIFormation#AIFORMATION.FormationRightWing(): Form a right wing formation.
  • AIFormation#AIFORMATION.FormationLeftWing(): Form a left wing formation.
  • AIFormation#AIFORMATION.FormationCenterLine(): Form a center line formation.
  • -
  • AIFormation#AIFORMATION.FormationCenterWing(): Form a center wing formation.
  • AIFormation#AIFORMATION.FormationCenterBoxed(): Form a center boxed formation.
  • Usage:

    -
    -- Declare a new FollowPlanes object as follows:
    -
    --- First find the GROUP object and the CLIENT object.
    -local FollowUnit = CLIENT:FindByName( "Unit Name" ) -- The Unit Name is the name of the unit flagged with the skill Client in the mission editor.
    -local FollowGroup = GROUP:FindByName( "Group Name" ) -- The Group Name is the name of the group that will escort the Follow Client.
    -
    --- Now use these 2 objects to construct the new FollowPlanes object.
    -FollowPlanes = AI_FORMATION:New( FollowUnit, FollowGroup, "Desert", "Welcome to the mission. You are escorted by a plane with code name 'Desert', which can be instructed through the F10 radio menu." )
    +		
    local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
    +FollowGroupSet:Flush()
    +local LeaderUnit = UNIT:FindByName( "Leader" )
    +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Center Wing Formation", "Briefing" )
    +LargeFormation:FormationCenterWing( 500, 50, 0, 250, 250 )
    +LargeFormation:__Start( 1 )
     
    @@ -559,6 +586,52 @@ FollowPlanes = AI_FORMATION:New( FollowUnit, FollowGroup, "Desert", "Welcome to + + +
    +
    + + +AI_FORMATION:FormationCenterWing(XStart, XSpace, YStart, ZStart, ZSpace) + +
    +
    + +

    FormationCenterWing Trigger for AI_FORMATION

    + +

    Parameters

    +
      +
    • + +

      #number XStart : +The start position on the X-axis in meters for the first group.

      + +
    • +
    • + +

      #number XSpace : +The space between groups on the X-axis in meters for each sequent group.

      + +
    • +
    • + +

      #nubmer YStart : +The start position on the Y-axis in meters for the first group.

      + +
    • +
    • + +

      #nubmer ZStart : +The start position on the Z-axis in meters for the first group.

      + +
    • +
    • + +

      #number ZSpace : +The space between groups on the Z-axis in meters for each sequent group.

      + +
    • +
    @@ -780,6 +853,73 @@ self

    + +AI_FORMATION:OnAfterFormationCenterWing(FollowGroupSet, From, Event, To, XStart, XSpace, YStart, ZStart, ZSpace) + +
    +
    + +

    FormationCenterWing Handler OnAfter for AI_FORMATION

    + +

    Parameters

    +
      +
    • + +

      Core.Set#SET_GROUP FollowGroupSet : +The group AI escorting the FollowUnit.

      + +
    • +
    • + +

      #string From :

      + +
    • +
    • + +

      #string Event :

      + +
    • +
    • + +

      #string To :

      + +
    • +
    • + +

      #number XStart : +The start position on the X-axis in meters for the first group.

      + +
    • +
    • + +

      #number XSpace : +The space between groups on the X-axis in meters for each sequent group.

      + +
    • +
    • + +

      #nubmer YStart : +The start position on the Y-axis in meters for the first group.

      + +
    • +
    • + +

      #nubmer ZStart : +The start position on the Z-axis in meters for the first group.

      + +
    • +
    • + +

      #number ZSpace : +The space between groups on the Z-axis in meters for each sequent group.

      + +
    • +
    +
    +
    +
    +
    + AI_FORMATION:OnAfterFormationLeftLine(FollowGroupSet, From, Event, To, XStart, YStart, ZStart, ZSpace) @@ -1036,6 +1176,78 @@ The space between groups on the Z-axis in meters for each sequent group.

    + +AI_FORMATION:OnBeforeFormationCenterWing(FollowGroupSet, From, Event, To, XStart, XSpace, YStart, ZStart, ZSpace) + +
    +
    + +

    FormationCenterWing Handler OnBefore for AI_FORMATION

    + +

    Parameters

    +
      +
    • + +

      Core.Set#SET_GROUP FollowGroupSet : +The group AI escorting the FollowUnit.

      + +
    • +
    • + +

      #string From :

      + +
    • +
    • + +

      #string Event :

      + +
    • +
    • + +

      #string To :

      + +
    • +
    • + +

      #number XStart : +The start position on the X-axis in meters for the first group.

      + +
    • +
    • + +

      #number XSpace : +The space between groups on the X-axis in meters for each sequent group.

      + +
    • +
    • + +

      #nubmer YStart : +The start position on the Y-axis in meters for the first group.

      + +
    • +
    • + +

      #nubmer ZStart : +The start position on the Z-axis in meters for the first group.

      + +
    • +
    • + +

      #number ZSpace : +The space between groups on the Z-axis in meters for each sequent group.

      + +
    • +
    +

    Return value

    + +

    #boolean:

    + + +
    +
    +
    +
    + AI_FORMATION:OnBeforeFormationLeftLine(FollowGroupSet, From, Event, To, XStart, YStart, ZStart, ZSpace) @@ -1383,6 +1595,57 @@ If true, then the direction vector will be smoked.

    + +AI_FORMATION:__FormationCenterWing(Delay, XStart, XSpace, YStart, ZStart, ZSpace) + +
    +
    + +

    FormationCenterWing Asynchronous Trigger for AI_FORMATION

    + +

    Parameters

    +
      +
    • + +

      #number Delay :

      + +
    • +
    • + +

      #number XStart : +The start position on the X-axis in meters for the first group.

      + +
    • +
    • + +

      #number XSpace : +The space between groups on the X-axis in meters for each sequent group.

      + +
    • +
    • + +

      #nubmer YStart : +The start position on the Y-axis in meters for the first group.

      + +
    • +
    • + +

      #nubmer ZStart : +The start position on the Z-axis in meters for the first group.

      + +
    • +
    • + +

      #number ZSpace : +The space between groups on the Z-axis in meters for each sequent group.

      + +
    • +
    +
    +
    +
    +
    + AI_FORMATION:__FormationLeftLine(Delay, XStart, YStart, ZStart, ZSpace) @@ -1575,6 +1838,67 @@ The space between groups on the Z-axis in meters for each sequent group.

    + +AI_FORMATION:onafterFormationCenterWing(FollowGroupSet, From, Event, To, XStart, XSpace, YStart, ZStart, ZSpace) + +
    +
    + + + +

    Parameters

    +
      +
    • + +

      FollowGroupSet :

      + +
    • +
    • + +

      From :

      + +
    • +
    • + +

      Event :

      + +
    • +
    • + +

      To :

      + +
    • +
    • + +

      XStart :

      + +
    • +
    • + +

      XSpace :

      + +
    • +
    • + +

      YStart :

      + +
    • +
    • + +

      ZStart :

      + +
    • +
    • + +

      ZSpace :

      + +
    • +
    +
    +
    +
    +
    + AI_FORMATION:onafterFormationLeftLine(FollowGroupSet, From, Event, To, XStart, YStart, ZStart, ZSpace) diff --git a/docs/Documentation/Database.html b/docs/Documentation/Database.html index 36577a336..1953c3339 100644 --- a/docs/Documentation/Database.html +++ b/docs/Documentation/Database.html @@ -1830,7 +1830,6 @@ self

    - #number DATABASE.UNITS_Position diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html index 491edc91b..6770c840c 100644 --- a/docs/Documentation/Detection.html +++ b/docs/Documentation/Detection.html @@ -2478,7 +2478,7 @@ The index of the DetectedItem.

    - #number + DETECTION_BASE.DetectionInterval diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html index 9f6365bca..c8c189c3e 100644 --- a/docs/Documentation/Fsm.html +++ b/docs/Documentation/Fsm.html @@ -1624,7 +1624,7 @@ A string defining the start state.

    - + #string FSM._StartState @@ -1923,7 +1923,6 @@ A string defining the start state.

    - FSM.current diff --git a/docs/Documentation/Movement.html b/docs/Documentation/Movement.html index ab459b6d5..45c002a4d 100644 --- a/docs/Documentation/Movement.html +++ b/docs/Documentation/Movement.html @@ -215,7 +215,6 @@ on defined intervals (currently every minute).

    - #number MOVEMENT.AliveUnits @@ -224,9 +223,6 @@ on defined intervals (currently every minute).

    - -

    Contains the counter how many units are currently alive

    -
    diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index b120d2a28..81de94c32 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -2073,9 +2073,6 @@ The group that was spawned. You can use this group for further actions.

    - -

    Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.

    -
    @@ -2529,9 +2526,6 @@ when nothing was spawned.

    - -

    Overwrite unit names by default with group name.

    -
    @@ -2546,9 +2540,6 @@ when nothing was spawned.

    - -

    By default, no InitLimit

    -
    @@ -2584,7 +2575,7 @@ when nothing was spawned.

    - #number + SPAWN.SpawnMaxGroups @@ -2601,7 +2592,7 @@ when nothing was spawned.

    - #number + SPAWN.SpawnMaxUnitsAlive @@ -2929,7 +2920,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
    - #boolean + SPAWN.SpawnUnControlled @@ -2953,7 +2944,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 ) -

    Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.

    +

    When the first Spawn executes, all the Groups need to be made visible before start.

    diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html index 07dbd4536..3895f8162 100644 --- a/docs/Documentation/Task_Cargo.html +++ b/docs/Documentation/Task_Cargo.html @@ -503,7 +503,7 @@ based on the tasking capabilities defined in Task#TA
    - Core.Cargo#CARGO + Core.Cargo#CARGO_GROUP FSM_PROCESS.Cargo