Banner Image

Module Core.Zone

Core - Define zones within your mission of various forms, with various capabilities.


Features:

  • Create radius zones.
  • Create trigger zones.
  • Create polygon zones.
  • Create moving zones around a unit.
  • Create moving zones around a group.
  • Provide the zone behavior. Some zones are static, while others are moveable.
  • Enquire if a coordinate is within a zone.
  • Smoke zones.
  • Set a zone probability to control zone selection.
  • Get zone coordinates.
  • Get zone properties.
  • Get zone bounding box.
  • Set/get zone name.
  • Draw zones (circular and polygon) on the F10 map.

There are essentially two core functions that zones accommodate:

  • Test if an object is within the zone boundaries.
  • Provide the zone behavior. Some zones are static, while others are moveable.

The object classes are using the zone classes to test the zone boundaries, which can take various forms:

  • Test if completely within the zone.
  • Test if partly within the zone (for Wrapper.Group#GROUP objects).
  • Test if not in the zone.
  • Distance to the nearest intersecting point of the zone.
  • Distance to the center of the zone.
  • ...

Each of these ZONE classes have a zone name, and specific parameters defining the zone type:

  • #ZONE_BASE: The ZONE_BASE class defining the base for all other zone classes.
  • #ZONE_RADIUS: The ZONE_RADIUS class defined by a zone name, a location and a radius.
  • #ZONE: The ZONE class, defined by the zone name as defined within the Mission Editor.
  • #ZONE_UNIT: The ZONE_UNIT class defines by a zone around a Wrapper.Unit#UNIT with a radius.
  • #ZONE_GROUP: The ZONE_GROUP class defines by a zone around a Wrapper.Group#GROUP with a radius.
  • #ZONE_POLYGON: The ZONE_POLYGON class defines by a sequence of Wrapper.Group#GROUP waypoints within the Mission Editor, forming a polygon.
  • #ZONE_OVAL: The ZONE_OVAL class is defined by a center point, major axis, minor axis, and angle.

Demo Missions


Author: FlightControl

Contributions: Applevangelist, FunkyFranky, coconutcockpit


Global(s)

Global ZONE

The ZONE class, defined by the zone name as defined within the Mission Editor.

#ZONE ZONE

The ZONE class, defined by the zone name as defined within the Mission Editor.

This class implements the inherited functions from #ZONE_RADIUS taking into account the own zone format and properties.

ZONE constructor

  • ZONE.New(): Constructor. This will search for a trigger zone with the name given, and will return for you a ZONE object.

Declare a ZONE directly in the DCS mission editor!

You can declare a ZONE using the DCS mission editor by adding a trigger zone in the mission editor.

Then during mission startup, when loading Moose.lua, this trigger zone will be detected as a ZONE declaration. Within the background, a ZONE object will be created within the Core.Database. The ZONE name will be the trigger zone name.

So, you can search yourself for the ZONE object by using the ZONE.FindByName() method. In this example, local TriggerZone = ZONE:FindByName( "DefenseZone" ) would return the ZONE object that was created at mission startup, and reference it into the TriggerZone local object.

Refer to mission ZON-110 for a demonstration.

This is especially handy if you want to quickly setup a SET_ZONE... So when you would declare local SetZone = SET_ZONE:New():FilterPrefixes( "Defense" ):FilterStart(), then SetZone would contain the ZONE object DefenseZone as part of the zone collection, without much scripting overhead!!!

Global ZONE_AIRBASE

The ZONE_AIRBASE class defines by a zone around a Wrapper.Airbase#AIRBASE with a radius.

#ZONE_AIRBASE ZONE_AIRBASE

The ZONE_AIRBASE class defines by a zone around a Wrapper.Airbase#AIRBASE with a radius.

This class implements the inherited functions from #ZONE_RADIUS taking into account the own zone format and properties.

Global ZONE_BASE

This class is an abstract BASE class for derived classes, and is not meant to be instantiated.

#ZONE_BASE ZONE_BASE

This class is an abstract BASE class for derived classes, and is not meant to be instantiated.

Each zone has a name:

Each zone implements two polymorphic functions defined in #ZONE_BASE:

A zone has a probability factor that can be set to randomize a selection between zones:

  • ZONE_BASE.SetZoneProbability(): Set the randomization probability of a zone to be selected, taking a value between 0 and 1 ( 0 = 0%, 1 = 100% )
  • ZONE_BASE.GetZoneProbability(): Get the randomization probability of a zone to be selected, passing a value between 0 and 1 ( 0 = 0%, 1 = 100% )
  • ZONE_BASE.GetZoneMaybe(): Get the zone taking into account the randomization probability. nil is returned if this zone is not a candidate.

A zone manages vectors:

A zone has a bounding square:

A zone can be marked:

A zone might have additional Properties created in the DCS Mission Editor, which can be accessed:

*ZONE_BASE.GetProperty(): Returns the Value of the zone with the given PropertyName, or nil if no matching property exists. *ZONE_BASE.GetAllProperties(): Returns the zone Properties table.

Global ZONE_ELASTIC

The ZONE_ELASTIC class defines a dynamic polygon zone, where only the convex hull is used.

#ZONE_ELASTIC ZONE_ELASTIC

The ZONE_ELASTIC class defines a dynamic polygon zone, where only the convex hull is used.

Global ZONE_GROUP

The ZONE_GROUP class defines by a zone around a Wrapper.Group#GROUP with a radius.

#ZONE_GROUP ZONE_GROUP

The ZONE_GROUP class defines by a zone around a Wrapper.Group#GROUP with a radius.

The current leader of the group defines the center of the zone. This class implements the inherited functions from #ZONE_RADIUS taking into account the own zone format and properties.

Global ZONE_OVAL

ZONE_OVAL class, extends #ZONE_BASE

The ZONE_OVAL class is defined by a center point, major axis, minor axis, and angle.

#ZONE_OVAL ZONE_OVAL

ZONE_OVAL class, extends #ZONE_BASE

The ZONE_OVAL class is defined by a center point, major axis, minor axis, and angle.

This class implements the inherited functions from #ZONE_BASE taking into account the own zone format and properties.

Global ZONE_POLYGON

The ZONE_POLYGON class defined by a sequence of Wrapper.Group#GROUP waypoints within the Mission Editor, forming a polygon, OR by drawings made with the Draw tool - in the Mission Editor This class implements the inherited functions from #ZONE_RADIUS taking into account the own zone format and properties.

#ZONE_POLYGON ZONE_POLYGON

The ZONE_POLYGON class defined by a sequence of Wrapper.Group#GROUP waypoints within the Mission Editor, forming a polygon, OR by drawings made with the Draw tool - in the Mission Editor This class implements the inherited functions from #ZONE_RADIUS taking into account the own zone format and properties.

Declare a ZONE_POLYGON directly in the DCS mission editor!

You can declare a ZONE_POLYGON using the DCS mission editor by adding the #ZONE_POLYGON tag in the group name.

So, imagine you have a group declared in the mission editor, with group name DefenseZone#ZONE_POLYGON. Then during mission startup, when loading Moose.lua, this group will be detected as a ZONE_POLYGON declaration. Within the background, a ZONE_POLYGON object will be created within the Core.Database using the properties of the group. The ZONE_POLYGON name will be the group name without the #ZONE_POLYGON tag.

So, you can search yourself for the ZONE_POLYGON by using the ZONE_POLYGON.FindByName() method. In this example, local PolygonZone = ZONE_POLYGON:FindByName( "DefenseZone" ) would return the ZONE_POLYGON object that was created at mission startup, and reference it into the PolygonZone local object.

Mission ZON-510 shows a demonstration of this feature or method.

This is especially handy if you want to quickly setup a SET_ZONE... So when you would declare local SetZone = SET_ZONE:New():FilterPrefixes( "Defense" ):FilterStart(), then SetZone would contain the ZONE_POLYGON object DefenseZone as part of the zone collection, without much scripting overhead!

This class now also supports drawings made with the Draw tool in the Mission Editor. Any drawing made with Line > Segments > Closed, Polygon > Rect or Polygon > Free can be made into a ZONE_POLYGON.

This class has been updated to use a accurate way of generating random points inside the polygon without having to use trial and error guesses. You can also get the surface area of the polygon now, handy if you want measure which coalition has the largest captured area, for example.

Global ZONE_POLYGON_BASE

The ZONE_POLYGON_BASE class defined by a sequence of Wrapper.Group#GROUP waypoints within the Mission Editor, forming a polygon.

#ZONE_POLYGON_BASE ZONE_POLYGON_BASE

The ZONE_POLYGON_BASE class defined by a sequence of Wrapper.Group#GROUP waypoints within the Mission Editor, forming a polygon.

This class implements the inherited functions from #ZONE_RADIUS taking into account the own zone format and properties. This class is an abstract BASE class for derived classes, and is not meant to be instantiated.

Zone point randomization

Various functions exist to find random points within the zone.

Draw zone

Global ZONE_RADIUS

The ZONE_RADIUS class defined by a zone name, a location and a radius.

#ZONE_RADIUS ZONE_RADIUS

The ZONE_RADIUS class defined by a zone name, a location and a radius.

This class implements the inherited functions from #ZONE_BASE taking into account the own zone format and properties.

ZONE_RADIUS constructor

Manage the radius of the zone

Manage the location of the zone

Zone point randomization

Various functions exist to find random points within the zone.

Draw zone

Global ZONE_UNIT

ZONE_UNIT class, extends #ZONE_RADIUS

The ZONE_UNIT class defined by a zone attached to a Wrapper.Unit#UNIT with a radius and optional offsets.

#ZONE_UNIT ZONE_UNIT

ZONE_UNIT class, extends #ZONE_RADIUS

The ZONE_UNIT class defined by a zone attached to a Wrapper.Unit#UNIT with a radius and optional offsets.

This class implements the inherited functions from #ZONE_RADIUS taking into account the own zone format and properties.

Global _ZONE_TRIANGLE

ZONETRIANGLE class, extends #ZONE_BASE

ZONETRIANGLE class is a helper class for ZONE_POLYGON This class implements the inherited functions from #ZONE_BASE taking into account the own zone format and properties.

#_ZONE_TRIANGLE _ZONE_TRIANGLE

ZONETRIANGLE class, extends #ZONE_BASE

ZONETRIANGLE class is a helper class for ZONE_POLYGON This class implements the inherited functions from #ZONE_BASE taking into account the own zone format and properties.

Type(s)

ZONE , extends #ZONE_RADIUS
Fields and Methods inherited from ZONE Description

ZONE:FindByName(ZoneName)

Find a zone in the _DATABASE using the name of the zone.

ZONE:New(ZoneName)

Constructor of ZONE taking the zone name.

Fields and Methods inherited from ZONE_AIRBASE Description

ZONE_AIRBASE:GetAirbase()

Get the airbase as part of the ZONE_AIRBASE object.

ZONE_AIRBASE:GetRandomPointVec2(inner, outer)

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D location within the zone.

ZONE_AIRBASE:GetVec2()

Returns the current location of the AIRBASE.

ZONE_AIRBASE:New(AirbaseName, Radius)

Constructor to create a ZONE_AIRBASE instance, taking the zone name, a zone Wrapper.Airbase#AIRBASE and a radius.

ZONE_AIRBASE.isAirdrome

If true, airbase is an airdrome.

ZONE_AIRBASE.isHelipad

If true, airbase is a helipad.

ZONE_AIRBASE.isShip

If true, airbase is a ship.

Fields and Methods inherited from ZONE_BASE Description

ZONE_BASE:BoundZone()

Bound the zone boundaries with a tires.

ZONE_BASE.Checktime

Check every Checktime seconds, used for ZONE:Trigger()

ZONE_BASE.Color

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

ZONE_BASE.Coordinate

ZONE_BASE.DrawID

Unique ID of the drawn zone on the F10 map.

ZONE_BASE.FillColor

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

ZONE_BASE:Get2DDistance(Coordinate)

Get 2D distance to a coordinate.

ZONE_BASE:GetAllProperties()

Returns the zone Properties table.

ZONE_BASE:GetBoundingSquare()

Get the bounding square the zone.

ZONE_BASE:GetColor()

Get color table of the zone.

ZONE_BASE:GetColorAlpha()

Get transparency Alpha value of zone.

ZONE_BASE:GetColorRGB()

Get RGB color of zone.

ZONE_BASE:GetCoordinate(Height)

Returns a Core.Point#COORDINATE of the zone.

ZONE_BASE:GetDrawCoalition()

Get draw coalition of zone.

ZONE_BASE:GetDrawID()

Get ID of the zone object drawn on the F10 map.

ZONE_BASE:GetFillColor()

Get fill color table of the zone.

ZONE_BASE:GetFillColorAlpha()

Get transparency Alpha fill value of zone.

ZONE_BASE:GetFillColorRGB()

Get RGB fill color of zone.

ZONE_BASE:GetName()

Returns the name of the zone.

ZONE_BASE:GetPointVec2(Height)

Returns a Core.Point#POINT_VEC2 of the zone.

ZONE_BASE:GetPointVec3(Height)

Returns a Core.Point#POINT_VEC3 of the zone.

ZONE_BASE:GetProperty(PropertyName)

Returns the Value of the zone with the given PropertyName, or nil if no matching property exists.

ZONE_BASE:GetRandomPointVec2()

Define a random Core.Point#POINT_VEC2 within the zone.

ZONE_BASE:GetRandomPointVec3()

Define a random Core.Point#POINT_VEC3 within the zone.

ZONE_BASE:GetRandomVec2()

Define a random DCS#Vec2 within the zone.

ZONE_BASE:GetSurfaceType()

Get surface type of the zone.

ZONE_BASE:GetVec2()

Returns the DCS#Vec2 coordinate of the zone.

ZONE_BASE:GetVec3(Height)

Returns the DCS#Vec3 of the zone.

ZONE_BASE:GetZoneMaybe()

Get the zone taking into account the randomization probability of a zone to be selected.

ZONE_BASE:GetZoneProbability()

Get the randomization probability of a zone to be selected.

ZONE_BASE:IsCoordinateInZone(Coordinate)

Returns if a Coordinate is within the zone.

ZONE_BASE:IsPointVec2InZone(Coordinate)

Returns if a PointVec2 is within the zone.

ZONE_BASE:IsPointVec3InZone(PointVec3)

Returns if a PointVec3 is within the zone.

ZONE_BASE:IsVec2InZone(Vec2)

Returns if a Vec2 is within the zone.

ZONE_BASE:IsVec3InZone(Vec3)

Returns if a Vec3 is within the zone.

ZONE_BASE:New(ZoneName)

ZONE_BASE constructor

ZONE_BASE:OnAfterEnteredZone(From, Event, To, Controllable)

On After "EnteredZone" event.

ZONE_BASE:OnAfterLeftZone(From, Event, To, Controllable)

On After "LeftZone" event.

ZONE_BASE:SetCheckTime(seconds)

Set the check time for ZONE:Trigger()

ZONE_BASE:SetColor(RGBcolor, Alpha)

Set color of zone.

ZONE_BASE:SetDrawCoalition(Coalition)

Set draw coalition of zone.

ZONE_BASE:SetFillColor(RGBcolor, Alpha)

Set fill color of zone.

ZONE_BASE:SetName(ZoneName)

Sets the name of the zone.

ZONE_BASE:SetZoneProbability(ZoneProbability)

Set the randomization probability of a zone to be selected.

ZONE_BASE:SmokeZone(SmokeColor)

Smokes the zone boundaries in a color.

ZONE_BASE.Surface

Type of surface. Only determined at the center of the zone!

ZONE_BASE.Table

of any trigger zone properties from the ME. The key is the Name of the property, and the value is the property's Value.

ZONE_BASE:Trigger(Objects)

Start watching if the Object or Objects move into or out of a zone.

ZONE_BASE:TriggerStop()

Triggers the FSM event "TriggerStop".

ZONE_BASE:UndrawZone(Delay)

Remove the drawing of the zone from the F10 map.

ZONE_BASE.ZoneID

ID of zone. Only zones defined in the ME have an ID!

ZONE_BASE.ZoneName

Name of the zone.

ZONE_BASE.ZoneProbability

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

ZONE_BASE:_TriggerCheck(fromstart)

(Internal) Check the assigned objects for being in/out of the zone

ZONE_BASE:__TriggerStop(delay)

Triggers the FSM event "TriggerStop" after a delay.

ZONE_BASE.checkobjects

ZONE_BASE.drawCoalition

Draw coalition.

ZONE_BASE.objectset

ZONE_BASE:onafterTriggerRunCheck(From, Event, to, To)

(Internal) Check the assigned objects for being in/out of the zone

Fields and Methods inherited from FSM Description

ZONE_BASE:AddEndState(State)

Adds an End state.

ZONE_BASE:AddProcess(From, Event, Process, ReturnEvents)

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

ZONE_BASE:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

ZONE_BASE:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

ZONE_BASE:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

ZONE_BASE.CallScheduler

ZONE_BASE.Events

ZONE_BASE:GetCurrentState()

Get current state.

ZONE_BASE:GetEndStates()

Returns the End states.

ZONE_BASE:GetProcess(From, Event)

ZONE_BASE:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

ZONE_BASE:GetScores()

Returns a table with the scores defined.

ZONE_BASE:GetStartState()

Returns the start state of the FSM.

ZONE_BASE:GetState()

Get current state.

ZONE_BASE:GetSubs()

Returns a table with the Subs defined.

ZONE_BASE:GetTransitions()

Returns a table of the transition rules defined within the FSM.

ZONE_BASE:Is(State)

Check if FSM is in state.

ZONE_BASE:LoadCallBacks(CallBackTable)

Load call backs.

ZONE_BASE:New()

Creates a new FSM object.

ZONE_BASE.Scores

ZONE_BASE:SetProcess(From, Event, Fsm)

ZONE_BASE:SetStartState(State)

Sets the start state of the FSM.

ZONE_BASE._EndStates

ZONE_BASE._EventSchedules

ZONE_BASE._Processes

ZONE_BASE._Scores

ZONE_BASE._StartState

ZONE_BASE._Transitions

ZONE_BASE:_add_to_map(Map, Event)

Add to map.

ZONE_BASE:_call_handler(step, trigger, params, EventName)

Call handler.

ZONE_BASE:_create_transition(EventName)

Create transition.

ZONE_BASE:_delayed_transition(EventName)

Delayed transition.

ZONE_BASE:_eventmap(Events, EventStructure)

Event map.

ZONE_BASE:_gosub(ParentFrom, ParentEvent)

Go sub.

ZONE_BASE:_handler(EventName, ...)

Handler.

ZONE_BASE:_isendstate(Current)

Is end state.

ZONE_BASE:_submap(subs, sub, name)

Sub maps.

ZONE_BASE:can(e)

Check if can do an event.

ZONE_BASE:cannot(e)

Check if cannot do an event.

ZONE_BASE.current

ZONE_BASE.endstates

ZONE_BASE:is(State, state)

Check if FSM is in state.

ZONE_BASE.options

ZONE_BASE.subs

Fields and Methods inherited from ZONE_BASE.BoundingSquare Description

ZONE_BASE.BoundingSquare.x1

The lower x coordinate (left down)

ZONE_BASE.BoundingSquare.x2

The higher x coordinate (right up)

ZONE_BASE.BoundingSquare.y1

The lower y coordinate (left down)

ZONE_BASE.BoundingSquare.y2

The higher y coordinate (right up)

Fields and Methods inherited from ZONE_ELASTIC Description

ZONE_ELASTIC:AddSetGroup(GroupSet)

Add a set of groups.

ZONE_ELASTIC:AddVertex2D(Vec2)

Add a vertex (point) to the polygon.

ZONE_ELASTIC:AddVertex3D(Vec3)

Add a vertex (point) to the polygon.

ZONE_ELASTIC:New(ZoneName, Points)

Constructor to create a ZONE_ELASTIC instance.

ZONE_ELASTIC:StartUpdate(Tstart, dT, Tstop, Draw)

Start the updating scheduler.

ZONE_ELASTIC:StopUpdate(Delay)

Stop the updating scheduler.

ZONE_ELASTIC:Update(Delay, Draw)

Update the convex hull of the polygon.

ZONE_ELASTIC:_ConvexHull(pl)

Create a convex hull.

ZONE_ELASTIC.points

Points in 2D.

ZONE_ELASTIC.setGroups

Set of GROUPs.

ZONE_ELASTIC.setOpsGroups

Set of OPSGROUPS.

ZONE_ELASTIC.setUnits

Set of UNITs.

ZONE_ELASTIC.updateID

Scheduler ID for updating.

Fields and Methods inherited from ZONE_GROUP Description

ZONE_GROUP:GetRandomPointVec2(inner, outer)

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D location within the zone.

ZONE_GROUP:GetRandomVec2()

Returns a random location within the zone of the Wrapper.Group.

ZONE_GROUP:GetVec2()

Returns the current location of the Wrapper.Group.

ZONE_GROUP:New(ZoneName, ZoneGROUP, Radius)

Constructor to create a ZONE_GROUP instance, taking the zone name, a zone Wrapper.Group#GROUP and a radius.

Fields and Methods inherited from ZONE_OVAL Description

ZONE_OVAL.Angle

ZONE_OVAL.CenterVec2

ZONE_OVAL.DrawPoly

ZONE_OVAL:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly)

Draw the zone on the F10 map.

ZONE_OVAL:GetAngle()

Gets the angle of the oval.

ZONE_OVAL:GetBoundingSquare()

Calculates the bounding box of the oval.

ZONE_OVAL:GetMajorAxis()

Gets the major axis of the oval.

ZONE_OVAL:GetMinorAxis()

Gets the minor axis of the oval.

ZONE_OVAL:GetRandomPointVec2()

Define a random Core.Point#POINT_VEC2 within the zone.

ZONE_OVAL:GetRandomPointVec3()

Define a random Core.Point#POINT_VEC2 within the zone.

ZONE_OVAL:GetRandomVec2()

Returns a random Vec2 within the oval.

ZONE_OVAL:GetVec2()

Returns a the center point of the oval

ZONE_OVAL:IsVec2InZone(point, vec2)

Checks if a point is contained within the oval.

ZONE_OVAL.MajorAxis

ZONE_OVAL.MinorAxis

ZONE_OVAL:New(name, vec2, major_axis, minor_axis, angle)

Creates a new ZONE_OVAL from a center point, major axis, minor axis, and angle.

ZONE_OVAL:NewFromDrawing(DrawingName)

Constructor to create a ZONE_OVAL instance, taking the name of a drawing made with the draw tool in the Mission Editor.

ZONE_OVAL:PointsOnEdge(num_points)

Find points on the edge of the oval

ZONE_OVAL:UndrawZone()

Remove drawing from F10 map

ZONE_OVAL.ZoneName

Fields and Methods inherited from ZONE_BASE Description

ZONE_OVAL:BoundZone()

Bound the zone boundaries with a tires.

ZONE_OVAL.Checktime

Check every Checktime seconds, used for ZONE:Trigger()

ZONE_OVAL.Color

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

ZONE_OVAL.Coordinate

ZONE_OVAL.DrawID

Unique ID of the drawn zone on the F10 map.

ZONE_OVAL.FillColor

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

ZONE_OVAL:Get2DDistance(Coordinate)

Get 2D distance to a coordinate.

ZONE_OVAL:GetAllProperties()

Returns the zone Properties table.

ZONE_OVAL:GetBoundingSquare()

Get the bounding square the zone.

ZONE_OVAL:GetColor()

Get color table of the zone.

ZONE_OVAL:GetColorAlpha()

Get transparency Alpha value of zone.

ZONE_OVAL:GetColorRGB()

Get RGB color of zone.

ZONE_OVAL:GetCoordinate(Height)

Returns a Core.Point#COORDINATE of the zone.

ZONE_OVAL:GetDrawCoalition()

Get draw coalition of zone.

ZONE_OVAL:GetDrawID()

Get ID of the zone object drawn on the F10 map.

ZONE_OVAL:GetFillColor()

Get fill color table of the zone.

ZONE_OVAL:GetFillColorAlpha()

Get transparency Alpha fill value of zone.

ZONE_OVAL:GetFillColorRGB()

Get RGB fill color of zone.

ZONE_OVAL:GetName()

Returns the name of the zone.

ZONE_OVAL:GetPointVec2(Height)

Returns a Core.Point#POINT_VEC2 of the zone.

ZONE_OVAL:GetPointVec3(Height)

Returns a Core.Point#POINT_VEC3 of the zone.

ZONE_OVAL:GetProperty(PropertyName)

Returns the Value of the zone with the given PropertyName, or nil if no matching property exists.

ZONE_OVAL:GetRandomPointVec2()

Define a random Core.Point#POINT_VEC2 within the zone.

ZONE_OVAL:GetRandomPointVec3()

Define a random Core.Point#POINT_VEC3 within the zone.

ZONE_OVAL:GetRandomVec2()

Define a random DCS#Vec2 within the zone.

ZONE_OVAL:GetSurfaceType()

Get surface type of the zone.

ZONE_OVAL:GetVec2()

Returns the DCS#Vec2 coordinate of the zone.

ZONE_OVAL:GetVec3(Height)

Returns the DCS#Vec3 of the zone.

ZONE_OVAL:GetZoneMaybe()

Get the zone taking into account the randomization probability of a zone to be selected.

ZONE_OVAL:GetZoneProbability()

Get the randomization probability of a zone to be selected.

ZONE_OVAL:IsCoordinateInZone(Coordinate)

Returns if a Coordinate is within the zone.

ZONE_OVAL:IsPointVec2InZone(Coordinate)

Returns if a PointVec2 is within the zone.

ZONE_OVAL:IsPointVec3InZone(PointVec3)

Returns if a PointVec3 is within the zone.

ZONE_OVAL:IsVec2InZone(Vec2)

Returns if a Vec2 is within the zone.

ZONE_OVAL:IsVec3InZone(Vec3)

Returns if a Vec3 is within the zone.

ZONE_OVAL:New(ZoneName)

ZONE_BASE constructor

ZONE_OVAL:OnAfterEnteredZone(From, Event, To, Controllable)

On After "EnteredZone" event.

ZONE_OVAL:OnAfterLeftZone(From, Event, To, Controllable)

On After "LeftZone" event.

ZONE_OVAL:SetCheckTime(seconds)

Set the check time for ZONE:Trigger()

ZONE_OVAL:SetColor(RGBcolor, Alpha)

Set color of zone.

ZONE_OVAL:SetDrawCoalition(Coalition)

Set draw coalition of zone.

ZONE_OVAL:SetFillColor(RGBcolor, Alpha)

Set fill color of zone.

ZONE_OVAL:SetName(ZoneName)

Sets the name of the zone.

ZONE_OVAL:SetZoneProbability(ZoneProbability)

Set the randomization probability of a zone to be selected.

ZONE_OVAL:SmokeZone(SmokeColor)

Smokes the zone boundaries in a color.

ZONE_OVAL.Surface

Type of surface. Only determined at the center of the zone!

ZONE_OVAL.Table

of any trigger zone properties from the ME. The key is the Name of the property, and the value is the property's Value.

ZONE_OVAL:Trigger(Objects)

Start watching if the Object or Objects move into or out of a zone.

ZONE_OVAL:TriggerStop()

Triggers the FSM event "TriggerStop".

ZONE_OVAL:UndrawZone(Delay)

Remove the drawing of the zone from the F10 map.

ZONE_OVAL.ZoneID

ID of zone. Only zones defined in the ME have an ID!

ZONE_OVAL.ZoneName

Name of the zone.

ZONE_OVAL.ZoneProbability

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

ZONE_OVAL:_TriggerCheck(fromstart)

(Internal) Check the assigned objects for being in/out of the zone

ZONE_OVAL:__TriggerStop(delay)

Triggers the FSM event "TriggerStop" after a delay.

ZONE_OVAL.checkobjects

ZONE_OVAL.drawCoalition

Draw coalition.

ZONE_OVAL.objectset

ZONE_OVAL:onafterTriggerRunCheck(From, Event, to, To)

(Internal) Check the assigned objects for being in/out of the zone

Fields and Methods inherited from FSM Description

ZONE_OVAL:AddEndState(State)

Adds an End state.

ZONE_OVAL:AddProcess(From, Event, Process, ReturnEvents)

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

ZONE_OVAL:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

ZONE_OVAL:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

ZONE_OVAL:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

ZONE_OVAL.CallScheduler

ZONE_OVAL.Events

ZONE_OVAL:GetCurrentState()

Get current state.

ZONE_OVAL:GetEndStates()

Returns the End states.

ZONE_OVAL:GetProcess(From, Event)

ZONE_OVAL:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

ZONE_OVAL:GetScores()

Returns a table with the scores defined.

ZONE_OVAL:GetStartState()

Returns the start state of the FSM.

ZONE_OVAL:GetState()

Get current state.

ZONE_OVAL:GetSubs()

Returns a table with the Subs defined.

ZONE_OVAL:GetTransitions()

Returns a table of the transition rules defined within the FSM.

ZONE_OVAL:Is(State)

Check if FSM is in state.

ZONE_OVAL:LoadCallBacks(CallBackTable)

Load call backs.

ZONE_OVAL:New()

Creates a new FSM object.

ZONE_OVAL.Scores

ZONE_OVAL:SetProcess(From, Event, Fsm)

ZONE_OVAL:SetStartState(State)

Sets the start state of the FSM.

ZONE_OVAL._EndStates

ZONE_OVAL._EventSchedules

ZONE_OVAL._Processes

ZONE_OVAL._Scores

ZONE_OVAL._StartState

ZONE_OVAL._Transitions

ZONE_OVAL:_add_to_map(Map, Event)

Add to map.

ZONE_OVAL:_call_handler(step, trigger, params, EventName)

Call handler.

ZONE_OVAL:_create_transition(EventName)

Create transition.

ZONE_OVAL:_delayed_transition(EventName)

Delayed transition.

ZONE_OVAL:_eventmap(Events, EventStructure)

Event map.

ZONE_OVAL:_gosub(ParentFrom, ParentEvent)

Go sub.

ZONE_OVAL:_handler(EventName, ...)

Handler.

ZONE_OVAL:_isendstate(Current)

Is end state.

ZONE_OVAL:_submap(subs, sub, name)

Sub maps.

ZONE_OVAL:can(e)

Check if can do an event.

ZONE_OVAL:cannot(e)

Check if cannot do an event.

ZONE_OVAL.current

ZONE_OVAL.endstates

ZONE_OVAL:is(State, state)

Check if FSM is in state.

ZONE_OVAL.options

ZONE_OVAL.subs

Fields and Methods inherited from ZONE_POLYGON Description

ZONE_POLYGON:CheckScannedCoalition(Coalition)

Check if a certain coalition is inside a scanned zone.

ZONE_POLYGON:CountScannedCoalitions()

Count the number of different coalitions inside the zone.

ZONE_POLYGON:FindByName(ZoneName)

Find a polygon zone in the _DATABASE using the name of the polygon zone.

ZONE_POLYGON:GetScannedCoalition(Coalition)

Get Coalitions of the units in the Zone, or Check if there are units of the given Coalition in the Zone.

ZONE_POLYGON:GetScannedScenery()

Get scanned scenery table

ZONE_POLYGON:GetScannedSceneryObjects()

Get scanned scenery table

ZONE_POLYGON:GetScannedSceneryType(SceneryType)

Get scanned scenery types

ZONE_POLYGON:GetScannedSetGroup()

Get a set of scanned units.

ZONE_POLYGON:GetScannedSetScenery()

Get scanned set of scenery objects

ZONE_POLYGON:GetScannedSetUnit()

Get a set of scanned units.

ZONE_POLYGON:GetScannedUnits()

Count the number of different coalitions inside the zone.

ZONE_POLYGON:IsAllInZoneOfCoalition(Coalition)

Is All in Zone of Coalition?

ZONE_POLYGON:IsAllInZoneOfOtherCoalition(Coalition)

Is All in Zone of Other Coalition?

ZONE_POLYGON:IsNoneInZone()

Is None in Zone?

ZONE_POLYGON:IsNoneInZoneOfCoalition(Coalition)

Is None in Zone of Coalition?

ZONE_POLYGON:IsSomeInZoneOfCoalition(Coalition)

Is Some in Zone of Coalition?

ZONE_POLYGON:New(ZoneName, ZoneGroup)

Constructor to create a ZONE_POLYGON instance, taking the zone name and the Wrapper.Group#GROUP defined within the Mission Editor.

ZONE_POLYGON:NewFromDrawing(DrawingName)

Constructor to create a ZONE_POLYGON instance, taking the name of a drawing made with the draw tool in the Mission Editor.

ZONE_POLYGON:NewFromGroupName(GroupName)

Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the Wrapper.Group#GROUP defined within the Mission Editor.

ZONE_POLYGON:NewFromPointsArray(ZoneName, PointsArray)

Constructor to create a ZONE_POLYGON instance, taking the zone name and an array of DCS#Vec2, forming a polygon.

ZONE_POLYGON:Scan(ObjectCategories, UnitCategories)

Scan the zone for the presence of units of the given ObjectCategories.

ZONE_POLYGON.ScanData

ZONE_POLYGON.ScanSetGroup

Fields and Methods inherited from ZONE_POLYGON_BASE Description

ZONE_POLYGON_BASE.Borderlines

ZONE_POLYGON_BASE:BoundZone(UnBound)

Smokes the zone boundaries in a color.

ZONE_POLYGON_BASE:Boundary(Coalition, Color, Radius, Alpha, Segments, Closed)

Draw a frontier on the F10 map with small filled circles.

ZONE_POLYGON_BASE.DrawID

ZONE_POLYGON_BASE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly, IncludeTriangles)

Draw the zone on the F10 map.

ZONE_POLYGON_BASE.FillTriangles

ZONE_POLYGON_BASE:FlareZone(FlareColor, Segments, Azimuth, AddHeight)

Flare the zone boundaries in a color.

ZONE_POLYGON_BASE:Flush()

Flush polygon coordinates as a table in DCS.log.

ZONE_POLYGON_BASE:GetBoundingSquare()

Get the bounding square the zone.

ZONE_POLYGON_BASE:GetBoundingVec2()

Get the bounding 2D vectors of the polygon.

ZONE_POLYGON_BASE:GetRadius()

Get the smallest radius encompassing all points of the polygon zone.

ZONE_POLYGON_BASE:GetRandomCoordinate()

Return a Core.Point#COORDINATE object representing a random 3D point at landheight within the zone.

ZONE_POLYGON_BASE:GetRandomPointVec2()

Return a Core.Point#POINT_VEC2 object representing a random 2D point at landheight within the zone.

ZONE_POLYGON_BASE:GetRandomPointVec3()

Return a Core.Point#POINT_VEC3 object representing a random 3D point at landheight within the zone.

ZONE_POLYGON_BASE:GetRandomVec2()

Define a random DCS#Vec2 within the zone.

ZONE_POLYGON_BASE:GetSurfaceArea()

Get the surface area of this polygon

ZONE_POLYGON_BASE:GetVec2()

Returns the center location of the polygon.

ZONE_POLYGON_BASE:GetVertexCoordinate(Index)

Get a vertex of the polygon.

ZONE_POLYGON_BASE:GetVertexVec2(Index)

Get a vertex of the polygon.

ZONE_POLYGON_BASE:GetVertexVec3(Index)

Get a vertex of the polygon.

ZONE_POLYGON_BASE:GetVerticiesCoordinates()

Get a list of verticies of the polygon.

ZONE_POLYGON_BASE:GetVerticiesVec2()

Get a list of verticies of the polygon.

ZONE_POLYGON_BASE:GetVerticiesVec3()

Get a list of verticies of the polygon.

ZONE_POLYGON_BASE:GetZoneQuad(ZoneName, DoNotRegisterZone)

Get the smallest rectangular zone encompassing all points points of the polygon zone.

ZONE_POLYGON_BASE:GetZoneRadius(ZoneName, DoNotRegisterZone)

Get the smallest circular zone encompassing all points of the polygon zone.

ZONE_POLYGON_BASE:IsVec2InZone(Vec2)

Returns if a location is within the zone.

ZONE_POLYGON_BASE:IsVec3InZone(Vec3)

Returns if a point is within the zone.

ZONE_POLYGON_BASE:New(ZoneName, PointsArray)

Constructor to create a ZONE_POLYGON_BASE instance, taking the zone name and an array of DCS#Vec2, forming a polygon.

ZONE_POLYGON_BASE.Polygon

The polygon defined by an array of DCS#Vec2.

ZONE_POLYGON_BASE:ReDrawBorderline(Color, Alpha, LineType)

Change/Re-draw the border of a Polygon Zone

ZONE_POLYGON_BASE:ReFill(Color, Alpha)

Change/Re-fill a Polygon Zone

ZONE_POLYGON_BASE:RemoveJunk(Height)

Remove junk inside the zone.

ZONE_POLYGON_BASE:SmokeZone(SmokeColor, Segments)

Smokes the zone boundaries in a color.

ZONE_POLYGON_BASE.SurfaceArea

ZONE_POLYGON_BASE:UpdateFromVec2(Vec2Array)

Update polygon points with an array of DCS#Vec2.

ZONE_POLYGON_BASE:UpdateFromVec3(Vec2Array, Vec3Array)

Update polygon points with an array of DCS#Vec3.

ZONE_POLYGON_BASE:_CalculateSurfaceArea()

Calculates the surface area of the polygon.

ZONE_POLYGON_BASE._Triangles

ZONE_POLYGON_BASE:_Triangulate()

Triangulates the polygon.

Fields and Methods inherited from ZONE_RADIUS Description

ZONE_RADIUS:BoundZone(Points, CountryID, UnBound)

Bounds the zone with tires.

ZONE_RADIUS:CheckScannedCoalition(Coalition)

Check if a certain coalition is inside a scanned zone.

ZONE_RADIUS:CountScannedCoalitions()

Count the number of different coalitions inside the zone.

ZONE_RADIUS.DrawID

ZONE_RADIUS:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly)

Draw the zone circle on the F10 map.

ZONE_RADIUS:FlareZone(FlareColor, Points, Azimuth, AddHeight)

Flares the zone boundaries in a color.

ZONE_RADIUS:GetRadius()

Returns the radius of the zone.

ZONE_RADIUS:GetRandomCoordinate(inner, outer, surfacetypes)

Returns a Core.Point#COORDINATE object reflecting a random 3D location within the zone.

ZONE_RADIUS:GetRandomCoordinateWithoutBuildings(inner, outer, distance, markbuildings, markfinal)

Returns a Core.Point#COORDINATE object reflecting a random location within the zone where there are no map objects of type "Building".

ZONE_RADIUS:GetRandomPointVec2(inner, outer)

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D location within the zone.

ZONE_RADIUS:GetRandomPointVec3(inner, outer)

Returns a Core.Point#POINT_VEC3 object reflecting a random 3D location within the zone.

ZONE_RADIUS:GetRandomVec2(inner, outer, surfacetypes)

Returns a random Vec2 location within the zone.

ZONE_RADIUS:GetRandomVec3(inner, outer)

Returns Returns a random Vec3 location within the zone.

ZONE_RADIUS:GetScannedCoalition(Coalition)

Get Coalitions of the units in the Zone, or Check if there are units of the given Coalition in the Zone.

ZONE_RADIUS:GetScannedScenery()

Get scanned scenery table

ZONE_RADIUS:GetScannedSceneryObjects()

Get table of scanned scenery objects

ZONE_RADIUS:GetScannedSceneryType(SceneryType)

Get scanned scenery type

ZONE_RADIUS:GetScannedSetGroup()

Get a set of scanned groups.

ZONE_RADIUS:GetScannedSetScenery()

Get set of scanned scenery objects

ZONE_RADIUS:GetScannedSetUnit()

Get a set of scanned units.

ZONE_RADIUS:GetScannedUnits()

Get a table of scanned units.

ZONE_RADIUS:GetVec2()

Returns the DCS#Vec2 of the zone.

ZONE_RADIUS:GetVec3(Height)

Returns the DCS#Vec3 of the ZONE_RADIUS.

ZONE_RADIUS:IsAllInZoneOfCoalition(Coalition)

Is All in Zone of Coalition?

ZONE_RADIUS:IsAllInZoneOfOtherCoalition(Coalition)

Is All in Zone of Other Coalition?

ZONE_RADIUS:IsNoneInZone()

Is None in Zone?

ZONE_RADIUS:IsNoneInZoneOfCoalition(Coalition)

Is None in Zone of Coalition?

ZONE_RADIUS:IsSomeInZoneOfCoalition(Coalition)

Is Some in Zone of Coalition?

ZONE_RADIUS:IsVec2InZone(Vec2)

Returns if a location is within the zone.

ZONE_RADIUS:IsVec3InZone(Vec3)

Returns if a point is within the zone.

ZONE_RADIUS:MarkZone(Points)

Mark the zone with markers on the F10 map.

ZONE_RADIUS:New(ZoneName, Vec2, Radius, DoNotRegisterZone)

Constructor of #ZONE_RADIUS, taking the zone name, the zone location and a radius.

ZONE_RADIUS.Radius

The radius of the zone.

ZONE_RADIUS:RemoveJunk()

Remove junk inside the zone using the world.removeJunk function.

ZONE_RADIUS:Scan(ObjectCategories, UnitCategories)

Scan the zone for the presence of units of the given ObjectCategories.

ZONE_RADIUS.ScanData

ZONE_RADIUS.ScanSetGroup

ZONE_RADIUS:SearchZone(ObjectCategories, EvaluateFunction)

Searches the zone

ZONE_RADIUS:SetRadius(Radius)

Sets the radius of the zone.

ZONE_RADIUS:SetVec2(Vec2)

Sets the DCS#Vec2 of the zone.

ZONE_RADIUS:SmokeZone(SmokeColor, Points, AddHeight, AddOffSet, AngleOffset)

Smokes the zone boundaries in a color.

ZONE_RADIUS:UpdateFromVec2(Vec2, Radius)

Update zone from a 2D vector.

ZONE_RADIUS:UpdateFromVec3(Vec3, Radius)

Update zone from a 2D vector.

ZONE_RADIUS.Vec2

The current location of the zone.

Fields and Methods inherited from ZONE_UNIT Description

ZONE_UNIT:GetRandomVec2()

Returns a random location within the zone.

ZONE_UNIT:GetVec2()

Returns the current location of the Wrapper.Unit#UNIT.

ZONE_UNIT:GetVec3(Height)

Returns the DCS#Vec3 of the ZONE_UNIT.

ZONE_UNIT.LastVec2

ZONE_UNIT:New(ZoneName, ZoneUNIT, Radius, Offset)

Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius and optional offsets in X and Y directions.

ZONE_UNIT.ZoneUNIT

Fields and Methods inherited from ZONE_RADIUS Description

ZONE_UNIT:BoundZone(Points, CountryID, UnBound)

Bounds the zone with tires.

ZONE_UNIT:CheckScannedCoalition(Coalition)

Check if a certain coalition is inside a scanned zone.

ZONE_UNIT:CountScannedCoalitions()

Count the number of different coalitions inside the zone.

ZONE_UNIT.DrawID

ZONE_UNIT:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly)

Draw the zone circle on the F10 map.

ZONE_UNIT:FlareZone(FlareColor, Points, Azimuth, AddHeight)

Flares the zone boundaries in a color.

ZONE_UNIT:GetRadius()

Returns the radius of the zone.

ZONE_UNIT:GetRandomCoordinate(inner, outer, surfacetypes)

Returns a Core.Point#COORDINATE object reflecting a random 3D location within the zone.

ZONE_UNIT:GetRandomCoordinateWithoutBuildings(inner, outer, distance, markbuildings, markfinal)

Returns a Core.Point#COORDINATE object reflecting a random location within the zone where there are no map objects of type "Building".

ZONE_UNIT:GetRandomPointVec2(inner, outer)

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D location within the zone.

ZONE_UNIT:GetRandomPointVec3(inner, outer)

Returns a Core.Point#POINT_VEC3 object reflecting a random 3D location within the zone.

ZONE_UNIT:GetRandomVec2(inner, outer, surfacetypes)

Returns a random Vec2 location within the zone.

ZONE_UNIT:GetRandomVec3(inner, outer)

Returns Returns a random Vec3 location within the zone.

ZONE_UNIT:GetScannedCoalition(Coalition)

Get Coalitions of the units in the Zone, or Check if there are units of the given Coalition in the Zone.

ZONE_UNIT:GetScannedScenery()

Get scanned scenery table

ZONE_UNIT:GetScannedSceneryObjects()

Get table of scanned scenery objects

ZONE_UNIT:GetScannedSceneryType(SceneryType)

Get scanned scenery type

ZONE_UNIT:GetScannedSetGroup()

Get a set of scanned groups.

ZONE_UNIT:GetScannedSetScenery()

Get set of scanned scenery objects

ZONE_UNIT:GetScannedSetUnit()

Get a set of scanned units.

ZONE_UNIT:GetScannedUnits()

Get a table of scanned units.

ZONE_UNIT:GetVec2()

Returns the DCS#Vec2 of the zone.

ZONE_UNIT:GetVec3(Height)

Returns the DCS#Vec3 of the ZONE_RADIUS.

ZONE_UNIT:IsAllInZoneOfCoalition(Coalition)

Is All in Zone of Coalition?

ZONE_UNIT:IsAllInZoneOfOtherCoalition(Coalition)

Is All in Zone of Other Coalition?

ZONE_UNIT:IsNoneInZone()

Is None in Zone?

ZONE_UNIT:IsNoneInZoneOfCoalition(Coalition)

Is None in Zone of Coalition?

ZONE_UNIT:IsSomeInZoneOfCoalition(Coalition)

Is Some in Zone of Coalition?

ZONE_UNIT:IsVec2InZone(Vec2)

Returns if a location is within the zone.

ZONE_UNIT:IsVec3InZone(Vec3)

Returns if a point is within the zone.

ZONE_UNIT:MarkZone(Points)

Mark the zone with markers on the F10 map.

ZONE_UNIT:New(ZoneName, Vec2, Radius, DoNotRegisterZone)

Constructor of #ZONE_RADIUS, taking the zone name, the zone location and a radius.

ZONE_UNIT.Radius

The radius of the zone.

ZONE_UNIT:RemoveJunk()

Remove junk inside the zone using the world.removeJunk function.

ZONE_UNIT:Scan(ObjectCategories, UnitCategories)

Scan the zone for the presence of units of the given ObjectCategories.

ZONE_UNIT.ScanData

ZONE_UNIT.ScanSetGroup

ZONE_UNIT:SearchZone(ObjectCategories, EvaluateFunction)

Searches the zone

ZONE_UNIT:SetRadius(Radius)

Sets the radius of the zone.

ZONE_UNIT:SetVec2(Vec2)

Sets the DCS#Vec2 of the zone.

ZONE_UNIT:SmokeZone(SmokeColor, Points, AddHeight, AddOffSet, AngleOffset)

Smokes the zone boundaries in a color.

ZONE_UNIT:UpdateFromVec2(Vec2, Radius)

Update zone from a 2D vector.

ZONE_UNIT:UpdateFromVec3(Vec3, Radius)

Update zone from a 2D vector.

ZONE_UNIT.Vec2

The current location of the zone.

Fields and Methods inherited from _ZONE_TRIANGLE Description

_ZONE_TRIANGLE:ContainsPoint(pt, points)

Checks if a point is contained within the triangle.

_ZONE_TRIANGLE:Draw(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly)

Draw the triangle

_ZONE_TRIANGLE:Fill(Coalition, FillColor, FillAlpha, ReadOnly)

Draw the triangle

_ZONE_TRIANGLE:GetRandomVec2(points)

Returns a random Vec2 within the triangle.

_ZONE_TRIANGLE:New(p1, p2, p3)

Fields and Methods inherited from ZONE_BASE Description

_ZONE_TRIANGLE:BoundZone()

Bound the zone boundaries with a tires.

_ZONE_TRIANGLE.Checktime

Check every Checktime seconds, used for ZONE:Trigger()

_ZONE_TRIANGLE.Color

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

_ZONE_TRIANGLE.Coordinate

_ZONE_TRIANGLE.DrawID

Unique ID of the drawn zone on the F10 map.

_ZONE_TRIANGLE.FillColor

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

_ZONE_TRIANGLE:Get2DDistance(Coordinate)

Get 2D distance to a coordinate.

_ZONE_TRIANGLE:GetAllProperties()

Returns the zone Properties table.

_ZONE_TRIANGLE:GetBoundingSquare()

Get the bounding square the zone.

_ZONE_TRIANGLE:GetColor()

Get color table of the zone.

_ZONE_TRIANGLE:GetColorAlpha()

Get transparency Alpha value of zone.

_ZONE_TRIANGLE:GetColorRGB()

Get RGB color of zone.

_ZONE_TRIANGLE:GetCoordinate(Height)

Returns a Core.Point#COORDINATE of the zone.

_ZONE_TRIANGLE:GetDrawCoalition()

Get draw coalition of zone.

_ZONE_TRIANGLE:GetDrawID()

Get ID of the zone object drawn on the F10 map.

_ZONE_TRIANGLE:GetFillColor()

Get fill color table of the zone.

_ZONE_TRIANGLE:GetFillColorAlpha()

Get transparency Alpha fill value of zone.

_ZONE_TRIANGLE:GetFillColorRGB()

Get RGB fill color of zone.

_ZONE_TRIANGLE:GetName()

Returns the name of the zone.

_ZONE_TRIANGLE:GetPointVec2(Height)

Returns a Core.Point#POINT_VEC2 of the zone.

_ZONE_TRIANGLE:GetPointVec3(Height)

Returns a Core.Point#POINT_VEC3 of the zone.

_ZONE_TRIANGLE:GetProperty(PropertyName)

Returns the Value of the zone with the given PropertyName, or nil if no matching property exists.

_ZONE_TRIANGLE:GetRandomPointVec2()

Define a random Core.Point#POINT_VEC2 within the zone.

_ZONE_TRIANGLE:GetRandomPointVec3()

Define a random Core.Point#POINT_VEC3 within the zone.

_ZONE_TRIANGLE:GetRandomVec2()

Define a random DCS#Vec2 within the zone.

_ZONE_TRIANGLE:GetSurfaceType()

Get surface type of the zone.

_ZONE_TRIANGLE:GetVec2()

Returns the DCS#Vec2 coordinate of the zone.

_ZONE_TRIANGLE:GetVec3(Height)

Returns the DCS#Vec3 of the zone.

_ZONE_TRIANGLE:GetZoneMaybe()

Get the zone taking into account the randomization probability of a zone to be selected.

_ZONE_TRIANGLE:GetZoneProbability()

Get the randomization probability of a zone to be selected.

_ZONE_TRIANGLE:IsCoordinateInZone(Coordinate)

Returns if a Coordinate is within the zone.

_ZONE_TRIANGLE:IsPointVec2InZone(Coordinate)

Returns if a PointVec2 is within the zone.

_ZONE_TRIANGLE:IsPointVec3InZone(PointVec3)

Returns if a PointVec3 is within the zone.

_ZONE_TRIANGLE:IsVec2InZone(Vec2)

Returns if a Vec2 is within the zone.

_ZONE_TRIANGLE:IsVec3InZone(Vec3)

Returns if a Vec3 is within the zone.

_ZONE_TRIANGLE:New(ZoneName)

ZONE_BASE constructor

_ZONE_TRIANGLE:OnAfterEnteredZone(From, Event, To, Controllable)

On After "EnteredZone" event.

_ZONE_TRIANGLE:OnAfterLeftZone(From, Event, To, Controllable)

On After "LeftZone" event.

_ZONE_TRIANGLE:SetCheckTime(seconds)

Set the check time for ZONE:Trigger()

_ZONE_TRIANGLE:SetColor(RGBcolor, Alpha)

Set color of zone.

_ZONE_TRIANGLE:SetDrawCoalition(Coalition)

Set draw coalition of zone.

_ZONE_TRIANGLE:SetFillColor(RGBcolor, Alpha)

Set fill color of zone.

_ZONE_TRIANGLE:SetName(ZoneName)

Sets the name of the zone.

_ZONE_TRIANGLE:SetZoneProbability(ZoneProbability)

Set the randomization probability of a zone to be selected.

_ZONE_TRIANGLE:SmokeZone(SmokeColor)

Smokes the zone boundaries in a color.

_ZONE_TRIANGLE.Surface

Type of surface. Only determined at the center of the zone!

_ZONE_TRIANGLE.Table

of any trigger zone properties from the ME. The key is the Name of the property, and the value is the property's Value.

_ZONE_TRIANGLE:Trigger(Objects)

Start watching if the Object or Objects move into or out of a zone.

_ZONE_TRIANGLE:TriggerStop()

Triggers the FSM event "TriggerStop".

_ZONE_TRIANGLE:UndrawZone(Delay)

Remove the drawing of the zone from the F10 map.

_ZONE_TRIANGLE.ZoneID

ID of zone. Only zones defined in the ME have an ID!

_ZONE_TRIANGLE.ZoneName

Name of the zone.

_ZONE_TRIANGLE.ZoneProbability

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

_ZONE_TRIANGLE:_TriggerCheck(fromstart)

(Internal) Check the assigned objects for being in/out of the zone

_ZONE_TRIANGLE:__TriggerStop(delay)

Triggers the FSM event "TriggerStop" after a delay.

_ZONE_TRIANGLE.checkobjects

_ZONE_TRIANGLE.drawCoalition

Draw coalition.

_ZONE_TRIANGLE.objectset

_ZONE_TRIANGLE:onafterTriggerRunCheck(From, Event, to, To)

(Internal) Check the assigned objects for being in/out of the zone

Fields and Methods inherited from FSM Description

_ZONE_TRIANGLE:AddEndState(State)

Adds an End state.

_ZONE_TRIANGLE:AddProcess(From, Event, Process, ReturnEvents)

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

_ZONE_TRIANGLE:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

_ZONE_TRIANGLE:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

_ZONE_TRIANGLE:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

_ZONE_TRIANGLE.CallScheduler

_ZONE_TRIANGLE.Events

_ZONE_TRIANGLE:GetCurrentState()

Get current state.

_ZONE_TRIANGLE:GetEndStates()

Returns the End states.

_ZONE_TRIANGLE:GetProcess(From, Event)

_ZONE_TRIANGLE:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

_ZONE_TRIANGLE:GetScores()

Returns a table with the scores defined.

_ZONE_TRIANGLE:GetStartState()

Returns the start state of the FSM.

_ZONE_TRIANGLE:GetState()

Get current state.

_ZONE_TRIANGLE:GetSubs()

Returns a table with the Subs defined.

_ZONE_TRIANGLE:GetTransitions()

Returns a table of the transition rules defined within the FSM.

_ZONE_TRIANGLE:Is(State)

Check if FSM is in state.

_ZONE_TRIANGLE:LoadCallBacks(CallBackTable)

Load call backs.

_ZONE_TRIANGLE:New()

Creates a new FSM object.

_ZONE_TRIANGLE.Scores

_ZONE_TRIANGLE:SetProcess(From, Event, Fsm)

_ZONE_TRIANGLE:SetStartState(State)

Sets the start state of the FSM.

_ZONE_TRIANGLE._EndStates

_ZONE_TRIANGLE._EventSchedules

_ZONE_TRIANGLE._Processes

_ZONE_TRIANGLE._Scores

_ZONE_TRIANGLE._StartState

_ZONE_TRIANGLE._Transitions

_ZONE_TRIANGLE:_add_to_map(Map, Event)

Add to map.

_ZONE_TRIANGLE:_call_handler(step, trigger, params, EventName)

Call handler.

_ZONE_TRIANGLE:_create_transition(EventName)

Create transition.

_ZONE_TRIANGLE:_delayed_transition(EventName)

Delayed transition.

_ZONE_TRIANGLE:_eventmap(Events, EventStructure)

Event map.

_ZONE_TRIANGLE:_gosub(ParentFrom, ParentEvent)

Go sub.

_ZONE_TRIANGLE:_handler(EventName, ...)

Handler.

_ZONE_TRIANGLE:_isendstate(Current)

Is end state.

_ZONE_TRIANGLE:_submap(subs, sub, name)

Sub maps.

_ZONE_TRIANGLE:can(e)

Check if can do an event.

_ZONE_TRIANGLE:cannot(e)

Check if cannot do an event.

_ZONE_TRIANGLE.current

_ZONE_TRIANGLE.endstates

_ZONE_TRIANGLE:is(State, state)

Check if FSM is in state.

_ZONE_TRIANGLE.options

_ZONE_TRIANGLE.subs

Field(s)

Function(s)

Find a zone in the _DATABASE using the name of the zone.

Defined in:

ZONE

Parameter:

#string ZoneName

The name of the zone.

Return value:

self

Constructor of ZONE taking the zone name.

Defined in:

ZONE

Parameter:

#string ZoneName

The name of the zone as defined within the mission editor.

Return value:

self

Field(s)

#boolean ZONE_AIRBASE.isAirdrome

If true, airbase is an airdrome.

#boolean ZONE_AIRBASE.isHelipad

If true, airbase is a helipad.

#boolean ZONE_AIRBASE.isShip

If true, airbase is a ship.

Function(s)

Get the airbase as part of the ZONE_AIRBASE object.

Defined in:

ZONE_AIRBASE

Return value:

The airbase.

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D location within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

ZONE_AIRBASE

Parameters:

#number inner

(optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

Return value:

The Core.Point#POINT_VEC2 object reflecting the random 3D location within the zone.

Returns the current location of the AIRBASE.

Defined in:

ZONE_AIRBASE

Return value:

The location of the zone based on the AIRBASE location.

Constructor to create a ZONE_AIRBASE instance, taking the zone name, a zone Wrapper.Airbase#AIRBASE and a radius.

Defined in:

ZONE_AIRBASE

Parameters:

#string AirbaseName

Name of the airbase.

DCS#Distance Radius

(Optional)The radius of the zone in meters. Default 4000 meters.

Return value:

Field(s)

#number ZONE_BASE.Checktime

Check every Checktime seconds, used for ZONE:Trigger()

#table ZONE_BASE.Color

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

ZONE_BASE.Coordinate

Create a new coordinate object.

#number ZONE_BASE.DrawID

Unique ID of the drawn zone on the F10 map.

#table ZONE_BASE.FillColor

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

#number ZONE_BASE.Surface

Type of surface. Only determined at the center of the zone!

#table ZONE_BASE.Table

of any trigger zone properties from the ME. The key is the Name of the property, and the value is the property's Value.

#number ZONE_BASE.ZoneID

ID of zone. Only zones defined in the ME have an ID!

#string ZONE_BASE.ZoneName

Name of the zone.

#number ZONE_BASE.ZoneProbability

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

#number ZONE_BASE.drawCoalition

Draw coalition.

Function(s)

Bound the zone boundaries with a tires.

Defined in:

ZONE_BASE

Get 2D distance to a coordinate.

Defined in:

ZONE_BASE

Parameter:

Reference coordinate. Can also be a DCS#Vec2 or DCS#Vec3 object.

Return value:

#number:

Distance to the reference coordinate in meters.

Returns the zone Properties table.

Defined in:

ZONE_BASE

Return value:

#table:

The Key:Value table of TriggerZone properties of the zone.

Get the bounding square the zone.

Defined in:

ZONE_BASE

Return value:

#nil:

The bounding square.

Get color table of the zone.

Defined in:

ZONE_BASE

Return value:

#table:

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

Get transparency Alpha value of zone.

Defined in:

ZONE_BASE

Return value:

#number:

Alpha value.

Get RGB color of zone.

Defined in:

ZONE_BASE

Return value:

#table:

Table with three entries, e.g. {1, 0, 0}, which is the RGB color code.

Returns a Core.Point#COORDINATE of the zone.

Defined in:

ZONE_BASE

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The Coordinate of the zone.

Get draw coalition of zone.

Defined in:

ZONE_BASE

Return value:

#number:

Draw coalition.

Get ID of the zone object drawn on the F10 map.

The ID can be used to remove the drawn object from the F10 map view via UTILS.RemoveMark(MarkID).

Defined in:

ZONE_BASE

Return value:

#number:

Unique ID of the

Get fill color table of the zone.

Defined in:

ZONE_BASE

Return value:

#table:

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

Get transparency Alpha fill value of zone.

Defined in:

ZONE_BASE

Return value:

#number:

Alpha value.

Get RGB fill color of zone.

Defined in:

ZONE_BASE

Return value:

#table:

Table with three entries, e.g. {1, 0, 0}, which is the RGB color code.

Returns the name of the zone.

Defined in:

ZONE_BASE

Return value:

#string:

The name of the zone.

Returns a Core.Point#POINT_VEC2 of the zone.

Defined in:

ZONE_BASE

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The PointVec2 of the zone.

Returns a Core.Point#POINT_VEC3 of the zone.

Defined in:

ZONE_BASE

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The PointVec3 of the zone.

Returns the Value of the zone with the given PropertyName, or nil if no matching property exists.

Defined in:

ZONE_BASE

Parameter:

#string PropertyName

The name of a the TriggerZone Property to be retrieved.

Return value:

#string:

The Value of the TriggerZone Property with the given PropertyName, or nil if absent.

Usage:


local PropertiesZone = ZONE:FindByName("Properties Zone")
local Property = "ExampleProperty"
local PropertyValue = PropertiesZone:GetProperty(Property)

Define a random Core.Point#POINT_VEC2 within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

ZONE_BASE

Return value:

The PointVec2 coordinates.

Define a random Core.Point#POINT_VEC3 within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec3 table.

Defined in:

ZONE_BASE

Return value:

The PointVec3 coordinates.

Define a random DCS#Vec2 within the zone.

Defined in:

ZONE_BASE

Return value:

The Vec2 coordinates.

Get surface type of the zone.

Defined in:

ZONE_BASE

Return value:

Type of surface.

Returns the DCS#Vec2 coordinate of the zone.

Defined in:

ZONE_BASE

Return value:

#nil:

Returns the DCS#Vec3 of the zone.

Defined in:

ZONE_BASE

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The Vec3 of the zone.

Get the zone taking into account the randomization probability of a zone to be selected.

Defined in:

ZONE_BASE

Return values:

The zone is selected taking into account the randomization probability factor.

#nil:

The zone is not selected taking into account the randomization probability factor.

Usage:


local ZoneArray = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }

-- We set a zone probability of 70% to the first zone and 30% to the second zone.
ZoneArray[1]:SetZoneProbability( 0.5 )
ZoneArray[2]:SetZoneProbability( 0.5 )

local ZoneSelected = nil

while ZoneSelected == nil do
  for _, Zone in pairs( ZoneArray ) do
    ZoneSelected = Zone:GetZoneMaybe()
    if ZoneSelected ~= nil then
      break
    end
  end
end

-- The result should be that Zone1 would be more probable selected than Zone2.

Get the randomization probability of a zone to be selected.

Defined in:

ZONE_BASE

Return value:

#number:

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

Returns if a Coordinate is within the zone.

Defined in:

ZONE_BASE

Parameter:

The coordinate to test.

Return value:

#boolean:

true if the coordinate is within the zone.

Returns if a PointVec2 is within the zone.

(Name is misleading, actually takes a #COORDINATE)

Defined in:

ZONE_BASE

Parameter:

The coordinate to test.

Return value:

#boolean:

true if the PointVec2 is within the zone.

Returns if a PointVec3 is within the zone.

Defined in:

ZONE_BASE

Parameter:

The PointVec3 to test.

Return value:

#boolean:

true if the PointVec3 is within the zone.

Returns if a Vec2 is within the zone.

Defined in:

ZONE_BASE

Parameter:

DCS#Vec2 Vec2

The Vec2 to test.

Return value:

#boolean:

true if the Vec2 is within the zone.

Returns if a Vec3 is within the zone.

Defined in:

ZONE_BASE

Parameter:

DCS#Vec3 Vec3

The point to test.

Return value:

#boolean:

true if the Vec3 is within the zone.

ZONE_BASE constructor

Defined in:

ZONE_BASE

Parameter:

#string ZoneName

Name of the zone.

Return value:

self

On After "EnteredZone" event.

An observed object has entered the zone.

Defined in:

ZONE_BASE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The controllable entering the zone.

On After "LeftZone" event.

An observed object has left the zone.

Defined in:

ZONE_BASE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The controllable leaving the zone.

Set the check time for ZONE:Trigger()

Defined in:

ZONE_BASE

Parameter:

#number seconds

Check every seconds for objects entering or leaving the zone. Defaults to 5 secs.

Return value:

self

Set color of zone.

Defined in:

ZONE_BASE

Parameters:

#table RGBcolor

RGB color table. Default {1, 0, 0}.

#number Alpha

Transparency between 0 and 1. Default 0.15.

Return value:

self

Set draw coalition of zone.

Defined in:

ZONE_BASE

Parameter:

#number Coalition

Coalition. Default -1.

Return value:

self

Set fill color of zone.

Defined in:

ZONE_BASE

Parameters:

#table RGBcolor

RGB color table. Default {1, 0, 0}.

#number Alpha

Transparacy between 0 and 1. Default 0.15.

Return value:

self

Sets the name of the zone.

Defined in:

ZONE_BASE

Parameter:

#string ZoneName

The name of the zone.

Return value:

Set the randomization probability of a zone to be selected.

Defined in:

ZONE_BASE

Parameter:

#number ZoneProbability

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

Return value:

self

Smokes the zone boundaries in a color.

Defined in:

ZONE_BASE

Parameter:

The smoke color.

Start watching if the Object or Objects move into or out of a zone.

Defined in:

ZONE_BASE

Parameter:

Object or Objects to watch, can be of type UNIT, GROUP, CLIENT, or SET_UNIT, SET_GROUP, SET_CLIENT

Return value:

self

Usage:

           -- Create a new zone and start watching it every 5 secs for a defined GROUP entering or leaving
           local triggerzone = ZONE:New("ZonetoWatch"):Trigger(GROUP:FindByName("Aerial-1"))

           -- This FSM function will be called when the group enters the zone
           function triggerzone:OnAfterEnteredZone(From,Event,To,Group)
             MESSAGE:New("Group has entered zone!",15):ToAll()
           end

           -- This FSM function will be called when the group leaves the zone
           function triggerzone:OnAfterLeftZone(From,Event,To,Group)
             MESSAGE:New("Group has left zone!",15):ToAll()
           end

           -- Stop watching the zone after 1 hour
          triggerzone:__TriggerStop(3600)

Triggers the FSM event "TriggerStop".

Stops the ZONE_BASE Trigger.

Defined in:

ZONE_BASE

Remove the drawing of the zone from the F10 map.

Defined in:

ZONE_BASE

Parameter:

#number Delay

(Optional) Delay before the drawing is removed.

Return value:

self

(Internal) Check the assigned objects for being in/out of the zone

Defined in:

ZONE_BASE

Parameter:

#boolean fromstart

If true, do the init of the objects

Return value:

self

Triggers the FSM event "TriggerStop" after a delay.

Defined in:

ZONE_BASE

Parameter:

#number delay

Delay in seconds.

(Internal) Check the assigned objects for being in/out of the zone

Defined in:

ZONE_BASE

Parameters:

#string From

#string Event

#string to

To

Return value:

self

Field(s)

#number ZONE_BASE.Checktime

Check every Checktime seconds, used for ZONE:Trigger()

#table ZONE_BASE.Color

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

ZONE_BASE.Coordinate

Create a new coordinate object.

#number ZONE_BASE.DrawID

Unique ID of the drawn zone on the F10 map.

#table ZONE_BASE.FillColor

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

#number ZONE_BASE.Surface

Type of surface. Only determined at the center of the zone!

#table ZONE_BASE.Table

of any trigger zone properties from the ME. The key is the Name of the property, and the value is the property's Value.

#number ZONE_BASE.ZoneID

ID of zone. Only zones defined in the ME have an ID!

#string ZONE_BASE.ZoneName

Name of the zone.

#number ZONE_BASE.ZoneProbability

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

#number ZONE_BASE.drawCoalition

Draw coalition.

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Transitions.

Check if FSM is in state.

Defined in:

Parameter:

#string State

State name.

Return value:

#boolean:

If true, FSM is in this state.

Load call backs.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

Call handler.

Defined in:

Parameters:

#string step

Step "onafter", "onbefore", "onenter", "onleave".

#string trigger

Trigger.

#table params

Parameters.

#string EventName

Event name.

Return value:

Value.

Create transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Delayed transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Event map.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

Check if can do an event.

Defined in:

Parameter:

#string e

Event name.

Return values:

#boolean:

If true, FSM can do the event.

#string:

To state.

Check if cannot do an event.

Defined in:

Parameter:

#string e

Event name.

Return value:

#boolean:

If true, FSM cannot do the event.

Check if FSM is in state.

Defined in:

Parameters:

#string State

State name.

state

Return value:

#boolean:

If true, FSM is in this state.

The ZONE_BASE.BoundingSquare

Field(s)

DCS#Distance ZONE_BASE.BoundingSquare.x1

The lower x coordinate (left down)

DCS#Distance ZONE_BASE.BoundingSquare.x2

The higher x coordinate (right up)

DCS#Distance ZONE_BASE.BoundingSquare.y1

The lower y coordinate (left down)

DCS#Distance ZONE_BASE.BoundingSquare.y2

The higher y coordinate (right up)

Function(s)

Field(s)

#table ZONE_ELASTIC.points

Points in 2D.

#table ZONE_ELASTIC.setGroups

Set of GROUPs.

#table ZONE_ELASTIC.setOpsGroups

Set of OPSGROUPS.

#table ZONE_ELASTIC.setUnits

Set of UNITs.

#number ZONE_ELASTIC.updateID

Scheduler ID for updating.

Function(s)

Add a set of groups.

Positions of the group will be considered as polygon vertices when contructing the convex hull.

Defined in:

ZONE_ELASTIC

Parameter:

Set of groups.

Return value:

Add a vertex (point) to the polygon.

Defined in:

ZONE_ELASTIC

Parameter:

DCS#Vec2 Vec2

Point in 2D (with x and y coordinates).

Return value:

Add a vertex (point) to the polygon.

Defined in:

ZONE_ELASTIC

Parameter:

DCS#Vec3 Vec3

Point in 3D (with x, y and z coordinates). Only the x and z coordinates are used.

Return value:

Constructor to create a ZONE_ELASTIC instance.

Defined in:

ZONE_ELASTIC

Parameters:

#string ZoneName

Name of the zone.

DCS#Vec2 Points

(Optional) Fixed points.

Return value:

Start the updating scheduler.

Defined in:

ZONE_ELASTIC

Parameters:

#number Tstart

Time in seconds before the updating starts.

#number dT

Time interval in seconds between updates. Default 60 sec.

#number Tstop

Time in seconds after which the updating stops. Default nil.

#boolean Draw

Draw the zone. Default nil.

Return value:

Stop the updating scheduler.

Defined in:

ZONE_ELASTIC

Parameter:

#number Delay

Delay in seconds before the scheduler will be stopped. Default 0.

Return value:

Update the convex hull of the polygon.

This uses the Graham scan.

Defined in:

ZONE_ELASTIC

Parameters:

#number Delay

Delay in seconds before the zone is updated. Default 0.

#boolean Draw

Draw the zone. Default nil.

Return value:

Create a convex hull.

Defined in:

ZONE_ELASTIC

Parameter:

#table pl

Points

Return value:

#table:

Points

Field(s)

Function(s)

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D location within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

ZONE_GROUP

Parameters:

#number inner

(optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

Return value:

The Core.Point#POINT_VEC2 object reflecting the random 3D location within the zone.

Returns a random location within the zone of the Wrapper.Group.

Defined in:

ZONE_GROUP

Return value:

The random location of the zone based on the Wrapper.Group location.

Returns the current location of the Wrapper.Group.

Defined in:

ZONE_GROUP

Return value:

The location of the zone based on the Wrapper.Group location.

Constructor to create a ZONE_GROUP instance, taking the zone name, a zone Wrapper.Group#GROUP and a radius.

Defined in:

ZONE_GROUP

Parameters:

#string ZoneName

Name of the zone.

The Wrapper.Group as the center of the zone.

DCS#Distance Radius

The radius of the zone.

Return value:

self

ZONE_OVAL created from a center point, major axis, minor axis, and angle.

Ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Oval.lua

Field(s)

Function(s)

Draw the zone on the F10 map.

  • ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Oval.lua

Defined in:

ZONE_OVAL

Parameters:

#number Coalition

Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.

#table Color

RGB color table {r, g, b}, e.g. {1,0,0} for red.

#number Alpha

Transparency [0,1]. Default 1.

#table FillColor

RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as Color value. -- doesn't seem to work

#number FillAlpha

Transparency [0,1]. Default 0.15. -- doesn't seem to work

#number LineType

Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.

#boolean ReadOnly

(Optional) Mark is readonly and cannot be removed by users. Default false.

Return value:

self

Gets the angle of the oval.

Defined in:

ZONE_OVAL

Return value:

#number:

The angle of the oval

Calculates the bounding box of the oval.

The bounding box is the smallest rectangle that contains the oval.

Defined in:

ZONE_OVAL

Return value:

#table:

The bounding box of the oval

Gets the major axis of the oval.

Defined in:

ZONE_OVAL

Return value:

#number:

The major axis of the oval

Gets the minor axis of the oval.

Defined in:

ZONE_OVAL

Return value:

#number:

The minor axis of the oval

Define a random Core.Point#POINT_VEC2 within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

ZONE_OVAL

Return value:

The PointVec2 coordinates.

Define a random Core.Point#POINT_VEC2 within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec3 table.

Defined in:

ZONE_OVAL

Return value:

The PointVec2 coordinates.

Returns a random Vec2 within the oval.

Defined in:

ZONE_OVAL

Return value:

#table:

The random Vec2

Returns a the center point of the oval

Defined in:

ZONE_OVAL

Return value:

#table:

The center Vec2

Checks if a point is contained within the oval.

Defined in:

ZONE_OVAL

Parameters:

#table point

The point to check

vec2

Return value:

True if the point is contained, false otherwise

Creates a new ZONE_OVAL from a center point, major axis, minor axis, and angle.

  • ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Oval.lua

Defined in:

ZONE_OVAL

Parameters:

#string name

Name of the zone.

#table vec2

The center point of the oval

#number major_axis

The major axis of the oval

#number minor_axis

The minor axis of the oval

#number angle

The angle of the oval

Return value:

The new oval

Constructor to create a ZONE_OVAL instance, taking the name of a drawing made with the draw tool in the Mission Editor.

  • ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Oval.lua

Defined in:

ZONE_OVAL

Parameter:

#string DrawingName

The name of the drawing in the Mission Editor

Return value:

self

Find points on the edge of the oval

Defined in:

ZONE_OVAL

Parameter:

#number num_points

How many points should be found. More = smoother shape

Return value:

#table:

Points on he edge

Remove drawing from F10 map

Defined in:

ZONE_OVAL

Field(s)

Function(s)

Bound the zone boundaries with a tires.

Defined in:

Get 2D distance to a coordinate.

Defined in:

Parameter:

Reference coordinate. Can also be a DCS#Vec2 or DCS#Vec3 object.

Return value:

#number:

Distance to the reference coordinate in meters.

Returns the zone Properties table.

Defined in:

Return value:

#table:

The Key:Value table of TriggerZone properties of the zone.

Get the bounding square the zone.

Defined in:

Return value:

#nil:

The bounding square.

Get color table of the zone.

Defined in:

Return value:

#table:

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

Get transparency Alpha value of zone.

Defined in:

Return value:

#number:

Alpha value.

Get RGB color of zone.

Defined in:

Return value:

#table:

Table with three entries, e.g. {1, 0, 0}, which is the RGB color code.

Returns a Core.Point#COORDINATE of the zone.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The Coordinate of the zone.

Get draw coalition of zone.

Defined in:

Return value:

#number:

Draw coalition.

Get ID of the zone object drawn on the F10 map.

The ID can be used to remove the drawn object from the F10 map view via UTILS.RemoveMark(MarkID).

Defined in:

Return value:

#number:

Unique ID of the

Get fill color table of the zone.

Defined in:

Return value:

#table:

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

Get transparency Alpha fill value of zone.

Defined in:

Return value:

#number:

Alpha value.

Get RGB fill color of zone.

Defined in:

Return value:

#table:

Table with three entries, e.g. {1, 0, 0}, which is the RGB color code.

Returns the name of the zone.

Defined in:

Return value:

#string:

The name of the zone.

Returns a Core.Point#POINT_VEC2 of the zone.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The PointVec2 of the zone.

Returns a Core.Point#POINT_VEC3 of the zone.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The PointVec3 of the zone.

Returns the Value of the zone with the given PropertyName, or nil if no matching property exists.

Defined in:

Parameter:

#string PropertyName

The name of a the TriggerZone Property to be retrieved.

Return value:

#string:

The Value of the TriggerZone Property with the given PropertyName, or nil if absent.

Usage:


local PropertiesZone = ZONE:FindByName("Properties Zone")
local Property = "ExampleProperty"
local PropertyValue = PropertiesZone:GetProperty(Property)

Define a random Core.Point#POINT_VEC2 within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

Return value:

The PointVec2 coordinates.

Define a random Core.Point#POINT_VEC3 within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec3 table.

Defined in:

Return value:

The PointVec3 coordinates.

Define a random DCS#Vec2 within the zone.

Defined in:

Return value:

The Vec2 coordinates.

Get surface type of the zone.

Defined in:

Return value:

Type of surface.

Returns the DCS#Vec2 coordinate of the zone.

Defined in:

Return value:

#nil:

Returns the DCS#Vec3 of the zone.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The Vec3 of the zone.

Get the zone taking into account the randomization probability of a zone to be selected.

Defined in:

Return values:

The zone is selected taking into account the randomization probability factor.

#nil:

The zone is not selected taking into account the randomization probability factor.

Usage:


local ZoneArray = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }

-- We set a zone probability of 70% to the first zone and 30% to the second zone.
ZoneArray[1]:SetZoneProbability( 0.5 )
ZoneArray[2]:SetZoneProbability( 0.5 )

local ZoneSelected = nil

while ZoneSelected == nil do
  for _, Zone in pairs( ZoneArray ) do
    ZoneSelected = Zone:GetZoneMaybe()
    if ZoneSelected ~= nil then
      break
    end
  end
end

-- The result should be that Zone1 would be more probable selected than Zone2.

Get the randomization probability of a zone to be selected.

Defined in:

Return value:

#number:

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

Returns if a Coordinate is within the zone.

Defined in:

Parameter:

The coordinate to test.

Return value:

#boolean:

true if the coordinate is within the zone.

Returns if a PointVec2 is within the zone.

(Name is misleading, actually takes a #COORDINATE)

Defined in:

Parameter:

The coordinate to test.

Return value:

#boolean:

true if the PointVec2 is within the zone.

Returns if a PointVec3 is within the zone.

Defined in:

Parameter:

The PointVec3 to test.

Return value:

#boolean:

true if the PointVec3 is within the zone.

Returns if a Vec2 is within the zone.

Defined in:

Parameter:

DCS#Vec2 Vec2

The Vec2 to test.

Return value:

#boolean:

true if the Vec2 is within the zone.

Returns if a Vec3 is within the zone.

Defined in:

Parameter:

DCS#Vec3 Vec3

The point to test.

Return value:

#boolean:

true if the Vec3 is within the zone.

ZONE_BASE constructor

Defined in:

Parameter:

#string ZoneName

Name of the zone.

Return value:

self

On After "EnteredZone" event.

An observed object has entered the zone.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The controllable entering the zone.

On After "LeftZone" event.

An observed object has left the zone.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The controllable leaving the zone.

Set the check time for ZONE:Trigger()

Defined in:

Parameter:

#number seconds

Check every seconds for objects entering or leaving the zone. Defaults to 5 secs.

Return value:

self

Set color of zone.

Defined in:

Parameters:

#table RGBcolor

RGB color table. Default {1, 0, 0}.

#number Alpha

Transparency between 0 and 1. Default 0.15.

Return value:

self

Set draw coalition of zone.

Defined in:

Parameter:

#number Coalition

Coalition. Default -1.

Return value:

self

Set fill color of zone.

Defined in:

Parameters:

#table RGBcolor

RGB color table. Default {1, 0, 0}.

#number Alpha

Transparacy between 0 and 1. Default 0.15.

Return value:

self

Sets the name of the zone.

Defined in:

Parameter:

#string ZoneName

The name of the zone.

Return value:

Set the randomization probability of a zone to be selected.

Defined in:

Parameter:

#number ZoneProbability

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

Return value:

self

Smokes the zone boundaries in a color.

Defined in:

Parameter:

The smoke color.

Start watching if the Object or Objects move into or out of a zone.

Defined in:

Parameter:

Object or Objects to watch, can be of type UNIT, GROUP, CLIENT, or SET_UNIT, SET_GROUP, SET_CLIENT

Return value:

self

Usage:

           -- Create a new zone and start watching it every 5 secs for a defined GROUP entering or leaving
           local triggerzone = ZONE:New("ZonetoWatch"):Trigger(GROUP:FindByName("Aerial-1"))

           -- This FSM function will be called when the group enters the zone
           function triggerzone:OnAfterEnteredZone(From,Event,To,Group)
             MESSAGE:New("Group has entered zone!",15):ToAll()
           end

           -- This FSM function will be called when the group leaves the zone
           function triggerzone:OnAfterLeftZone(From,Event,To,Group)
             MESSAGE:New("Group has left zone!",15):ToAll()
           end

           -- Stop watching the zone after 1 hour
          triggerzone:__TriggerStop(3600)

Triggers the FSM event "TriggerStop".

Stops the ZONE_BASE Trigger.

Defined in:

Remove the drawing of the zone from the F10 map.

Defined in:

Parameter:

#number Delay

(Optional) Delay before the drawing is removed.

Return value:

self

(Internal) Check the assigned objects for being in/out of the zone

Defined in:

Parameter:

#boolean fromstart

If true, do the init of the objects

Return value:

self

Triggers the FSM event "TriggerStop" after a delay.

Defined in:

Parameter:

#number delay

Delay in seconds.

(Internal) Check the assigned objects for being in/out of the zone

Defined in:

Parameters:

#string From

#string Event

#string to

To

Return value:

self

Field(s)

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Transitions.

Check if FSM is in state.

Defined in:

Parameter:

#string State

State name.

Return value:

#boolean:

If true, FSM is in this state.

Load call backs.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

Call handler.

Defined in:

Parameters:

#string step

Step "onafter", "onbefore", "onenter", "onleave".

#string trigger

Trigger.

#table params

Parameters.

#string EventName

Event name.

Return value:

Value.

Create transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Delayed transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Event map.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

Check if can do an event.

Defined in:

Parameter:

#string e

Event name.

Return values:

#boolean:

If true, FSM can do the event.

#string:

To state.

Check if cannot do an event.

Defined in:

Parameter:

#string e

Event name.

Return value:

#boolean:

If true, FSM cannot do the event.

Check if FSM is in state.

Defined in:

Parameters:

#string State

State name.

state

Return value:

#boolean:

If true, FSM is in this state.

Field(s)

Function(s)

Check if a certain coalition is inside a scanned zone.

Defined in:

ZONE_POLYGON

Parameter:

#number Coalition

The coalition id, e.g. coalition.side.BLUE.

Return value:

#boolean:

If true, the coalition is inside the zone.

Count the number of different coalitions inside the zone.

Defined in:

ZONE_POLYGON

Return value:

#number:

Counted coalitions.

Find a polygon zone in the _DATABASE using the name of the polygon zone.

Defined in:

ZONE_POLYGON

Parameter:

#string ZoneName

The name of the polygon zone.

Return value:

Get Coalitions of the units in the Zone, or Check if there are units of the given Coalition in the Zone.

Returns nil if there are none to two Coalitions in the zone! Returns one Coalition if there are only Units of one Coalition in the Zone. Returns the Coalition for the given Coalition if there are units of the Coalition in the Zone.

Defined in:

ZONE_POLYGON

Parameter:

Coalition

Return value:

#table:

Get scanned scenery table

Defined in:

ZONE_POLYGON

Return value:

#table:

Structured table of [type].[name].Wrapper.Scenery#SCENERY scenery objects.

Get scanned scenery table

Defined in:

ZONE_POLYGON

Return value:

#table:

Table of Wrapper.Scenery#SCENERY scenery objects.

Get scanned scenery types

Defined in:

ZONE_POLYGON

Parameter:

SceneryType

Return value:

#table:

Table of DCS scenery type objects.

Get a set of scanned units.

Defined in:

ZONE_POLYGON

Return value:

Set of groups.

Get scanned set of scenery objects

Defined in:

ZONE_POLYGON

Return value:

#table:

Table of Wrapper.Scenery#SCENERY scenery objects.

Get a set of scanned units.

Defined in:

ZONE_POLYGON

Return value:

Set of units and statics inside the zone.

Count the number of different coalitions inside the zone.

Defined in:

ZONE_POLYGON

Return value:

#table:

Table of DCS units and DCS statics inside the zone.

Is All in Zone of Coalition?

Check if only the specified coalition is inside the zone and noone else.

Defined in:

ZONE_POLYGON

Parameter:

#number Coalition

Coalition ID of the coalition which is checked to be the only one in the zone.

Return value:

#boolean:

True, if only that coalition is inside the zone and no one else.

Usage:

   self.Zone:Scan()
   local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )

Is All in Zone of Other Coalition?

Check if only one coalition is inside the zone and the specified coalition is not the one. You first need to use the ZONE_POLYGON.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

ZONE_POLYGON

Parameter:

#number Coalition

Coalition ID of the coalition which is not supposed to be in the zone.

Return value:

#boolean:

True, if and only if only one coalition is inside the zone and the specified coalition is not it.

Usage:

   self.Zone:Scan()
   local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )

Is None in Zone?

You first need to use the ZONE_POLYGON.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

ZONE_POLYGON

Return value:

#boolean:

Usage:

   self.Zone:Scan()
   local IsEmpty = self.Zone:IsNoneInZone()

Is None in Zone of Coalition?

You first need to use the ZONE_POLYGON.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

ZONE_POLYGON

Parameter:

Coalition

Return value:

#boolean:

Usage:

   self.Zone:Scan()
   local IsOccupied = self.Zone:IsNoneInZoneOfCoalition( self.Coalition )

Is Some in Zone of Coalition?

Check if more than one coalition is inside the zone and the specified coalition is one of them. You first need to use the ZONE_POLYGON.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

ZONE_POLYGON

Parameter:

#number Coalition

ID of the coalition which is checked to be inside the zone.

Return value:

#boolean:

True if more than one coalition is inside the zone and the specified coalition is one of them.

Usage:

   self.Zone:Scan()
   local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )

Constructor to create a ZONE_POLYGON instance, taking the zone name and the Wrapper.Group#GROUP defined within the Mission Editor.

The Wrapper.Group#GROUP waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.

Defined in:

ZONE_POLYGON

Parameters:

#string ZoneName

Name of the zone.

The GROUP waypoints as defined within the Mission Editor define the polygon shape.

Return value:

Constructor to create a ZONE_POLYGON instance, taking the name of a drawing made with the draw tool in the Mission Editor.

Defined in:

ZONE_POLYGON

Parameter:

#string DrawingName

The name of the drawing in the Mission Editor

Return value:

Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the Wrapper.Group#GROUP defined within the Mission Editor.

The Wrapper.Group#GROUP waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.

Defined in:

ZONE_POLYGON

Parameter:

#string GroupName

The group name of the GROUP defining the waypoints within the Mission Editor to define the polygon shape.

Return value:

Constructor to create a ZONE_POLYGON instance, taking the zone name and an array of DCS#Vec2, forming a polygon.

Defined in:

ZONE_POLYGON

Parameters:

#string ZoneName

Name of the zone.

An array of DCS#Vec2, forming a polygon.

Return value:

Scan the zone for the presence of units of the given ObjectCategories.

Does not scan for scenery at the moment. Note that only after a zone has been scanned, the zone can be evaluated by:

Defined in:

ZONE_POLYGON

Parameters:

ObjectCategories

An array of categories of the objects to find in the zone. E.g. {Object.Category.UNIT}

UnitCategories

An array of unit categories of the objects to find in the zone. E.g. {Unit.Category.GROUND_UNIT,Unit.Category.SHIP}

Usage:

   myzone:Scan({Object.Category.UNIT},{Unit.Category.GROUND_UNIT})
   local IsAttacked = myzone:IsSomeInZoneOfCoalition( self.Coalition )

Field(s)

#ZONE_POLYGON_BASE.ListVec2 ZONE_POLYGON_BASE.Polygon

The polygon defined by an array of DCS#Vec2.

Function(s)

Smokes the zone boundaries in a color.

Defined in:

ZONE_POLYGON_BASE

Parameter:

#boolean UnBound

If true, the tyres will be destroyed.

Return value:

Draw a frontier on the F10 map with small filled circles.

Defined in:

ZONE_POLYGON_BASE

Parameters:

#number Coalition

(Optional) Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1= All.

#table Color

(Optional) RGB color table {r, g, b}, e.g. {1, 0, 0} for red. Default {1, 1, 1}= White.

#number Radius

(Optional) Radius of the circles in meters. Default 1000.

#number Alpha

(Optional) Alpha transparency [0,1]. Default 1.

#number Segments

(Optional) Number of segments within boundary line. Default 10.

#boolean Closed

(Optional) Link the last point with the first one to obtain a closed boundary. Default false

Return value:

Draw the zone on the F10 map.

Infinite number of points supported - ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Polygon.lua

Defined in:

ZONE_POLYGON_BASE

Parameters:

#number Coalition

Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.

#table Color

RGB color table {r, g, b}, e.g. {1,0,0} for red.

#number Alpha

Transparency [0,1]. Default 1.

#table FillColor

RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as Color value. -- doesn't seem to work

#number FillAlpha

Transparency [0,1]. Default 0.15. -- doesn't seem to work

#number LineType

Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.

#boolean ReadOnly

(Optional) Mark is readonly and cannot be removed by users. Default false.s

IncludeTriangles

Return value:

Flare the zone boundaries in a color.

Defined in:

ZONE_POLYGON_BASE

Parameters:

The flare color.

#number Segments

(Optional) Number of segments within boundary line. Default 10.

DCS#Azimuth Azimuth

(optional) Azimuth The azimuth of the flare.

#number AddHeight

(optional) The height to be added for the smoke.

Return value:

Flush polygon coordinates as a table in DCS.log.

Defined in:

ZONE_POLYGON_BASE

Return value:

Get the bounding square the zone.

Defined in:

ZONE_POLYGON_BASE

Return value:

The bounding square.

Get the bounding 2D vectors of the polygon.

Defined in:

ZONE_POLYGON_BASE

Return values:

Coordinates of western-southern-lower vertex of the box.

Coordinates of eastern-northern-upper vertex of the box.

Get the smallest radius encompassing all points of the polygon zone.

Defined in:

ZONE_POLYGON_BASE

Return value:

#number:

Radius of the zone in meters.

Return a Core.Point#COORDINATE object representing a random 3D point at landheight within the zone.

Defined in:

ZONE_POLYGON_BASE

Return value:

Return a Core.Point#POINT_VEC2 object representing a random 2D point at landheight within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

ZONE_POLYGON_BASE

Return value:

Return a Core.Point#POINT_VEC3 object representing a random 3D point at landheight within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec3 table.

Defined in:

ZONE_POLYGON_BASE

Return value:

Define a random DCS#Vec2 within the zone.

  • ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Polygon.lua

Defined in:

ZONE_POLYGON_BASE

Return value:

The Vec2 coordinate.

Get the surface area of this polygon

Defined in:

ZONE_POLYGON_BASE

Return value:

#number:

Surface area

Returns the center location of the polygon.

Defined in:

ZONE_POLYGON_BASE

Return value:

The location of the zone based on the Wrapper.Group location.

Get a vertex of the polygon.

Defined in:

ZONE_POLYGON_BASE

Parameter:

#number Index

Index of the vertex. Default 1.

Return value:

Vertex of the polygon.

Get a vertex of the polygon.

Defined in:

ZONE_POLYGON_BASE

Parameter:

#number Index

Index of the vertex. Default 1.

Return value:

Vertex of the polygon.

Get a vertex of the polygon.

Defined in:

ZONE_POLYGON_BASE

Parameter:

#number Index

Index of the vertex. Default 1.

Return value:

Vertex of the polygon.

Get a list of verticies of the polygon.

Defined in:

ZONE_POLYGON_BASE

Return value:

#table:

List of COORDINATES verticies defining the edges of the polygon.

Get a list of verticies of the polygon.

Defined in:

ZONE_POLYGON_BASE

Return value:

List of DCS#Vec2 verticies defining the edges of the polygon.

Get a list of verticies of the polygon.

Defined in:

ZONE_POLYGON_BASE

Return value:

#table:

List of DCS#Vec3 verticies defining the edges of the polygon.

Get the smallest rectangular zone encompassing all points points of the polygon zone.

Defined in:

ZONE_POLYGON_BASE

Parameters:

#string ZoneName

(Optional) Name of the zone. Default is the name of the polygon zone.

#boolean DoNotRegisterZone

(Optional) If true, zone is not registered.

Return value:

The rectangular zone.

Get the smallest circular zone encompassing all points of the polygon zone.

Defined in:

ZONE_POLYGON_BASE

Parameters:

#string ZoneName

(Optional) Name of the zone. Default is the name of the polygon zone.

#boolean DoNotRegisterZone

(Optional) If true, zone is not registered.

Return value:

The circular zone.

Returns if a location is within the zone.

Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html

Defined in:

ZONE_POLYGON_BASE

Parameter:

DCS#Vec2 Vec2

The location to test.

Return value:

#boolean:

true if the location is within the zone.

Returns if a point is within the zone.

Defined in:

ZONE_POLYGON_BASE

Parameter:

DCS#Vec3 Vec3

The point to test.

Return value:

#boolean:

true if the point is within the zone.

Constructor to create a ZONE_POLYGON_BASE instance, taking the zone name and an array of DCS#Vec2, forming a polygon.

The Wrapper.Group#GROUP waypoints define the polygon corners. The first and the last point are automatically connected.

Defined in:

ZONE_POLYGON_BASE

Parameters:

#string ZoneName

Name of the zone.

An array of DCS#Vec2, forming a polygon.

Return value:

Change/Re-draw the border of a Polygon Zone

Defined in:

ZONE_POLYGON_BASE

Parameters:

#table Color

RGB color table {r, g, b}, e.g. {1,0,0} for red.

#number Alpha

Transparency [0,1]. Default 1.

#number LineType

Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.

Return value:

Change/Re-fill a Polygon Zone

Defined in:

ZONE_POLYGON_BASE

Parameters:

#table Color

RGB color table {r, g, b}, e.g. {1,0,0} for red.

#number Alpha

Transparency [0,1]. Default 1.

Return value:

Remove junk inside the zone.

Due to DCS limitations, this works only for rectangular zones. So we get the smallest rectangular zone encompassing all points points of the polygon zone.

Defined in:

ZONE_POLYGON_BASE

Parameter:

#number Height

Height of the box in meters. Default 1000.

Return value:

#number:

Number of removed objects.

Smokes the zone boundaries in a color.

Defined in:

ZONE_POLYGON_BASE

Parameters:

The smoke color.

#number Segments

(Optional) Number of segments within boundary line. Default 10.

Return value:

Update polygon points with an array of DCS#Vec2.

Defined in:

ZONE_POLYGON_BASE

Parameter:

An array of DCS#Vec2, forming a polygon.

Return value:

Update polygon points with an array of DCS#Vec3.

Defined in:

ZONE_POLYGON_BASE

Parameters:

An array of DCS#Vec3, forming a polygon.

Vec3Array

Return value:

Calculates the surface area of the polygon.

The surface area is the sum of the areas of the triangles that make up the polygon. - ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Polygon.lua

Defined in:

ZONE_POLYGON_BASE

Return value:

#number:

The surface area of the polygon

Triangulates the polygon.

  • ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Polygon.lua

Defined in:

ZONE_POLYGON_BASE

Return value:

#table:

The #ZONETRIANGLE list that makes up the polygon

The ZONE_RADIUS class, defined by a zone name, a location and a radius.

Field(s)

DCS#Distance ZONE_RADIUS.Radius

The radius of the zone.

DCS#Vec2 ZONE_RADIUS.Vec2

The current location of the zone.

Function(s)

Bounds the zone with tires.

Defined in:

ZONE_RADIUS

Parameters:

#number Points

(optional) The amount of points in the circle. Default 360.

DCS#country.id CountryID

The country id of the tire objects, e.g. country.id.USA for blue or country.id.RUSSIA for red.

#boolean UnBound

(Optional) If true the tyres will be destroyed.

Return value:

self

Check if a certain coalition is inside a scanned zone.

Defined in:

ZONE_RADIUS

Parameter:

#number Coalition

The coalition id, e.g. coalition.side.BLUE.

Return value:

#boolean:

If true, the coalition is inside the zone.

Count the number of different coalitions inside the zone.

Defined in:

ZONE_RADIUS

Return value:

#number:

Counted coalitions.

Draw the zone circle on the F10 map.

Defined in:

ZONE_RADIUS

Parameters:

#number Coalition

Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.

#table Color

RGB color table {r, g, b}, e.g. {1,0,0} for red.

#number Alpha

Transparency [0,1]. Default 1.

#table FillColor

RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as Color value.

#number FillAlpha

Transparency [0,1]. Default 0.15.

#number LineType

Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.

#boolean ReadOnly

(Optional) Mark is readonly and cannot be removed by users. Default false.

Return value:

self

Flares the zone boundaries in a color.

Defined in:

ZONE_RADIUS

Parameters:

The flare color.

#number Points

(optional) The amount of points in the circle.

DCS#Azimuth Azimuth

(optional) Azimuth The azimuth of the flare.

#number AddHeight

(optional) The height to be added for the smoke.

Return value:

self

Returns the radius of the zone.

Defined in:

ZONE_RADIUS

Return value:

The radius of the zone.

Returns a Core.Point#COORDINATE object reflecting a random 3D location within the zone.

Defined in:

ZONE_RADIUS

Parameters:

#number inner

(Optional) Minimal distance from the center of the zone in meters. Default is 0 m.

#number outer

(Optional) Maximal distance from the outer edge of the zone in meters. Default is the radius of the zone.

#table surfacetypes

(Optional) Table of surface types. Can also be a single surface type. We will try max 100 times to find the right type!

Return value:

The random coordinate.

Returns a Core.Point#COORDINATE object reflecting a random location within the zone where there are no map objects of type "Building".

Does not find statics you might have placed there. Note This might be quite CPU intensive, use with care.

Defined in:

ZONE_RADIUS

Parameters:

#number inner

(Optional) Minimal distance from the center of the zone in meters. Default is 0m.

#number outer

(Optional) Maximal distance from the outer edge of the zone in meters. Default is the radius of the zone.

#number distance

(Optional) Minimum distance from any building coordinate. Defaults to 100m.

#boolean markbuildings

(Optional) Place markers on found buildings (if any).

#boolean markfinal

(Optional) Place marker on the final coordinate (if any).

Return value:

The random coordinate or nil if cannot be found in 1000 iterations.

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D location within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

ZONE_RADIUS

Parameters:

#number inner

(optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

Return value:

The Core.Point#POINT_VEC2 object reflecting the random 3D location within the zone.

Returns a Core.Point#POINT_VEC3 object reflecting a random 3D location within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec3 table.

Defined in:

ZONE_RADIUS

Parameters:

#number inner

(optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

Return value:

The Core.Point#POINT_VEC3 object reflecting the random 3D location within the zone.

Returns a random Vec2 location within the zone.

Defined in:

ZONE_RADIUS

Parameters:

#number inner

(Optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(Optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

#table surfacetypes

(Optional) Table of surface types. Can also be a single surface type. We will try max 100 times to find the right type!

Return value:

The random location within the zone.

Returns Returns a random Vec3 location within the zone.

Defined in:

ZONE_RADIUS

Parameters:

#number inner

(optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

Return value:

The random location within the zone.

Get Coalitions of the units in the Zone, or Check if there are units of the given Coalition in the Zone.

Returns nil if there are none to two Coalitions in the zone! Returns one Coalition if there are only Units of one Coalition in the Zone. Returns the Coalition for the given Coalition if there are units of the Coalition in the Zone.

Defined in:

ZONE_RADIUS

Parameter:

Coalition

Return value:

#table:

Get scanned scenery table

Defined in:

ZONE_RADIUS

Return value:

#table:

Structured object table: [type].[name].SCENERY

Get table of scanned scenery objects

Defined in:

ZONE_RADIUS

Return value:

#table:

Table of SCENERY objects.

Get scanned scenery type

Defined in:

ZONE_RADIUS

Parameter:

SceneryType

Return value:

#table:

Table of DCS scenery type objects.

Get a set of scanned groups.

Defined in:

ZONE_RADIUS

Return value:

Set of groups.

Get set of scanned scenery objects

Defined in:

ZONE_RADIUS

Return value:

#table:

Table of Wrapper.Scenery#SCENERY scenery objects.

Get a set of scanned units.

Defined in:

ZONE_RADIUS

Return value:

Set of units and statics inside the zone.

Get a table of scanned units.

Defined in:

ZONE_RADIUS

Return value:

#table:

Table of DCS units and DCS statics inside the zone.

Returns the DCS#Vec2 of the zone.

Defined in:

ZONE_RADIUS

Return value:

The location of the zone.

Returns the DCS#Vec3 of the ZONE_RADIUS.

Defined in:

ZONE_RADIUS

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The point of the zone.

Is All in Zone of Coalition?

Check if only the specified coalition is inside the zone and no one else.

Defined in:

ZONE_RADIUS

Parameter:

#number Coalition

Coalition ID of the coalition which is checked to be the only one in the zone.

Return value:

#boolean:

True, if only that coalition is inside the zone and no one else.

Usage:

   self.Zone:Scan()
   local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )

Is All in Zone of Other Coalition?

Check if only one coalition is inside the zone and the specified coalition is not the one. You first need to use the ZONE_RADIUS.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

ZONE_RADIUS

Parameter:

#number Coalition

Coalition ID of the coalition which is not supposed to be in the zone.

Return value:

#boolean:

True, if and only if only one coalition is inside the zone and the specified coalition is not it.

Usage:

   self.Zone:Scan()
   local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )

Is None in Zone?

You first need to use the ZONE_RADIUS.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

ZONE_RADIUS

Return value:

#boolean:

Usage:

   self.Zone:Scan()
   local IsEmpty = self.Zone:IsNoneInZone()

Is None in Zone of Coalition?

You first need to use the ZONE_RADIUS.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

ZONE_RADIUS

Parameter:

Coalition

Return value:

#boolean:

Usage:

   self.Zone:Scan()
   local IsOccupied = self.Zone:IsNoneInZoneOfCoalition( self.Coalition )

Is Some in Zone of Coalition?

Check if more than one coalition is inside the zone and the specified coalition is one of them. You first need to use the ZONE_RADIUS.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

ZONE_RADIUS

Parameter:

#number Coalition

ID of the coalition which is checked to be inside the zone.

Return value:

#boolean:

True if more than one coalition is inside the zone and the specified coalition is one of them.

Usage:

   self.Zone:Scan()
   local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )

Returns if a location is within the zone.

Defined in:

ZONE_RADIUS

Parameter:

DCS#Vec2 Vec2

The location to test.

Return value:

#boolean:

true if the location is within the zone.

Returns if a point is within the zone.

Defined in:

ZONE_RADIUS

Parameter:

DCS#Vec3 Vec3

The point to test.

Return value:

#boolean:

true if the point is within the zone.

Mark the zone with markers on the F10 map.

Defined in:

ZONE_RADIUS

Parameter:

#number Points

(Optional) The amount of points in the circle. Default 360.

Return value:

self

Constructor of #ZONE_RADIUS, taking the zone name, the zone location and a radius.

Defined in:

ZONE_RADIUS

Parameters:

#string ZoneName

Name of the zone.

DCS#Vec2 Vec2

The location of the zone.

DCS#Distance Radius

The radius of the zone.

DCS#Boolean DoNotRegisterZone

Determines if the Zone should not be registered in the _Database Table. Default=false

Return value:

self

Remove junk inside the zone using the world.removeJunk function.

Defined in:

ZONE_RADIUS

Return value:

#number:

Number of deleted objects.

Scan the zone for the presence of units of the given ObjectCategories.

Note that only after a zone has been scanned, the zone can be evaluated by:

Defined in:

ZONE_RADIUS

Parameters:

ObjectCategories

An array of categories of the objects to find in the zone. E.g. {Object.Category.UNIT}

UnitCategories

An array of unit categories of the objects to find in the zone. E.g. {Unit.Category.GROUND_UNIT,Unit.Category.SHIP}

Usage:

   myzone:Scan({Object.Category.UNIT},{Unit.Category.GROUND_UNIT})
   local IsAttacked = myzone:IsSomeInZoneOfCoalition( self.Coalition )

Searches the zone

Defined in:

ZONE_RADIUS

Parameters:

ObjectCategories

A list of categories, which are members of Object.Category

EvaluateFunction

Sets the radius of the zone.

Defined in:

ZONE_RADIUS

Parameter:

DCS#Distance Radius

The radius of the zone.

Return value:

The radius of the zone.

Sets the DCS#Vec2 of the zone.

Defined in:

ZONE_RADIUS

Parameter:

DCS#Vec2 Vec2

The new location of the zone.

Return value:

The new location of the zone.

Smokes the zone boundaries in a color.

Defined in:

ZONE_RADIUS

Parameters:

The smoke color.

#number Points

(optional) The amount of points in the circle.

#number AddHeight

(optional) The height to be added for the smoke.

#number AddOffSet

(optional) The angle to be added for the smoking start position.

AngleOffset

Return value:

self

Update zone from a 2D vector.

Defined in:

ZONE_RADIUS

Parameters:

DCS#Vec2 Vec2

The location of the zone.

DCS#Distance Radius

The radius of the zone.

Return value:

self

Update zone from a 2D vector.

Defined in:

ZONE_RADIUS

Parameters:

DCS#Vec3 Vec3

The location of the zone.

DCS#Distance Radius

The radius of the zone.

Return value:

self

Field(s)

Function(s)

Returns a random location within the zone.

Defined in:

ZONE_UNIT

Return value:

The random location within the zone.

Returns the current location of the Wrapper.Unit#UNIT.

Defined in:

ZONE_UNIT

Return value:

The location of the zone based on the Wrapper.Unit#UNITlocation and the offset, if any.

Returns the DCS#Vec3 of the ZONE_UNIT.

Defined in:

ZONE_UNIT

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The point of the zone.

Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius and optional offsets in X and Y directions.

Defined in:

ZONE_UNIT

Parameters:

#string ZoneName

Name of the zone.

The unit as the center of the zone.

#number Radius

The radius of the zone in meters.

#table Offset

A table specifying the offset. The offset table may have the following elements: dx The offset in X direction, +x is north. dy The offset in Y direction, +y is east. rho The distance of the zone from the unit theta The azimuth of the zone relative to unit relative_to_unit If true, theta is measured clockwise from unit's direction else clockwise from north. If using dx, dy setting this to true makes +x parallel to unit heading. dx, dy OR rho, theta may be used, not both.

Return value:

self

Field(s)

Function(s)

Bounds the zone with tires.

Defined in:

Parameters:

#number Points

(optional) The amount of points in the circle. Default 360.

DCS#country.id CountryID

The country id of the tire objects, e.g. country.id.USA for blue or country.id.RUSSIA for red.

#boolean UnBound

(Optional) If true the tyres will be destroyed.

Return value:

self

Check if a certain coalition is inside a scanned zone.

Defined in:

Parameter:

#number Coalition

The coalition id, e.g. coalition.side.BLUE.

Return value:

#boolean:

If true, the coalition is inside the zone.

Count the number of different coalitions inside the zone.

Defined in:

Return value:

#number:

Counted coalitions.

Draw the zone circle on the F10 map.

Defined in:

Parameters:

#number Coalition

Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.

#table Color

RGB color table {r, g, b}, e.g. {1,0,0} for red.

#number Alpha

Transparency [0,1]. Default 1.

#table FillColor

RGB color table {r, g, b}, e.g. {1,0,0} for red. Default is same as Color value.

#number FillAlpha

Transparency [0,1]. Default 0.15.

#number LineType

Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot dash, 5=Long dash, 6=Two dash. Default 1=Solid.

#boolean ReadOnly

(Optional) Mark is readonly and cannot be removed by users. Default false.

Return value:

self

Flares the zone boundaries in a color.

Defined in:

Parameters:

The flare color.

#number Points

(optional) The amount of points in the circle.

DCS#Azimuth Azimuth

(optional) Azimuth The azimuth of the flare.

#number AddHeight

(optional) The height to be added for the smoke.

Return value:

self

Returns the radius of the zone.

Defined in:

Return value:

The radius of the zone.

Returns a Core.Point#COORDINATE object reflecting a random 3D location within the zone.

Defined in:

Parameters:

#number inner

(Optional) Minimal distance from the center of the zone in meters. Default is 0 m.

#number outer

(Optional) Maximal distance from the outer edge of the zone in meters. Default is the radius of the zone.

#table surfacetypes

(Optional) Table of surface types. Can also be a single surface type. We will try max 100 times to find the right type!

Return value:

The random coordinate.

Returns a Core.Point#COORDINATE object reflecting a random location within the zone where there are no map objects of type "Building".

Does not find statics you might have placed there. Note This might be quite CPU intensive, use with care.

Defined in:

Parameters:

#number inner

(Optional) Minimal distance from the center of the zone in meters. Default is 0m.

#number outer

(Optional) Maximal distance from the outer edge of the zone in meters. Default is the radius of the zone.

#number distance

(Optional) Minimum distance from any building coordinate. Defaults to 100m.

#boolean markbuildings

(Optional) Place markers on found buildings (if any).

#boolean markfinal

(Optional) Place marker on the final coordinate (if any).

Return value:

The random coordinate or nil if cannot be found in 1000 iterations.

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D location within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

Parameters:

#number inner

(optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

Return value:

The Core.Point#POINT_VEC2 object reflecting the random 3D location within the zone.

Returns a Core.Point#POINT_VEC3 object reflecting a random 3D location within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec3 table.

Defined in:

Parameters:

#number inner

(optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

Return value:

The Core.Point#POINT_VEC3 object reflecting the random 3D location within the zone.

Returns a random Vec2 location within the zone.

Defined in:

Parameters:

#number inner

(Optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(Optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

#table surfacetypes

(Optional) Table of surface types. Can also be a single surface type. We will try max 100 times to find the right type!

Return value:

The random location within the zone.

Returns Returns a random Vec3 location within the zone.

Defined in:

Parameters:

#number inner

(optional) Minimal distance from the center of the zone. Default is 0.

#number outer

(optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.

Return value:

The random location within the zone.

Get Coalitions of the units in the Zone, or Check if there are units of the given Coalition in the Zone.

Returns nil if there are none to two Coalitions in the zone! Returns one Coalition if there are only Units of one Coalition in the Zone. Returns the Coalition for the given Coalition if there are units of the Coalition in the Zone.

Defined in:

Parameter:

Coalition

Return value:

#table:

Get scanned scenery table

Defined in:

Return value:

#table:

Structured object table: [type].[name].SCENERY

Get table of scanned scenery objects

Defined in:

Return value:

#table:

Table of SCENERY objects.

Get scanned scenery type

Defined in:

Parameter:

SceneryType

Return value:

#table:

Table of DCS scenery type objects.

Get a set of scanned groups.

Defined in:

Return value:

Set of groups.

Get set of scanned scenery objects

Defined in:

Return value:

#table:

Table of Wrapper.Scenery#SCENERY scenery objects.

Get a set of scanned units.

Defined in:

Return value:

Set of units and statics inside the zone.

Get a table of scanned units.

Defined in:

Return value:

#table:

Table of DCS units and DCS statics inside the zone.

Returns the DCS#Vec2 of the zone.

Defined in:

Return value:

The location of the zone.

Returns the DCS#Vec3 of the ZONE_RADIUS.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The point of the zone.

Is All in Zone of Coalition?

Check if only the specified coalition is inside the zone and no one else.

Defined in:

Parameter:

#number Coalition

Coalition ID of the coalition which is checked to be the only one in the zone.

Return value:

#boolean:

True, if only that coalition is inside the zone and no one else.

Usage:

   self.Zone:Scan()
   local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )

Is All in Zone of Other Coalition?

Check if only one coalition is inside the zone and the specified coalition is not the one. You first need to use the ZONE_RADIUS.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

Parameter:

#number Coalition

Coalition ID of the coalition which is not supposed to be in the zone.

Return value:

#boolean:

True, if and only if only one coalition is inside the zone and the specified coalition is not it.

Usage:

   self.Zone:Scan()
   local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )

Is None in Zone?

You first need to use the ZONE_RADIUS.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

Return value:

#boolean:

Usage:

   self.Zone:Scan()
   local IsEmpty = self.Zone:IsNoneInZone()

Is None in Zone of Coalition?

You first need to use the ZONE_RADIUS.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

Parameter:

Coalition

Return value:

#boolean:

Usage:

   self.Zone:Scan()
   local IsOccupied = self.Zone:IsNoneInZoneOfCoalition( self.Coalition )

Is Some in Zone of Coalition?

Check if more than one coalition is inside the zone and the specified coalition is one of them. You first need to use the ZONE_RADIUS.Scan method to scan the zone before it can be evaluated! Note that once a zone has been scanned, multiple evaluations can be done on the scan result set.

Defined in:

Parameter:

#number Coalition

ID of the coalition which is checked to be inside the zone.

Return value:

#boolean:

True if more than one coalition is inside the zone and the specified coalition is one of them.

Usage:

   self.Zone:Scan()
   local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )

Returns if a location is within the zone.

Defined in:

Parameter:

DCS#Vec2 Vec2

The location to test.

Return value:

#boolean:

true if the location is within the zone.

Returns if a point is within the zone.

Defined in:

Parameter:

DCS#Vec3 Vec3

The point to test.

Return value:

#boolean:

true if the point is within the zone.

Mark the zone with markers on the F10 map.

Defined in:

Parameter:

#number Points

(Optional) The amount of points in the circle. Default 360.

Return value:

self

Constructor of #ZONE_RADIUS, taking the zone name, the zone location and a radius.

Defined in:

Parameters:

#string ZoneName

Name of the zone.

DCS#Vec2 Vec2

The location of the zone.

DCS#Distance Radius

The radius of the zone.

DCS#Boolean DoNotRegisterZone

Determines if the Zone should not be registered in the _Database Table. Default=false

Return value:

self

Remove junk inside the zone using the world.removeJunk function.

Defined in:

Return value:

#number:

Number of deleted objects.

Scan the zone for the presence of units of the given ObjectCategories.

Note that only after a zone has been scanned, the zone can be evaluated by:

Defined in:

Parameters:

ObjectCategories

An array of categories of the objects to find in the zone. E.g. {Object.Category.UNIT}

UnitCategories

An array of unit categories of the objects to find in the zone. E.g. {Unit.Category.GROUND_UNIT,Unit.Category.SHIP}

Usage:

   myzone:Scan({Object.Category.UNIT},{Unit.Category.GROUND_UNIT})
   local IsAttacked = myzone:IsSomeInZoneOfCoalition( self.Coalition )

Searches the zone

Defined in:

Parameters:

ObjectCategories

A list of categories, which are members of Object.Category

EvaluateFunction

Sets the radius of the zone.

Defined in:

Parameter:

DCS#Distance Radius

The radius of the zone.

Return value:

The radius of the zone.

Sets the DCS#Vec2 of the zone.

Defined in:

Parameter:

DCS#Vec2 Vec2

The new location of the zone.

Return value:

The new location of the zone.

Smokes the zone boundaries in a color.

Defined in:

Parameters:

The smoke color.

#number Points

(optional) The amount of points in the circle.

#number AddHeight

(optional) The height to be added for the smoke.

#number AddOffSet

(optional) The angle to be added for the smoking start position.

AngleOffset

Return value:

self

Update zone from a 2D vector.

Defined in:

Parameters:

DCS#Vec2 Vec2

The location of the zone.

DCS#Distance Radius

The radius of the zone.

Return value:

self

Update zone from a 2D vector.

Defined in:

Parameters:

DCS#Vec3 Vec3

The location of the zone.

DCS#Distance Radius

The radius of the zone.

Return value:

self

Ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Triangle.lua - This triangle "zone" is not really to be used on its own, it only serves as building blocks for - ZONE_POLYGON to accurately find a point inside a polygon; as well as getting the correct surface area of - a polygon.

Field(s)

Function(s)

Checks if a point is contained within the triangle.

Defined in:

ZONETRIANGLE

Parameters:

#table pt

The point to check

#table points

(optional) The points of the triangle, or 3 other points if you're just using the TRIANGLE class without an object of it

Return value:

True if the point is contained, false otherwise

Draw the triangle

Defined in:

ZONETRIANGLE

Parameters:

Coalition

Color

Alpha

FillColor

FillAlpha

LineType

ReadOnly

Return value:

#table:

of draw IDs

Draw the triangle

Defined in:

ZONETRIANGLE

Parameters:

Coalition

FillColor

FillAlpha

ReadOnly

Return value:

#table:

of draw IDs

Returns a random Vec2 within the triangle.

Defined in:

ZONETRIANGLE

Parameter:

#table points

The points of the triangle, or 3 other points if you're just using the TRIANGLE class without an object of it

Return value:

#table:

The random Vec2

Defined in:

ZONETRIANGLE

Parameters:

DCS#Vec p1

DCS#Vec p2

DCS#Vec p3

Return value:

Field(s)

Function(s)

Bound the zone boundaries with a tires.

Defined in:

Get 2D distance to a coordinate.

Defined in:

Parameter:

Reference coordinate. Can also be a DCS#Vec2 or DCS#Vec3 object.

Return value:

#number:

Distance to the reference coordinate in meters.

Returns the zone Properties table.

Defined in:

Return value:

#table:

The Key:Value table of TriggerZone properties of the zone.

Get the bounding square the zone.

Defined in:

Return value:

#nil:

The bounding square.

Get color table of the zone.

Defined in:

Return value:

#table:

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

Get transparency Alpha value of zone.

Defined in:

Return value:

#number:

Alpha value.

Get RGB color of zone.

Defined in:

Return value:

#table:

Table with three entries, e.g. {1, 0, 0}, which is the RGB color code.

Returns a Core.Point#COORDINATE of the zone.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The Coordinate of the zone.

Get draw coalition of zone.

Defined in:

Return value:

#number:

Draw coalition.

Get ID of the zone object drawn on the F10 map.

The ID can be used to remove the drawn object from the F10 map view via UTILS.RemoveMark(MarkID).

Defined in:

Return value:

#number:

Unique ID of the

Get fill color table of the zone.

Defined in:

Return value:

#table:

Table with four entries, e.g. {1, 0, 0, 0.15}. First three are RGB color code. Fourth is the transparency Alpha value.

Get transparency Alpha fill value of zone.

Defined in:

Return value:

#number:

Alpha value.

Get RGB fill color of zone.

Defined in:

Return value:

#table:

Table with three entries, e.g. {1, 0, 0}, which is the RGB color code.

Returns the name of the zone.

Defined in:

Return value:

#string:

The name of the zone.

Returns a Core.Point#POINT_VEC2 of the zone.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The PointVec2 of the zone.

Returns a Core.Point#POINT_VEC3 of the zone.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The PointVec3 of the zone.

Returns the Value of the zone with the given PropertyName, or nil if no matching property exists.

Defined in:

Parameter:

#string PropertyName

The name of a the TriggerZone Property to be retrieved.

Return value:

#string:

The Value of the TriggerZone Property with the given PropertyName, or nil if absent.

Usage:


local PropertiesZone = ZONE:FindByName("Properties Zone")
local Property = "ExampleProperty"
local PropertyValue = PropertiesZone:GetProperty(Property)

Define a random Core.Point#POINT_VEC2 within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec2 table.

Defined in:

Return value:

The PointVec2 coordinates.

Define a random Core.Point#POINT_VEC3 within the zone.

Note that this is actually a Core.Point#COORDINATE type object, and not a simple Vec3 table.

Defined in:

Return value:

The PointVec3 coordinates.

Define a random DCS#Vec2 within the zone.

Defined in:

Return value:

The Vec2 coordinates.

Get surface type of the zone.

Defined in:

Return value:

Type of surface.

Returns the DCS#Vec2 coordinate of the zone.

Defined in:

Return value:

#nil:

Returns the DCS#Vec3 of the zone.

Defined in:

Parameter:

DCS#Distance Height

The height to add to the land height where the center of the zone is located.

Return value:

The Vec3 of the zone.

Get the zone taking into account the randomization probability of a zone to be selected.

Defined in:

Return values:

The zone is selected taking into account the randomization probability factor.

#nil:

The zone is not selected taking into account the randomization probability factor.

Usage:


local ZoneArray = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }

-- We set a zone probability of 70% to the first zone and 30% to the second zone.
ZoneArray[1]:SetZoneProbability( 0.5 )
ZoneArray[2]:SetZoneProbability( 0.5 )

local ZoneSelected = nil

while ZoneSelected == nil do
  for _, Zone in pairs( ZoneArray ) do
    ZoneSelected = Zone:GetZoneMaybe()
    if ZoneSelected ~= nil then
      break
    end
  end
end

-- The result should be that Zone1 would be more probable selected than Zone2.

Get the randomization probability of a zone to be selected.

Defined in:

Return value:

#number:

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

Returns if a Coordinate is within the zone.

Defined in:

Parameter:

The coordinate to test.

Return value:

#boolean:

true if the coordinate is within the zone.

Returns if a PointVec2 is within the zone.

(Name is misleading, actually takes a #COORDINATE)

Defined in:

Parameter:

The coordinate to test.

Return value:

#boolean:

true if the PointVec2 is within the zone.

Returns if a PointVec3 is within the zone.

Defined in:

Parameter:

The PointVec3 to test.

Return value:

#boolean:

true if the PointVec3 is within the zone.

Returns if a Vec2 is within the zone.

Defined in:

Parameter:

DCS#Vec2 Vec2

The Vec2 to test.

Return value:

#boolean:

true if the Vec2 is within the zone.

Returns if a Vec3 is within the zone.

Defined in:

Parameter:

DCS#Vec3 Vec3

The point to test.

Return value:

#boolean:

true if the Vec3 is within the zone.

ZONE_BASE constructor

Defined in:

Parameter:

#string ZoneName

Name of the zone.

Return value:

self

On After "EnteredZone" event.

An observed object has entered the zone.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The controllable entering the zone.

On After "LeftZone" event.

An observed object has left the zone.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The controllable leaving the zone.

Set the check time for ZONE:Trigger()

Defined in:

Parameter:

#number seconds

Check every seconds for objects entering or leaving the zone. Defaults to 5 secs.

Return value:

self

Set color of zone.

Defined in:

Parameters:

#table RGBcolor

RGB color table. Default {1, 0, 0}.

#number Alpha

Transparency between 0 and 1. Default 0.15.

Return value:

self

Set draw coalition of zone.

Defined in:

Parameter:

#number Coalition

Coalition. Default -1.

Return value:

self

Set fill color of zone.

Defined in:

Parameters:

#table RGBcolor

RGB color table. Default {1, 0, 0}.

#number Alpha

Transparacy between 0 and 1. Default 0.15.

Return value:

self

Sets the name of the zone.

Defined in:

Parameter:

#string ZoneName

The name of the zone.

Return value:

Set the randomization probability of a zone to be selected.

Defined in:

Parameter:

#number ZoneProbability

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

Return value:

self

Smokes the zone boundaries in a color.

Defined in:

Parameter:

The smoke color.

Start watching if the Object or Objects move into or out of a zone.

Defined in:

Parameter:

Object or Objects to watch, can be of type UNIT, GROUP, CLIENT, or SET_UNIT, SET_GROUP, SET_CLIENT

Return value:

self

Usage:

           -- Create a new zone and start watching it every 5 secs for a defined GROUP entering or leaving
           local triggerzone = ZONE:New("ZonetoWatch"):Trigger(GROUP:FindByName("Aerial-1"))

           -- This FSM function will be called when the group enters the zone
           function triggerzone:OnAfterEnteredZone(From,Event,To,Group)
             MESSAGE:New("Group has entered zone!",15):ToAll()
           end

           -- This FSM function will be called when the group leaves the zone
           function triggerzone:OnAfterLeftZone(From,Event,To,Group)
             MESSAGE:New("Group has left zone!",15):ToAll()
           end

           -- Stop watching the zone after 1 hour
          triggerzone:__TriggerStop(3600)

Triggers the FSM event "TriggerStop".

Stops the ZONE_BASE Trigger.

Defined in:

Remove the drawing of the zone from the F10 map.

Defined in:

Parameter:

#number Delay

(Optional) Delay before the drawing is removed.

Return value:

self

(Internal) Check the assigned objects for being in/out of the zone

Defined in:

Parameter:

#boolean fromstart

If true, do the init of the objects

Return value:

self

Triggers the FSM event "TriggerStop" after a delay.

Defined in:

Parameter:

#number delay

Delay in seconds.

(Internal) Check the assigned objects for being in/out of the zone

Defined in:

Parameters:

#string From

#string Event

#string to

To

Return value:

self

Field(s)

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Transitions.

Check if FSM is in state.

Defined in:

Parameter:

#string State

State name.

Return value:

#boolean:

If true, FSM is in this state.

Load call backs.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

Call handler.

Defined in:

Parameters:

#string step

Step "onafter", "onbefore", "onenter", "onleave".

#string trigger

Trigger.

#table params

Parameters.

#string EventName

Event name.

Return value:

Value.

Create transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Delayed transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Event map.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

Check if can do an event.

Defined in:

Parameter:

#string e

Event name.

Return values:

#boolean:

If true, FSM can do the event.

#string:

To state.

Check if cannot do an event.

Defined in:

Parameter:

#string e

Event name.

Return value:

#boolean:

If true, FSM cannot do the event.

Check if FSM is in state.

Defined in:

Parameters:

#string State

State name.

state

Return value:

#boolean:

If true, FSM is in this state.