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.

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

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

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

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

Creation of a Crash Event.

ZONE_BASE:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

ZONE_BASE:CreateEventDynamicCargoLoaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

ZONE_BASE:CreateEventDynamicCargoRemoved(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

ZONE_BASE:CreateEventDynamicCargoUnloaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

ZONE_BASE:CreateEventNewDynamicCargo(DynamicCargo)

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

ZONE_BASE:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT 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 Core.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(EventID, 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 Event for an object is triggered.

ZONE_BASE:OnEventBDA(EventData)

BDA.

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:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

ZONE_BASE:OnEventDynamicCargoLoaded(EventData)

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

ZONE_BASE:OnEventDynamicCargoRemoved(EventData)

Occurs when a dynamic cargo crate is removed.

ZONE_BASE:OnEventDynamicCargoUnloaded(EventData)

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

ZONE_BASE:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

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 Have a look at the class Core.Event#EVENT as these are just the prototypes.

ZONE_BASE:OnEventLandingAfterEjection(EventData)

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

ZONE_BASE:OnEventLandingQualityMark(EventData)

Landing quality mark.

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 Have a look at the class Core.Event#EVENT as these are just the prototypes.

ZONE_BASE:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

ZONE_BASE:OnEventNewDynamicCargo(EventData)

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

ZONE_BASE:OnEventParatrooperLanding(EventData)

Weapon add.

ZONE_BASE:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

ZONE_BASE:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

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:OnEventTriggerZone(EventData)

Trigger zone.

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

Stops the Schedule.

ZONE_BASE.Scheduler

ZONE_BASE:SetEventPriority(EventPriority)

Set the Class Core.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(EventID)

UnSubscribe to a DCS event.

ZONE_BASE._

ZONE_BASE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

ZONE_BASE:_Serialize(Arguments)

(Internal) Serialize arguments

ZONE_BASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

ZONE_BASE.__

ZONE_BASE:onEvent(event)

The main event handling function...

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

Call scheduler.

ZONE_OVAL.ClassName

Name of the class.

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

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

Current state name.

ZONE_OVAL.endstates

ZONE_OVAL:is(State, state)

Check if FSM is in state.

ZONE_OVAL.options

Options.

ZONE_OVAL.subs

Subs.

Fields and Methods inherited from BASE Description

ZONE_OVAL.ClassID

The ID number of the class.

ZONE_OVAL.ClassName

The name of the class.

ZONE_OVAL.ClassNameAndID

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

ZONE_OVAL:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

ZONE_OVAL:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

ZONE_OVAL:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

ZONE_OVAL:CreateEventDynamicCargoLoaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

ZONE_OVAL:CreateEventDynamicCargoRemoved(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

ZONE_OVAL:CreateEventDynamicCargoUnloaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

ZONE_OVAL:CreateEventNewDynamicCargo(DynamicCargo)

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

ZONE_OVAL:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

ZONE_OVAL:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

ZONE_OVAL:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

ZONE_OVAL:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

ZONE_OVAL:E(Arguments)

Log an exception which will be traced always.

ZONE_OVAL:EventDispatcher()

Returns the event dispatcher

ZONE_OVAL:EventRemoveAll()

Remove all subscribed events

ZONE_OVAL:F(Arguments)

Trace a function call.

ZONE_OVAL:F2(Arguments)

Trace a function call level 2.

ZONE_OVAL:F3(Arguments)

Trace a function call level 3.

ZONE_OVAL:GetClassID()

Get the ClassID of the class instance.

ZONE_OVAL:GetClassName()

Get the ClassName of the class instance.

ZONE_OVAL:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

ZONE_OVAL:GetEventPriority()

Get the Class Core.Event processing Priority.

ZONE_OVAL:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

ZONE_OVAL:GetState(Object, Key)

Get a Value given a Key from the Object.

ZONE_OVAL:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

ZONE_OVAL:I(Arguments)

Log an information which will be traced always.

ZONE_OVAL:Inherit(Child, Parent)

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

ZONE_OVAL:IsInstanceOf(ClassName)

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

ZONE_OVAL:IsTrace()

Enquires if tracing is on (for the class).

ZONE_OVAL:New()

BASE constructor.

ZONE_OVAL:OnEvent(EventData)

Occurs when an Event for an object is triggered.

ZONE_OVAL:OnEventBDA(EventData)

BDA.

ZONE_OVAL:OnEventBaseCaptured(EventData)

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

ZONE_OVAL:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

ZONE_OVAL:OnEventCrash(EventData)

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

ZONE_OVAL:OnEventDead(EventData)

Occurs when an object is dead.

ZONE_OVAL:OnEventDetailedFailure(EventData)

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

ZONE_OVAL:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

ZONE_OVAL:OnEventDynamicCargoLoaded(EventData)

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

ZONE_OVAL:OnEventDynamicCargoRemoved(EventData)

Occurs when a dynamic cargo crate is removed.

ZONE_OVAL:OnEventDynamicCargoUnloaded(EventData)

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

ZONE_OVAL:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

ZONE_OVAL:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

ZONE_OVAL:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

ZONE_OVAL:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

ZONE_OVAL:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

ZONE_OVAL:OnEventKill(EventData)

Occurs on the death of a unit.

ZONE_OVAL:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.

ZONE_OVAL:OnEventLandingAfterEjection(EventData)

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

ZONE_OVAL:OnEventLandingQualityMark(EventData)

Landing quality mark.

ZONE_OVAL:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

ZONE_OVAL:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

ZONE_OVAL:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

ZONE_OVAL:OnEventMissionEnd(EventData)

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

ZONE_OVAL:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

ZONE_OVAL:OnEventNewDynamicCargo(EventData)

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

ZONE_OVAL:OnEventParatrooperLanding(EventData)

Weapon add.

ZONE_OVAL:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

ZONE_OVAL:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

ZONE_OVAL:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

ZONE_OVAL:OnEventPlayerLeaveUnit(EventData)

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

ZONE_OVAL:OnEventRefueling(EventData)

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

ZONE_OVAL:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

ZONE_OVAL:OnEventScore(EventData)

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

ZONE_OVAL:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

ZONE_OVAL:OnEventShootingStart(EventData)

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

ZONE_OVAL:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

ZONE_OVAL:OnEventTakeoff(EventData)

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

ZONE_OVAL:OnEventTriggerZone(EventData)

Trigger zone.

ZONE_OVAL:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

ZONE_OVAL:ScheduleStop(SchedulerID)

Stops the Schedule.

ZONE_OVAL.Scheduler

ZONE_OVAL:SetEventPriority(EventPriority)

Set the Class Core.Event processing Priority.

ZONE_OVAL:SetState(Object, Key, Value)

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

ZONE_OVAL:T(Arguments)

Trace a function logic level 1.

ZONE_OVAL:T2(Arguments)

Trace a function logic level 2.

ZONE_OVAL:T3(Arguments)

Trace a function logic level 3.

ZONE_OVAL:TraceAll(TraceAll)

Trace all methods in MOOSE

ZONE_OVAL:TraceClass(Class)

Set tracing for a class

ZONE_OVAL:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

ZONE_OVAL:TraceLevel(Level)

Set trace level

ZONE_OVAL:TraceOff()

Set trace off.

ZONE_OVAL:TraceOn()

Set trace on.

ZONE_OVAL: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_OVAL:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

ZONE_OVAL._

ZONE_OVAL:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

ZONE_OVAL:_Serialize(Arguments)

(Internal) Serialize arguments

ZONE_OVAL:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

ZONE_OVAL.__

ZONE_OVAL:onEvent(event)

The main event handling function...

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

Call scheduler.

_ZONE_TRIANGLE.ClassName

Name of the class.

_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

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

Current state name.

_ZONE_TRIANGLE.endstates

_ZONE_TRIANGLE:is(State, state)

Check if FSM is in state.

_ZONE_TRIANGLE.options

Options.

_ZONE_TRIANGLE.subs

Subs.

Fields and Methods inherited from BASE Description

_ZONE_TRIANGLE.ClassID

The ID number of the class.

_ZONE_TRIANGLE.ClassName

The name of the class.

_ZONE_TRIANGLE.ClassNameAndID

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

_ZONE_TRIANGLE:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

_ZONE_TRIANGLE:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

_ZONE_TRIANGLE:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

_ZONE_TRIANGLE:CreateEventDynamicCargoLoaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

_ZONE_TRIANGLE:CreateEventDynamicCargoRemoved(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

_ZONE_TRIANGLE:CreateEventDynamicCargoUnloaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

_ZONE_TRIANGLE:CreateEventNewDynamicCargo(DynamicCargo)

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

_ZONE_TRIANGLE:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

_ZONE_TRIANGLE:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

_ZONE_TRIANGLE:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

_ZONE_TRIANGLE:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

_ZONE_TRIANGLE:E(Arguments)

Log an exception which will be traced always.

_ZONE_TRIANGLE:EventDispatcher()

Returns the event dispatcher

_ZONE_TRIANGLE:EventRemoveAll()

Remove all subscribed events

_ZONE_TRIANGLE:F(Arguments)

Trace a function call.

_ZONE_TRIANGLE:F2(Arguments)

Trace a function call level 2.

_ZONE_TRIANGLE:F3(Arguments)

Trace a function call level 3.

_ZONE_TRIANGLE:GetClassID()

Get the ClassID of the class instance.

_ZONE_TRIANGLE:GetClassName()

Get the ClassName of the class instance.

_ZONE_TRIANGLE:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

_ZONE_TRIANGLE:GetEventPriority()

Get the Class Core.Event processing Priority.

_ZONE_TRIANGLE:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

_ZONE_TRIANGLE:GetState(Object, Key)

Get a Value given a Key from the Object.

_ZONE_TRIANGLE:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

_ZONE_TRIANGLE:I(Arguments)

Log an information which will be traced always.

_ZONE_TRIANGLE:Inherit(Child, Parent)

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

_ZONE_TRIANGLE:IsInstanceOf(ClassName)

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

_ZONE_TRIANGLE:IsTrace()

Enquires if tracing is on (for the class).

_ZONE_TRIANGLE:New()

BASE constructor.

_ZONE_TRIANGLE:OnEvent(EventData)

Occurs when an Event for an object is triggered.

_ZONE_TRIANGLE:OnEventBDA(EventData)

BDA.

_ZONE_TRIANGLE:OnEventBaseCaptured(EventData)

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

_ZONE_TRIANGLE:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

_ZONE_TRIANGLE:OnEventCrash(EventData)

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

_ZONE_TRIANGLE:OnEventDead(EventData)

Occurs when an object is dead.

_ZONE_TRIANGLE:OnEventDetailedFailure(EventData)

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

_ZONE_TRIANGLE:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

_ZONE_TRIANGLE:OnEventDynamicCargoLoaded(EventData)

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

_ZONE_TRIANGLE:OnEventDynamicCargoRemoved(EventData)

Occurs when a dynamic cargo crate is removed.

_ZONE_TRIANGLE:OnEventDynamicCargoUnloaded(EventData)

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

_ZONE_TRIANGLE:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

_ZONE_TRIANGLE:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

_ZONE_TRIANGLE:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

_ZONE_TRIANGLE:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

_ZONE_TRIANGLE:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

_ZONE_TRIANGLE:OnEventKill(EventData)

Occurs on the death of a unit.

_ZONE_TRIANGLE:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.

_ZONE_TRIANGLE:OnEventLandingAfterEjection(EventData)

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

_ZONE_TRIANGLE:OnEventLandingQualityMark(EventData)

Landing quality mark.

_ZONE_TRIANGLE:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

_ZONE_TRIANGLE:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

_ZONE_TRIANGLE:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

_ZONE_TRIANGLE:OnEventMissionEnd(EventData)

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

_ZONE_TRIANGLE:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

_ZONE_TRIANGLE:OnEventNewDynamicCargo(EventData)

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

_ZONE_TRIANGLE:OnEventParatrooperLanding(EventData)

Weapon add.

_ZONE_TRIANGLE:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

_ZONE_TRIANGLE:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

_ZONE_TRIANGLE:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

_ZONE_TRIANGLE:OnEventPlayerLeaveUnit(EventData)

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

_ZONE_TRIANGLE:OnEventRefueling(EventData)

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

_ZONE_TRIANGLE:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

_ZONE_TRIANGLE:OnEventScore(EventData)

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

_ZONE_TRIANGLE:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

_ZONE_TRIANGLE:OnEventShootingStart(EventData)

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

_ZONE_TRIANGLE:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

_ZONE_TRIANGLE:OnEventTakeoff(EventData)

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

_ZONE_TRIANGLE:OnEventTriggerZone(EventData)

Trigger zone.

_ZONE_TRIANGLE:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

_ZONE_TRIANGLE:ScheduleStop(SchedulerID)

Stops the Schedule.

_ZONE_TRIANGLE.Scheduler

_ZONE_TRIANGLE:SetEventPriority(EventPriority)

Set the Class Core.Event processing Priority.

_ZONE_TRIANGLE:SetState(Object, Key, Value)

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

_ZONE_TRIANGLE:T(Arguments)

Trace a function logic level 1.

_ZONE_TRIANGLE:T2(Arguments)

Trace a function logic level 2.

_ZONE_TRIANGLE:T3(Arguments)

Trace a function logic level 3.

_ZONE_TRIANGLE:TraceAll(TraceAll)

Trace all methods in MOOSE

_ZONE_TRIANGLE:TraceClass(Class)

Set tracing for a class

_ZONE_TRIANGLE:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

_ZONE_TRIANGLE:TraceLevel(Level)

Set trace level

_ZONE_TRIANGLE:TraceOff()

Set trace off.

_ZONE_TRIANGLE:TraceOn()

Set trace on.

_ZONE_TRIANGLE: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_TRIANGLE:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

_ZONE_TRIANGLE._

_ZONE_TRIANGLE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

_ZONE_TRIANGLE:_Serialize(Arguments)

(Internal) Serialize arguments

_ZONE_TRIANGLE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

_ZONE_TRIANGLE.__

_ZONE_TRIANGLE:onEvent(event)

The main event handling function...

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.

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)

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.

IniObjectCategory

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.

IniObjectCategory

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

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 Core.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 Core.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, set to nil, 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:

Event ID.

#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 Event for an object is triggered.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Discard chair after ejection.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a dynamic cargo crate is removed.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

  • 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 Have a look at the class Core.Event#EVENT as these are just the prototypes.

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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

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

Landing quality mark.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.

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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when a player enters a slot and takes control of an aircraft.

Have a look at the class Core.Event#EVENT as these are just the prototypes. NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Trigger zone.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

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

#string:

The Schedule ID 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:

#string:

The Schedule ID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#string SchedulerID

(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.

Set the Class Core.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 Core.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, set to nil, 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

Class name.

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

Class name.

#string Method

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:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

The main event handling function...

This function captures all events generated for the class.

Defined in:

Parameter:

DCS#Event 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)

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

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.

IniObjectCategory

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.

IniObjectCategory

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

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 Core.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 Core.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, set to nil, 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:

Event ID.

#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 Event for an object is triggered.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Discard chair after ejection.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a dynamic cargo crate is removed.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

  • 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 Have a look at the class Core.Event#EVENT as these are just the prototypes.

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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

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

Landing quality mark.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.

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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when a player enters a slot and takes control of an aircraft.

Have a look at the class Core.Event#EVENT as these are just the prototypes. NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Trigger zone.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

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

#string:

The Schedule ID 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:

#string:

The Schedule ID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#string SchedulerID

(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.

Set the Class Core.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 Core.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, set to nil, 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

Class name.

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

Class name.

#string Method

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:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

The main event handling function...

This function captures all events generated for the class.

Defined in:

Parameter:

DCS#Event event

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.

Field(s)

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.

IniObjectCategory

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.

IniObjectCategory

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

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 Core.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 Core.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, set to nil, 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:

Event ID.

#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 Event for an object is triggered.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Discard chair after ejection.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a dynamic cargo crate is removed.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

  • 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 Have a look at the class Core.Event#EVENT as these are just the prototypes.

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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

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

Landing quality mark.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.

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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when a player enters a slot and takes control of an aircraft.

Have a look at the class Core.Event#EVENT as these are just the prototypes. NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes. 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. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.

Trigger zone.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

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

#string:

The Schedule ID 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:

#string:

The Schedule ID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#string SchedulerID

(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.

Set the Class Core.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 Core.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, set to nil, 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

Class name.

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

Class name.

#string Method

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:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

The main event handling function...

This function captures all events generated for the class.

Defined in:

Parameter:

DCS#Event event