Module PatrolZone

This module contains the PATROLZONE class.


1) Patrol#PATROLZONE class, extends Base#BASE

The Patrol#PATROLZONE class implements the core functions to patrol a Zone.

1.1) PATROLZONE constructor:

PatrolZone#PATROLZONE.New(): Creates a new PATROLZONE object.

1.2) Modify the PATROLZONE parameters:

The following methods are available to modify the parameters of a PATROLZONE object:

* <a href="PatrolZone.html##(PATROLZONE).SetGroup">PatrolZone#PATROLZONE.SetGroup</a>(): Set the AI Patrol Group.
* <a href="PatrolZone.html##(PATROLZONE).SetSpeed">PatrolZone#PATROLZONE.SetSpeed</a>(): Set the patrol speed of the AI, for the next patrol.
* <a href="PatrolZone.html##(PATROLZONE).SetAltitude">PatrolZone#PATROLZONE.SetAltitude</a>(): Set altitude of the AI, for the next patrol.

1.3) Manage the out of fuel in the PATROLZONE:

When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base. Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated. When the fuel treshold is reached, the PatrolGroup will continue for a given time its patrol task in orbit, while a new PatrolGroup is targetted to the PATROLZONE. Once the time is finished, the old PatrolGroup will return to the base. Use the method PatrolZone#PATROLZONE.ManageFuel() to have this proces in place.


Global(s)

PATROLZONE
_NewPatrolRoute(PatrolGroup)

Type PATROLZONE

PATROLZONE.ClassName
PATROLZONE:ManageFuel(PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime)

When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.

PATROLZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed)

Creates a new PATROLZONE object, taking a Group object as a parameter.

PATROLZONE:NewPatrolRoute()

Defines a new patrol route using the PatrolZone parameters and settings.

PATROLZONE.PatrolCeilingAltitude

The highest altitude in meters where to execute the patrol.

PATROLZONE.PatrolFloorAltitude

The lowest altitude in meters where to execute the patrol.

PATROLZONE.PatrolFuelTresholdPercentage
PATROLZONE.PatrolGroup

The Group patrolling.

PATROLZONE.PatrolGroupTemplateName
PATROLZONE.PatrolManageFuel
PATROLZONE.PatrolMaxSpeed

The maximum speed of the Group in km/h.

PATROLZONE.PatrolMinSpeed

The minimum speed of the Group in km/h.

PATROLZONE.PatrolOutOfFuelMonitor
PATROLZONE.PatrolOutOfFuelOrbitTime
PATROLZONE.PatrolZone

The Zone where the patrol needs to be executed.

PATROLZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)

Sets the floor and ceiling altitude of the patrol.

PATROLZONE:SetGroup(PatrolGroup)

Set the Group to act as the Patroller.

PATROLZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)

Sets (modifies) the minimum and maximum speed of the patrol.

PATROLZONE.SpawnPatrolGroup

Global(s)

#PATROLZONE PATROLZONE
_NewPatrolRoute(PatrolGroup)

Parameter

Type PatrolZone

Type PATROLZONE

PATROLZONE class

Field(s)

#string PATROLZONE.ClassName
PATROLZONE:ManageFuel(PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime)

When the PatrolGroup is out of fuel, it is required that a new PatrolGroup is started, before the old PatrolGroup can return to the home base.

Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated. When the fuel treshold is reached, the PatrolGroup will continue for a given time its patrol task in orbit, while a new PatrolGroup is targetted to the PATROLZONE. Once the time is finished, the old PatrolGroup will return to the base.

Parameters

  • #number PatrolFuelTresholdPercentage : The treshold in percentage (between 0 and 1) when the PatrolGroup is considered to get out of fuel.

  • #number PatrolOutOfFuelOrbitTime : The amount of seconds the out of fuel PatrolGroup will orbit before returning to the base.

Return value

#PATROLZONE: self

PATROLZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed)

Creates a new PATROLZONE object, taking a Group object as a parameter.

The GROUP needs to be alive.

Parameters

Return value

#PATROLZONE: self

Usage:

-- Define a new PATROLZONE Object. This PatrolArea will patrol a group within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
PatrolZone = ZONE:New( 'PatrolZone' )
PatrolGroup = GROUP:FindByName( "Patrol Group" )
PatrolArea = PATROLZONE:New( PatrolGroup, PatrolZone, 3000, 6000, 600, 900 )
PATROLZONE:NewPatrolRoute()

Defines a new patrol route using the PatrolZone parameters and settings.

Return value

#PATROLZONE: self

DCSTypes#Altitude PATROLZONE.PatrolCeilingAltitude

The highest altitude in meters where to execute the patrol.

DCSTypes#Altitude PATROLZONE.PatrolFloorAltitude

The lowest altitude in meters where to execute the patrol.

PATROLZONE.PatrolFuelTresholdPercentage
Group#GROUP PATROLZONE.PatrolGroup

The Group patrolling.

PATROLZONE.PatrolGroupTemplateName
#boolean PATROLZONE.PatrolManageFuel
DCSTypes#Speed PATROLZONE.PatrolMaxSpeed

The maximum speed of the Group in km/h.

DCSTypes#Speed PATROLZONE.PatrolMinSpeed

The minimum speed of the Group in km/h.

PATROLZONE.PatrolOutOfFuelMonitor
PATROLZONE.PatrolOutOfFuelOrbitTime
Zone#ZONE_BASE PATROLZONE.PatrolZone

The Zone where the patrol needs to be executed.

PATROLZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)

Sets the floor and ceiling altitude of the patrol.

Parameters

  • DCSTypes#Altitude PatrolFloorAltitude : The lowest altitude in meters where to execute the patrol.

  • DCSTypes#Altitude PatrolCeilingAltitude : The highest altitude in meters where to execute the patrol.

Return value

#PATROLZONE: self

PATROLZONE:SetGroup(PatrolGroup)

Set the Group to act as the Patroller.

Parameter

Return value

#PATROLZONE: self

PATROLZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)

Sets (modifies) the minimum and maximum speed of the patrol.

Parameters

Return value

#PATROLZONE: self

PATROLZONE.SpawnPatrolGroup