From 9d0f264d5c5cc3b3ca1ca2d9f37c710fa0cd249e Mon Sep 17 00:00:00 2001 From: FlightControl Date: Mon, 6 Mar 2017 11:43:13 +0100 Subject: [PATCH] Point optmized. --- Moose Development/Moose/Core/Point.lua | 6 +- Moose Development/Moose/Functional/Escort.lua | 2 +- .../Moose/Wrapper/Controllable.lua | 4 +- .../l10n/DEFAULT/Moose.lua | 14 +- Moose Mission Setup/Moose.lua | 14 +- docs/Documentation/AI_Patrol.html | 3 + docs/Documentation/Cargo.html | 1 + docs/Documentation/Controllable.html | 156 +++++++++--------- docs/Documentation/Fsm.html | 3 +- docs/Documentation/Point.html | 5 + docs/Documentation/Spawn.html | 26 +-- docs/Documentation/Static.html | 12 +- docs/Documentation/Zone.html | 76 +++++++++ 13 files changed, 203 insertions(+), 119 deletions(-) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index ea6a26b66..c129b2122 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -26,7 +26,11 @@ -- 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 -- diff --git a/Moose Development/Moose/Functional/Escort.lua b/Moose Development/Moose/Functional/Escort.lua index 247ede8b9..2f159a561 100644 --- a/Moose Development/Moose/Functional/Escort.lua +++ b/Moose Development/Moose/Functional/Escort.lua @@ -1089,7 +1089,7 @@ function ESCORT:_FollowScheduler() self:T( { "Client Speed, Escort Speed, Speed, FollowDistance, Time:", CS, GS, Speed, FollowDistance, Time } ) -- Now route the escort to the desired point with the desired speed. - self.EscortGroup:TaskRouteToVec3( GDV, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second) + self.EscortGroup:RouteToVec3( GDV, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second) end return true diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 0fe259cbf..a767de06f 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -1454,7 +1454,7 @@ end -- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format. -- @param #number Speed The speed to travel. -- @return #CONTROLLABLE self -function CONTROLLABLE:TaskRouteToVec2( Point, Speed ) +function CONTROLLABLE:RouteToVec2( Point, Speed ) self:F2( { Point, Speed } ) local ControllablePoint = self:GetUnit( 1 ):GetVec2() @@ -1505,7 +1505,7 @@ end -- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format. -- @param #number Speed The speed to travel. -- @return #CONTROLLABLE self -function CONTROLLABLE:TaskRouteToVec3( Point, Speed ) +function CONTROLLABLE:RouteToVec3( Point, Speed ) self:F2( { Point, Speed } ) local ControllableVec3 = self:GetUnit( 1 ):GetVec3() diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua index ceab59ba7..a5cd68431 100644 --- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua +++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20170305_1434' ) +env.info( 'Moose Generation Timestamp: 20170306_1142' ) local base = _G Include = {} @@ -10317,7 +10317,11 @@ end -- 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 -- @@ -14739,7 +14743,7 @@ end -- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format. -- @param #number Speed The speed to travel. -- @return #CONTROLLABLE self -function CONTROLLABLE:TaskRouteToVec2( Point, Speed ) +function CONTROLLABLE:RouteToVec2( Point, Speed ) self:F2( { Point, Speed } ) local ControllablePoint = self:GetUnit( 1 ):GetVec2() @@ -14790,7 +14794,7 @@ end -- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format. -- @param #number Speed The speed to travel. -- @return #CONTROLLABLE self -function CONTROLLABLE:TaskRouteToVec3( Point, Speed ) +function CONTROLLABLE:RouteToVec3( Point, Speed ) self:F2( { Point, Speed } ) local ControllableVec3 = self:GetUnit( 1 ):GetVec3() @@ -23045,7 +23049,7 @@ function ESCORT:_FollowScheduler() self:T( { "Client Speed, Escort Speed, Speed, FollowDistance, Time:", CS, GS, Speed, FollowDistance, Time } ) -- Now route the escort to the desired point with the desired speed. - self.EscortGroup:TaskRouteToVec3( GDV, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second) + self.EscortGroup:RouteToVec3( GDV, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second) end return true diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index ceab59ba7..a5cd68431 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20170305_1434' ) +env.info( 'Moose Generation Timestamp: 20170306_1142' ) local base = _G Include = {} @@ -10317,7 +10317,11 @@ end -- 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 -- @@ -14739,7 +14743,7 @@ end -- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format. -- @param #number Speed The speed to travel. -- @return #CONTROLLABLE self -function CONTROLLABLE:TaskRouteToVec2( Point, Speed ) +function CONTROLLABLE:RouteToVec2( Point, Speed ) self:F2( { Point, Speed } ) local ControllablePoint = self:GetUnit( 1 ):GetVec2() @@ -14790,7 +14794,7 @@ end -- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format. -- @param #number Speed The speed to travel. -- @return #CONTROLLABLE self -function CONTROLLABLE:TaskRouteToVec3( Point, Speed ) +function CONTROLLABLE:RouteToVec3( Point, Speed ) self:F2( { Point, Speed } ) local ControllableVec3 = self:GetUnit( 1 ):GetVec3() @@ -23045,7 +23049,7 @@ function ESCORT:_FollowScheduler() self:T( { "Client Speed, Escort Speed, Speed, FollowDistance, Time:", CS, GS, Speed, FollowDistance, Time } ) -- Now route the escort to the desired point with the desired speed. - self.EscortGroup:TaskRouteToVec3( GDV, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second) + self.EscortGroup:RouteToVec3( GDV, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second) end return true diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html index 3d4f402b1..51fe4286e 100644 --- a/docs/Documentation/AI_Patrol.html +++ b/docs/Documentation/AI_Patrol.html @@ -881,6 +881,9 @@ Use the method AIPATROLZONE.M + +

This table contains the targets detected during patrol.

+
diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html index 59202c294..efcd3f237 100644 --- a/docs/Documentation/Cargo.html +++ b/docs/Documentation/Cargo.html @@ -2425,6 +2425,7 @@ The UNIT carrying the package.

+ AI_CARGO_UNIT.CargoCarrier diff --git a/docs/Documentation/Controllable.html b/docs/Documentation/Controllable.html index e400ce576..f68d33b66 100644 --- a/docs/Documentation/Controllable.html +++ b/docs/Documentation/Controllable.html @@ -483,6 +483,18 @@ This is different from the EnRoute tasks, where the targets of the task need to

(AIR) Return the Controllable to an Airbase#AIRBASE A speed can be given in km/h.

+ + + + CONTROLLABLE:RouteToVec2(Point, Speed) + +

(AIR + GROUND) Make the Controllable move to fly to a given point.

+ + + + CONTROLLABLE:RouteToVec3(Point, Speed) + +

(AIR + GROUND) Make the Controllable move to a given point.

@@ -639,18 +651,6 @@ A speed can be given in km/h.

CONTROLLABLE:TaskRoute(Points)

Return a Misson task to follow a given route defined by Points.

- - - - CONTROLLABLE:TaskRouteToVec2(Point, Speed) - -

(AIR + GROUND) Make the Controllable move to fly to a given point.

- - - - CONTROLLABLE:TaskRouteToVec3(Point, Speed) - -

(AIR + GROUND) Make the Controllable move to a given point.

@@ -1866,6 +1866,72 @@ The route

+ +CONTROLLABLE:RouteToVec2(Point, Speed) + +
+
+ +

(AIR + GROUND) Make the Controllable move to fly to a given point.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec3 Point : +The destination point in Vec3 format.

    + +
  • +
  • + +

    #number Speed : +The speed to travel.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:RouteToVec3(Point, Speed) + +
+
+ +

(AIR + GROUND) Make the Controllable move to a given point.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec3 Point : +The destination point in Vec3 format.

    + +
  • +
  • + +

    #number Speed : +The speed to travel.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ CONTROLLABLE:SetCommand(DCSCommand) @@ -2890,72 +2956,6 @@ A table of route points.

Dcs.DCSTasking.Task#Task:

- -
-
-
- - -CONTROLLABLE:TaskRouteToVec2(Point, Speed) - -
-
- -

(AIR + GROUND) Make the Controllable move to fly to a given point.

- -

Parameters

-
    -
  • - -

    Dcs.DCSTypes#Vec3 Point : -The destination point in Vec3 format.

    - -
  • -
  • - -

    #number Speed : -The speed to travel.

    - -
  • -
-

Return value

- -

#CONTROLLABLE: -self

- -
-
-
-
- - -CONTROLLABLE:TaskRouteToVec3(Point, Speed) - -
-
- -

(AIR + GROUND) Make the Controllable move to a given point.

- -

Parameters

-
    -
  • - -

    Dcs.DCSTypes#Vec3 Point : -The destination point in Vec3 format.

    - -
  • -
  • - -

    #number Speed : -The speed to travel.

    - -
  • -
-

Return value

- -

#CONTROLLABLE: -self

-
diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html index 0f56b2bba..0e7e9df7f 100644 --- a/docs/Documentation/Fsm.html +++ b/docs/Documentation/Fsm.html @@ -1506,7 +1506,7 @@ A string defining the start state.

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

+ FSM.current diff --git a/docs/Documentation/Point.html b/docs/Documentation/Point.html index 287f01602..fdc60bf54 100644 --- a/docs/Documentation/Point.html +++ b/docs/Documentation/Point.html @@ -105,6 +105,10 @@ Note that the Set and Add methods return the current POINT_VEC3 object, so these
 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

@@ -1222,6 +1226,7 @@ The new calculated POINT_VEC2.

+ POINT_VEC2.z diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index 0eb4ade3e..ecc39c847 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -834,12 +834,6 @@ A coding example is provided at the description of the SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) - - - - SPAWN.uncontrolled - - @@ -2239,7 +2233,7 @@ when nothing was spawned.

- + #number SPAWN.SpawnMaxGroups @@ -2256,7 +2250,7 @@ when nothing was spawned.

- + #number SPAWN.SpawnMaxUnitsAlive @@ -2535,7 +2529,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
- #boolean + SPAWN.SpawnUnControlled @@ -3198,20 +3192,6 @@ True = Continue Scheduler

- -
-
-
- - - -SPAWN.uncontrolled - -
-
- - -
diff --git a/docs/Documentation/Static.html b/docs/Documentation/Static.html index 7d906b032..cdcb75c70 100644 --- a/docs/Documentation/Static.html +++ b/docs/Documentation/Static.html @@ -125,7 +125,7 @@ If the DCS Static object does not exist or is nil, the STATIC methods will retur - STATIC:FindByName(StaticName) + STATIC:FindByName(StaticName, RaiseError)

Finds a STATIC from the _DATABASE using the relevant Static Name.

@@ -196,7 +196,7 @@ If the DCS Static object does not exist or is nil, the STATIC methods will retur
-STATIC:FindByName(StaticName) +STATIC:FindByName(StaticName, RaiseError)
@@ -206,13 +206,19 @@ If the DCS Static object does not exist or is nil, the STATIC methods will retur

As an optional parameter, a briefing text can be given also.

-

Parameter

+

Parameters

  • #string StaticName : Name of the DCS Static as defined within the Mission Editor.

    +
  • +
  • + +

    #boolean RaiseError : +Raise an error if not found.

    +

Return value

diff --git a/docs/Documentation/Zone.html b/docs/Documentation/Zone.html index 9e2cce3f3..110de3739 100644 --- a/docs/Documentation/Zone.html +++ b/docs/Documentation/Zone.html @@ -340,6 +340,12 @@ This class implements the inherited functions from Type ZONE_BASE + + + +
ZONE_BASE:BoundZone() +

Bound the zone boundaries with a tires.

+
ZONE_BASE.ClassName @@ -512,6 +518,12 @@ This class implements the inherited functions from Type ZONE_POLYGON_BASE + + + +
ZONE_POLYGON_BASE:BoundZone() +

Smokes the zone boundaries in a color.

+
ZONE_POLYGON_BASE.ClassName @@ -576,6 +588,12 @@ This class implements the inherited functions from Type ZONE_RADIUS + + + +
ZONE_RADIUS:BoundZone(Points) +

Bounds the zone with tires.

+
ZONE_RADIUS.ClassName @@ -878,6 +896,19 @@ The name of the zone as defined within the mission editor.

+ +ZONE_BASE:BoundZone() + +
+
+ +

Bound the zone boundaries with a tires.

+ +
+
+
+
+ #string ZONE_BASE.ClassName @@ -1414,6 +1445,24 @@ self

+ +ZONE_POLYGON_BASE:BoundZone() + +
+
+ +

Smokes the zone boundaries in a color.

+ +

Return value

+ +

#ZONEPOLYGONBASE: +self

+ +
+
+
+
+ #string ZONE_POLYGON_BASE.ClassName @@ -1638,6 +1687,33 @@ self

+ +ZONE_RADIUS:BoundZone(Points) + +
+
+ +

Bounds the zone with tires.

+ +

Parameter

+
    +
  • + +

    #number Points : +(optional) The amount of points in the circle.

    + +
  • +
+

Return value

+ +

#ZONE_RADIUS: +self

+ +
+
+
+
+ #string ZONE_RADIUS.ClassName