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 20fde20a3..3f9af300b 100644 --- a/Moose Development/Moose/Functional/Escort.lua +++ b/Moose Development/Moose/Functional/Escort.lua @@ -1121,7 +1121,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 84c97e611..209befa24 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -1442,7 +1442,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() @@ -1493,7 +1493,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 Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100 - Scoring of Statics.lua b/Moose Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100 - Scoring of Statics.lua index b45814d10..28186f64c 100644 --- a/Moose Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100 - Scoring of Statics.lua +++ b/Moose Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100 - Scoring of Statics.lua @@ -18,9 +18,9 @@ local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) local Scoring = SCORING:New( "Shooting Range 1" ) -Scoring:SetMultiplierDestroyScore( 10 ) +Scoring:SetScaleDestroyScore( 10 ) -Scoring:SetMultiplierDestroyPenalty( 40 ) +Scoring:SetScaleDestroyPenalty( 40 ) Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) @@ -35,4 +35,4 @@ Scoring:AddZoneScore( ShootingRangeZone, 200 ) local SceneryZone = ZONE:New( "ScoringZone2" ) Scoring:AddZoneScore( SceneryZone, 200 ) - +Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) diff --git a/Moose Test Missions/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua b/Moose Test Missions/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua new file mode 100644 index 000000000..1a4c15294 --- /dev/null +++ b/Moose Test Missions/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua @@ -0,0 +1,139 @@ +--- +-- Name: SCO-500 - Scoring Multi Player Demo Mission 1 +-- Author: Pikey and FlightControl +-- Date Created: 1 Mar 2017 +-- +-- # Situation: +-- +-- A demo mission for the scoring. Read the briefing and have fun. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill targets. + +-- Define the patrol zones +local BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) ) +local RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) ) + +-- Define the engage zones +local BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) ) +local RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) ) + +-- Define the Spawn zones for ground vehicles +local BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) ) +--local RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) ) + +local RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" ) + +-- Define the Scoring zones that define the shelters +local BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) ) +local RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) ) + +-- Define the Set of Clients that are used for the AI Balancers +local BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player") +local RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player") + +-- Define the Spawn objects for the AI planes +local BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) +local RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) + +-- Define the AI Balancers for the planes +local BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 ) +local RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 ) + +-- Define the Spawn objects for the airbase defenses +local BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) +local BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) +local RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) +local RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) + +-- Define the ground forces spawning engines... + +-- First define the template arrays. +local BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" } +local RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" } + +-- New we are using these templates to define the spawn objects for the ground forces. +-- We spawn them at random places into the define zone. +local BlueGroundSpawn = SPAWN + :New( "Blue Ground Forces" ) + :InitLimit( 12, 30 ) + :InitRandomizeZones( { BlueSpawnGroundZone } ) + :InitRandomizeTemplate( BlueGroundTemplates ) + :SpawnScheduled( 60, 0.2 ) + +local RedGroundSpawn = SPAWN + :New( "Red Ground Forces" ) + :InitLimit( 12, 30 ) + :InitRandomizeTemplate( RedGroundTemplates ) + :InitRandomizeZones( { RedSpawnGroundZone } ) + :SpawnScheduled( 60, 0.2 ) + + + +local BlueCap = {} +local RedCap = {} + +-- Define the OnAfterSpawned events of the AI balancer Spawn Groups +function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + if AIGroup then + BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 ) + local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE + + Cap:ManageFuel( 0.4, 180 ) + Cap:SetEngageZone( BlueEngageZone ) + Cap:SetControllable( AIGroup ) + Cap:Start() + end +end + +function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + + if AIGroup then + RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 ) + local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE + + Cap:ManageFuel( 0.4, 180 ) + Cap:SetEngageZone( BlueEngageZone ) + Cap:SetControllable( AIGroup ) + Cap:Start() + end +end + + + + +-- Okay, now that we defined all this stuff, now make the SCORING setup ... + +-- First define a Scoring object +local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" ) + +-- Define within the scoring the shelter designated targets. +Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. +Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. + +-- Define the static objects that give extra scores +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 ) + +-- Scale the scoring rewarded. +Scoring:SetScaleDestroyScore( 30 ) +Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys. + diff --git a/Moose Test Missions/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.miz b/Moose Test Missions/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.miz new file mode 100644 index 000000000..a1de2242c Binary files /dev/null and b/Moose Test Missions/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.miz differ diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html index 4339111c1..1c326229c 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/Controllable.html b/docs/Documentation/Controllable.html index fc7daf27b..b37775dba 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) @@ -2896,72 +2962,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 ca46b6637..2aaeaf448 100644 --- a/docs/Documentation/Fsm.html +++ b/docs/Documentation/Fsm.html @@ -1542,7 +1542,7 @@ A string defining the start state.

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

+ FSM.current diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index 9a836ef50..64c70728c 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -2532,7 +2532,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
- #boolean + SPAWN.SpawnUnControlled diff --git a/docs/Documentation/Static.html b/docs/Documentation/Static.html index c05f4004d..60fca2b1e 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 ee46f1980..7e505edc7 100644 --- a/docs/Documentation/Zone.html +++ b/docs/Documentation/Zone.html @@ -295,6 +295,12 @@ This class implements the inherited functions from Type ZONE_BASE + + + +
ZONE_BASE:BoundZone() +

Bound the zone boundaries with a tires.

+
ZONE_BASE.ClassName @@ -479,6 +485,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 @@ -531,6 +543,12 @@ This class implements the inherited functions from Type ZONE_RADIUS + + + +
ZONE_RADIUS:BoundZone(Points) +

Bounds the zone with tires.

+
ZONE_RADIUS.ClassName @@ -821,6 +839,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 @@ -1420,6 +1451,24 @@ self

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

Smokes the zone boundaries in a color.

+ +

Return value

+ +

#ZONEPOLYGONBASE: +self

+ +
+
+
+
+ #string ZONE_POLYGON_BASE.ClassName @@ -1608,6 +1657,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