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 behaviour. Some zones are static, while others are moveable.
  • Enquiry 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.

There are essentially two core functions that zones accomodate:

  • Test if an object is within the zone boundaries.
  • Provide the zone behaviour. 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:


Author: FlightControl

Contributions:


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 Core.Zone#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 Core.Zone#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:

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 Core.Zone#ZONE_RADIUS 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.

#ZONE_POLYGON ZONE_POLYGON

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

This class implements the inherited functions from Core.Zone#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!!!

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 Core.Zone#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.

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 Core.Zone#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.

Global ZONE_UNIT

ZONE_UNIT class, extends Zone#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#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.

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:GetRandomVec2()

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

ZONE_AIRBASE:GetVec2()

Returns the current location of the Wrapper.Group.

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_BASE , extends Core.Fsm#FSM , extends Core.Base#BASE
Fields and Methods inherited from ZONE_BASE Description

ZONE_BASE:BoundZone()

Bound the zone boundaries with a tires.

ZONE_BASE.Coordinate

object of the zone.

ZONE_BASE:GetBoundingSquare()

Get the bounding square the zone.

ZONE_BASE:GetCoordinate(Height)

Returns a Core.Point#COORDINATE of the 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: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: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(PointVec2)

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: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.ZoneName

Name of the zone.

ZONE_BASE.ZoneProbability

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

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 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

Call scheduler.

ZONE_BASE.ClassName

Name of the class.

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(Scores)

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, If)

Check if FSM is in state.

ZONE_BASE:LoadCallBacks(CallBackTable)

Load call backs.

ZONE_BASE:New()

Creates a new FSM object.

ZONE_BASE.Scores

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

Current state name.

ZONE_BASE.endstates

ZONE_BASE:is(State, If, state)

Check if FSM is in state.

ZONE_BASE.options

Options.

ZONE_BASE.subs

Subs.

Fields and Methods inherited from BASE Description

ZONE_BASE.ClassID

The ID number of the class.

ZONE_BASE.ClassName

The name of the class.

ZONE_BASE.ClassNameAndID

The name of the class concatenated with the ID number of the class.

ZONE_BASE:ClearState(Object, StateName)

Clear the state of an object.

ZONE_BASE:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace)

Creation of a Birth Event.

ZONE_BASE:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

ZONE_BASE:CreateEventDead(EventTime, Initiator)

Creation of a Dead Event.

ZONE_BASE:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

ZONE_BASE:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

ZONE_BASE:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

ZONE_BASE:E(Arguments)

Log an exception which will be traced always.

ZONE_BASE:EventDispatcher()

Returns the event dispatcher

ZONE_BASE:EventRemoveAll()

Remove all subscribed events

ZONE_BASE:F(Arguments)

Trace a function call.

ZONE_BASE:F2(Arguments)

Trace a function call level 2.

ZONE_BASE:F3(Arguments)

Trace a function call level 3.

ZONE_BASE:GetClassID()

Get the ClassID of the class instance.

ZONE_BASE:GetClassName()

Get the ClassName of the class instance.

ZONE_BASE:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

ZONE_BASE:GetEventPriority()

Get the Class Event processing Priority.

ZONE_BASE:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

ZONE_BASE:GetState(Object, Key)

Get a Value given a Key from the Object.

ZONE_BASE:HandleEvent(Event, EventFunction)

Subscribe to a DCS Event.

ZONE_BASE:I(Arguments)

Log an information which will be traced always.

ZONE_BASE:Inherit(Child, Parent)

This is the worker method to inherit from a parent class.

ZONE_BASE:IsInstanceOf(ClassName)

This is the worker method to check if an object is an (sub)instance of a class.

ZONE_BASE:IsTrace()

Enquires if tracing is on (for the class).

ZONE_BASE:New()

BASE constructor.

ZONE_BASE:OnEvent(EventData)

Occurs when an object is completely destroyed.

ZONE_BASE:OnEventBaseCaptured(EventData)

Occurs when a ground unit captures either an airbase or a farp.

ZONE_BASE:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

ZONE_BASE:OnEventCrash(EventData)

Occurs when any aircraft crashes into the ground and is completely destroyed.

ZONE_BASE:OnEventDead(EventData)

Occurs when an object is dead.

ZONE_BASE:OnEventDetailedFailure(EventData)

Unknown precisely what creates this event, likely tied into newer damage model.

ZONE_BASE:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

ZONE_BASE:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

ZONE_BASE:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

ZONE_BASE:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

ZONE_BASE:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

ZONE_BASE:OnEventKill(EventData)

Occurs on the death of a unit.

ZONE_BASE:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

ZONE_BASE:OnEventLandingAfterEjection(EventData)

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

ZONE_BASE:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

ZONE_BASE:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

ZONE_BASE:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

ZONE_BASE:OnEventMissionEnd(EventData)

Occurs when a mission ends

ZONE_BASE:OnEventMissionStart(EventData)

Occurs when a mission starts

ZONE_BASE:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

ZONE_BASE:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

ZONE_BASE:OnEventPlayerLeaveUnit(EventData)

Occurs when any player relieves control of a unit to the AI.

ZONE_BASE:OnEventRefueling(EventData)

Occurs when an aircraft connects with a tanker and begins taking on fuel.

ZONE_BASE:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

ZONE_BASE:OnEventScore(EventData)

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

ZONE_BASE:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

ZONE_BASE:OnEventShootingStart(EventData)

Occurs when any unit begins firing a weapon that has a high rate of fire.

ZONE_BASE:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

ZONE_BASE:OnEventTakeoff(EventData)

Occurs when an aircraft takes off from an airbase, farp, or ship.

ZONE_BASE:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

ZONE_BASE:ScheduleOnce(Start, SchedulerFunction, ...)

Schedule a new time event.

ZONE_BASE:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...)

Schedule a new time event.

ZONE_BASE:ScheduleStop(SchedulerFunction)

Stops the Schedule.

ZONE_BASE.Scheduler

ZONE_BASE:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

ZONE_BASE:SetState(Object, Key, Value)

Set a state or property of the Object given a Key and a Value.

ZONE_BASE:T(Arguments)

Trace a function logic level 1.

ZONE_BASE:T2(Arguments)

Trace a function logic level 2.

ZONE_BASE:T3(Arguments)

Trace a function logic level 3.

ZONE_BASE:TraceAll(TraceAll)

Trace all methods in MOOSE

ZONE_BASE:TraceClass(Class)

Set tracing for a class

ZONE_BASE:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

ZONE_BASE:TraceLevel(Level)

Set trace level

ZONE_BASE:TraceOff()

Set trace off.

ZONE_BASE:TraceOn()

Set trace on.

ZONE_BASE:TraceOnOff(TraceOnOff)

Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.

ZONE_BASE:UnHandleEvent(Event)

UnSubscribe to a DCS event.

ZONE_BASE._

ZONE_BASE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

ZONE_BASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

ZONE_BASE.__

ZONE_BASE:onEvent(event)

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_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_POLYGON Description

ZONE_POLYGON:FindByName(ZoneName)

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

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: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.

Fields and Methods inherited from ZONE_POLYGON_BASE Description

ZONE_POLYGON_BASE:BoundZone(UnBound)

Smokes the zone boundaries in a color.

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: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:GetVec2()

Returns the center location of the polygon.

ZONE_POLYGON_BASE:IsVec2InZone(Vec2)

Returns if a location 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:SmokeZone(SmokeColor, Segments)

Smokes the zone boundaries in a color.

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.

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: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)

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

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)

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:GetScannedSceneryType(SceneryType)

Get scanned scenery type

ZONE_RADIUS:GetScannedSetUnit()

Get a set of scanned units.

ZONE_RADIUS:GetScannedUnits()

Count the number of different coalitions inside the zone.

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)

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

ZONE_RADIUS.Radius

The radius of the zone.

ZONE_RADIUS:Scan(ObjectCategories, UnitCategories)

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

ZONE_RADIUS.ScanData

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

ZONE_UNIT.dx

ZONE_UNIT.dy

ZONE_UNIT.relative_to_unit

ZONE_UNIT.rho

ZONE_UNIT.theta

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: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)

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

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)

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:GetScannedSceneryType(SceneryType)

Get scanned scenery type

ZONE_UNIT:GetScannedSetUnit()

Get a set of scanned units.

ZONE_UNIT:GetScannedUnits()

Count the number of different coalitions inside the zone.

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)

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

ZONE_UNIT.Radius

The radius of the zone.

ZONE_UNIT:Scan(ObjectCategories, UnitCategories)

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

ZONE_UNIT.ScanData

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.

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:

Field(s)

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.

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 a random location within the zone of the Wrapper.Group.

Defined in:

ZONE_AIRBASE

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_AIRBASE

Return value:

The location of the zone based on the Wrapper.Group 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)

#string ZONE_BASE.ZoneName

Name of the zone.

#number ZONE_BASE.ZoneProbability

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

Function(s)

Bound the zone boundaries with a tires.

Defined in:

ZONE_BASE

Get the bounding square the zone.

Defined in:

ZONE_BASE

Return value:

#nil:

The bounding square.

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.

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.

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

Defined in:

ZONE_BASE

Return value:

The PointVec2 coordinates.

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

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.

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.

Defined in:

ZONE_BASE

Parameter:

The PointVec2 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

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.

Field(s)

#string ZONE_BASE.ZoneName

Name of the zone.

#number ZONE_BASE.ZoneProbability

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

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

Set the default 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:

Parameter:

#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:

Parameters:

#string State

State name.

#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.

#boolean If

true, FSM is in this state.

state

Field(s)

#string ZONE_BASE.ZoneName

Name of the zone.

#number ZONE_BASE.ZoneProbability

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

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Remove Unit Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Takeoff Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Log an exception which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#string:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

The ClassName + ClassID is formatted as '%s#%09d'.

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the Class Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Return value:

#number:

The Event processing Priority.

This is the worker method to retrieve the Parent class.

Note that the Parent class must be passed to call the parent class method.

self:GetParent(self):ParentMethod()


Defined in:

Parameters:

#BASE Child

This is the Child class from which the Parent class needs to be retrieved.

#BASE FromClass

(Optional) The class from which to get the parent.

Return value:

Get a Value given a Key from the Object.

Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

The key that is used to retrieve the value. Note that the key can be a #string, but it can also be any other type!

Return value:

The Value retrieved or nil if the Key was not found and thus the Value could not be retrieved.

Subscribe to a DCS Event.

Defined in:

Parameters:

#function EventFunction

(optional) The function to be called when the event occurs for the unit.

Return value:

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

This is the worker method to inherit from a parent class.

Defined in:

Parameters:

Child

is the Child class that inherits.

#BASE Parent

is the Parent class that the Child inherits from.

Return value:

Child

This is the worker method to check if an object is an (sub)instance of a class.

Examples:

  • ZONE:New( 'some zone' ):IsInstanceOf( ZONE ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'ZONE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'zone' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'BASE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'GROUP' ) will return false

Defined in:

Parameter:

ClassName

is the name of the class or the class itself to run the check against

Return value:

#boolean:

Enquires if tracing is on (for the class).

Defined in:

Return value:

#boolean:

BASE constructor.

This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.

function EVENT:New()
  local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
  return self
end
  

Defined in:

Return value:

Occurs when an object is completely destroyed.

initiator : The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Occurs when a ground unit captures either an airbase or a farp.

initiator : The unit that captured the base place: The airbase that was captured, can be a FARP or Airbase. When calling place:getCoalition() the faction will already be the new owning faction.

Defined in:

Parameter:

The EventData structure.

Occurs when any object is spawned into the mission.

initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft crashes into the ground and is completely destroyed.

initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

Unknown precisely what creates this event, likely tied into newer damage model.

Will update this page when new information become available.

  • initiator: The unit that had the failure.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.

Defined in:

Parameter:

The EventData structure.

Occurs when any system fails on a human controlled aircraft.

initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs on the death of a unit.

Contains more and different information. Similar to unit_lost it will occur for aircraft before the aircraft crash event occurs.

  • initiator: The unit that killed the target
  • target: Target Object
  • weapon: Weapon Object

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

Event does not occur if the pilot lands in the water and sub combs to Davey Jones Locker.

  • initiator: Static object representing the ejected pilot. Place : Aircraft that the pilot ejected from.
  • place: may not return as a valid object if the aircraft has crashed into the ground and no longer exists.
  • subplace: is always 0 for unknown reasons.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts

Defined in:

Parameter:

The EventData structure.

Occurs when the pilot of an aircraft is killed.

Can occur either if the player is alive and crashes or if a weapon kills the pilot without completely destroying the plane. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player relieves control of a unit to the AI.

initiator : The unit that the player left.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft connects with a tanker and begins taking on fuel.

initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

There is no information on what values the score was changed to. Event is likely similar to player_comment in this regard.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. initiator : The unit that was doing the shooting.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit begins firing a weapon that has a high rate of fire.

Most common with aircraft cannons (GAU-8), autocannons, and machine guns. initiator : The unit that is doing the shooting. target: The unit that is being targeted.

Defined in:

Parameter:

The EventData structure.

Occurs whenever any unit in a mission fires a weapon.

But not any machine gun or autocannon based weapon, those are handled by EVENT.ShootingStart.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft takes off from an airbase, farp, or ship.

initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

  • initiator: The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Schedule a new time event.

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

#table ...

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#number:

The ScheduleID of the planned schedule.

Schedule a new time event.

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

#number Repeat

Specifies the interval in seconds when the scheduler will call the event function.

#number RandomizeFactor

Specifies a randomization factor between 0 and 1 to randomize the Repeat.

#number Stop

Specifies the amount of seconds when the scheduler will be stopped.

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

#table ...

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#number:

The ScheduleID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

Set the Class Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Parameter:

#number EventPriority

The Event processing Priority.

Return value:

self

Set a state or property of the Object given a Key and a Value.

Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that will hold the Value set by the Key.

Key

The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

true = trace all methods in MOOSE.

Set tracing for a class

Defined in:

Parameter:

#string Class

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

#string Method

Set trace level

Defined in:

Parameter:

#number Level

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.

So tracing must be switched on manually in your mission if you are using Moose statically. When moose is loading dynamically (for moose class development), tracing is switched on by default.

Defined in:

Parameter:

#boolean TraceOnOff

Switch the tracing on or off.

Usage:

-- Switch the tracing On
BASE:TraceOnOff( true )

-- Switch the tracing Off
BASE:TraceOnOff( false )

UnSubscribe to a DCS event.

Defined in:

Parameter:

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

TODO: Complete DCS#Event structure.
- The main event handling function... This function captures all events generated for the class. @param #BASE self @param DCS#Event event

Defined in:

Parameter:

event

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)

Function(s)

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

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

Field(s)

Function(s)

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:

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 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:

Field(s)

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:

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.

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.

Defined in:

ZONE_POLYGON_BASE

Return value:

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

Defined in:

ZONE_POLYGON_BASE

Return value:

Define a random DCS#Vec2 within the zone.

Defined in:

ZONE_POLYGON_BASE

Return value:

The Vec2 coordinate.

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.

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.

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:

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:

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.

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. Default is 0.

#number outer

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

Return value:

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D 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 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.

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.

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:

Table of DCS 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 units.

Defined in:

ZONE_RADIUS

Return value:

Set of units and statics inside the zone.

Count the number of different coalitions inside the zone.

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 specifed coalition is inside the zone and noone 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 coaltion is inside the zone and the specifed 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 coaliton 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.

Return value:

self

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

Note that 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.

UnitCategories

An array of unit categories of the objects to find in the zone.

Usage:

   self.Zone:Scan()
   local IsAttacked = self.Zone: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.

The radius of the zone.

#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.

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. Default is 0.

#number outer

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

Return value:

Returns a Core.Point#POINT_VEC2 object reflecting a random 2D 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 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.

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.

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:

Table of DCS scenery objects.

Get scanned scenery type

Defined in:

Parameter:

SceneryType

Return value:

#table:

Table of DCS scenery type objects.

Get a set of scanned units.

Defined in:

Return value:

Set of units and statics inside the zone.

Count the number of different coalitions inside the zone.

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 specifed coalition is inside the zone and noone 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 coaltion is inside the zone and the specifed 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 coaliton 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.

Return value:

self

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

Note that 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.

UnitCategories

An array of unit categories of the objects to find in the zone.

Usage:

   self.Zone:Scan()
   local IsAttacked = self.Zone: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