From c62cd53e5f4b059ae9680d76c6f0b4b6ea3ae9f8 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Wed, 13 Sep 2017 13:31:08 +0200 Subject: [PATCH 1/9] Removed AI_RAT.html --- docs/Documentation/AI_RAT.html | 3196 -------------------------------- 1 file changed, 3196 deletions(-) delete mode 100644 docs/Documentation/AI_RAT.html diff --git a/docs/Documentation/AI_RAT.html b/docs/Documentation/AI_RAT.html deleted file mode 100644 index 96a34ce57..000000000 --- a/docs/Documentation/AI_RAT.html +++ /dev/null @@ -1,3196 +0,0 @@ - - - - - - -
-
- -
-
-
-
- -
-

Module AI_RAT

- -
    -
  • Functional -- Create random airtraffic in your missions.
  • -
- - -

-Banner Image

- -
- -

The documentation of the SPAWN class can be found further in this document.

- -
- -

Global(s)

- - - - - - - - - -
RAT -

RAT class

-
myid -

Some ID to identify where we are

-

string myid

-
-

Type RAT

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RAT.AlphaDescent - -
RAT.ClassName - -
RAT:Commute(switch) -

Aircraft will commute between their departure and destination airports.

-
RAT:ContinueJourney(switch) -

Aircraft will continue their journey from their destination.

-
RAT.FLmaxuser - -
RAT.FLminuser - -
RAT.FLuser - -
RAT.Menu - -
RAT.MenuF10 -

Main F10 menu.

-
RAT:New(groupname) -

Create a new RAT object.

-
RAT:PlaceMarkers(switch) -

Place markers of waypoints on the F10 map.

-
RAT.RAT - -
RAT.ROE -

RAT rules of engagement.

-
RAT.ROT -

RAT reaction to threat.

-
RAT:RespawnAfterLanding(delay) -

Make aircraft respawn the moment they land rather than at engine shut down.

-
RAT:SetClimbRate(rate) -

Set the climb rate.

-
RAT:SetCoalition(friendly) -

Set the friendly coalitions from which the airports can be used as departure or destination.

-
RAT:SetDeparture(names) -

Set possible departure ports.

-
RAT:SetDescentAngle(angle) -

Set the angle of descent.

-
RAT:SetDestination(names) -

Set name of destination airport for the AI aircraft.

-
RAT:SetFL(height) -

Set flight level.

-
RAT:SetFLcruise(height) -

Set flight level of cruising part.

-
RAT:SetFLmax(height) -

Set max flight level.

-
RAT:SetFLmin(height) -

Set min flight level.

-
RAT:SetMaxCruiseSpeed(speed) -

Set the maximum cruise speed of the aircraft.

-
RAT:SetMaxDistance(dist) -

Set maximum distance between departure and destination.

-
RAT:SetMinDistance(dist) -

Set minimum distance between departure and destination.

-
RAT:SetROE(roe) -

Set rules of engagement (ROE).

-
RAT:SetROT(rot) -

Set reaction to threat (ROT).

-
RAT:SetSpawnDelay(delay) -

Set the delay before first group is spawned.

-
RAT:SetSpawnInterval(interval) -

Set the interval between spawnings of the template group.

-
RAT:SetTakeoff(type) -

Set takeoff type.

-
RAT:Spawn(naircraft) -

Triggers the spawning of AI aircraft.

-
RAT:Status(message, forID) -

Report status of RAT groups.

-
RAT:StatusReports(switch) -

Aircraft report status messages.

-
RAT.SubMenuName - -
RAT.Vclimb - -
RAT.Vcruisemax - -
RAT:_AirportExists(name) -

Test if an airport exists on the current map.

-
RAT:_Course(a, b) -

Determine the heading from point a to point b.

-
RAT:_Debug(switch) -

Turn debug messages on or off.

-
RAT:_DeleteMarkers(ids) -

Delete all markers on F10 map.

-
RAT:_Despawn(group) -

Despawn unit.

-
RAT:_EngineStartup(EventData) -

Function is executed when a unit starts its engines.

-
RAT:_FLmax(alpha, beta, d, phi, h0) -

Calculate the max flight level for a given distance and fixed climb and descent rates.

-
RAT:_GetAirportsOfCoalition() -

Get all "friendly" airports of the current map.

-
RAT:_GetAirportsOfMap() -

Get all airports of the current map.

-
RAT:_GetDestinations(q, minrange, maxrange) -

Get all possible destination airports depending on departure position.

-
RAT:_GetLife(group) -

Get (relative) life of first unit of a group.

-
RAT:_InitAircraft(DCSgroup) -

Initialize basic parameters of the aircraft based on its (template) group in the mission editor.

-
RAT:_ModifySpawnTemplate(waypoints) -

Modifies the template of the group to be spawned.

-
RAT:_OnBirth(EventData) -

Function is executed when a unit is spawned.

-
RAT:_OnCrash(EventData) -

Function is executed when a unit crashes.

-
RAT:_OnDead(EventData) -

Function is executed when a unit is dead.

-
RAT:_OnEngineShutdown(EventData) -

Function is executed when a unit shuts down its engines.

-
RAT:_OnLand(EventData) -

Function is executed when a unit lands.

-
RAT:_OnTakeoff(EventData) -

Function is executed when a unit takes off.

-
RAT:_PickDeparture(takeoff) -

Set the departure airport of the AI.

-
RAT:_PickDestination(destinations, _random) -

Set the destination airport of the AI.

-
RAT:_PlaceMarkers(waypoints) -

Place markers of the waypoints.

-
RAT:_Randomize(value, fac, lower, upper) -

Randomize a value by a certain amount.

-
RAT:_Respawn(group) -

Respawn a group.

-
RAT:_Routeinfo(waypoints, comment) -

Provide information about the assigned flightplan.

-
RAT:_SetCoalitionTable() -

Create a table with the valid coalitions for departure and destination airports.

-
RAT:_SetMarker(text, wp) -

Set a marker visible for all on the F10 map.

-
RAT:_SetROE(group, roe) -

Set ROE for a group.

-
RAT:_SetROT(group, rot) -

Set ROT for a group.

-
RAT:_SetRoute(Takeoff, _departure, _destination, takeoff) -

Set the route of the AI plane.

-
RAT:_SetStatus(group, status) -

Set status of group.

-
RAT:_SpawnWithRoute(_departure, _destination) -

Spawn the AI aircraft with a route.

-
RAT:_TaskHolding(P1, Altitude, Speed, Duration) -

Orbit at a specified position at a specified alititude with a specified speed.

-
RAT:_Waypoint(Type, Coord, Speed, Altitude, Airport) -

Create a waypoint that can be used with the Route command.

-
RAT.aircraft - -
RAT.airports - -
RAT.airports_map - -
RAT.alive - -
RAT.cat -

RAT categories.

-
RAT.category - -
RAT.coal -

RAT friendly coalitions.

-
RAT.coalition - -
RAT.commute - -
RAT.continuejourney - -
RAT.ctable - -
RAT.debug - -
RAT.departure_ports - -
RAT.departure_zones - -
RAT.destination_ports - -
RAT.f10menu - -
RAT.friendly - -
RAT.markerid -

Running number of placed markers on the F10 map.

-
RAT.markerids - -
RAT.maxdist - -
RAT.mindist - -
RAT.placemarkers - -
RAT.random_departure - -
RAT.random_destination - -
RAT.ratcraft - -
RAT.reportstatus - -
RAT.respawn_after_landing - -
RAT.respawn_delay - -
RAT.roe - -
RAT.rot - -
RAT.spawndelay - -
RAT.spawninterval - -
RAT.statusinterval - -
RAT.takeoff - -
RAT.unit -

RAT unit conversions.

-
RAT.wp -

RAT waypoint type.

-
- -

Global(s)

-
-
- - #RAT - -RAT - -
-
- -

RAT class

- -
-
-
-
- - #string - -myid - -
-
- -

Some ID to identify where we are

-

string myid

- -
-
-

Type AI_RAT

- -

Type RAT

- -

RAT class

- -

Field(s)

-
-
- - #number - -RAT.AlphaDescent - -
-
- - - -
-
-
-
- - #string - -RAT.ClassName - -
-
- - - -
-
-
-
- - -RAT:Commute(switch) - -
-
- -

Aircraft will commute between their departure and destination airports.

- - -

Note, this option is not available if aircraft are spawned in air since they don't have a valid departure airport to fly back to.

- -

Parameter

-
    -
  • - -

    #boolean switch : -Turn commute on=true or off=false. If no value is given switch=true.

    - -
  • -
-
-
-
-
- - -RAT:ContinueJourney(switch) - -
-
- -

Aircraft will continue their journey from their destination.

- - -

This means they are respawned at their destination and get a new random destination.

- -

Parameter

-
    -
  • - -

    #boolean switch : -Turn journey on=true or off=false. If no value is given switch=true.

    - -
  • -
-
-
-
-
- - #number - -RAT.FLmaxuser - -
-
- - - -
-
-
-
- - #number - -RAT.FLminuser - -
-
- - - -
-
-
-
- - #number - -RAT.FLuser - -
-
- - - -
-
-
-
- - #table - -RAT.Menu - -
-
- - - -
-
-
-
- - #RAT - -RAT.MenuF10 - -
-
- -

Main F10 menu.

- -
-
-
-
- - -RAT:New(groupname) - -
-
- -

Create a new RAT object.

- -

Parameter

-
    -
  • - -

    #string groupname : -Name of the group as defined in the mission editor. This group is serving as a template for all spawned units.

    - -
  • -
-

Return values

-
    -
  1. - -

    #RAT: -Object of RAT class.

    - -
  2. -
  3. - -

    #nil: -If the group does not exist in the mission editor.

    - -
  4. -
-

Usage:

-
yak:RAT("RAT_YAK") will create a RAT object called "yak". The template group in the mission editor must have the name "RAT_YAK".
- -
-
-
-
- - -RAT:PlaceMarkers(switch) - -
-
- -

Place markers of waypoints on the F10 map.

- - -

Default is off.

- -

Parameter

-
    -
  • - -

    #boolean switch : -true=yes, false=no.

    - -
  • -
-
-
-
-
- - #table - -RAT.RAT - -
-
- - - -
-
-
-
- - #RAT - -RAT.ROE - -
-
- -

RAT rules of engagement.

- -
-
-
-
- - #RAT - -RAT.ROT - -
-
- -

RAT reaction to threat.

- -
-
-
-
- - -RAT:RespawnAfterLanding(delay) - -
-
- -

Make aircraft respawn the moment they land rather than at engine shut down.

- -

Parameter

-
    -
  • - -

    #number delay : -(Optional) Delay in seconds until respawn happens after landing. Default is 180 seconds.

    - -
  • -
-
-
-
-
- - -RAT:SetClimbRate(rate) - -
-
- -

Set the climb rate.

- - -

Default is 1500 ft/min. This automatically sets the climb angle.

- -

Parameter

-
    -
  • - -

    #number rate : -Climb rate in ft/min.

    - -
  • -
-
-
-
-
- - -RAT:SetCoalition(friendly) - -
-
- -

Set the friendly coalitions from which the airports can be used as departure or destination.

- -

Parameter

-
    -
  • - -

    #string friendly : -"same"=own coalition+neutral (default), "all"=neutral+red+blue", "sameonly"=own coalition only, "blue"=blue+neutral, "blueonly"=blue, "red"=red+neutral, "redonly"=red, "neutral"=neutral. -Default is "same", so aircraft will use airports of the coalition their spawn template has plus all neutral airports.

    - -
  • -
-

Usages:

-
    -
  • yak:SetCoalition("all") will spawn aircraft randomly on airports of any coaliton, i.e. red, blue and neutral, regardless of its own coalition.
  • -
  • yak:SetCoalition("redonly") will spawn aircraft randomly on airports belonging to the red coalition _only_.
  • -
- -
-
-
-
- - -RAT:SetDeparture(names) - -
-
- -

Set possible departure ports.

- - -

This can be an airport or a zone defined in the mission editor.

- -

Parameter

-
    -
  • - -

    #string names : -Name or table of names of departure airports or zones.

    - -
  • -
-

Usages:

-
    -
  • RAT:SetDeparture("Sochi-Adler") will spawn RAT objects at Sochi-Adler airport.
  • -
  • RAT:SetDeparture({"Sochi-Adler", "Gudauta"}) will spawn RAT aircraft radomly at Sochi-Adler or Gudauta airport.
  • -
  • RAT:SetDeparture({"Zone A", "Gudauta"}) will spawn RAT aircraft in air randomly within Zone A, which has to be defined in the mission editor, or within a zone around Gudauta airport. Note that this also requires RAT:takeoff("air") to be set.
  • -
- -
-
-
-
- - -RAT:SetDescentAngle(angle) - -
-
- -

Set the angle of descent.

- - -

Default is 3.6 degrees, which corresponds to 3000 ft descent after one mile of travel.

- -

Parameter

-
    -
  • - -

    #number angle : -Angle of descent in degrees.

    - -
  • -
-
-
-
-
- - -RAT:SetDestination(names) - -
-
- -

Set name of destination airport for the AI aircraft.

- - -

If no name is given an airport from the friendly coalition(s) is chosen randomly.

- -

Parameter

-
    -
  • - -

    #string names : -Name of the destination airport or table of destination airports.

    - -
  • -
-

Usage:

-
RAT:SetDestination("Krymsk") makes all aircraft of this RAT oject fly to Krymsk airport.
- -
-
-
-
- - -RAT:SetFL(height) - -
-
- -

Set flight level.

- - -

Setting this value will overrule all other logic. Aircraft will try to fly at this height regardless.

- -

Parameter

-
    -
  • - -

    #number height : -FL in hundrets of feet. E.g. FL200 = 20000 ft ASL.

    - -
  • -
-
-
-
-
- - -RAT:SetFLcruise(height) - -
-
- -

Set flight level of cruising part.

- - -

This is still be checked for consitancy with selected route and prone to radomization. -Default is FL200 for planes and FL005 for helicopters.

- -

Parameter

-
    -
  • - -

    #number height : -FL in hundrets of feet. E.g. FL200 = 20000 ft ASL.

    - -
  • -
-
-
-
-
- - -RAT:SetFLmax(height) - -
-
- -

Set max flight level.

- - -

Setting this value will overrule all other logic. Aircraft will try to fly at less than this FL regardless.

- -

Parameter

-
    -
  • - -

    #number height : -Maximum FL in hundrets of feet.

    - -
  • -
-
-
-
-
- - -RAT:SetFLmin(height) - -
-
- -

Set min flight level.

- - -

Setting this value will overrule all other logic. Aircraft will try to fly at higher than this FL regardless.

- -

Parameter

-
    -
  • - -

    #number height : -Maximum FL in hundrets of feet.

    - -
  • -
-
-
-
-
- - -RAT:SetMaxCruiseSpeed(speed) - -
-
- -

Set the maximum cruise speed of the aircraft.

- -

Parameter

-
    -
  • - -

    #number speed : -Speed in km/h.

    - -
  • -
-
-
-
-
- - -RAT:SetMaxDistance(dist) - -
-
- -

Set maximum distance between departure and destination.

- - -

Default is 5000 km but aircarft range is also taken into account automatically.

- -

Parameter

-
    -
  • - -

    #number dist : -Distance in km.

    - -
  • -
-
-
-
-
- - -RAT:SetMinDistance(dist) - -
-
- -

Set minimum distance between departure and destination.

- - -

Default is 5 km. -Minimum distance should not be smaller than ~500(?) meters to ensure that departure and destination are different.

- -

Parameter

-
    -
  • - -

    #number dist : -Distance in km.

    - -
  • -
-
-
-
-
- - -RAT:SetROE(roe) - -
-
- -

Set rules of engagement (ROE).

- - -

Default is weapon hold. This is a peaceful class.

- -

Parameter

-
    -
  • - -

    #string roe : -"hold" = weapon hold, "return" = return fire, "free" = weapons free.

    - -
  • -
-
-
-
-
- - -RAT:SetROT(rot) - -
-
- -

Set reaction to threat (ROT).

- - -

Default is no reaction, i.e. aircraft will simply ignore all enemies.

- -

Parameter

-
    -
  • - -

    #string rot : -"noreaction = no reactino, "passive" = passive defence, "evade" = weapons free.

    - -
  • -
-
-
-
-
- - -RAT:SetSpawnDelay(delay) - -
-
- -

Set the delay before first group is spawned.

- - -

Minimum delay is 0.5 seconds.

- -

Parameter

-
    -
  • - -

    #number delay : -Delay in seconds.

    - -
  • -
-
-
-
-
- - -RAT:SetSpawnInterval(interval) - -
-
- -

Set the interval between spawnings of the template group.

- - -

Minimum interval is 0.5 seconds.

- -

Parameter

-
    -
  • - -

    #number interval : -Interval in seconds.

    - -
  • -
-
-
-
-
- - -RAT:SetTakeoff(type) - -
-
- -

Set takeoff type.

- - -

Starting cold at airport, starting hot at airport, starting at runway, starting in the air. -Default is "takeoff-hot" for a start at airport with engines already running.

- -

Parameter

-
    -
  • - -

    #string type : -Type can be "takeoff-cold" or "cold", "takeoff-hot" or "hot", "takeoff-runway" or "runway", "air".

    - -
  • -
-

Usages:

-
    -
  • RAT:Takeoff("hot") will spawn RAT objects at airports with engines started.
  • -
  • RAT:Takeoff("cold") will spawn RAT objects at airports with engines off.
  • -
  • RAT:Takeoff("air") will spawn RAT objects in air over random airports or within pre-defined zones. 
  • -
- -
-
-
-
- - -RAT:Spawn(naircraft) - -
-
- -

Triggers the spawning of AI aircraft.

- - -

Note that all additional options should be set before giving the spawn command.

- -

Parameter

-
    -
  • - -

    #number naircraft : -(Optional) Number of aircraft to spawn. Default is one aircraft.

    - -
  • -
-

Usage:

-
yak:Spawn(5) will spawn five aircraft. By default aircraft will spawn at neutral and red airports if the template group is part of the red coaliton.
- -
-
-
-
- - -RAT:Status(message, forID) - -
-
- -

Report status of RAT groups.

- -

Parameters

-
    -
  • - -

    #boolean message : -(Optional) Send message if true.

    - -
  • -
  • - -

    #number forID : -(Optional) Send message only for this ID.

    - -
  • -
-
-
-
-
- - -RAT:StatusReports(switch) - -
-
- -

Aircraft report status messages.

- - -

Default is off.

- -

Parameter

-
    -
  • - -

    #boolean switch : -true=on, false=off.

    - -
  • -
-
-
-
-
- - #string - -RAT.SubMenuName - -
-
- - - -
-
-
-
- - #number - -RAT.Vclimb - -
-
- - - -
-
-
-
- - #number - -RAT.Vcruisemax - -
-
- - - -
-
-
-
- - -RAT:_AirportExists(name) - -
-
- -

Test if an airport exists on the current map.

- -

Parameter

-
    -
  • - -

    #string name :

    - -
  • -
-

Return value

- -

#boolean: -True if airport exsits, false otherwise.

- -
-
-
-
- - -RAT:_Course(a, b) - -
-
- -

Determine the heading from point a to point b.

- -

Parameters

- -

Return value

- -

#number: -Heading/angle in degrees.

- -
-
-
-
- - -RAT:_Debug(switch) - -
-
- -

Turn debug messages on or off.

- - -

Default is off.

- -

Parameter

-
    -
  • - -

    #boolean switch : -true turn messages on, false=off.

    - -
  • -
-
-
-
-
- - -RAT:_DeleteMarkers(ids) - -
-
- -

Delete all markers on F10 map.

- -

Parameter

-
    -
  • - -

    #table ids : -(Optional) Table holding the marker IDs to be deleted.

    - -
  • -
-
-
-
-
- - -RAT:_Despawn(group) - -
-
- -

Despawn unit.

- - -

Unit gets destoyed and group is set to nil. -Index of ratcraft array is taken from spawned group name.

- -

Parameter

- -
-
-
-
- - -RAT:_EngineStartup(EventData) - -
-
- -

Function is executed when a unit starts its engines.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_FLmax(alpha, beta, d, phi, h0) - -
-
- -

Calculate the max flight level for a given distance and fixed climb and descent rates.

- - -

In other words we have a distance between two airports and want to know how high we -can climb before we must descent again to arrive at the destination without any level/cruising part.

- -

Parameters

-
    -
  • - -

    #number alpha : -Angle of climb [rad].

    - -
  • -
  • - -

    #number beta : -Angle of descent [rad].

    - -
  • -
  • - -

    #number d : -Distance between the two airports [m].

    - -
  • -
  • - -

    #number phi : -Angle between departure and destination [rad].

    - -
  • -
  • - -

    #number h0 : -Height [m] of departure airport. Note we implicitly assume that the height difference between departure and destination is negligible.

    - -
  • -
-

Return value

- -

#number: - Maximal flight level in meters.

- -
-
-
-
- - -RAT:_GetAirportsOfCoalition() - -
-
- -

Get all "friendly" airports of the current map.

- -
-
-
-
- - -RAT:_GetAirportsOfMap() - -
-
- -

Get all airports of the current map.

- -
-
-
-
- - -RAT:_GetDestinations(q, minrange, maxrange) - -
-
- -

Get all possible destination airports depending on departure position.

- - -

The list is sorted w.r.t. distance to departure position.

- -

Parameters

-
    -
  • - -

    Core.Point#COORDINATE q : -Coordinate of the departure point.

    - -
  • -
  • - -

    #number minrange : -Minimum range to q in meters.

    - -
  • -
  • - -

    #number maxrange : -Maximum range to q in meters.

    - -
  • -
-

Return values

-
    -
  1. - -

    #table: -Table with possible destination airports.

    - -
  2. -
  3. - -

    #nil: -If no airports could be found.

    - -
  4. -
-
-
-
-
- - -RAT:_GetLife(group) - -
-
- -

Get (relative) life of first unit of a group.

- -

Parameter

- -

Return value

- -

#number: -Life of unit in percent.

- -
-
-
-
- - -RAT:_InitAircraft(DCSgroup) - -
-
- -

Initialize basic parameters of the aircraft based on its (template) group in the mission editor.

- -

Parameter

- -
-
-
-
- - -RAT:_ModifySpawnTemplate(waypoints) - -
-
- -

Modifies the template of the group to be spawned.

- - -

In particular, the waypoints of the group's flight plan are copied into the spawn template. -This allows to spawn at airports and also land at other airports, i.e. circumventing the DCS "landing bug".

- -

Parameter

-
    -
  • - -

    #table waypoints : -The waypoints of the AI flight plan.

    - -
  • -
-
-
-
-
- - -RAT:_OnBirth(EventData) - -
-
- -

Function is executed when a unit is spawned.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnCrash(EventData) - -
-
- -

Function is executed when a unit crashes.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnDead(EventData) - -
-
- -

Function is executed when a unit is dead.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnEngineShutdown(EventData) - -
-
- -

Function is executed when a unit shuts down its engines.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnLand(EventData) - -
-
- -

Function is executed when a unit lands.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnTakeoff(EventData) - -
-
- -

Function is executed when a unit takes off.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_PickDeparture(takeoff) - -
-
- -

Set the departure airport of the AI.

- - -

If no airport name is given explicitly an airport from the coalition is chosen randomly. -If takeoff style is set to "air", we use zones around the airports or the zones specified by user input.

- -

Parameter

-
    -
  • - -

    #number takeoff : -Takeoff type.

    - -
  • -
-

Return values

-
    -
  1. - -

    Wrapper.Airbase#AIRBASE: -Departure airport if spawning at airport.

    - -
  2. -
  3. - -

    Coore.Zone#ZONE: -Departure zone if spawning in air.

    - -
  4. -
-
-
-
-
- - -RAT:_PickDestination(destinations, _random) - -
-
- -

Set the destination airport of the AI.

- - -

If no airport name is given an airport from the coalition is chosen randomly.

- -

Parameters

-
    -
  • - -

    #table destinations : -Table with destination airports.

    - -
  • -
  • - -

    #boolean _random : -Optional switch to activate a random selection of airports.

    - -
  • -
-

Return value

- -

Wrapper.Airbase#AIRBASE: -Destination airport.

- -
-
-
-
- - -RAT:_PlaceMarkers(waypoints) - -
-
- -

Place markers of the waypoints.

- - -

Note we assume a very specific number and type of waypoints here.

- -

Parameter

-
    -
  • - -

    #table waypoints : -Table with waypoints.

    - -
  • -
-
-
-
-
- - -RAT:_Randomize(value, fac, lower, upper) - -
-
- -

Randomize a value by a certain amount.

- -

Parameters

-
    -
  • - -

    #number value : -The value which should be randomized

    - -
  • -
  • - -

    #number fac : -Randomization factor.

    - -
  • -
  • - -

    #number lower : -(Optional) Lower limit of the returned value.

    - -
  • -
  • - -

    #number upper : -(Optional) Upper limit of the returned value.

    - -
  • -
-

Return value

- -

#number: -Randomized value.

- -

Usages:

-
    -
  • _Randomize(100, 0.1) returns a value between 90 and 110, i.e. a plus/minus ten percent variation.
  • -
  • _Randomize(100, 0.5, nil, 120) returns a value between 50 and 120, i.e. a plus/minus fivty percent variation with upper bound 120.
  • -
- -
-
-
-
- - -RAT:_Respawn(group) - -
-
- -

Respawn a group.

- -

Parameter

- -
-
-
-
- - -RAT:_Routeinfo(waypoints, comment) - -
-
- -

Provide information about the assigned flightplan.

- -

Parameters

-
    -
  • - -

    #table waypoints : -Waypoints of the flight plan.

    - -
  • -
  • - -

    #string comment : -Some comment to identify the provided information.

    - -
  • -
-

Return value

- -

#number: -total Total route length in meters.

- -
-
-
-
- - -RAT:_SetCoalitionTable() - -
-
- -

Create a table with the valid coalitions for departure and destination airports.

- -
-
-
-
- - -RAT:_SetMarker(text, wp) - -
-
- -

Set a marker visible for all on the F10 map.

- -

Parameters

-
    -
  • - -

    #string text : -Info text displayed at maker.

    - -
  • -
  • - -

    #table wp : -Position of marker coming in as waypoint, i.e. has x, y and alt components.

    - -
  • -
-
-
-
-
- - -RAT:_SetROE(group, roe) - -
-
- -

Set ROE for a group.

- -

Parameters

-
    -
  • - -

    Wrapper.Group#GROUP group : -Group for which the ROE is set.

    - -
  • -
  • - -

    #string roe : -ROE of group.

    - -
  • -
-
-
-
-
- - -RAT:_SetROT(group, rot) - -
-
- -

Set ROT for a group.

- -

Parameters

-
    -
  • - -

    Wrapper.Group#GROUP group : -Group for which the ROT is set.

    - -
  • -
  • - -

    #string rot : -ROT of group.

    - -
  • -
-
-
-
-
- - -RAT:_SetRoute(Takeoff, _departure, _destination, takeoff) - -
-
- -

Set the route of the AI plane.

- - -

Due to DCS landing bug, this has to be done before the unit is spawned.

- -

Parameters

- -

Return values

-
    -
  1. - -

    Wrapper.Airport#AIRBASE: -Departure airbase.

    - -
  2. -
  3. - -

    Wrapper.Airport#AIRBASE: -Destination airbase.

    - -
  4. -
  5. - -

    #table: -Table of flight plan waypoints.

    - -
  6. -
-
-
-
-
- - -RAT:_SetStatus(group, status) - -
-
- -

Set status of group.

- -

Parameters

-
    -
  • - -

    group :

    - -
  • -
  • - -

    status :

    - -
  • -
-
-
-
-
- - -RAT:_SpawnWithRoute(_departure, _destination) - -
-
- -

Spawn the AI aircraft with a route.

- - -

Sets the departure and destination airports and waypoints. -Modifies the spawn template. -Sets ROE/ROT. -Initializes the ratcraft array and group menu.

- -

Parameters

-
    -
  • - -

    #string _departure : -(Optional) Name of departure airbase.

    - -
  • -
  • - -

    #string _destination : -(Optional) Name of destination airbase.

    - -
  • -
-
-
-
-
- - -RAT:_TaskHolding(P1, Altitude, Speed, Duration) - -
-
- -

Orbit at a specified position at a specified alititude with a specified speed.

- -

Parameters

-
    -
  • - -

    Dcs.DCSTypes#Vec2 P1 : -The point to hold the position.

    - -
  • -
  • - -

    #number Altitude : -The altitude ASL at which to hold the position.

    - -
  • -
  • - -

    #number Speed : -The speed flying when holding the position in m/s.

    - -
  • -
  • - -

    #number Duration : -Duration of holding pattern in seconds.

    - -
  • -
-

Return value

- -

Dcs.DCSTasking.Task#Task: -DCSTask

- -
-
-
-
- - -RAT:_Waypoint(Type, Coord, Speed, Altitude, Airport) - -
-
- -

Create a waypoint that can be used with the Route command.

- -

Parameters

-
    -
  • - -

    #number Type : -Type of waypoint.

    - -
  • -
  • - -

    Core.Point#COORDINATE Coord : -3D coordinate of the waypoint.

    - -
  • -
  • - -

    #number Speed : -Speed in m/s.

    - -
  • -
  • - -

    #number Altitude : -Altitude in m.

    - -
  • -
  • - -

    Wrapper.Airbase#AIRBASE Airport : -Airport of object to spawn.

    - -
  • -
-

Return value

- -

#table: -Waypoints for DCS task route or spawn template.

- -
-
-
-
- - #table - -RAT.aircraft - -
-
- - - -
-
-
-
- - #table - -RAT.airports - -
-
- - - -
-
-
-
- - #table - -RAT.airports_map - -
-
- - - -
-
-
-
- - #number - -RAT.alive - -
-
- - - -
-
-
-
- - #RAT - -RAT.cat - -
-
- -

RAT categories.

- -
-
-
-
- - #string - -RAT.category - -
-
- - - -
-
-
-
- - #RAT - -RAT.coal - -
-
- -

RAT friendly coalitions.

- -
-
-
-
- - #number - -RAT.coalition - -
-
- - - -
-
-
-
- - #boolean - -RAT.commute - -
-
- - - -
-
-
-
- - #boolean - -RAT.continuejourney - -
-
- - - -
-
-
-
- - #table - -RAT.ctable - -
-
- - - -
-
-
-
- - #boolean - -RAT.debug - -
-
- - - -
-
-
-
- - #table - -RAT.departure_ports - -
-
- - - -
-
-
-
- - #table - -RAT.departure_zones - -
-
- - - -
-
-
-
- - #table - -RAT.destination_ports - -
-
- - - -
-
-
-
- - #boolean - -RAT.f10menu - -
-
- - - -
-
-
-
- - #string - -RAT.friendly - -
-
- - - -
-
-
-
- - #RAT - -RAT.markerid - -
-
- -

Running number of placed markers on the F10 map.

- -
-
-
-
- - #table - -RAT.markerids - -
-
- - - -
-
-
-
- - #number - -RAT.maxdist - -
-
- - - -
-
-
-
- - #number - -RAT.mindist - -
-
- - - -
-
-
-
- - #boolean - -RAT.placemarkers - -
-
- - - -
-
-
-
- - #boolean - -RAT.random_departure - -
-
- - - -
-
-
-
- - #boolean - -RAT.random_destination - -
-
- - - -
-
-
-
- - #table - -RAT.ratcraft - -
-
- - - -
-
-
-
- - #boolean - -RAT.reportstatus - -
-
- - - -
-
-
-
- - #boolean - -RAT.respawn_after_landing - -
-
- - - -
-
-
-
- - #number - -RAT.respawn_delay - -
-
- - - -
-
-
-
- - #string - -RAT.roe - -
-
- - - -
-
-
-
- - #string - -RAT.rot - -
-
- - - -
-
-
-
- - #number - -RAT.spawndelay - -
-
- - - -
-
-
-
- - #number - -RAT.spawninterval - -
-
- - - -
-
-
-
- - #number - -RAT.statusinterval - -
-
- - - -
-
-
-
- - #string - -RAT.takeoff - -
-
- - - -
-
-
-
- - #RAT - -RAT.unit - -
-
- -

RAT unit conversions.

- -
-
-
-
- - #RAT - -RAT.wp - -
-
- -

RAT waypoint type.

- -
-
- -

Type list

- -
- -
- - From d29d959e47f89f945fa7cce1c09e3bb58baa4221 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Wed, 13 Sep 2017 16:48:00 +0200 Subject: [PATCH 2/9] Added livery and skill options (untested) --- Moose Development/Moose/Functional/RAT.lua | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index 4d7da7fcf..9eb5545e0 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -103,6 +103,8 @@ -- @field #boolean respawn_at_landing Respawn aircraft the moment they land rather than at engine shutdown. -- @field #number respawn_delay Delay in seconds until repawn happens after landing. -- @field #table markerids Array with marker IDs. +-- @field #string livery Livery of the aircraft set by user. +-- @field #string skill Skill of AI. -- @extends Functional.Spawn#SPAWN ---# RAT class, extends @{Spawn#SPAWN} @@ -122,7 +124,7 @@ -- ### The default behavior can be changed: -- -- * A specific departure and/or destination airport can be chosen. --- * Valid coalitions can be set, e.g. only red, blue or neutral, all three �colours�. +-- * Valid coalitions can be set, e.g. only red, blue or neutral, all three "colours". -- * It is possible to start in air within a zone defined in the mission editor or within a zone above an airport of the map. -- -- ## Flight Plan @@ -151,7 +153,7 @@ -- * Give the group a good name. In the example above the group is named "RAT_YAK". -- * Activate the "LATE ACTIVATION" tick box. Note that this aircraft will not be spawned itself but serves a template for each RAT aircraft spawned when the mission starts. -- --- Voil�, your already done! +-- Voilà, your already done! -- -- Optionally, you can set a specific livery for the aircraft or give it some weapons. -- However, the aircraft will by default not engage any enemies. Think of them as beeing on a peaceful or ferry mission. @@ -280,6 +282,8 @@ RAT={ respawn_at_landing=false, -- Respawn aircraft the moment they land rather than at engine shutdown. respawn_delay=nil, -- Delay in seconds until repawn happens after landing. markerids={}, -- Array with marker IDs. + livery=nil, -- Livery of the aircraft. + skill="High", -- Skill of AI. } ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -671,6 +675,16 @@ function RAT:SetDestination(names) end +--- Set livery of aircraft. If more than one livery is specified in a table, the actually used one is chosen randomly from the selection. +-- @param #RAT self +-- @param #string skins Name of livery or table of names of liveries. +function RAT:Livery(skins) + if type(skins)=="string" then + local skins={skins} + end +end + + --- Aircraft will continue their journey from their destination. This means they are respawned at their destination and get a new random destination. -- @param #RAT self -- @param #boolean switch Turn journey on=true or off=false. If no value is given switch=true. @@ -2304,6 +2318,16 @@ function RAT:_ModifySpawnTemplate(waypoints) SpawnTemplate.units[UnitID].y = TY SpawnTemplate.units[UnitID].alt = PointVec3.y SpawnTemplate.units[UnitID].heading = math.rad(heading) + -- Set another livery. + if self.livery then + SpawnTemplate.units[UnitID].livery_id = self.livery[math.random(#self.livery)] + end + -- Set AI skill. + SpawnTemplate.units[UnitID]["skill"] = self.skill + -- Onboard number. + SpawnTemplate.units[UnitID]["onboard_num"] = self.SpawnIndex + -- Parking spot. + --SpawnTemplate.units[UnitID]["parking"]=19 self:T('After Translation SpawnTemplate.units['..UnitID..'].x = '..SpawnTemplate.units[UnitID].x..', SpawnTemplate.units['..UnitID..'].y = '..SpawnTemplate.units[UnitID].y) end From ae2be627e322e7c2dbd3675a0239b36b35f6a55c Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Thu, 14 Sep 2017 00:37:26 +0200 Subject: [PATCH 3/9] Added function to spawn without template (no working yet). --- Moose Development/Moose/Functional/RAT.lua | 232 +++++++++++++++------ 1 file changed, 165 insertions(+), 67 deletions(-) diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index 9eb5545e0..9bf515363 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -680,7 +680,9 @@ end -- @param #string skins Name of livery or table of names of liveries. function RAT:Livery(skins) if type(skins)=="string" then - local skins={skins} + self.livery={skins} + else + self.livery=skins end end @@ -2283,71 +2285,6 @@ end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---- Modifies the template of the group to be spawned. --- In particular, the waypoints of the group's flight plan are copied into the spawn template. --- This allows to spawn at airports and also land at other airports, i.e. circumventing the DCS "landing bug". --- @param #RAT self --- @param #table waypoints The waypoints of the AI flight plan. -function RAT:_ModifySpawnTemplate(waypoints) - - -- The 3D vector of the first waypoint, i.e. where we actually spawn the template group. - local PointVec3 = {x=waypoints[1].x, y=waypoints[1].alt, z=waypoints[1].y} - - -- Heading from first to seconds waypoints to align units in case of air start. - local heading = self:_Course(waypoints[1], waypoints[2]) - - if self:_GetSpawnIndex(self.SpawnIndex+1) then - - -- Get copy of spawn template. - local SpawnTemplate = self.SpawnGroups[self.SpawnIndex].SpawnTemplate - - if SpawnTemplate then - self:T(SpawnTemplate) - - -- Translate the position of the Group Template to the Vec3. - for UnitID = 1, #SpawnTemplate.units do - self:T('Before Translation SpawnTemplate.units['..UnitID..'].x = '..SpawnTemplate.units[UnitID].x..', SpawnTemplate.units['..UnitID..'].y = '..SpawnTemplate.units[UnitID].y) - local UnitTemplate = SpawnTemplate.units[UnitID] - local SX = UnitTemplate.x - local SY = UnitTemplate.y - local BX = SpawnTemplate.route.points[1].x - local BY = SpawnTemplate.route.points[1].y - local TX = PointVec3.x + (SX-BX) - local TY = PointVec3.z + (SY-BY) - SpawnTemplate.units[UnitID].x = TX - SpawnTemplate.units[UnitID].y = TY - SpawnTemplate.units[UnitID].alt = PointVec3.y - SpawnTemplate.units[UnitID].heading = math.rad(heading) - -- Set another livery. - if self.livery then - SpawnTemplate.units[UnitID].livery_id = self.livery[math.random(#self.livery)] - end - -- Set AI skill. - SpawnTemplate.units[UnitID]["skill"] = self.skill - -- Onboard number. - SpawnTemplate.units[UnitID]["onboard_num"] = self.SpawnIndex - -- Parking spot. - --SpawnTemplate.units[UnitID]["parking"]=19 - self:T('After Translation SpawnTemplate.units['..UnitID..'].x = '..SpawnTemplate.units[UnitID].x..', SpawnTemplate.units['..UnitID..'].y = '..SpawnTemplate.units[UnitID].y) - end - - -- Copy waypoints into spawntemplate. By this we avoid the nasty DCS "landing bug" :) - for i,wp in ipairs(waypoints) do - SpawnTemplate.route.points[i]=wp - end - - -- Also modify x,y of the template. Not sure why. - SpawnTemplate.x = PointVec3.x - SpawnTemplate.y = PointVec3.z - --SpawnTemplate.uncontrolled=true - - -- Update modified template for spawn group. - self.SpawnGroups[self.SpawnIndex].SpawnTemplate=SpawnTemplate - - self:T(SpawnTemplate) - end - end -end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2639,4 +2576,165 @@ function RAT:_DeleteMarkers() --self:E({"self ids after: ", self.markerids}) end -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file +--- Utility function which checks if table contains a specific value. +-- @param #RAT self +-- @param #table tab Table with elements to check. +-- @param #string val The value we are looking for. +-- @return #boolean True if element in the list, false otherwise. +function RAT:has_value (tab, val) + for _,value in pairs(tab) do + if value == val then + return true + end + end + return false +end + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +--- Modifies the template of the group to be spawned. +-- In particular, the waypoints of the group's flight plan are copied into the spawn template. +-- This allows to spawn at airports and also land at other airports, i.e. circumventing the DCS "landing bug". +-- @param #RAT self +-- @param #table waypoints The waypoints of the AI flight plan. +function RAT:_ModifySpawnTemplate(waypoints) + + -- The 3D vector of the first waypoint, i.e. where we actually spawn the template group. + local PointVec3 = {x=waypoints[1].x, y=waypoints[1].alt, z=waypoints[1].y} + + -- Heading from first to seconds waypoints to align units in case of air start. + local heading = self:_Course(waypoints[1], waypoints[2]) + + if self:_GetSpawnIndex(self.SpawnIndex+1) then + + + local scratch=false + local SpawnTemplate + if not scratch then + -- Get copy of spawn template. + SpawnTemplate = self.SpawnGroups[self.SpawnIndex].SpawnTemplate + else + SpawnTemplate=self:_InitSpawnTemplate() + end + + if SpawnTemplate then + self:T(SpawnTemplate) + + -- Translate the position of the Group Template to the Vec3. + for UnitID = 1, #SpawnTemplate.units do + self:T('Before Translation SpawnTemplate.units['..UnitID..'].x = '..SpawnTemplate.units[UnitID].x..', SpawnTemplate.units['..UnitID..'].y = '..SpawnTemplate.units[UnitID].y) + + -- Tranlate position. + local UnitTemplate = SpawnTemplate.units[UnitID] + local SX = UnitTemplate.x + local SY = UnitTemplate.y + local BX = SpawnTemplate.route.points[1].x + local BY = SpawnTemplate.route.points[1].y + local TX = PointVec3.x + (SX-BX) + local TY = PointVec3.z + (SY-BY) + SpawnTemplate.units[UnitID].x = TX + SpawnTemplate.units[UnitID].y = TY + SpawnTemplate.units[UnitID].alt = PointVec3.y + SpawnTemplate.units[UnitID].heading = math.rad(heading) + + -- Set another livery. + env.info("Livery template:"..SpawnTemplate.units[UnitID].livery_id) + if self.livery then + local skin=self.livery[math.random(#self.livery)] + if not (skin:lower()=="default" or skin:lower()=="template") then + SpawnTemplate.units[UnitID].livery_id = self.livery[math.random(#self.livery)] + end + env.info("Livery modified:"..SpawnTemplate.units[UnitID].livery_id) + end + + SpawnTemplate.units[UnitID]["type"] = "Tu-142" + + -- Set AI skill. + SpawnTemplate.units[UnitID]["skill"] = self.skill + + -- Onboard number. + SpawnTemplate.units[UnitID]["onboard_num"] = self.SpawnIndex + + -- Parking spot. + --SpawnTemplate.units[UnitID]["parking"]=19 + self:T('After Translation SpawnTemplate.units['..UnitID..'].x = '..SpawnTemplate.units[UnitID].x..', SpawnTemplate.units['..UnitID..'].y = '..SpawnTemplate.units[UnitID].y) + + end + + -- Copy waypoints into spawntemplate. By this we avoid the nasty DCS "landing bug" :) + for i,wp in ipairs(waypoints) do + SpawnTemplate.route.points[i]=wp + end + + -- Also modify x,y of the template. Not sure why. + SpawnTemplate.x = PointVec3.x + SpawnTemplate.y = PointVec3.z + --SpawnTemplate.uncontrolled=true + + -- Update modified template for spawn group. + self.SpawnGroups[self.SpawnIndex].SpawnTemplate=SpawnTemplate + + self:T(SpawnTemplate) + end + end +end + +--- Set up the basic spawn template. +-- @param #RAT self +function RAT:_InitSpawnTemplate() + local template = + { + ["modulation"] = 0, + ["tasks"] = {}, + ["task"] = "Transport", + ["uncontrolled"] = false, + ["route"] = + { + ["points"] = {}, + }, + ["groupId"] = 1, + ["hidden"] = false, + ["y"] = 0, + ["x"] = 0, + ["name"] = "DictKey_GroupName_5", + ["communication"] = true, + ["start_time"] = 0, + ["frequency"] = 251, + ["units"] = {}, -- end of ["units"] + } + return template +end + +--- Initialize a unit of the spawn template. +-- @param #RAT self +function RAT:_InitSpawnUnit() + local unit = + { + ["country"]=country.id.USA, + ["name"] = "DictKey_UnitName_6", + ["alt"] = 30, + ["alt_type"] = "BARO", + ["livery_id"] = "Aeroflot", + ["skill"] = "High", + ["parking"] = "31", + ["speed"] = 0, + ["type"] = "Yak-40", + ["unitId"] = 1, + ["psi"] = 0, --3.1270847373636 + ["parking_id"] = "23", + ["x"] = 0, + ["y"] = 0, + ["heading"] = 0, + ["callsign"] = 101, + ["onboard_num"] = "010", + ["payload"] = + { + ["pylons"] = {}, + ["fuel"] = "3080", + ["flare"] = 0, + ["chaff"] = 0, + ["gun"] = 100, + }, -- end of ["payload"] + } + return unit +end \ No newline at end of file From 6b08f6aaaca1204dcf0ab51da4e26cd68a975027 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Thu, 14 Sep 2017 00:44:09 +0200 Subject: [PATCH 4/9] Bloody html --- .gitignore | 1 + docs/Documentation/Account.html | 26 +-- docs/Documentation/Assign.html | 6 +- docs/Documentation/Cargo.html | 1 + docs/Documentation/CommandCenter.html | 76 +++++++- docs/Documentation/Designate.html | 5 +- docs/Documentation/Detection.html | 22 +-- docs/Documentation/Message.html | 252 ++++++++++++++++++++++++- docs/Documentation/Mission.html | 17 +- docs/Documentation/Point.html | 261 +++++++++++++++++++++++++- docs/Documentation/Positionable.html | 137 ++++++++++++++ docs/Documentation/Route.html | 16 +- docs/Documentation/Set.html | 72 +++++++ docs/Documentation/Settings.html | 175 +++++++++++++++++ docs/Documentation/Spawn.html | 27 +-- docs/Documentation/Spot.html | 4 + docs/Documentation/Task_Cargo.html | 2 +- 17 files changed, 996 insertions(+), 104 deletions(-) diff --git a/.gitignore b/.gitignore index 135102f04..ec71258a4 100644 --- a/.gitignore +++ b/.gitignore @@ -221,3 +221,4 @@ _gsdata_/ .gitattributes .gitignore Moose Test Missions/MOOSE_Test_Template.miz +*.html diff --git a/docs/Documentation/Account.html b/docs/Documentation/Account.html index 24ae8f028..67a542954 100644 --- a/docs/Documentation/Account.html +++ b/docs/Documentation/Account.html @@ -245,19 +245,19 @@ - ACT_ACCOUNT_DEADS:onafterEvent(ProcessClient, Task, From, Event, To, EventData) + ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Task, From, Event, To, EventData)

StateMachine callback function

- ACT_ACCOUNT_DEADS:onenterAccountForOther(ProcessClient, Task, From, Event, To, EventData) + ACT_ACCOUNT_DEADS:onenterAccountForOther(ProcessUnit, Task, From, Event, To, EventData)

StateMachine callback function

- ACT_ACCOUNT_DEADS:onenterAccountForPlayer(ProcessClient, Task, From, Event, To, EventData) + ACT_ACCOUNT_DEADS:onenterAccountForPlayer(ProcessUnit, Task, From, Event, To, EventData)

StateMachine callback function

@@ -444,7 +444,7 @@ There are 2 moments when state transition methods will be called by the state ma
diff --git a/docs/Documentation/Designate.html b/docs/Documentation/Designate.html index acd9d1911..8ecc57ea8 100644 --- a/docs/Documentation/Designate.html +++ b/docs/Documentation/Designate.html @@ -1097,7 +1097,7 @@ function below will use the range 1-7 just in case

- + #number DESIGNATE.LaseDuration @@ -1151,10 +1151,7 @@ function below will use the range 1-7 just in case

-<<<<<<< HEAD -======= ->>>>>>> master DESIGNATE.LaserCodes diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html index 4c6dc041c..db832f4d5 100644 --- a/docs/Documentation/Detection.html +++ b/docs/Documentation/Detection.html @@ -1062,12 +1062,6 @@ The different values of Unit.Category can be:

DETECTION_BASE.DetectedItem.Set

-- The Set of Units in the detected area.

- - - - DETECTION_BASE.DetectedItem.ThreatLevel - - @@ -4058,7 +4052,7 @@ Return false to cancel Transition.

- + #number DETECTION_BASE.RefreshTimeInterval @@ -5009,20 +5003,6 @@ The To State string.

-- The Set of Units in the detected area.

- -
-
-
- - - -DETECTION_BASE.DetectedItem.ThreatLevel - -
-
- - -
diff --git a/docs/Documentation/Message.html b/docs/Documentation/Message.html index d88a100d0..ec6d862bc 100644 --- a/docs/Documentation/Message.html +++ b/docs/Documentation/Message.html @@ -129,9 +129,27 @@

Type MESSAGE

+ + + + + + + + + + + + @@ -153,13 +171,13 @@ - + - + @@ -171,7 +189,7 @@ - + @@ -180,6 +198,46 @@ + + + + + +
MESSAGE.MessageCategory + +
MESSAGE.MessageDuration + +
MESSAGE:New(MessageText, MessageDuration, MessageCategory)

Creates a new MESSAGE object.

+
MESSAGE:NewType(MessageText, MessageType) +

Creates a new MESSAGE object of a certain type.

MESSAGE:ToClient(Client)MESSAGE:ToClient(Client, Settings)

Sends a MESSAGE to a Client Group.

MESSAGE:ToCoalition(CoalitionSide)MESSAGE:ToCoalition(CoalitionSide, Settings)

Sends a MESSAGE to a Coalition.

MESSAGE:ToGroup(Group)MESSAGE:ToGroup(Group, Settings)

Sends a MESSAGE to a Group.

MESSAGE:ToRed()

Sends a MESSAGE to the Red Coalition.

+
MESSAGE.Type + +
+ +

Type MESSAGE.Type

+ + + + + + + + + + + + + + + + + + + +
MESSAGE.Type.Briefing + +
MESSAGE.Type.Detailed + +
MESSAGE.Type.Information + +
MESSAGE.Type.Overview + +
MESSAGE.Type.Update +
@@ -250,6 +308,33 @@ To send messages, you need to use the To functions.

+ +MESSAGE.MessageCategory + +
+
+ + + +
+
+
+
+ + + +MESSAGE.MessageDuration + +
+
+ + + +
+
+
+
+ MESSAGE:New(MessageText, MessageDuration, MessageCategory) @@ -303,6 +388,50 @@ MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25
+ +MESSAGE:NewType(MessageText, MessageType) + +
+
+ +

Creates a new MESSAGE object of a certain type.

+ + +

Note that these MESSAGE objects are not yet displayed on the display panel. +You must use the functions ToClient or ToCoalition or ToAll to send these Messages to the respective recipients. +The message display times are automatically defined based on the timing settings in the Settings menu.

+ +

Parameters

+
    +
  • + +

    #string MessageText : +is the text of the Message.

    + +
  • +
  • + +

    #MESSAGE.Type MessageType : +The type of the message.

    + +
  • +
+

Return value

+ +

#MESSAGE:

+ + +

Usage:

+
  MessageAll = MESSAGE:NewType( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", MESSAGE.Type.Information )
+  MessageRED = MESSAGE:NewType( "To the RED Players: You receive a penalty because you've killed one of your own units", MESSAGE.Type.Information )
+  MessageClient1 = MESSAGE:NewType( "Congratulations, you've just hit a target", MESSAGE.Type.Update )
+  MessageClient2 = MESSAGE:NewType( "Congratulations, you've just killed a target", MESSAGE.Type.Update )
+ +
+
+
+
+ MESSAGE:ToAll() @@ -384,7 +513,7 @@ MessageBLUE:ToBlue()
-MESSAGE:ToClient(Client) +MESSAGE:ToClient(Client, Settings)
@@ -394,13 +523,18 @@ MessageBLUE:ToBlue()

Note that the Group needs to be defined within the ME with the skillset "Client" or "Player".

-

Parameter

+

Parameters

Return value

@@ -430,20 +564,25 @@ MessageClient2:ToClient( ClientGroup )
-MESSAGE:ToCoalition(CoalitionSide) +MESSAGE:ToCoalition(CoalitionSide, Settings)

Sends a MESSAGE to a Coalition.

-

Parameter

+

Parameters

  • CoalitionSide : needs to be filled out by the defined structure of the standard scripting engine coalition.side.

    +
  • +
  • + +

    Settings :

    +

Return value

@@ -498,20 +637,25 @@ needs to be filled out by the defined structure of the standard scripting engine
-MESSAGE:ToGroup(Group) +MESSAGE:ToGroup(Group, Settings)

Sends a MESSAGE to a Group.

-

Parameter

+

Parameters

Return value

@@ -546,6 +690,96 @@ or MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ) MessageRED:ToRed() +
+
+
+
+ + #MESSAGE.Type + +MESSAGE.Type + +
+
+ + + +
+
+ +

Type MESSAGE.Type

+ +

Message Types

+ +

Field(s)

+
+
+ + #string + +MESSAGE.Type.Briefing + +
+
+ + + +
+
+
+
+ + #string + +MESSAGE.Type.Detailed + +
+
+ + + +
+
+
+
+ + #string + +MESSAGE.Type.Information + +
+
+ + + +
+
+
+
+ + #string + +MESSAGE.Type.Overview + +
+
+ + + +
+
+
+
+ + #string + +MESSAGE.Type.Update + +
+
+ + +
diff --git a/docs/Documentation/Mission.html b/docs/Documentation/Mission.html index 97e6fddff..9fc977939 100644 --- a/docs/Documentation/Mission.html +++ b/docs/Documentation/Mission.html @@ -619,7 +619,7 @@ MISSION:onenterCOMPLETED(From, Event, To) - +

FSM function for a MISSION

@@ -2731,30 +2731,23 @@ The delay in seconds.

- - - -

FSM function for a MISSION - @param #MISSION self - @param #string From - @param #string Event - @param #string To

+

FSM function for a MISSION

Parameters

  • -

    From :

    +

    #string From :

  • -

    Event :

    +

    #string Event :

  • -

    To :

    +

    #string To :

diff --git a/docs/Documentation/Point.html b/docs/Documentation/Point.html index 0126c087e..496131c9a 100644 --- a/docs/Documentation/Point.html +++ b/docs/Documentation/Point.html @@ -268,12 +268,30 @@ COORDINATE:GetDistanceText(Distance, Settings)

Provides a distance text expressed in the units of measurement.

+ + + + COORDINATE:GetHeading() + +

Get the heading of the coordinate, if applicable.

+ + + + COORDINATE:GetHeadingText(Settings) + +

Return the heading text of the COORDINATE.

COORDINATE:GetLandHeight()

Return the height of the land at the coordinate.

+ + + + COORDINATE:GetMovingText(Settings) + +

Return velocity text of the COORDINATE.

@@ -304,6 +322,24 @@ COORDINATE:GetVec3()

Return the coordinates of the COORDINATE in Vec3 format.

+ + + + COORDINATE:GetVelocity() + +

Return the velocity of the COORDINATE.

+ + + + COORDINATE:GetVelocityText(Settings) + +

Return the velocity text of the COORDINATE.

+ + + + COORDINATE.Heading + + @@ -340,6 +376,12 @@ COORDINATE:MarkToCoalitionRed(MarkText)

Mark to Red Coalition

+ + + + COORDINATE:MarkToGroup(MarkText, MarkGroup) + +

Mark to Group

@@ -369,7 +411,13 @@ COORDINATE:SetHeading(Heading) - +

Set the heading of the coordinate, if applicable.

+ + + + COORDINATE:SetVelocity(Velocity) + +

Set the velocity of the COORDINATE.

@@ -480,6 +528,12 @@ COORDINATE:Translate(Distance, Angle)

Add a Distance in meters from the COORDINATE orthonormal plane, with the given angle, and calculate the new COORDINATE.

+ + + + COORDINATE.Velocity + + @@ -1572,6 +1626,50 @@ The distance text expressed in the units of measurement.

+ +COORDINATE:GetHeading() + +
+
+ +

Get the heading of the coordinate, if applicable.

+ +

Return value

+ +

#number: +or nil

+ +
+
+
+
+ + +COORDINATE:GetHeadingText(Settings) + +
+
+ +

Return the heading text of the COORDINATE.

+ +

Parameter

+
    +
  • + +

    Settings :

    + +
  • +
+

Return value

+ +

#string: +Heading text.

+ +
+
+
+
+ COORDINATE:GetLandHeight() @@ -1585,6 +1683,32 @@ The distance text expressed in the units of measurement.

#number:

+
+
+
+
+ + +COORDINATE:GetMovingText(Settings) + +
+
+ +

Return velocity text of the COORDINATE.

+ +

Parameter

+
    +
  • + +

    Settings :

    + +
  • +
+

Return value

+ +

#string:

+ +
@@ -1701,6 +1825,64 @@ The Vec2 format coordinate.

Dcs.DCSTypes#Vec3: The Vec3 format coordinate.

+ +
+
+
+ + +COORDINATE:GetVelocity() + +
+
+ +

Return the velocity of the COORDINATE.

+ +

Return value

+ +

#number: +Velocity in meters per second.

+ +
+
+
+
+ + +COORDINATE:GetVelocityText(Settings) + +
+
+ +

Return the velocity text of the COORDINATE.

+ +

Parameter

+
    +
  • + +

    Settings :

    + +
  • +
+

Return value

+ +

#string: +Velocity text.

+ +
+
+
+
+ + + +COORDINATE.Heading + +
+
+ + +
@@ -1874,6 +2056,44 @@ The resulting Mark ID which is a number.

+ +COORDINATE:MarkToGroup(MarkText, MarkGroup) + +
+
+ +

Mark to Group

+ +

Parameters

+
    +
  • + +

    #string MarkText : +Free format text that shows the marking clarification.

    + +
  • +
  • + +

    Wrapper.Group#GROUP MarkGroup : +The Group that receives the mark.

    + +
  • +
+

Return value

+ +

#number: +The resulting Mark ID which is a number.

+ +

Usage:

+
  local TargetCoord = TargetGroup:GetCoordinate()
+  local MarkGroup = GROUP:FindByName( "AttackGroup" )
+  local MarkID = TargetCoord:MarkToGroup( "This is a target for the attack group", AttackGroup )
+ +
+
+
+
+ COORDINATE:New(x, y, z) @@ -2008,7 +2228,7 @@ The ID of the mark to be removed.

- +

Set the heading of the coordinate, if applicable.

Parameter

+
+
+
+ + + +COORDINATE.Velocity + +
+
+ + +
@@ -3139,6 +3395,7 @@ The y coordinate.

+ POINT_VEC2.z diff --git a/docs/Documentation/Positionable.html b/docs/Documentation/Positionable.html index b5c697006..e531312d4 100644 --- a/docs/Documentation/Positionable.html +++ b/docs/Documentation/Positionable.html @@ -246,6 +246,12 @@ POSITIONABLE:GetMessageText(Message, Name)

Returns the message text with the callsign embedded (if there is one).

+ + + + POSITIONABLE:GetMessageType(Message, MessageType, Name) + +

Returns a message of a specified type with the callsign embedded (if there is one).

@@ -402,6 +408,18 @@ POSITIONABLE:MessageToSetGroup(Message, Duration, MessageSetGroup, Name)

Send a message to a Set#SET_GROUP.

+ + + + POSITIONABLE:MessageTypeToCoalition(Message, MessageType, MessageCoalition) + +

Send a message to a coalition.

+ + + + POSITIONABLE:MessageTypeToGroup(Message, MessageType, MessageGroup, Name) + +

Send a message of a message type to a Group.

@@ -912,6 +930,45 @@ The message text

#string: The message text

+ +
+
+
+ + +POSITIONABLE:GetMessageType(Message, MessageType, Name) + +
+
+ +

Returns a message of a specified type with the callsign embedded (if there is one).

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Core.Message#MESSAGE MessageType : +MessageType The message type.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+

Return value

+ +

Core.Message#MESSAGE:

+ +
@@ -1685,6 +1742,86 @@ The SET_GROUP collection receiving the message.

+ +POSITIONABLE:MessageTypeToCoalition(Message, MessageType, MessageCoalition) + +
+
+ +

Send a message to a coalition.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+ +
+
+
+
+ + +POSITIONABLE:MessageTypeToGroup(Message, MessageType, MessageGroup, Name) + +
+
+ +

Send a message of a message type to a Group.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Core.Message#MESSAGE.Type MessageType : +The message type that determines the duration.

    + +
  • +
  • + +

    Wrapper.Group#GROUP MessageGroup : +The GROUP object receiving the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+
+
+
+
+ POSITIONABLE:New(PositionableName) diff --git a/docs/Documentation/Route.html b/docs/Documentation/Route.html index 7b9c61985..2874fa7d7 100644 --- a/docs/Documentation/Route.html +++ b/docs/Documentation/Route.html @@ -617,7 +617,7 @@ Upon arrival at the zone, a confirmation of arrival is sent, and the process wil @@ -809,7 +809,7 @@ self

+
+
+ + +SETTINGS:MenuMessageTimingsSystem(MenuGroup, RootMenu, MessageType, MessageTime) + +
+
+ + + +

Parameters

+
    +
  • + +

    MenuGroup :

    + +
  • +
  • + +

    RootMenu :

    + +
  • +
  • + +

    MessageType :

    + +
  • +
  • + +

    MessageTime :

    + +
  • +
+
+
+
+
+ + +SETTINGS.MessageTypeTimings + +
+
+ + +
@@ -1406,6 +1553,34 @@ true if metric.

+ +SETTINGS:SetMessageTime(MessageType, MessageTime) + +
+
+ +

Sets the SETTINGS Message Display Timing of a MessageType

+ +

Parameters

+
    +
  • + +

    Core.Message#MESSAGE MessageType : +The type of the message.

    + +
  • +
  • + +

    #number MessageTime : +The display time duration in seconds of the MessageType.

    + +
  • +
+
+
+
+
+ SETTINGS:SetMetric() diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index 7608c3d05..66659d03f 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -823,12 +823,6 @@ and any spaces before and after the resulting name are removed.

SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) - - - - SPAWN.uncontrolled - - @@ -2739,9 +2733,6 @@ when nothing was spawned.

- -

Overwrite unit names by default with group name.

-
@@ -3139,7 +3130,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
- + #boolean SPAWN.SpawnUnControlled @@ -3163,7 +3154,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 ) -

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

+

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

@@ -3743,20 +3734,6 @@ True = Continue Scheduler

- -
-
-
- - - -SPAWN.uncontrolled - -
-
- - -
diff --git a/docs/Documentation/Spot.html b/docs/Documentation/Spot.html index f7f4e87fa..47f777855 100644 --- a/docs/Documentation/Spot.html +++ b/docs/Documentation/Spot.html @@ -766,6 +766,7 @@ true if it is lasing

+ SPOT.ScheduleID @@ -779,6 +780,7 @@ true if it is lasing

+ SPOT.SpotIR @@ -792,6 +794,7 @@ true if it is lasing

+ SPOT.SpotLaser @@ -805,6 +808,7 @@ true if it is lasing

+ SPOT.Target diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html index c7e689347..0414583bc 100644 --- a/docs/Documentation/Task_Cargo.html +++ b/docs/Documentation/Task_Cargo.html @@ -631,7 +631,7 @@ based on the tasking capabilities defined in Task#TA
- + #number TASK_CARGO.CargoLimit From 27e32486fd94135f53f66a908fc5c3a720ce27f2 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Thu, 14 Sep 2017 00:45:36 +0200 Subject: [PATCH 5/9] remove RAT.html --- docs/Documentation/RAT.html | 3424 ----------------------------------- 1 file changed, 3424 deletions(-) delete mode 100644 docs/Documentation/RAT.html diff --git a/docs/Documentation/RAT.html b/docs/Documentation/RAT.html deleted file mode 100644 index cbbba2eb8..000000000 --- a/docs/Documentation/RAT.html +++ /dev/null @@ -1,3424 +0,0 @@ - - - - - - -
-
- -
-
-
-
- -
-

Module Rat

- -
    -
  • Functional - Create random airtraffic in your missions.
  • -
- - -

-Banner Image

- -
- -

The aim of the RAT class is to fill the empty DCS world with randomized air traffic and bring more life to your airports.

- -

In particular, it is designed to spawn AI air units at random airports. These units will be assigned a random flight path to another random airport on the map.

- -

Even the mission designer will not know where aircraft will be spawned and which route they follow.

- -

Features

- -
    -
  • Very simple interface. Just one unit and two lines of Lua code needed to fill your map.
  • -
  • High degree of randomization. Aircraft will spawn at random airports, have random routes and random destinations.
  • -
  • Specific departure and/or destination airports can be chosen.
  • -
  • Departure and destination airports can be restricted by coalition.
  • -
  • Planes and helicopters supported. Helicopters can also be send to FARPs and ships.
  • -
  • Units can also be spawned in air within pre-defined zones of the map.
  • -
  • Aircraft will be removed when they arrive at their destination (or get stuck on the ground).
  • -
  • When a unit is removed a new unit with a different flight plan is respawned.
  • -
  • Aircraft can report their status during the route.
  • -
  • All of the above can be customized by the user if necessary.
  • -
  • Can be used on all current (Caucasus, Nevada, Normandy) and future maps.
  • -
- -

The RAT class creates an entry in the F10 menu which allows to

- -
    -
  • Create new groups on-the-fly, i.e. at run time within the mission,
  • -
  • Destory specific groups (e.g. if they get stuck or damaged and block a runway),
  • -
  • Request the status of all RAT aircraft or individual groups,
  • -
  • Place markers at waypoints on the F10 map for each group.
  • -
- -

Note that by its very nature, this class is suited best for civil or transport aircraft. However, it also works perfectly fine for military aircraft of any kind.

- -
- -

Demo Missions

- -

ALL Demo Missions pack of the last release

- -
- -

YouTube Channel

- -

RAT YouTube Channel

- -
- -

Author: funkyfranky

- -

Contributions: Sven Van de Velde (FlightControl)

- -
- -

Global(s)

- - - - - -
RAT -

RAT class, extends Spawn#SPAWN

-

The RAT class implements an easy to use way to randomly fill your map with AI aircraft.

-
-

Type RAT

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RAT.AlphaDescent -

Default angle of descenti in degrees. A value of 3.6 follows the 3:1 rule of 3 miles of travel and 1000 ft descent.

-
RAT.ClassName -

Name of the Class.

-
RAT:Commute(switch) -

Aircraft will commute between their departure and destination airports.

-
RAT:ContinueJourney(switch) -

Aircraft will continue their journey from their destination.

-
RAT.FLmaxuser -

Maximum flight level set by user.

-
RAT.FLminuser -

Minimum flight level set by user.

-
RAT.FLuser -

Flight level set by users explicitly.

-
RAT.Menu -

F10 menu items for this RAT object.

-
RAT.MenuF10 -

Main F10 menu.

-
RAT:New(groupname) -

Create a new RAT object.

-
RAT:PlaceMarkers(switch) -

Place markers of waypoints on the F10 map.

-
RAT.ROE -

RAT rules of engagement.

-
RAT.ROT -

RAT reaction to threat.

-
RAT:RespawnAfterLanding(delay) -

Make aircraft respawn the moment they land rather than at engine shut down.

-
RAT:SetClimbRate(rate) -

Set the climb rate.

-
RAT:SetCoalition(friendly) -

Set the friendly coalitions from which the airports can be used as departure or destination.

-
RAT:SetDeparture(names) -

Set possible departure ports.

-
RAT:SetDescentAngle(angle) -

Set the angle of descent.

-
RAT:SetDestination(names) -

Set name of destination airport for the AI aircraft.

-
RAT:SetFL(height) -

Set flight level.

-
RAT:SetFLcruise(height) -

Set flight level of cruising part.

-
RAT:SetFLmax(height) -

Set max flight level.

-
RAT:SetFLmin(height) -

Set min flight level.

-
RAT:SetMaxCruiseSpeed(speed) -

Set the maximum cruise speed of the aircraft.

-
RAT:SetMaxDistance(dist) -

Set maximum distance between departure and destination.

-
RAT:SetMinDistance(dist) -

Set minimum distance between departure and destination.

-
RAT:SetROE(roe) -

Set rules of engagement (ROE).

-
RAT:SetROT(rot) -

Set reaction to threat (ROT).

-
RAT:SetSpawnDelay(delay) -

Set the delay before first group is spawned.

-
RAT:SetSpawnInterval(interval) -

Set the interval between spawnings of the template group.

-
RAT:SetTakeoff(type) -

Set takeoff type.

-
RAT:Spawn(naircraft) -

Triggers the spawning of AI aircraft.

-
RAT:Status(message, forID) -

Report status of RAT groups.

-
RAT:StatusReports(switch) -

Aircraft report status messages.

-
RAT.SubMenuName -

Submenu name for RAT object.

-
RAT:TimeDestroyInactive(time) -

Set the time after which inactive groups will be destroyed.

-
RAT.Tinactive -

Time in seconds after which inactive units will be destroyed. Default is 180 seconds.

-
RAT.Vclimb -

Default climb rate in ft/min.

-
RAT.Vcruisemax -

Max cruise speed in m/s (250 m/s = 900 km/h = 486 kt) set by user.

-
RAT:_AirportExists(name) -

Test if an airport exists on the current map.

-
RAT:_Course(a, b) -

Determine the heading from point a to point b.

-
RAT:_Debug(switch) -

Turn debug messages on or off.

-
RAT:_DeleteMarkers(ids) -

Delete all markers on F10 map.

-
RAT:_Despawn(group) -

Despawn unit.

-
RAT:_EngineStartup(EventData) -

Function is executed when a unit starts its engines.

-
RAT:_FLmax(alpha, beta, d, phi, h0) -

Calculate the max flight level for a given distance and fixed climb and descent rates.

-
RAT:_GetAirportsOfCoalition() -

Get all "friendly" airports of the current map.

-
RAT:_GetAirportsOfMap() -

Get all airports of the current map.

-
RAT:_GetDestinations(q, minrange, maxrange) -

Get all possible destination airports depending on departure position.

-
RAT:_GetLife(group) -

Get (relative) life of first unit of a group.

-
RAT:_InitAircraft(DCSgroup) -

Initialize basic parameters of the aircraft based on its (template) group in the mission editor.

-
RAT:_ModifySpawnTemplate(waypoints) -

Modifies the template of the group to be spawned.

-
RAT:_OnBirth(EventData) -

Function is executed when a unit is spawned.

-
RAT:_OnCrash(EventData) -

Function is executed when a unit crashes.

-
RAT:_OnDead(EventData) -

Function is executed when a unit is dead.

-
RAT:_OnEngineShutdown(EventData) -

Function is executed when a unit shuts down its engines.

-
RAT:_OnLand(EventData) -

Function is executed when a unit lands.

-
RAT:_OnTakeoff(EventData) -

Function is executed when a unit takes off.

-
RAT:_PickDeparture(takeoff) -

Set the departure airport of the AI.

-
RAT:_PickDestination(destinations, _random) -

Set the destination airport of the AI.

-
RAT:_PlaceMarkers(waypoints) -

Place markers of the waypoints.

-
RAT:_Randomize(value, fac, lower, upper) -

Randomize a value by a certain amount.

-
RAT:_Respawn(group) -

Respawn a group.

-
RAT:_Routeinfo(waypoints, comment) -

Provide information about the assigned flightplan.

-
RAT:_SetCoalitionTable() -

Create a table with the valid coalitions for departure and destination airports.

-
RAT:_SetMarker(text, wp) -

Set a marker visible for all on the F10 map.

-
RAT:_SetROE(group, roe) -

Set ROE for a group.

-
RAT:_SetROT(group, rot) -

Set ROT for a group.

-
RAT:_SetRoute(Takeoff, _departure, _destination, takeoff) -

Set the route of the AI plane.

-
RAT:_SetStatus(group, status) -

Set status of group.

-
RAT:_SpawnWithRoute(_departure, _destination) -

Spawn the AI aircraft with a route.

-
RAT:_TaskHolding(P1, Altitude, Speed, Duration) -

Orbit at a specified position at a specified alititude with a specified speed.

-
RAT:_Waypoint(Type, Coord, Speed, Altitude, Airport) -

Create a waypoint that can be used with the Route command.

-
RAT.aircraft -

Table which holds the basic aircraft properties (speed, range, ...).

-
RAT.airports -

All airports of friedly coalitions.

-
RAT.airports_map -

All airports available on current map (Caucasus, Nevada, Normandy, ...).

-
RAT.alive -

Number of groups which are alive.

-
RAT.cat - -
RAT.category -

Category of aircarft: "plane" or "heli".

-
RAT.coal -

RAT friendly coalitions.

-
RAT.coalition -

Coalition of spawn group template.

-
RAT.commute -

Aircraft commute between departure and destination, i.e. when respawned the departure airport becomes the new destiation.

-
RAT.continuejourney -

Aircraft will continue their journey, i.e. get respawned at their destination with a new random destination.

-
RAT.ctable -

Table with the valid coalitons from choice self.friendly.

-
RAT.debug -

Turn debug messages on or off.

-
RAT.departure_ports -

Array containing the names of the destination airports.

-
RAT.departure_zones -

Array containing the names of the departure zones.

-
RAT.destination_ports -

Array containing the names of the destination airports.

-
RAT.f10menu -

Add an F10 menu for RAT.

-
RAT.friendly -

Possible departure/destination airport: all=blue+red+neutral, same=spawn+neutral, spawnonly=spawn, blue=blue+neutral, blueonly=blue, red=red+neutral, redonly=red.

-
RAT.id -

Some ID to identify who we are in output of the DCS.log file.

-
RAT.markerid -

Running number of placed markers on the F10 map.

-
RAT.markerids -

Array with marker IDs.

-
RAT.maxdist -

Max distance from departure to destination in meters. Default 5000 km.

-
RAT.mindist -

Min distance from departure to destination in meters. Default 5 km.

-
RAT.placemarkers -

Place markers of waypoints on F10 map.

-
RAT.random_departure -

By default a random friendly airport is chosen as departure.

-
RAT.random_destination -

By default a random friendly airport is chosen as destination.

-
RAT.ratcraft -

Array with the spawned RAT aircraft.

-
RAT.reportstatus -

Aircraft report status.

-
RAT.respawn_at_landing -

Respawn aircraft the moment they land rather than at engine shutdown.

-
RAT.respawn_delay -

Delay in seconds until repawn happens after landing.

-
RAT.roe -

ROE of spawned groups, default is weapon hold (this is a peaceful class for civil aircraft or ferry missions). Possible: "hold", "return", "free".

-
RAT.rot -

ROT of spawned groups, default is no reaction. Possible: "noreaction", "passive", "evade".

-
RAT.spawndelay -

Delay time in seconds before first spawning happens.

-
RAT.spawninterval -

Interval between spawning units/groups. Note that we add a randomization of 50%.

-
RAT.statusinterval -

Intervall between status checks (and reports if enabled).

-
RAT.takeoff -

Takeoff type. 0=coldorhot.

-
RAT.unit -

RAT unit conversions.

-
RAT.wp -

RAT waypoint type.

-
- -

Global(s)

-
-
- - #RAT - -RAT - -
-
- -

RAT class, extends Spawn#SPAWN

-

The RAT class implements an easy to use way to randomly fill your map with AI aircraft.

- - - - -

Airport Selection

- -

Process

- -

Default settings:

- -
    -
  • By default, aircraft are spawned at airports of their own coalition (blue or red) or neutral airports.
  • -
  • Destination airports are by default also of neutral or of the same coalition as the template group of the spawned aircraft.
  • -
  • Possible destinations are restricted by their distance to the departure airport. The maximal distance depends on the max range of spawned aircraft type and its initial fuel amount.
  • -
- -

The default behavior can be changed:

- -
    -
  • A specific departure and/or destination airport can be chosen.
  • -
  • Valid coalitions can be set, e.g. only red, blue or neutral, all three „colours“.
  • -
  • It is possible to start in air within a zone defined in the mission editor or within a zone above an airport of the map.
  • -
- -

Flight Plan

- -

Process

- -
    -
  • A general flight plan has five main airborn segments: Climb, cruise, descent, holding and final approach.
  • -
  • Events monitored during the flight are: birth, engine-start, take-off, landing and engine-shutdown.
  • -
  • The default flight level (FL) is set to ~FL200, i.e. 20000 feet ASL but randomized for each aircraft. - Service ceiling of aircraft type is into account for max FL as well as the distance between departure and destination.
  • -
  • Maximal distance between destination and departure airports depends on range and initial fuel of aircraft.
  • -
  • Climb rate is set to a moderate value of ~1500 ft/min.
  • -
  • The standard descent rate follows the 3:1 rule, i.e. 1000 ft decent per 3 miles of travel. Hence, angle of descent is ~3.6 degrees.
  • -
  • A holding point is randomly selected at a distance between 5 and 10 km away from destination airport.
  • -
  • The altitude of theholding point is ~1200 m AGL. Holding patterns might or might not happen with variable duration.
  • -
  • If an aircraft is spawned in air, the procedure omitts taxi and take-off and starts with the climb/cruising part.
  • -
  • All values are randomized for each spawned aircraft.
  • -
- -

Mission Editor Setup

- -

Process

- -

Basic mission setup is very simple and essentially a three step process:

- -
    -
  • Place your aircraft anywhere on the map. It really does not matter where you put it.
  • -
  • Give the group a good name. In the example above the group is named "RAT_YAK".
  • -
  • Activate the "LATE ACTIVATION" tick box. Note that this aircraft will not be spawned itself but serves a template for each RAT aircraft spawned when the mission starts.
  • -
- -

Voilà, your already done!

- -

Optionally, you can set a specific livery for the aircraft or give it some weapons. -However, the aircraft will by default not engage any enemies. Think of them as beeing on a peaceful or ferry mission.

- -

Basic Lua Script

- -

Process

- -

The basic Lua script for one template group consits of two simple lines as shown in the picture above.

- -
    -
  • Line 2 creates a new RAT object "yak". The only required parameter for the constructor RAT.New() is the name of the group as defined in the mission editor. In this example it is "RAT_YAK".
  • -
  • Line 5 trigger the command to spawn the aircraft. The (optional) parameter for the RAT.Spawn() function is the number of aircraft to be spawned of this object. - By default each of these aircraft gets a random departure airport anywhere on the map and a random destination airport, which lies within range of the of the selected aircraft type.
  • -
- -

In this simple example aircraft are respawned with a completely new flightplan when they have reached their destination airport. -The "old" aircraft is despawned (destroyed) after it has shut-down its engines and a new aircraft of the same type is spawned at a random departure airport anywhere on the map. -Hence, the default flight plan for a RAT aircraft will be: Fly from airport A to B, get respawned at C and fly to D, get respawned at E and fly to F, ... -This ensures that you always have a constant number of AI aircraft on your map.

- -

Examples

- -

Here are a few examples, how you can modify the default settings of RAT class objects.

- -

Specify Departure and Destinations

- -

Process

- -

In the picture above you find a few possibilities how to modify the default behaviour to spawn at random airports and fly to random destinations.

- -

In particular, you can specify fixed departure and/or destination airports. This is done via the RAT.SetDeparture() or RAT.SetDestination() functions, respectively.

- -
    -
  • If you only fix a specific departure airport via RAT.SetDeparture() all aircraft will be spawned at that airport and get random destination airports.
  • -
  • If you only fix the destination airport via RAT.SetDestination(), aircraft a spawned at random departure airports but will all fly to the destination airport.
  • -
  • If you fix departure and destination airports, aircraft will only travel from between those airports. - When the aircraft reaches its destination, it will be respawned at its departure and fly again to its destination.
  • -
- -

There is also an option that allows aircraft to "continue their journey" from their destination. This is achieved by the RAT.ContinueJourney() function. -In that case, when the aircraft arrives at its first destination it will be respawned at that very airport and get a new random destination. -So the flight plan in this case would be: Fly from airport A to B, then from B to C, then from C to D, ...

- -

It is also possible to make aircraft "commute" between two airports, i.e. flying from airport A to B and then back from B to A, etc. -This can be done by the RAT.Commute() function. Note that if no departure or destination airports are specified, the first departure and destination are chosen randomly. -Then the aircraft will fly back and forth between those two airports indefinetly.

- - -

Spawn in Air

- -

Process

- -

Aircraft can also be spawned in air rather than at airports on the ground. This is done by setting RAT.SetTakeoff() to "air".

- -

By default, aircraft are spawned randomly above airports of the map.

- -

The RAT.SetDeparture() option can be used to specify zones, which have been defined in the mission editor as departure zones. -Aircraft will then be spawned at a random point within the zone or zones.

- -

Note that RAT.SetDeparture() also accepts airport names. For an air takeoff these are treated like zones with a radius of XX kilometers. -Again, aircraft are spawned at random points within these zones around the airport.

- -

Misc Options

- -

Process

- -

The default "takeoff" type of RAT aircraft is that they are spawned with hot or cold engines. -The choice is random, so 50% of aircraft will be spawned with hot engines while the other 50% will be spawned with cold engines. -This setting can be changed using the RAT.SetTakeoff() function. The possible parameters for starting on ground are:

- -
    -
  • RAT.SetTakeoff("cold"), which means that all aircraft are spawned with their engines off,
  • -
  • RAT.SetTakeoff("hot"), which means that all aircraft are spawned with their engines on,
  • -
  • RAT.SetTakeoff("runway"), which means that all aircraft are spawned already at the runway ready to takeoff. - Note that in this case the default spawn intervall is set to 180 seconds in order to avoid aircraft jamms on the runway. Generally, this takeoff at runways should be used with care and problems are to be expected.
  • -
- - -

The options RAT.SetMinDistance() and RAT.SetMaxDistance() can be used to restrict the range from departure to destination. For example

- -
    -
  • RAT.SetMinDistance(100) will cause only random destination airports to be selected which are at least 100 km away from the departure airport.
  • -
  • RAT.SetMaxDistance(150) will allow only destination airports which are less than 150 km away from the departure airport.
  • -
- - -

Certain other options like the flight level can also be specified. However, note that this might not be a good idea for random departures and/or destinations. -For example the random route might be too short to reach that altitude, which would result in very high climb and descent rates or strange flight plans.

- - - -
-
-

Type Rat

- -

Type RAT

- -
    -
  • RAT class
  • -
- -

Field(s)

-
-
- - #number - -RAT.AlphaDescent - -
-
- -

Default angle of descenti in degrees. A value of 3.6 follows the 3:1 rule of 3 miles of travel and 1000 ft descent.

- -
-
-
-
- - #string - -RAT.ClassName - -
-
- -

Name of the Class.

- -
-
-
-
- - -RAT:Commute(switch) - -
-
- -

Aircraft will commute between their departure and destination airports.

- - -

Note, this option is not available if aircraft are spawned in air since they don't have a valid departure airport to fly back to.

- -

Parameter

-
    -
  • - -

    #boolean switch : -Turn commute on=true or off=false. If no value is given switch=true.

    - -
  • -
-
-
-
-
- - -RAT:ContinueJourney(switch) - -
-
- -

Aircraft will continue their journey from their destination.

- - -

This means they are respawned at their destination and get a new random destination.

- -

Parameter

-
    -
  • - -

    #boolean switch : -Turn journey on=true or off=false. If no value is given switch=true.

    - -
  • -
-
-
-
-
- - #number - -RAT.FLmaxuser - -
-
- -

Maximum flight level set by user.

- -
-
-
-
- - #number - -RAT.FLminuser - -
-
- -

Minimum flight level set by user.

- -
-
-
-
- - #number - -RAT.FLuser - -
-
- -

Flight level set by users explicitly.

- -
-
-
-
- - #table - -RAT.Menu - -
-
- -

F10 menu items for this RAT object.

- -
-
-
-
- - #string - -RAT.MenuF10 - -
-
- -

Main F10 menu.

- -
-
-
-
- - -RAT:New(groupname) - -
-
- -

Create a new RAT object.

- -

Parameter

-
    -
  • - -

    #string groupname : -Name of the group as defined in the mission editor. This group is serving as a template for all spawned units.

    - -
  • -
-

Return values

-
    -
  1. - -

    #RAT: -Object of RAT class.

    - -
  2. -
  3. - -

    #nil: -If the group does not exist in the mission editor.

    - -
  4. -
-

Usage:

-
yak:RAT("RAT_YAK") will create a RAT object called "yak". The template group in the mission editor must have the name "RAT_YAK".
- -
-
-
-
- - -RAT:PlaceMarkers(switch) - -
-
- -

Place markers of waypoints on the F10 map.

- - -

Default is off.

- -

Parameter

-
    -
  • - -

    #boolean switch : -true=yes, false=no.

    - -
  • -
-
-
-
-
- - - -RAT.ROE - -
-
- -

RAT rules of engagement.

- -
-
-
-
- - - -RAT.ROT - -
-
- -

RAT reaction to threat.

- -
-
-
-
- - -RAT:RespawnAfterLanding(delay) - -
-
- -

Make aircraft respawn the moment they land rather than at engine shut down.

- -

Parameter

-
    -
  • - -

    #number delay : -(Optional) Delay in seconds until respawn happens after landing. Default is 180 seconds.

    - -
  • -
-
-
-
-
- - -RAT:SetClimbRate(rate) - -
-
- -

Set the climb rate.

- - -

Default is 1500 ft/min. This automatically sets the climb angle.

- -

Parameter

-
    -
  • - -

    #number rate : -Climb rate in ft/min.

    - -
  • -
-
-
-
-
- - -RAT:SetCoalition(friendly) - -
-
- -

Set the friendly coalitions from which the airports can be used as departure or destination.

- -

Parameter

-
    -
  • - -

    #string friendly : -"same"=own coalition+neutral (default), "all"=neutral+red+blue", "sameonly"=own coalition only, "blue"=blue+neutral, "blueonly"=blue, "red"=red+neutral, "redonly"=red, "neutral"=neutral. -Default is "same", so aircraft will use airports of the coalition their spawn template has plus all neutral airports.

    - -
  • -
-

Usages:

-
    -
  • yak:SetCoalition("all") will spawn aircraft randomly on airports of any coaliton, i.e. red, blue and neutral, regardless of its own coalition.
  • -
  • yak:SetCoalition("redonly") will spawn aircraft randomly on airports belonging to the red coalition _only_.
  • -
- -
-
-
-
- - -RAT:SetDeparture(names) - -
-
- -

Set possible departure ports.

- - -

This can be an airport or a zone defined in the mission editor.

- -

Parameter

-
    -
  • - -

    #string names : -Name or table of names of departure airports or zones.

    - -
  • -
-

Usages:

-
    -
  • RAT:SetDeparture("Sochi-Adler") will spawn RAT objects at Sochi-Adler airport.
  • -
  • RAT:SetDeparture({"Sochi-Adler", "Gudauta"}) will spawn RAT aircraft radomly at Sochi-Adler or Gudauta airport.
  • -
  • RAT:SetDeparture({"Zone A", "Gudauta"}) will spawn RAT aircraft in air randomly within Zone A, which has to be defined in the mission editor, or within a zone around Gudauta airport. Note that this also requires RAT:takeoff("air") to be set.
  • -
- -
-
-
-
- - -RAT:SetDescentAngle(angle) - -
-
- -

Set the angle of descent.

- - -

Default is 3.6 degrees, which corresponds to 3000 ft descent after one mile of travel.

- -

Parameter

-
    -
  • - -

    #number angle : -Angle of descent in degrees.

    - -
  • -
-
-
-
-
- - -RAT:SetDestination(names) - -
-
- -

Set name of destination airport for the AI aircraft.

- - -

If no name is given an airport from the friendly coalition(s) is chosen randomly.

- -

Parameter

-
    -
  • - -

    #string names : -Name of the destination airport or table of destination airports.

    - -
  • -
-

Usage:

-
RAT:SetDestination("Krymsk") makes all aircraft of this RAT oject fly to Krymsk airport.
- -
-
-
-
- - -RAT:SetFL(height) - -
-
- -

Set flight level.

- - -

Setting this value will overrule all other logic. Aircraft will try to fly at this height regardless.

- -

Parameter

-
    -
  • - -

    #number height : -FL in hundrets of feet. E.g. FL200 = 20000 ft ASL.

    - -
  • -
-
-
-
-
- - -RAT:SetFLcruise(height) - -
-
- -

Set flight level of cruising part.

- - -

This is still be checked for consitancy with selected route and prone to radomization. -Default is FL200 for planes and FL005 for helicopters.

- -

Parameter

-
    -
  • - -

    #number height : -FL in hundrets of feet. E.g. FL200 = 20000 ft ASL.

    - -
  • -
-
-
-
-
- - -RAT:SetFLmax(height) - -
-
- -

Set max flight level.

- - -

Setting this value will overrule all other logic. Aircraft will try to fly at less than this FL regardless.

- -

Parameter

-
    -
  • - -

    #number height : -Maximum FL in hundrets of feet.

    - -
  • -
-
-
-
-
- - -RAT:SetFLmin(height) - -
-
- -

Set min flight level.

- - -

Setting this value will overrule all other logic. Aircraft will try to fly at higher than this FL regardless.

- -

Parameter

-
    -
  • - -

    #number height : -Maximum FL in hundrets of feet.

    - -
  • -
-
-
-
-
- - -RAT:SetMaxCruiseSpeed(speed) - -
-
- -

Set the maximum cruise speed of the aircraft.

- -

Parameter

-
    -
  • - -

    #number speed : -Speed in km/h.

    - -
  • -
-
-
-
-
- - -RAT:SetMaxDistance(dist) - -
-
- -

Set maximum distance between departure and destination.

- - -

Default is 5000 km but aircarft range is also taken into account automatically.

- -

Parameter

-
    -
  • - -

    #number dist : -Distance in km.

    - -
  • -
-
-
-
-
- - -RAT:SetMinDistance(dist) - -
-
- -

Set minimum distance between departure and destination.

- - -

Default is 5 km. -Minimum distance should not be smaller than maybe ~500 meters to ensure that departure and destination are different.

- -

Parameter

-
    -
  • - -

    #number dist : -Distance in km.

    - -
  • -
-
-
-
-
- - -RAT:SetROE(roe) - -
-
- -

Set rules of engagement (ROE).

- - -

Default is weapon hold. This is a peaceful class.

- -

Parameter

-
    -
  • - -

    #string roe : -"hold" = weapon hold, "return" = return fire, "free" = weapons free.

    - -
  • -
-
-
-
-
- - -RAT:SetROT(rot) - -
-
- -

Set reaction to threat (ROT).

- - -

Default is no reaction, i.e. aircraft will simply ignore all enemies.

- -

Parameter

-
    -
  • - -

    #string rot : -"noreaction" = no reaction to threats, "passive" = passive defence, "evade" = evade enemy attacks.

    - -
  • -
-
-
-
-
- - -RAT:SetSpawnDelay(delay) - -
-
- -

Set the delay before first group is spawned.

- - -

Minimum delay is 0.5 seconds.

- -

Parameter

-
    -
  • - -

    #number delay : -Delay in seconds.

    - -
  • -
-
-
-
-
- - -RAT:SetSpawnInterval(interval) - -
-
- -

Set the interval between spawnings of the template group.

- - -

Minimum interval is 0.5 seconds.

- -

Parameter

-
    -
  • - -

    #number interval : -Interval in seconds.

    - -
  • -
-
-
-
-
- - -RAT:SetTakeoff(type) - -
-
- -

Set takeoff type.

- - -

Starting cold at airport, starting hot at airport, starting at runway, starting in the air. -Default is "takeoff-hot" for a start at airport with engines already running.

- -

Parameter

-
    -
  • - -

    #string type : -Type can be "takeoff-cold" or "cold", "takeoff-hot" or "hot", "takeoff-runway" or "runway", "air".

    - -
  • -
-

Usages:

-
    -
  • RAT:Takeoff("hot") will spawn RAT objects at airports with engines started.
  • -
  • RAT:Takeoff("cold") will spawn RAT objects at airports with engines off.
  • -
  • RAT:Takeoff("air") will spawn RAT objects in air over random airports or within pre-defined zones. 
  • -
- -
-
-
-
- - -RAT:Spawn(naircraft) - -
-
- -

Triggers the spawning of AI aircraft.

- - -

Note that all additional options should be set before giving the spawn command.

- -

Parameter

-
    -
  • - -

    #number naircraft : -(Optional) Number of aircraft to spawn. Default is one aircraft.

    - -
  • -
-

Usage:

-
yak:Spawn(5) will spawn five aircraft. By default aircraft will spawn at neutral and red airports if the template group is part of the red coaliton.
- -
-
-
-
- - -RAT:Status(message, forID) - -
-
- -

Report status of RAT groups.

- -

Parameters

-
    -
  • - -

    #boolean message : -(Optional) Send message if true.

    - -
  • -
  • - -

    #number forID : -(Optional) Send message only for this ID.

    - -
  • -
-
-
-
-
- - -RAT:StatusReports(switch) - -
-
- -

Aircraft report status messages.

- - -

Default is off.

- -

Parameter

-
    -
  • - -

    #boolean switch : -true=on, false=off.

    - -
  • -
-
-
-
-
- - #string - -RAT.SubMenuName - -
-
- -

Submenu name for RAT object.

- -
-
-
-
- - -RAT:TimeDestroyInactive(time) - -
-
- -

Set the time after which inactive groups will be destroyed.

- - -

Default is 180 seconds.

- -

Parameter

-
    -
  • - -

    #number time : -Time in seconds.

    - -
  • -
-
-
-
-
- - #number - -RAT.Tinactive - -
-
- -

Time in seconds after which inactive units will be destroyed. Default is 180 seconds.

- -
-
-
-
- - #number - -RAT.Vclimb - -
-
- -

Default climb rate in ft/min.

- -
-
-
-
- - #number - -RAT.Vcruisemax - -
-
- -

Max cruise speed in m/s (250 m/s = 900 km/h = 486 kt) set by user.

- -
-
-
-
- - -RAT:_AirportExists(name) - -
-
- -

Test if an airport exists on the current map.

- -

Parameter

-
    -
  • - -

    #string name :

    - -
  • -
-

Return value

- -

#boolean: -True if airport exsits, false otherwise.

- -
-
-
-
- - -RAT:_Course(a, b) - -
-
- -

Determine the heading from point a to point b.

- -

Parameters

- -

Return value

- -

#number: -Heading/angle in degrees.

- -
-
-
-
- - -RAT:_Debug(switch) - -
-
- -

Turn debug messages on or off.

- - -

Default is off.

- -

Parameter

-
    -
  • - -

    #boolean switch : -true turn messages on, false=off.

    - -
  • -
-
-
-
-
- - -RAT:_DeleteMarkers(ids) - -
-
- -

Delete all markers on F10 map.

- -

Parameter

-
    -
  • - -

    #table ids : -(Optional) Table holding the marker IDs to be deleted.

    - -
  • -
-
-
-
-
- - -RAT:_Despawn(group) - -
-
- -

Despawn unit.

- - -

Unit gets destoyed and group is set to nil. -Index of ratcraft array is taken from spawned group name.

- -

Parameter

- -
-
-
-
- - -RAT:_EngineStartup(EventData) - -
-
- -

Function is executed when a unit starts its engines.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_FLmax(alpha, beta, d, phi, h0) - -
-
- -

Calculate the max flight level for a given distance and fixed climb and descent rates.

- - -

In other words we have a distance between two airports and want to know how high we -can climb before we must descent again to arrive at the destination without any level/cruising part.

- -

Parameters

-
    -
  • - -

    #number alpha : -Angle of climb [rad].

    - -
  • -
  • - -

    #number beta : -Angle of descent [rad].

    - -
  • -
  • - -

    #number d : -Distance between the two airports [m].

    - -
  • -
  • - -

    #number phi : -Angle between departure and destination [rad].

    - -
  • -
  • - -

    #number h0 : -Height [m] of departure airport. Note we implicitly assume that the height difference between departure and destination is negligible.

    - -
  • -
-

Return value

- -

#number: - Maximal flight level in meters.

- -
-
-
-
- - -RAT:_GetAirportsOfCoalition() - -
-
- -

Get all "friendly" airports of the current map.

- -
-
-
-
- - -RAT:_GetAirportsOfMap() - -
-
- -

Get all airports of the current map.

- -
-
-
-
- - -RAT:_GetDestinations(q, minrange, maxrange) - -
-
- -

Get all possible destination airports depending on departure position.

- - -

The list is sorted w.r.t. distance to departure position.

- -

Parameters

-
    -
  • - -

    Core.Point#COORDINATE q : -Coordinate of the departure point.

    - -
  • -
  • - -

    #number minrange : -Minimum range to q in meters.

    - -
  • -
  • - -

    #number maxrange : -Maximum range to q in meters.

    - -
  • -
-

Return values

-
    -
  1. - -

    #table: -Table with possible destination airports.

    - -
  2. -
  3. - -

    #nil: -If no airports could be found.

    - -
  4. -
-
-
-
-
- - -RAT:_GetLife(group) - -
-
- -

Get (relative) life of first unit of a group.

- -

Parameter

- -

Return value

- -

#number: -Life of unit in percent.

- -
-
-
-
- - -RAT:_InitAircraft(DCSgroup) - -
-
- -

Initialize basic parameters of the aircraft based on its (template) group in the mission editor.

- -

Parameter

- -
-
-
-
- - -RAT:_ModifySpawnTemplate(waypoints) - -
-
- -

Modifies the template of the group to be spawned.

- - -

In particular, the waypoints of the group's flight plan are copied into the spawn template. -This allows to spawn at airports and also land at other airports, i.e. circumventing the DCS "landing bug".

- -

Parameter

-
    -
  • - -

    #table waypoints : -The waypoints of the AI flight plan.

    - -
  • -
-
-
-
-
- - -RAT:_OnBirth(EventData) - -
-
- -

Function is executed when a unit is spawned.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnCrash(EventData) - -
-
- -

Function is executed when a unit crashes.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnDead(EventData) - -
-
- -

Function is executed when a unit is dead.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnEngineShutdown(EventData) - -
-
- -

Function is executed when a unit shuts down its engines.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnLand(EventData) - -
-
- -

Function is executed when a unit lands.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_OnTakeoff(EventData) - -
-
- -

Function is executed when a unit takes off.

- -

Parameter

-
    -
  • - -

    EventData :

    - -
  • -
-
-
-
-
- - -RAT:_PickDeparture(takeoff) - -
-
- -

Set the departure airport of the AI.

- - -

If no airport name is given explicitly an airport from the coalition is chosen randomly. -If takeoff style is set to "air", we use zones around the airports or the zones specified by user input.

- -

Parameter

-
    -
  • - -

    #number takeoff : -Takeoff type.

    - -
  • -
-

Return values

-
    -
  1. - -

    Wrapper.Airbase#AIRBASE: -Departure airport if spawning at airport.

    - -
  2. -
  3. - -

    Coore.Zone#ZONE: -Departure zone if spawning in air.

    - -
  4. -
-
-
-
-
- - -RAT:_PickDestination(destinations, _random) - -
-
- -

Set the destination airport of the AI.

- - -

If no airport name is given an airport from the coalition is chosen randomly.

- -

Parameters

-
    -
  • - -

    #table destinations : -Table with destination airports.

    - -
  • -
  • - -

    #boolean _random : -Optional switch to activate a random selection of airports.

    - -
  • -
-

Return value

- -

Wrapper.Airbase#AIRBASE: -Destination airport.

- -
-
-
-
- - -RAT:_PlaceMarkers(waypoints) - -
-
- -

Place markers of the waypoints.

- - -

Note we assume a very specific number and type of waypoints here.

- -

Parameter

-
    -
  • - -

    #table waypoints : -Table with waypoints.

    - -
  • -
-
-
-
-
- - -RAT:_Randomize(value, fac, lower, upper) - -
-
- -

Randomize a value by a certain amount.

- -

Parameters

-
    -
  • - -

    #number value : -The value which should be randomized

    - -
  • -
  • - -

    #number fac : -Randomization factor.

    - -
  • -
  • - -

    #number lower : -(Optional) Lower limit of the returned value.

    - -
  • -
  • - -

    #number upper : -(Optional) Upper limit of the returned value.

    - -
  • -
-

Return value

- -

#number: -Randomized value.

- -

Usages:

-
    -
  • _Randomize(100, 0.1) returns a value between 90 and 110, i.e. a plus/minus ten percent variation.
  • -
  • _Randomize(100, 0.5, nil, 120) returns a value between 50 and 120, i.e. a plus/minus fivty percent variation with upper bound 120.
  • -
- -
-
-
-
- - -RAT:_Respawn(group) - -
-
- -

Respawn a group.

- -

Parameter

- -
-
-
-
- - -RAT:_Routeinfo(waypoints, comment) - -
-
- -

Provide information about the assigned flightplan.

- -

Parameters

-
    -
  • - -

    #table waypoints : -Waypoints of the flight plan.

    - -
  • -
  • - -

    #string comment : -Some comment to identify the provided information.

    - -
  • -
-

Return value

- -

#number: -total Total route length in meters.

- -
-
-
-
- - -RAT:_SetCoalitionTable() - -
-
- -

Create a table with the valid coalitions for departure and destination airports.

- -
-
-
-
- - -RAT:_SetMarker(text, wp) - -
-
- -

Set a marker visible for all on the F10 map.

- -

Parameters

-
    -
  • - -

    #string text : -Info text displayed at maker.

    - -
  • -
  • - -

    #table wp : -Position of marker coming in as waypoint, i.e. has x, y and alt components.

    - -
  • -
-
-
-
-
- - -RAT:_SetROE(group, roe) - -
-
- -

Set ROE for a group.

- -

Parameters

-
    -
  • - -

    Wrapper.Group#GROUP group : -Group for which the ROE is set.

    - -
  • -
  • - -

    #string roe : -ROE of group.

    - -
  • -
-
-
-
-
- - -RAT:_SetROT(group, rot) - -
-
- -

Set ROT for a group.

- -

Parameters

-
    -
  • - -

    Wrapper.Group#GROUP group : -Group for which the ROT is set.

    - -
  • -
  • - -

    #string rot : -ROT of group.

    - -
  • -
-
-
-
-
- - -RAT:_SetRoute(Takeoff, _departure, _destination, takeoff) - -
-
- -

Set the route of the AI plane.

- - -

Due to DCS landing bug, this has to be done before the unit is spawned.

- -

Parameters

- -

Return values

-
    -
  1. - -

    Wrapper.Airport#AIRBASE: -Departure airbase.

    - -
  2. -
  3. - -

    Wrapper.Airport#AIRBASE: -Destination airbase.

    - -
  4. -
  5. - -

    #table: -Table of flight plan waypoints.

    - -
  6. -
-
-
-
-
- - -RAT:_SetStatus(group, status) - -
-
- -

Set status of group.

- -

Parameters

-
    -
  • - -

    group :

    - -
  • -
  • - -

    status :

    - -
  • -
-
-
-
-
- - -RAT:_SpawnWithRoute(_departure, _destination) - -
-
- -

Spawn the AI aircraft with a route.

- - -

Sets the departure and destination airports and waypoints. -Modifies the spawn template. -Sets ROE/ROT. -Initializes the ratcraft array and group menu.

- -

Parameters

-
    -
  • - -

    #string _departure : -(Optional) Name of departure airbase.

    - -
  • -
  • - -

    #string _destination : -(Optional) Name of destination airbase.

    - -
  • -
-
-
-
-
- - -RAT:_TaskHolding(P1, Altitude, Speed, Duration) - -
-
- -

Orbit at a specified position at a specified alititude with a specified speed.

- -

Parameters

-
    -
  • - -

    Dcs.DCSTypes#Vec2 P1 : -The point to hold the position.

    - -
  • -
  • - -

    #number Altitude : -The altitude ASL at which to hold the position.

    - -
  • -
  • - -

    #number Speed : -The speed flying when holding the position in m/s.

    - -
  • -
  • - -

    #number Duration : -Duration of holding pattern in seconds.

    - -
  • -
-

Return value

- -

Dcs.DCSTasking.Task#Task: -DCSTask

- -
-
-
-
- - -RAT:_Waypoint(Type, Coord, Speed, Altitude, Airport) - -
-
- -

Create a waypoint that can be used with the Route command.

- -

Parameters

-
    -
  • - -

    #number Type : -Type of waypoint.

    - -
  • -
  • - -

    Core.Point#COORDINATE Coord : -3D coordinate of the waypoint.

    - -
  • -
  • - -

    #number Speed : -Speed in m/s.

    - -
  • -
  • - -

    #number Altitude : -Altitude in m.

    - -
  • -
  • - -

    Wrapper.Airbase#AIRBASE Airport : -Airport of object to spawn.

    - -
  • -
-

Return value

- -

#table: -Waypoints for DCS task route or spawn template.

- -
-
-
-
- - #table - -RAT.aircraft - -
-
- -

Table which holds the basic aircraft properties (speed, range, ...).

- -
-
-
-
- - #table - -RAT.airports - -
-
- -

All airports of friedly coalitions.

- -
-
-
-
- - #table - -RAT.airports_map - -
-
- -

All airports available on current map (Caucasus, Nevada, Normandy, ...).

- -
-
-
-
- - #number - -RAT.alive - -
-
- -

Number of groups which are alive.

- -
-
-
-
- - - -RAT.cat - -
-
- - - -
-
-
-
- - #string - -RAT.category - -
-
- -

Category of aircarft: "plane" or "heli".

- -
-
-
-
- - - -RAT.coal - -
-
- -

RAT friendly coalitions.

- -
-
-
-
- - #number - -RAT.coalition - -
-
- -

Coalition of spawn group template.

- -
-
-
-
- - #boolean - -RAT.commute - -
-
- -

Aircraft commute between departure and destination, i.e. when respawned the departure airport becomes the new destiation.

- -
-
-
-
- - #boolean - -RAT.continuejourney - -
-
- -

Aircraft will continue their journey, i.e. get respawned at their destination with a new random destination.

- -
-
-
-
- - #table - -RAT.ctable - -
-
- -

Table with the valid coalitons from choice self.friendly.

- -
-
-
-
- - #boolean - -RAT.debug - -
-
- -

Turn debug messages on or off.

- -
-
-
-
- - #table - -RAT.departure_ports - -
-
- -

Array containing the names of the destination airports.

- -
-
-
-
- - #table - -RAT.departure_zones - -
-
- -

Array containing the names of the departure zones.

- -
-
-
-
- - #table - -RAT.destination_ports - -
-
- -

Array containing the names of the destination airports.

- -
-
-
-
- - #boolean - -RAT.f10menu - -
-
- -

Add an F10 menu for RAT.

- -
-
-
-
- - #string - -RAT.friendly - -
-
- -

Possible departure/destination airport: all=blue+red+neutral, same=spawn+neutral, spawnonly=spawn, blue=blue+neutral, blueonly=blue, red=red+neutral, redonly=red.

- -
-
-
-
- - #string - -RAT.id - -
-
- -

Some ID to identify who we are in output of the DCS.log file.

- -
-
-
-
- - #number - -RAT.markerid - -
-
- -

Running number of placed markers on the F10 map.

- -
-
-
-
- - #table - -RAT.markerids - -
-
- -

Array with marker IDs.

- -
-
-
-
- - #number - -RAT.maxdist - -
-
- -

Max distance from departure to destination in meters. Default 5000 km.

- -
-
-
-
- - #number - -RAT.mindist - -
-
- -

Min distance from departure to destination in meters. Default 5 km.

- -
-
-
-
- - #boolean - -RAT.placemarkers - -
-
- -

Place markers of waypoints on F10 map.

- -
-
-
-
- - #boolean - -RAT.random_departure - -
-
- -

By default a random friendly airport is chosen as departure.

- -
-
-
-
- - #boolean - -RAT.random_destination - -
-
- -

By default a random friendly airport is chosen as destination.

- -
-
-
-
- - #table - -RAT.ratcraft - -
-
- -

Array with the spawned RAT aircraft.

- -
-
-
-
- - #boolean - -RAT.reportstatus - -
-
- -

Aircraft report status.

- -
-
-
-
- - #boolean - -RAT.respawn_at_landing - -
-
- -

Respawn aircraft the moment they land rather than at engine shutdown.

- -
-
-
-
- - #number - -RAT.respawn_delay - -
-
- -

Delay in seconds until repawn happens after landing.

- -
-
-
-
- - #string - -RAT.roe - -
-
- -

ROE of spawned groups, default is weapon hold (this is a peaceful class for civil aircraft or ferry missions). Possible: "hold", "return", "free".

- -
-
-
-
- - #string - -RAT.rot - -
-
- -

ROT of spawned groups, default is no reaction. Possible: "noreaction", "passive", "evade".

- -
-
-
-
- - #number - -RAT.spawndelay - -
-
- -

Delay time in seconds before first spawning happens.

- -
-
-
-
- - #number - -RAT.spawninterval - -
-
- -

Interval between spawning units/groups. Note that we add a randomization of 50%.

- -
-
-
-
- - #number - -RAT.statusinterval - -
-
- -

Intervall between status checks (and reports if enabled).

- -
-
-
-
- - #string - -RAT.takeoff - -
-
- -

Takeoff type. 0=coldorhot.

- -
-
-
-
- - - -RAT.unit - -
-
- -

RAT unit conversions.

- -
-
-
-
- - - -RAT.wp - -
-
- -

RAT waypoint type.

- -
-
- -

Type list

- -
- -
- - From 09f61610c1d8db84396c5635409ca0dd62ce1d2f Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Fri, 15 Sep 2017 00:02:29 +0200 Subject: [PATCH 6/9] Added metric functions for cruisealt. Fixed bugs regarding coalitions. Adjusted gaussian distribution for cruise alt. --- Moose Development/Moose/Functional/RAT.lua | 167 +++++++++------------ 1 file changed, 74 insertions(+), 93 deletions(-) diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index 9bf515363..4c285a5dd 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -86,7 +86,7 @@ -- @field #table departure_ports Array containing the names of the destination airports. -- @field #table destination_ports Array containing the names of the destination airports. -- @field #table ratcraft Array with the spawned RAT aircraft. --- @field #number Tinactive Time in seconds after which inactive units will be destroyed. Default is 180 seconds. +-- @field #number Tinactive Time in seconds after which inactive units will be destroyed. Default is 300 seconds. -- @field #boolean reportstatus Aircraft report status. -- @field #number statusinterval Intervall between status checks (and reports if enabled). -- @field #boolean placemarkers Place markers of waypoints on F10 map. @@ -104,7 +104,7 @@ -- @field #number respawn_delay Delay in seconds until repawn happens after landing. -- @field #table markerids Array with marker IDs. -- @field #string livery Livery of the aircraft set by user. --- @field #string skill Skill of AI. +-- @field #string skill Skill of AI. -- @extends Functional.Spawn#SPAWN ---# RAT class, extends @{Spawn#SPAWN} @@ -265,7 +265,7 @@ RAT={ departure_ports={}, -- Array containing the names of the departure airports. destination_ports={}, -- Array containing the names of the destination airports. ratcraft={}, -- Array with the spawned RAT aircraft. - Tinactive=180, -- Time in seconds after which inactive units will be destroyed. Default is 180 seconds. + Tinactive=300, -- Time in seconds after which inactive units will be destroyed. Default is 300 seconds. reportstatus=false, -- Aircraft report status. statusinterval=30, -- Intervall between status checks (and reports if enabled). placemarkers=false, -- Place markers of waypoints on F10 map. @@ -394,7 +394,7 @@ RAT.id="RAT | " --DONE: Improve behaviour when no destination or departure airports were found. Leads to crash, e.g. 1184: attempt to get length of local 'destinations' (a nil value) --DONE: Check cases where aircraft get shot down. --DONE: Handle the case where more than 10 RAT objects are spawned. Likewise, more than 10 groups of one object. Causes problems with the number of menu items! ==> not now! ---TODO: Add custom livery choice if possible. +--DONE: Add custom livery choice if possible. --TODO: When only a destination is set, it should be checked that the departure is within range. Also, that departure and destination are not the same. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -557,9 +557,7 @@ function RAT:SetCoalition(friendly) elseif friendly:lower()=="red" then self.friendly=RAT.coal.red elseif friendly:lower()=="redonly" then - self.friendly=RAT.coal.red - elseif friendly:lower()=="blue" then - self.friendly=RAT.coal.blue + self.friendly=RAT.coal.redonly elseif friendly:lower()=="neutral" then self.friendly=RAT.coal.neutral else @@ -727,7 +725,7 @@ function RAT:RespawnAfterLanding(delay) self.respawn_delay=delay end ---- Set the time after which inactive groups will be destroyed. Default is 180 seconds. +--- Set the time after which inactive groups will be destroyed. Default is 300 seconds. -- @param #RAT self -- @param #number time Time in seconds. function RAT:TimeDestroyInactive(time) @@ -844,6 +842,13 @@ function RAT:SetFLmax(height) self.FLmaxuser=height*RAT.unit.FL2m end +--- Set max cruising altitude above sea level. +-- @param #RAT self +-- @param #number alt Altitude ASL in meters. +function RAT:SetMaCruiseAltitude(alt) + self.FLmaxuser=alt +end + --- Set min flight level. Setting this value will overrule all other logic. Aircraft will try to fly at higher than this FL regardless. -- @param #RAT self -- @param #number height Maximum FL in hundrets of feet. @@ -851,6 +856,13 @@ function RAT:SetFLmin(height) self.FLminuser=height*RAT.unit.FL2m end +--- Set min cruising altitude above sea level. +-- @param #RAT self +-- @param #number alt Altitude ASL in meters. +function RAT:SetMinCruiseAltitude(alt) + self.FLminuser=alt +end + --- Set flight level of cruising part. This is still be checked for consitancy with selected route and prone to radomization. -- Default is FL200 for planes and FL005 for helicopters. -- @param #RAT self @@ -859,6 +871,13 @@ function RAT:SetFLcruise(height) self.aircraft.FLcruise=height*RAT.unit.FL2m end +--- Set cruising altitude. This is still be checked for consitancy with selected route and prone to radomization. +-- @param #RAT self +-- @param #number alt Cruising altitude ASL in meters. +function RAT:SetCruiseAltitude(alt) + self.aircraft.FLcruise=alt +end + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- Initialize basic parameters of the aircraft based on its (template) group in the mission editor. @@ -1091,9 +1110,6 @@ function RAT:_SetRoute(takeoff, _departure, _destination) -- Min cruise speed 70% of max cruise or 600 km/h whichever is lower. local VxCruiseMin = math.min(VxCruiseMax*0.70, 166) - -- Cruise speed (randomized). - --local VxCruise = self:_Randomize((VxCruiseMax-VxCruiseMin)/2+VxCruiseMin, 0.3 , VxCruiseMin, VxCruiseMax) - -- Cruise speed (randomized). Expectation value at midpoint between min and max. local VxCruise = self:_Random_Gaussian((VxCruiseMax-VxCruiseMin)/2+VxCruiseMin, (VxCruiseMax-VxCruiseMax)/4, VxCruiseMin, VxCruiseMax) @@ -1167,6 +1183,13 @@ function RAT:_SetRoute(takeoff, _departure, _destination) H_departure=Pdeparture.y end + -- Adjust min distance between departure and destination for user set min flight level. + if self.FLminuser then + self.mindist=self:_MinDistance(AlphaClimb, AlphaDescent, self.FLminuser-H_departure) + local text=string.format("Adjusting min distance to %d km (for given min FL%03d)", self.mindist/1000, self.FLminuser/RAT.unit.FL2m) + env.info(RAT.id..text) + end + -- DESTINATION AIRPORT local destination=nil if _destination then @@ -1285,9 +1308,14 @@ function RAT:_SetRoute(takeoff, _departure, _destination) FLmax=self.FLmaxuser end - -- Set cruise altitude: default with 100% randomization but limited to FLmin and FLmax. - --local FLcruise=self:_Randomize(self.aircraft.FLcruise, 1.0, FLmin, FLmax) - + -- Adjust FLcruise to be at leat FLmin and at most FLmax + if self.aircraft.FLcruiseFLmax then + self.aircraft.FLcruise=FLmax + end + -- Set cruise altitude. Selected from Gaussian distribution but limited to FLmin and FLmax. local FLcruise=self:_Random_Gaussian(self.aircraft.FLcruise, (FLmax-FLmin)/4, FLmin, FLmax) @@ -2342,7 +2370,7 @@ end -- @param #number d Distance between the two airports [m]. -- @param #number phi Angle between departure and destination [rad]. -- @param #number h0 Height [m] of departure airport. Note we implicitly assume that the height difference between departure and destination is negligible. --- @return #number Maximal flight level in meters. +-- @return #number Maximal flight level in meters. function RAT:_FLmax(alpha, beta, d, phi, h0) -- Solve ASA triangle for one side (d) and two adjacent angles (alpha, beta) given. local gamma=math.rad(180)-alpha-beta @@ -2363,6 +2391,18 @@ function RAT:_FLmax(alpha, beta, d, phi, h0) return h3+h0 end +--- Calculate min distance between departure and destination for given minimum flight level and climb/decent rates +-- @param #RAT self +-- @param #number alpha Angle of climb [rad]. +-- @param #number beta Angle of descent [rad]. +-- @param #number h min height AGL. +-- @return #number Minimum distance between departure and destiantion. +function RAT:_MinDistance(alpha, beta, h) + local d1=h/math.tan(alpha) + local d2=h/math.tan(beta) + return d1+d2 +end + --- Test if an airport exists on the current map. -- @param #RAT self @@ -2521,11 +2561,23 @@ function RAT:_Random_Gaussian(x0, sigma, xmin, xmax) -- Cut-off distribution at xmin. if xmin then - r=math.max(r, xmin) + if rxmax then + if xmin then + r=math.max(math.min(x0,xmax),xmin) + else + r=math.min(x0,xmax) + end + end end return r @@ -2607,15 +2659,7 @@ function RAT:_ModifySpawnTemplate(waypoints) if self:_GetSpawnIndex(self.SpawnIndex+1) then - - local scratch=false - local SpawnTemplate - if not scratch then - -- Get copy of spawn template. - SpawnTemplate = self.SpawnGroups[self.SpawnIndex].SpawnTemplate - else - SpawnTemplate=self:_InitSpawnTemplate() - end + local SpawnTemplate = self.SpawnGroups[self.SpawnIndex].SpawnTemplate if SpawnTemplate then self:T(SpawnTemplate) @@ -2637,17 +2681,12 @@ function RAT:_ModifySpawnTemplate(waypoints) SpawnTemplate.units[UnitID].alt = PointVec3.y SpawnTemplate.units[UnitID].heading = math.rad(heading) - -- Set another livery. - env.info("Livery template:"..SpawnTemplate.units[UnitID].livery_id) + -- Set (another) livery. if self.livery then - local skin=self.livery[math.random(#self.livery)] - if not (skin:lower()=="default" or skin:lower()=="template") then - SpawnTemplate.units[UnitID].livery_id = self.livery[math.random(#self.livery)] - end - env.info("Livery modified:"..SpawnTemplate.units[UnitID].livery_id) + SpawnTemplate.units[UnitID].livery_id = self.livery[math.random(#self.livery)] end - SpawnTemplate.units[UnitID]["type"] = "Tu-142" + --SpawnTemplate.units[UnitID]["type"] = "Tu-142" -- Set AI skill. SpawnTemplate.units[UnitID]["skill"] = self.skill @@ -2679,62 +2718,4 @@ function RAT:_ModifySpawnTemplate(waypoints) end end ---- Set up the basic spawn template. --- @param #RAT self -function RAT:_InitSpawnTemplate() - local template = - { - ["modulation"] = 0, - ["tasks"] = {}, - ["task"] = "Transport", - ["uncontrolled"] = false, - ["route"] = - { - ["points"] = {}, - }, - ["groupId"] = 1, - ["hidden"] = false, - ["y"] = 0, - ["x"] = 0, - ["name"] = "DictKey_GroupName_5", - ["communication"] = true, - ["start_time"] = 0, - ["frequency"] = 251, - ["units"] = {}, -- end of ["units"] - } - return template -end - ---- Initialize a unit of the spawn template. --- @param #RAT self -function RAT:_InitSpawnUnit() - local unit = - { - ["country"]=country.id.USA, - ["name"] = "DictKey_UnitName_6", - ["alt"] = 30, - ["alt_type"] = "BARO", - ["livery_id"] = "Aeroflot", - ["skill"] = "High", - ["parking"] = "31", - ["speed"] = 0, - ["type"] = "Yak-40", - ["unitId"] = 1, - ["psi"] = 0, --3.1270847373636 - ["parking_id"] = "23", - ["x"] = 0, - ["y"] = 0, - ["heading"] = 0, - ["callsign"] = 101, - ["onboard_num"] = "010", - ["payload"] = - { - ["pylons"] = {}, - ["fuel"] = "3080", - ["flare"] = 0, - ["chaff"] = 0, - ["gun"] = 100, - }, -- end of ["payload"] - } - return unit -end \ No newline at end of file +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file From 5ae7ee8e1b3524ddb714095c769da3f47e267751 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Fri, 15 Sep 2017 14:20:39 +0200 Subject: [PATCH 7/9] Docu fixes --- docs/Documentation/AI_Bai.html | 1964 +++++++++++++++++++++++++++++ docs/Documentation/Cargo.html | 1 - docs/Documentation/Designate.html | 4 - docs/Documentation/Point.html | 1 - docs/Documentation/Spawn.html | 20 + 5 files changed, 1984 insertions(+), 6 deletions(-) create mode 100644 docs/Documentation/AI_Bai.html diff --git a/docs/Documentation/AI_Bai.html b/docs/Documentation/AI_Bai.html new file mode 100644 index 000000000..4997d6b34 --- /dev/null +++ b/docs/Documentation/AI_Bai.html @@ -0,0 +1,1964 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module AI_Bai

+ +

AI -- Provide Battlefield Air Interdiction (bombing).

+ +

Banner Image

+ +
+ +

AI_BAI classes makes AI Controllables execute bombing tasks.

+ + + +

There are the following types of BAI classes defined:

+ + + +
+ +

Demo Missions

+ +

AI_BAI Demo Missions source code

+ +

AI_BAI Demo Missions, only for beta testers

+ +

ALL Demo Missions pack of the last release

+ +
+ +

YouTube Channel

+ +

AI_BAI YouTube Channel

+ +
+ +

Author: Sven Van de Velde (FlightControl)

+ +

Contributions:

+ + + +
+ + +

Global(s)

+ + + + + + + + + +
AI_BAI_ZONE +

AIBAIZONE class, extends AIPatrol#AIPATROL_ZONE

+ +

AIBAIZONE derives from the AIPatrol#AIPATROL_ZONE, inheriting its methods and behaviour.

+
_NewEngageRoute(AIControllable) + +
+

Type AI_BAI_ZONE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_BAI_ZONE.AIControllable +

The Controllable patrolling.

+
AI_BAI_ZONE:Abort() +

Synchronous Event Trigger for Event Abort.

+
AI_BAI_ZONE:Accomplish() +

Synchronous Event Trigger for Event Accomplish.

+
AI_BAI_ZONE.Accomplished + +
AI_BAI_ZONE:Destroy() +

Synchronous Event Trigger for Event Destroy.

+
AI_BAI_ZONE:Engage(EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) +

Synchronous Event Trigger for Event Engage.

+
AI_BAI_ZONE.EngageAltitude + +
AI_BAI_ZONE.EngageAttackQty + +
AI_BAI_ZONE.EngageDirection + +
AI_BAI_ZONE.EngageSpeed + +
AI_BAI_ZONE.EngageWeaponExpend + +
AI_BAI_ZONE.EngageZone + +
AI_BAI_ZONE:Fired() +

Synchronous Event Trigger for Event Fired.

+
AI_BAI_ZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageZone, PatrolAltType) +

Creates a new AIBAIZONE object

+
AI_BAI_ZONE:OnAfterAbort(Controllable, From, Event, To) +

OnAfter Transition Handler for Event Abort.

+
AI_BAI_ZONE:OnAfterAccomplish(Controllable, From, Event, To) +

OnAfter Transition Handler for Event Accomplish.

+
AI_BAI_ZONE:OnAfterDestroy(Controllable, From, Event, To) +

OnAfter Transition Handler for Event Destroy.

+
AI_BAI_ZONE:OnAfterEngage(Controllable, From, Event, To) +

OnAfter Transition Handler for Event Engage.

+
AI_BAI_ZONE:OnAfterFired(Controllable, From, Event, To) +

OnAfter Transition Handler for Event Fired.

+
AI_BAI_ZONE:OnBeforeAbort(Controllable, From, Event, To) +

OnBefore Transition Handler for Event Abort.

+
AI_BAI_ZONE:OnBeforeAccomplish(Controllable, From, Event, To) +

OnBefore Transition Handler for Event Accomplish.

+
AI_BAI_ZONE:OnBeforeDestroy(Controllable, From, Event, To) +

OnBefore Transition Handler for Event Destroy.

+
AI_BAI_ZONE:OnBeforeEngage(Controllable, From, Event, To) +

OnBefore Transition Handler for Event Engage.

+
AI_BAI_ZONE:OnBeforeFired(Controllable, From, Event, To) +

OnBefore Transition Handler for Event Fired.

+
AI_BAI_ZONE:OnEnterEngaging(Controllable, From, Event, To) +

OnEnter Transition Handler for State Engaging.

+
AI_BAI_ZONE:OnEventDead(EventData) + +
AI_BAI_ZONE:OnLeaveEngaging(Controllable, From, Event, To) +

OnLeave Transition Handler for State Engaging.

+
AI_BAI_ZONE.Search + +
AI_BAI_ZONE:SearchOff() +

If Search is Off, the current zone coordinate will be the center of the bombing.

+
AI_BAI_ZONE:SearchOn() +

If Search is On, BAI will search for potential targets in the zone.

+
AI_BAI_ZONE:SearchOnOff(Search) +

Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.

+
AI_BAI_ZONE:SetEngageZone(EngageZone) +

Set the Engage Zone where the AI is performing BOMB.

+
AI_BAI_ZONE.TargetZone +

The Zone where the patrol needs to be executed.

+
AI_BAI_ZONE:__Abort(Delay) +

Asynchronous Event Trigger for Event Abort.

+
AI_BAI_ZONE:__Accomplish(Delay) +

Asynchronous Event Trigger for Event Accomplish.

+
AI_BAI_ZONE:__Destroy(Delay) +

Asynchronous Event Trigger for Event Destroy.

+
AI_BAI_ZONE:__Engage(Delay, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) +

Asynchronous Event Trigger for Event Engage.

+
AI_BAI_ZONE:__Fired(Delay) +

Asynchronous Event Trigger for Event Fired.

+
AI_BAI_ZONE:onafterAbort(Controllable, From, Event, To) + +
AI_BAI_ZONE:onafterAccomplish(Controllable, From, Event, To) + +
AI_BAI_ZONE:onafterDestroy(Controllable, From, Event, To, EventData) + +
AI_BAI_ZONE:onafterEngage(Controllable, From, Event, To, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) + +
AI_BAI_ZONE:onafterStart(Controllable, From, Event, To) +

onafter State Transition for Event Start.

+
AI_BAI_ZONE:onafterTarget(Controllable, From, Event, To) + +
AI_BAI_ZONE:onbeforeEngage(Controllable, From, Event, To) + +
+ +

Global(s)

+
+
+ + #AI_BAI_ZONE + +AI_BAI_ZONE + +
+
+ +

AIBAIZONE class, extends AIPatrol#AIPATROL_ZONE

+ +

AIBAIZONE derives from the AIPatrol#AIPATROL_ZONE, inheriting its methods and behaviour.

+ + +

+The AIBAIZONE class implements the core functions to provide BattleGround Air Interdiction in an Engage Zone by an AIR Controllable or Group. +The AIBAIZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.

+ +

HoldAndEngage

+ +

The AIBAIZONE is assigned a Group and this must be done before the AIBAIZONE process can be started through the Start event.

+ +

Start Event

+ +

Upon started, The AI will Route itself towards the random 3D point within a patrol zone, +using a random speed within the given altitude and speed limits. +Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits. +This cycle will continue until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.

+ +

Route Event

+ +

When the AI is commanded to provide BattleGround Air Interdiction (through the event Engage), the AI will fly towards the Engage Zone. +Any target that is detected in the Engage Zone will be reported and will be destroyed by the AI.

+ +

Engage Event

+ +

The AI will detect the targets and will only destroy the targets within the Engage Zone.

+ +

Engage Event

+ +

Every target that is destroyed, is reported< by the AI.

+ +

Engage Event

+ +

Note that the AI does not know when the Engage Zone is cleared, and therefore will keep circling in the zone.

+ +

Engage Event

+ +

Until it is notified through the event Accomplish, which is to be triggered by an observing party:

+ +
    +
  • a FAC
  • +
  • a timed event
  • +
  • a menu option selected by a human
  • +
  • a condition
  • +
  • others ...
  • +
+ +

Engage Event

+ +

When the AI has accomplished the Bombing, it will fly back to the Patrol Zone.

+ +

Engage Event

+ +

It will keep patrolling there, until it is notified to RTB or move to another BOMB Zone. +It can be notified to go RTB through the RTB event.

+ +

When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.

+ +

Engage Event

+ +

1. AIBAIZONE constructor

+ + + +

2. AIBAIZONE is a FSM

+ +

Process

+ +

2.1. AIBAIZONE States

+ +
    +
  • None ( Group ): The process is not started yet.
  • +
  • Patrolling ( Group ): The AI is patrolling the Patrol Zone.
  • +
  • Engaging ( Group ): The AI is engaging the targets in the Engage Zone, executing BOMB.
  • +
  • Returning ( Group ): The AI is returning to Base..
  • +
+ +

2.2. AIBAIZONE Events

+ + + +

3. Modify the Engage Zone behaviour to pinpoint a map object or scenery object

+ +

Use the method AIBAIZONE.SearchOff() to specify that the EngageZone is not to be searched for potential targets (UNITs), but that the center of the zone +is the point where a map object is to be destroyed (like a bridge).

+ +

Example:

+ +
 -- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location.
+ AIBAIZone:SearchOff()
+
+ +

Searching can be switched back on with the method AIBAIZONE.SearchOn(). Use the method AIBAIZONE.SearchOnOff() to flexibily switch searching on or off.

+ +
+ + +
+
+
+
+ + +_NewEngageRoute(AIControllable) + +
+
+ + + +

Parameter

+ +
+
+

Type AI_Bai

+ +

Type AI_BAI_ZONE

+ +

AIBAIZONE class

+ +

Field(s)

+
+
+ + Wrapper.Controllable#CONTROLLABLE + +AI_BAI_ZONE.AIControllable + +
+
+ +

The Controllable patrolling.

+ +
+
+
+
+ + +AI_BAI_ZONE:Abort() + +
+
+ +

Synchronous Event Trigger for Event Abort.

+ +
+
+
+
+ + +AI_BAI_ZONE:Accomplish() + +
+
+ +

Synchronous Event Trigger for Event Accomplish.

+ +
+
+
+
+ + #boolean + +AI_BAI_ZONE.Accomplished + +
+
+ + + +
+
+
+
+ + +AI_BAI_ZONE:Destroy() + +
+
+ +

Synchronous Event Trigger for Event Destroy.

+ +
+
+
+
+ + +AI_BAI_ZONE:Engage(EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) + +
+
+ +

Synchronous Event Trigger for Event Engage.

+ +

Parameters

+
    +
  • + +

    #number EngageSpeed : +(optional) The speed the Group will hold when engaging to the target zone.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance EngageAltitude : +(optional) Desired altitude to perform the unit engagement.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend EngageWeaponExpend : +(optional) Determines how much weapon will be released at each attack. +If parameter is not defined the unit / controllable will choose expend on its own discretion. +Use the structure DCSTypes#AI.Task.WeaponExpend to define the amount of weapons to be release at each attack.

    + +
  • +
  • + +

    #number EngageAttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth EngageDirection : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE.EngageAltitude + +
+
+ + + +
+
+
+
+ + + +AI_BAI_ZONE.EngageAttackQty + +
+
+ + + +
+
+
+
+ + + +AI_BAI_ZONE.EngageDirection + +
+
+ + + +
+
+
+
+ + +AI_BAI_ZONE.EngageSpeed + +
+
+ + + +
+
+
+
+ + + +AI_BAI_ZONE.EngageWeaponExpend + +
+
+ + + +
+
+
+
+ + + +AI_BAI_ZONE.EngageZone + +
+
+ + + +
+
+
+
+ + +AI_BAI_ZONE:Fired() + +
+
+ +

Synchronous Event Trigger for Event Fired.

+ +
+
+
+
+ + +AI_BAI_ZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageZone, PatrolAltType) + +
+
+ +

Creates a new AIBAIZONE object

+ +

Parameters

+ +

Return value

+ +

#AIBAIZONE: +self

+ +
+
+
+
+ + +AI_BAI_ZONE:OnAfterAbort(Controllable, From, Event, To) + +
+
+ +

OnAfter Transition Handler for Event Abort.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:OnAfterAccomplish(Controllable, From, Event, To) + +
+
+ +

OnAfter Transition Handler for Event Accomplish.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:OnAfterDestroy(Controllable, From, Event, To) + +
+
+ +

OnAfter Transition Handler for Event Destroy.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:OnAfterEngage(Controllable, From, Event, To) + +
+
+ +

OnAfter Transition Handler for Event Engage.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:OnAfterFired(Controllable, From, Event, To) + +
+
+ +

OnAfter Transition Handler for Event Fired.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:OnBeforeAbort(Controllable, From, Event, To) + +
+
+ +

OnBefore Transition Handler for Event Abort.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+

Return value

+ +

#boolean: +Return false to cancel Transition.

+ +
+
+
+
+ + +AI_BAI_ZONE:OnBeforeAccomplish(Controllable, From, Event, To) + +
+
+ +

OnBefore Transition Handler for Event Accomplish.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+

Return value

+ +

#boolean: +Return false to cancel Transition.

+ +
+
+
+
+ + +AI_BAI_ZONE:OnBeforeDestroy(Controllable, From, Event, To) + +
+
+ +

OnBefore Transition Handler for Event Destroy.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+

Return value

+ +

#boolean: +Return false to cancel Transition.

+ +
+
+
+
+ + +AI_BAI_ZONE:OnBeforeEngage(Controllable, From, Event, To) + +
+
+ +

OnBefore Transition Handler for Event Engage.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:OnBeforeFired(Controllable, From, Event, To) + +
+
+ +

OnBefore Transition Handler for Event Fired.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+

Return value

+ +

#boolean: +Return false to cancel Transition.

+ +
+
+
+
+ + +AI_BAI_ZONE:OnEnterEngaging(Controllable, From, Event, To) + +
+
+ +

OnEnter Transition Handler for State Engaging.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:OnEventDead(EventData) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +AI_BAI_ZONE:OnLeaveEngaging(Controllable, From, Event, To) + +
+
+ +

OnLeave Transition Handler for State Engaging.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+

Return value

+ +

#boolean: +Return false to cancel Transition.

+ +
+
+
+
+ + + +AI_BAI_ZONE.Search + +
+
+ + + +
+
+
+
+ + +AI_BAI_ZONE:SearchOff() + +
+
+ +

If Search is Off, the current zone coordinate will be the center of the bombing.

+ +

Return value

+ +

#AIBAIZONE:

+ + +
+
+
+
+ + +AI_BAI_ZONE:SearchOn() + +
+
+ +

If Search is On, BAI will search for potential targets in the zone.

+ +

Return value

+ +

#AIBAIZONE:

+ + +
+
+
+
+ + +AI_BAI_ZONE:SearchOnOff(Search) + +
+
+ +

Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.

+ + +

AIBAIZONE will search for potential targets by default.

+ +

Parameter

+
    +
  • + +

    Search :

    + +
  • +
+

Return value

+ +

#AIBAIZONE:

+ + +
+
+
+
+ + +AI_BAI_ZONE:SetEngageZone(EngageZone) + +
+
+ +

Set the Engage Zone where the AI is performing BOMB.

+ + +

Note that if the EngageZone is changed, the AI needs to re-detect targets.

+ +

Parameter

+
    +
  • + +

    Core.Zone#ZONE EngageZone : +The zone where the AI is performing BOMB.

    + +
  • +
+

Return value

+ +

#AIBAIZONE: +self

+ +
+
+
+
+ + Core.Zone#ZONE_BASE + +AI_BAI_ZONE.TargetZone + +
+
+ +

The Zone where the patrol needs to be executed.

+ +
+
+
+
+ + +AI_BAI_ZONE:__Abort(Delay) + +
+
+ +

Asynchronous Event Trigger for Event Abort.

+ +

Parameter

+
    +
  • + +

    #number Delay : +The delay in seconds.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:__Accomplish(Delay) + +
+
+ +

Asynchronous Event Trigger for Event Accomplish.

+ +

Parameter

+
    +
  • + +

    #number Delay : +The delay in seconds.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:__Destroy(Delay) + +
+
+ +

Asynchronous Event Trigger for Event Destroy.

+ +

Parameter

+
    +
  • + +

    #number Delay : +The delay in seconds.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:__Engage(Delay, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) + +
+
+ +

Asynchronous Event Trigger for Event Engage.

+ +

Parameters

+
    +
  • + +

    #number Delay : +The delay in seconds.

    + +
  • +
  • + +

    #number EngageSpeed : +(optional) The speed the Group will hold when engaging to the target zone.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance EngageAltitude : +(optional) Desired altitude to perform the unit engagement.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend EngageWeaponExpend : +(optional) Determines how much weapon will be released at each attack. +If parameter is not defined the unit / controllable will choose expend on its own discretion. +Use the structure DCSTypes#AI.Task.WeaponExpend to define the amount of weapons to be release at each attack.

    + +
  • +
  • + +

    #number EngageAttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth EngageDirection : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:__Fired(Delay) + +
+
+ +

Asynchronous Event Trigger for Event Fired.

+ +

Parameter

+
    +
  • + +

    #number Delay : +The delay in seconds.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:onafterAbort(Controllable, From, Event, To) + +
+
+ + + +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:onafterAccomplish(Controllable, From, Event, To) + +
+
+ + + +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:onafterDestroy(Controllable, From, Event, To, EventData) + +
+
+ + + +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
  • + +

    Core.Event#EVENTDATA EventData :

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:onafterEngage(Controllable, From, Event, To, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) + +
+
+ + + +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
  • + +

    #number EngageSpeed : +(optional) The speed the Group will hold when engaging to the target zone.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance EngageAltitude : +(optional) Desired altitude to perform the unit engagement.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend EngageWeaponExpend : +(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    + +
  • +
  • + +

    #number EngageAttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth EngageDirection : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:onafterStart(Controllable, From, Event, To) + +
+
+ +

onafter State Transition for Event Start.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:onafterTarget(Controllable, From, Event, To) + +
+
+ + + +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+
+
+ + +AI_BAI_ZONE:onbeforeEngage(Controllable, From, Event, To) + +
+
+ + + +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +The Controllable Object managed by the FSM.

    + +
  • +
  • + +

    #string From : +The From State string.

    + +
  • +
  • + +

    #string Event : +The Event string.

    + +
  • +
  • + +

    #string To : +The To State string.

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html index d3e06f916..e1ae98516 100644 --- a/docs/Documentation/Cargo.html +++ b/docs/Documentation/Cargo.html @@ -3418,7 +3418,6 @@ The range till cargo will board.

- CARGO_UNIT.CargoCarrier diff --git a/docs/Documentation/Designate.html b/docs/Documentation/Designate.html index 04a372a42..ff349e1b5 100644 --- a/docs/Documentation/Designate.html +++ b/docs/Documentation/Designate.html @@ -1151,10 +1151,6 @@ function below will use the range 1-7 just in case

-<<<<<<< HEAD - -======= ->>>>>>> master DESIGNATE.LaserCodes diff --git a/docs/Documentation/Point.html b/docs/Documentation/Point.html index 496131c9a..80894df98 100644 --- a/docs/Documentation/Point.html +++ b/docs/Documentation/Point.html @@ -3395,7 +3395,6 @@ The y coordinate.

- POINT_VEC2.z diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index 214ba0ed3..2a77723ca 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -823,6 +823,12 @@ and any spaces before and after the resulting name are removed.

SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) + + + + SPAWN.uncontrolled + + @@ -3758,6 +3764,20 @@ True = Continue Scheduler

+ +
+
+
+ + + +SPAWN.uncontrolled + +
+
+ + +
From c1c148eab436de9affee39f1531c6d0e3ad9e54a Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Fri, 15 Sep 2017 14:24:25 +0200 Subject: [PATCH 8/9] deleted AI_Bai.html --- docs/Documentation/AI_Bai.html | 1964 -------------------------------- 1 file changed, 1964 deletions(-) delete mode 100644 docs/Documentation/AI_Bai.html diff --git a/docs/Documentation/AI_Bai.html b/docs/Documentation/AI_Bai.html deleted file mode 100644 index 4997d6b34..000000000 --- a/docs/Documentation/AI_Bai.html +++ /dev/null @@ -1,1964 +0,0 @@ - - - - - - -
-
- -
-
-
-
- -
-

Module AI_Bai

- -

AI -- Provide Battlefield Air Interdiction (bombing).

- -

Banner Image

- -
- -

AI_BAI classes makes AI Controllables execute bombing tasks.

- - - -

There are the following types of BAI classes defined:

- - - -
- -

Demo Missions

- -

AI_BAI Demo Missions source code

- -

AI_BAI Demo Missions, only for beta testers

- -

ALL Demo Missions pack of the last release

- -
- -

YouTube Channel

- -

AI_BAI YouTube Channel

- -
- -

Author: Sven Van de Velde (FlightControl)

- -

Contributions:

- - - -
- - -

Global(s)

- - - - - - - - - -
AI_BAI_ZONE -

AIBAIZONE class, extends AIPatrol#AIPATROL_ZONE

- -

AIBAIZONE derives from the AIPatrol#AIPATROL_ZONE, inheriting its methods and behaviour.

-
_NewEngageRoute(AIControllable) - -
-

Type AI_BAI_ZONE

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AI_BAI_ZONE.AIControllable -

The Controllable patrolling.

-
AI_BAI_ZONE:Abort() -

Synchronous Event Trigger for Event Abort.

-
AI_BAI_ZONE:Accomplish() -

Synchronous Event Trigger for Event Accomplish.

-
AI_BAI_ZONE.Accomplished - -
AI_BAI_ZONE:Destroy() -

Synchronous Event Trigger for Event Destroy.

-
AI_BAI_ZONE:Engage(EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) -

Synchronous Event Trigger for Event Engage.

-
AI_BAI_ZONE.EngageAltitude - -
AI_BAI_ZONE.EngageAttackQty - -
AI_BAI_ZONE.EngageDirection - -
AI_BAI_ZONE.EngageSpeed - -
AI_BAI_ZONE.EngageWeaponExpend - -
AI_BAI_ZONE.EngageZone - -
AI_BAI_ZONE:Fired() -

Synchronous Event Trigger for Event Fired.

-
AI_BAI_ZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageZone, PatrolAltType) -

Creates a new AIBAIZONE object

-
AI_BAI_ZONE:OnAfterAbort(Controllable, From, Event, To) -

OnAfter Transition Handler for Event Abort.

-
AI_BAI_ZONE:OnAfterAccomplish(Controllable, From, Event, To) -

OnAfter Transition Handler for Event Accomplish.

-
AI_BAI_ZONE:OnAfterDestroy(Controllable, From, Event, To) -

OnAfter Transition Handler for Event Destroy.

-
AI_BAI_ZONE:OnAfterEngage(Controllable, From, Event, To) -

OnAfter Transition Handler for Event Engage.

-
AI_BAI_ZONE:OnAfterFired(Controllable, From, Event, To) -

OnAfter Transition Handler for Event Fired.

-
AI_BAI_ZONE:OnBeforeAbort(Controllable, From, Event, To) -

OnBefore Transition Handler for Event Abort.

-
AI_BAI_ZONE:OnBeforeAccomplish(Controllable, From, Event, To) -

OnBefore Transition Handler for Event Accomplish.

-
AI_BAI_ZONE:OnBeforeDestroy(Controllable, From, Event, To) -

OnBefore Transition Handler for Event Destroy.

-
AI_BAI_ZONE:OnBeforeEngage(Controllable, From, Event, To) -

OnBefore Transition Handler for Event Engage.

-
AI_BAI_ZONE:OnBeforeFired(Controllable, From, Event, To) -

OnBefore Transition Handler for Event Fired.

-
AI_BAI_ZONE:OnEnterEngaging(Controllable, From, Event, To) -

OnEnter Transition Handler for State Engaging.

-
AI_BAI_ZONE:OnEventDead(EventData) - -
AI_BAI_ZONE:OnLeaveEngaging(Controllable, From, Event, To) -

OnLeave Transition Handler for State Engaging.

-
AI_BAI_ZONE.Search - -
AI_BAI_ZONE:SearchOff() -

If Search is Off, the current zone coordinate will be the center of the bombing.

-
AI_BAI_ZONE:SearchOn() -

If Search is On, BAI will search for potential targets in the zone.

-
AI_BAI_ZONE:SearchOnOff(Search) -

Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.

-
AI_BAI_ZONE:SetEngageZone(EngageZone) -

Set the Engage Zone where the AI is performing BOMB.

-
AI_BAI_ZONE.TargetZone -

The Zone where the patrol needs to be executed.

-
AI_BAI_ZONE:__Abort(Delay) -

Asynchronous Event Trigger for Event Abort.

-
AI_BAI_ZONE:__Accomplish(Delay) -

Asynchronous Event Trigger for Event Accomplish.

-
AI_BAI_ZONE:__Destroy(Delay) -

Asynchronous Event Trigger for Event Destroy.

-
AI_BAI_ZONE:__Engage(Delay, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) -

Asynchronous Event Trigger for Event Engage.

-
AI_BAI_ZONE:__Fired(Delay) -

Asynchronous Event Trigger for Event Fired.

-
AI_BAI_ZONE:onafterAbort(Controllable, From, Event, To) - -
AI_BAI_ZONE:onafterAccomplish(Controllable, From, Event, To) - -
AI_BAI_ZONE:onafterDestroy(Controllable, From, Event, To, EventData) - -
AI_BAI_ZONE:onafterEngage(Controllable, From, Event, To, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) - -
AI_BAI_ZONE:onafterStart(Controllable, From, Event, To) -

onafter State Transition for Event Start.

-
AI_BAI_ZONE:onafterTarget(Controllable, From, Event, To) - -
AI_BAI_ZONE:onbeforeEngage(Controllable, From, Event, To) - -
- -

Global(s)

-
-
- - #AI_BAI_ZONE - -AI_BAI_ZONE - -
-
- -

AIBAIZONE class, extends AIPatrol#AIPATROL_ZONE

- -

AIBAIZONE derives from the AIPatrol#AIPATROL_ZONE, inheriting its methods and behaviour.

- - -

-The AIBAIZONE class implements the core functions to provide BattleGround Air Interdiction in an Engage Zone by an AIR Controllable or Group. -The AIBAIZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.

- -

HoldAndEngage

- -

The AIBAIZONE is assigned a Group and this must be done before the AIBAIZONE process can be started through the Start event.

- -

Start Event

- -

Upon started, The AI will Route itself towards the random 3D point within a patrol zone, -using a random speed within the given altitude and speed limits. -Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits. -This cycle will continue until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.

- -

Route Event

- -

When the AI is commanded to provide BattleGround Air Interdiction (through the event Engage), the AI will fly towards the Engage Zone. -Any target that is detected in the Engage Zone will be reported and will be destroyed by the AI.

- -

Engage Event

- -

The AI will detect the targets and will only destroy the targets within the Engage Zone.

- -

Engage Event

- -

Every target that is destroyed, is reported< by the AI.

- -

Engage Event

- -

Note that the AI does not know when the Engage Zone is cleared, and therefore will keep circling in the zone.

- -

Engage Event

- -

Until it is notified through the event Accomplish, which is to be triggered by an observing party:

- -
    -
  • a FAC
  • -
  • a timed event
  • -
  • a menu option selected by a human
  • -
  • a condition
  • -
  • others ...
  • -
- -

Engage Event

- -

When the AI has accomplished the Bombing, it will fly back to the Patrol Zone.

- -

Engage Event

- -

It will keep patrolling there, until it is notified to RTB or move to another BOMB Zone. -It can be notified to go RTB through the RTB event.

- -

When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.

- -

Engage Event

- -

1. AIBAIZONE constructor

- - - -

2. AIBAIZONE is a FSM

- -

Process

- -

2.1. AIBAIZONE States

- -
    -
  • None ( Group ): The process is not started yet.
  • -
  • Patrolling ( Group ): The AI is patrolling the Patrol Zone.
  • -
  • Engaging ( Group ): The AI is engaging the targets in the Engage Zone, executing BOMB.
  • -
  • Returning ( Group ): The AI is returning to Base..
  • -
- -

2.2. AIBAIZONE Events

- - - -

3. Modify the Engage Zone behaviour to pinpoint a map object or scenery object

- -

Use the method AIBAIZONE.SearchOff() to specify that the EngageZone is not to be searched for potential targets (UNITs), but that the center of the zone -is the point where a map object is to be destroyed (like a bridge).

- -

Example:

- -
 -- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location.
- AIBAIZone:SearchOff()
-
- -

Searching can be switched back on with the method AIBAIZONE.SearchOn(). Use the method AIBAIZONE.SearchOnOff() to flexibily switch searching on or off.

- -
- - -
-
-
-
- - -_NewEngageRoute(AIControllable) - -
-
- - - -

Parameter

- -
-
-

Type AI_Bai

- -

Type AI_BAI_ZONE

- -

AIBAIZONE class

- -

Field(s)

-
-
- - Wrapper.Controllable#CONTROLLABLE - -AI_BAI_ZONE.AIControllable - -
-
- -

The Controllable patrolling.

- -
-
-
-
- - -AI_BAI_ZONE:Abort() - -
-
- -

Synchronous Event Trigger for Event Abort.

- -
-
-
-
- - -AI_BAI_ZONE:Accomplish() - -
-
- -

Synchronous Event Trigger for Event Accomplish.

- -
-
-
-
- - #boolean - -AI_BAI_ZONE.Accomplished - -
-
- - - -
-
-
-
- - -AI_BAI_ZONE:Destroy() - -
-
- -

Synchronous Event Trigger for Event Destroy.

- -
-
-
-
- - -AI_BAI_ZONE:Engage(EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) - -
-
- -

Synchronous Event Trigger for Event Engage.

- -

Parameters

-
    -
  • - -

    #number EngageSpeed : -(optional) The speed the Group will hold when engaging to the target zone.

    - -
  • -
  • - -

    Dcs.DCSTypes#Distance EngageAltitude : -(optional) Desired altitude to perform the unit engagement.

    - -
  • -
  • - -

    Dcs.DCSTypes#AI.Task.WeaponExpend EngageWeaponExpend : -(optional) Determines how much weapon will be released at each attack. -If parameter is not defined the unit / controllable will choose expend on its own discretion. -Use the structure DCSTypes#AI.Task.WeaponExpend to define the amount of weapons to be release at each attack.

    - -
  • -
  • - -

    #number EngageAttackQty : -(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    - -
  • -
  • - -

    Dcs.DCSTypes#Azimuth EngageDirection : -(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE.EngageAltitude - -
-
- - - -
-
-
-
- - - -AI_BAI_ZONE.EngageAttackQty - -
-
- - - -
-
-
-
- - - -AI_BAI_ZONE.EngageDirection - -
-
- - - -
-
-
-
- - -AI_BAI_ZONE.EngageSpeed - -
-
- - - -
-
-
-
- - - -AI_BAI_ZONE.EngageWeaponExpend - -
-
- - - -
-
-
-
- - - -AI_BAI_ZONE.EngageZone - -
-
- - - -
-
-
-
- - -AI_BAI_ZONE:Fired() - -
-
- -

Synchronous Event Trigger for Event Fired.

- -
-
-
-
- - -AI_BAI_ZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageZone, PatrolAltType) - -
-
- -

Creates a new AIBAIZONE object

- -

Parameters

- -

Return value

- -

#AIBAIZONE: -self

- -
-
-
-
- - -AI_BAI_ZONE:OnAfterAbort(Controllable, From, Event, To) - -
-
- -

OnAfter Transition Handler for Event Abort.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:OnAfterAccomplish(Controllable, From, Event, To) - -
-
- -

OnAfter Transition Handler for Event Accomplish.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:OnAfterDestroy(Controllable, From, Event, To) - -
-
- -

OnAfter Transition Handler for Event Destroy.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:OnAfterEngage(Controllable, From, Event, To) - -
-
- -

OnAfter Transition Handler for Event Engage.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:OnAfterFired(Controllable, From, Event, To) - -
-
- -

OnAfter Transition Handler for Event Fired.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:OnBeforeAbort(Controllable, From, Event, To) - -
-
- -

OnBefore Transition Handler for Event Abort.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-

Return value

- -

#boolean: -Return false to cancel Transition.

- -
-
-
-
- - -AI_BAI_ZONE:OnBeforeAccomplish(Controllable, From, Event, To) - -
-
- -

OnBefore Transition Handler for Event Accomplish.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-

Return value

- -

#boolean: -Return false to cancel Transition.

- -
-
-
-
- - -AI_BAI_ZONE:OnBeforeDestroy(Controllable, From, Event, To) - -
-
- -

OnBefore Transition Handler for Event Destroy.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-

Return value

- -

#boolean: -Return false to cancel Transition.

- -
-
-
-
- - -AI_BAI_ZONE:OnBeforeEngage(Controllable, From, Event, To) - -
-
- -

OnBefore Transition Handler for Event Engage.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:OnBeforeFired(Controllable, From, Event, To) - -
-
- -

OnBefore Transition Handler for Event Fired.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-

Return value

- -

#boolean: -Return false to cancel Transition.

- -
-
-
-
- - -AI_BAI_ZONE:OnEnterEngaging(Controllable, From, Event, To) - -
-
- -

OnEnter Transition Handler for State Engaging.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:OnEventDead(EventData) - -
-
- - - -

Parameter

- -
-
-
-
- - -AI_BAI_ZONE:OnLeaveEngaging(Controllable, From, Event, To) - -
-
- -

OnLeave Transition Handler for State Engaging.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-

Return value

- -

#boolean: -Return false to cancel Transition.

- -
-
-
-
- - - -AI_BAI_ZONE.Search - -
-
- - - -
-
-
-
- - -AI_BAI_ZONE:SearchOff() - -
-
- -

If Search is Off, the current zone coordinate will be the center of the bombing.

- -

Return value

- -

#AIBAIZONE:

- - -
-
-
-
- - -AI_BAI_ZONE:SearchOn() - -
-
- -

If Search is On, BAI will search for potential targets in the zone.

- -

Return value

- -

#AIBAIZONE:

- - -
-
-
-
- - -AI_BAI_ZONE:SearchOnOff(Search) - -
-
- -

Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.

- - -

AIBAIZONE will search for potential targets by default.

- -

Parameter

-
    -
  • - -

    Search :

    - -
  • -
-

Return value

- -

#AIBAIZONE:

- - -
-
-
-
- - -AI_BAI_ZONE:SetEngageZone(EngageZone) - -
-
- -

Set the Engage Zone where the AI is performing BOMB.

- - -

Note that if the EngageZone is changed, the AI needs to re-detect targets.

- -

Parameter

-
    -
  • - -

    Core.Zone#ZONE EngageZone : -The zone where the AI is performing BOMB.

    - -
  • -
-

Return value

- -

#AIBAIZONE: -self

- -
-
-
-
- - Core.Zone#ZONE_BASE - -AI_BAI_ZONE.TargetZone - -
-
- -

The Zone where the patrol needs to be executed.

- -
-
-
-
- - -AI_BAI_ZONE:__Abort(Delay) - -
-
- -

Asynchronous Event Trigger for Event Abort.

- -

Parameter

-
    -
  • - -

    #number Delay : -The delay in seconds.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:__Accomplish(Delay) - -
-
- -

Asynchronous Event Trigger for Event Accomplish.

- -

Parameter

-
    -
  • - -

    #number Delay : -The delay in seconds.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:__Destroy(Delay) - -
-
- -

Asynchronous Event Trigger for Event Destroy.

- -

Parameter

-
    -
  • - -

    #number Delay : -The delay in seconds.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:__Engage(Delay, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) - -
-
- -

Asynchronous Event Trigger for Event Engage.

- -

Parameters

-
    -
  • - -

    #number Delay : -The delay in seconds.

    - -
  • -
  • - -

    #number EngageSpeed : -(optional) The speed the Group will hold when engaging to the target zone.

    - -
  • -
  • - -

    Dcs.DCSTypes#Distance EngageAltitude : -(optional) Desired altitude to perform the unit engagement.

    - -
  • -
  • - -

    Dcs.DCSTypes#AI.Task.WeaponExpend EngageWeaponExpend : -(optional) Determines how much weapon will be released at each attack. -If parameter is not defined the unit / controllable will choose expend on its own discretion. -Use the structure DCSTypes#AI.Task.WeaponExpend to define the amount of weapons to be release at each attack.

    - -
  • -
  • - -

    #number EngageAttackQty : -(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    - -
  • -
  • - -

    Dcs.DCSTypes#Azimuth EngageDirection : -(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:__Fired(Delay) - -
-
- -

Asynchronous Event Trigger for Event Fired.

- -

Parameter

-
    -
  • - -

    #number Delay : -The delay in seconds.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:onafterAbort(Controllable, From, Event, To) - -
-
- - - -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:onafterAccomplish(Controllable, From, Event, To) - -
-
- - - -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:onafterDestroy(Controllable, From, Event, To, EventData) - -
-
- - - -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
  • - -

    Core.Event#EVENTDATA EventData :

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:onafterEngage(Controllable, From, Event, To, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection) - -
-
- - - -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
  • - -

    #number EngageSpeed : -(optional) The speed the Group will hold when engaging to the target zone.

    - -
  • -
  • - -

    Dcs.DCSTypes#Distance EngageAltitude : -(optional) Desired altitude to perform the unit engagement.

    - -
  • -
  • - -

    Dcs.DCSTypes#AI.Task.WeaponExpend EngageWeaponExpend : -(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    - -
  • -
  • - -

    #number EngageAttackQty : -(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    - -
  • -
  • - -

    Dcs.DCSTypes#Azimuth EngageDirection : -(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:onafterStart(Controllable, From, Event, To) - -
-
- -

onafter State Transition for Event Start.

- -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:onafterTarget(Controllable, From, Event, To) - -
-
- - - -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
-
-
- - -AI_BAI_ZONE:onbeforeEngage(Controllable, From, Event, To) - -
-
- - - -

Parameters

-
    -
  • - -

    Wrapper.Controllable#CONTROLLABLE Controllable : -The Controllable Object managed by the FSM.

    - -
  • -
  • - -

    #string From : -The From State string.

    - -
  • -
  • - -

    #string Event : -The Event string.

    - -
  • -
  • - -

    #string To : -The To State string.

    - -
  • -
-
-
- -
- -
- - From a8e14b5e20e11749f80444d4c49ea200a9a1b699 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Fri, 15 Sep 2017 14:31:23 +0200 Subject: [PATCH 9/9] .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index ec71258a4..135102f04 100644 --- a/.gitignore +++ b/.gitignore @@ -221,4 +221,3 @@ _gsdata_/ .gitattributes .gitignore Moose Test Missions/MOOSE_Test_Template.miz -*.html