diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 2e42342a5..bb49e4414 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -124,7 +124,15 @@ -- * @{#CONTROLLABLE.CommandDoScript}: Do Script command. -- * @{#CONTROLLABLE.CommandSwitchWayPoint}: Perform a switch waypoint command. -- --- ## CONTROLLABLE Option methods +-- ## Routing of Controllables +-- +-- Different routing methods exist to route GROUPs and UNITs to different locations: +-- +-- * @{#CONTROLLABLE.Route}(): Make the Controllable to follow a given route. +-- * @{#CONTROLLABLE.RouteGroundTo}(): Make the GROUND Controllable to drive towards a specific coordinate. +-- * @{#CONTROLLABLE.RouteAirTo}(): Make the AIR Controllable to fly towards a specific coordinate. +-- +-- ## Option methods -- -- Controllable **Option methods** change the behaviour of the Controllable while being alive. -- @@ -1762,7 +1770,7 @@ function CONTROLLABLE:Route( Route, DelaySeconds ) end ---- Make the GROUND controllable to drive towards a specific point. +--- Make the GROUND Controllable to drive towards a specific point. -- @param #CONTROLLABLE self -- @param Core.Point#COORDINATE ToCoordinate A Coordinate to drive to. -- @param #number Speed (optional) Speed in km/h. The default speed is 999 km/h. @@ -1781,6 +1789,29 @@ function CONTROLLABLE:RouteGroundTo( ToCoordinate, Speed, Formation, DelaySecond return self end + +--- Make the AIR Controllable fly towards a specific point. +-- @param #CONTROLLABLE self +-- @param Core.Point#COORDINATE ToCoordinate A Coordinate to drive to. +-- @param Core.Point#COORDINATE.RoutePointAltType AltType The altitude type. +-- @param Core.Point#COORDINATE.RoutePointType Type The route point type. +-- @param Core.Point#COORDINATE.RoutePointAction Action The route point action. +-- @param #number Speed (optional) Speed in km/h. The default speed is 999 km/h. +-- @param #number DelaySeconds Wait for the specified seconds before executing the Route. +-- @return #CONTROLLABLE The CONTROLLABLE. +function CONTROLLABLE:RouteAirTo( ToCoordinate, AltType, Type, Action, Speed, DelaySeconds ) + + local FromCoordinate = self:GetCoordinate() + local FromWP = FromCoordinate:WaypointAir() + + local ToWP = ToCoordinate:WaypointAir( AltType, Type, Action, Speed ) + + self:Route( { FromWP, ToWP }, DelaySeconds ) + + return self +end + + --- (AIR + GROUND) Route the controllable to a given zone. -- The controllable final destination point can be randomized. -- A speed can be given in km/h. diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html index a11fd4dba..9f6098452 100644 --- a/docs/Documentation/Cargo.html +++ b/docs/Documentation/Cargo.html @@ -3417,7 +3417,6 @@ The range till cargo will board.
Make the controllable to follow a given route.
+Make the AIR Controllable fly towards a specific point.
Make the GROUND controllable to drive towards a specific point.
+Make the GROUND Controllable to drive towards a specific point.
Different routing methods exist to route GROUPs and UNITs to different locations:
+ +Controllable Option methods change the behaviour of the Controllable while being alive.
@@ -2220,13 +2236,70 @@ The CONTROLLABLE.Make the AIR Controllable fly towards a specific point.
+ +Core.Point#COORDINATE ToCoordinate :
+A Coordinate to drive to.
Core.Point#COORDINATE.RoutePointAltType AltType :
+The altitude type.
Core.Point#COORDINATE.RoutePointType Type :
+The route point type.
Core.Point#COORDINATE.RoutePointAction Action :
+The route point action.
#number Speed :
+(optional) Speed in km/h. The default speed is 999 km/h.
#number DelaySeconds :
+Wait for the specified seconds before executing the Route.
#CONTROLLABLE: +The CONTROLLABLE.
+ +Make the GROUND controllable to drive towards a specific point.
+Make the GROUND Controllable to drive towards a specific point.
Contains the counter how many units are currently alive
+