Module Ops.ArmyGroup
Ops - Enhanced Ground Group.
Main Features:
- Patrol waypoints ad infinitum
- Easy change of ROE and alarm state, formation and other settings
- Dynamically add and remove waypoints
- Sophisticated task queueing system (know when DCS tasks start and end)
- Convenient checks when the group enters or leaves a zone
- Detection events for new, known and lost units
- Simple LASER and IR-pointer setup
- Compatible with AUFTRAG class
- Many additional events that the mission designer can hook into
Example Missions:
Demo missions can be found on github.
Author: funkyfranky
==
Global(s)
Global ARMYGROUP |
Your soul may belong to Jesus, but your ass belongs to the marines. -- Eugene B. |
Your soul may belong to Jesus, but your ass belongs to the marines. -- Eugene B.
Sledge
The ARMYGROUP Concept
This class enhances naval groups.
Type(s)
Fields and Methods inherited from ARMYGROUP | Description |
---|---|
Add a zone to the retreat zone set. |
|
ARMYGROUP:AddTaskAttackGroup(TargetGroup, WeaponExpend, WeaponType, Clock, Prio) |
Add a scheduled task. |
ARMYGROUP:AddTaskFireAtPoint(Coordinate, Clock, Radius, Nshots, WeaponType, Prio) |
Add a scheduled task to fire at a given coordinate. |
ARMYGROUP:AddTaskWaypointFireAtPoint(Coordinate, Waypoint, Radius, Nshots, WeaponType, Prio) |
Add a waypoint task to fire at a given coordinate. |
ARMYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Formation, Updateroute) |
Add an a waypoint to the route. |
Get coordinate of the closest road. |
|
Get 2D distance to the closest road. |
|
Check if the group is ready for combat. |
|
Check if the group is currently cruising. |
|
Check if the group is currently holding its positon. |
|
Check if the group is currently on a detour. |
|
Create a new ARMYGROUP class object. |
|
Event function handling the birth of a unit. |
|
Event function handling the crash of a unit. |
|
Event function handling when a unit is hit. |
|
Event function handling when a unit is removed from the game. |
|
Group patrols ad inifintum. |
|
Define a set of possible retreat zones. |
|
ARMYGROUP:SwitchFormation(Formation, Permanently, NoRouteUpdate) |
Switch to a specific formation. |
Initialize group parameters. |
|
Update engage target. |
|
Triggers the FSM event "Stop" after a delay. |
|
Resume route at first waypoint when final waypoint is reached. |
|
Engage target. |
|
Formation that is used permanently and overrules waypoint formations. |
|
If true, group is mobile. |
|
On after "Cruise" event. |
|
ARMYGROUP:onafterDetour(From, Event, To, Coordinate, Speed, Formation, ResumeRoute) |
On after "Detour" event. |
On after "DetourReached" event. |
|
On after "Disengage" event. |
|
On after "ElementSpawned" event. |
|
ARMYGROUP:onafterEngageTarget(From, Event, To, Group, Target) |
On after "EngageTarget" event. |
On after "FullStop" event. |
|
ARMYGROUP:onafterGotoWaypoint(From, Event, To, UID, Speed, Formation) |
On after "GotoWaypoint" event. |
ARMYGROUP:onafterRearm(From, Event, To, Coordinate, Formation) |
On after "Rearm" event. |
On after "Rearmed" event. |
|
On after "Rearming" event. |
|
On after "Retreat" event. |
|
On after "Retreated" event. |
|
On after "Spawned" event. |
|
Update status. |
|
On after "Stop" event. |
|
ARMYGROUP:onafterUpdateRoute(From, Event, To, n, Speed, Formation) |
On after "UpdateRoute" event. |
ARMYGROUP:onbeforeEngageTarget(From, Event, To, Group, Target) |
On after "EngageTarget" event. |
On before "Retreat" event. |
|
|
|
If true, the group will automatically retreat when out of ammo. Needs a retreat zone! |
|
Set of retreat zones. |
|
Army Group version. |
Fields and Methods inherited from OPSGROUP | Description |
---|---|
Activate a late activated group. |
|
Add a zone that triggers and event if the group enters or leaves any of the zones. |
|
Add mission to queue. |
|
Add a scheduled task. |
|
Add an enroute task. |
|
ARMYGROUP:AddTaskWaypoint(task, Waypoint, description, prio, duration) |
Add a waypoint task. |
Add a weapon range for ARTY auftrag. |
|
path finding. |
|
Check if task description is unique. |
|
Name of the class. |
|
Clear DCS tasks. |
|
Count remaining missons. |
|
Count the number of tasks that still pending in the queue. |
|
Count remaining waypoint tasks. |
|
Debug mode. Messages to all about status. |
|
Despawn the group. |
|
Despawn an element/unit of the group. |
|
Destroy group. |
|
Get current Alarm State of the group. |
|
Get inital amount of ammunition. |
|
Get the number of shells a unit or group currently has. |
|
Get total amount of ammunition of the whole group. |
|
Get the number of shells a unit or group currently has. |
|
Get coalition. |
|
Get current coordinate of the group. |
|
Get DCS GROUP object. |
|
Get DCS GROUP object. |
|
Get DCS units. |
|
Get set of detected groups. |
|
Get set of detected units. |
|
Get distance to waypoint. |
|
Get the first element of a group, which is alive. |
|
Get the element of a group. |
|
Returns the currently expected speed. |
|
Get MOOSE GROUP object. |
|
Get current heading of the group. |
|
Get highest threat. |
|
Get LASER code. |
|
Get current LASER coordinate, i.e. |
|
Get current target of the LASER. |
|
Returns the absolute (average) life points of the group. |
|
Get mission by its id (auftragsnummer). |
|
Get mission by its task id. |
|
Get current mission. |
|
Get the group name. |
|
Get number of elements alive. |
|
Get coordinate of next waypoint of the group. |
|
Get current orientation of the first unit in the group. |
|
Get current orientation of the first unit in the group. |
|
Get current ROE of the group. |
|
Get current ROT of the group. |
|
Get current Radio frequency and modulation. |
|
Get default cruise speed. |
|
Returns a non-zero speed to the next waypoint (even if the waypoint speed is zero). |
|
Get current TACAN parameters. |
|
Get task by its id. |
|
Get the currently executed task if there is any. |
|
Get the unfinished waypoint tasks |
|
Get highest detected threat. |
|
Get time to waypoint based on current velocity. |
|
Get MOOSE UNIT object. |
|
Get current 2D position vector of the group. |
|
Get current 3D position vector of the group. |
|
Get current velocity of the group. |
|
Get waypoint. |
|
Get the waypoint from its unique ID. |
|
Get the waypoint from its index. |
|
Get waypoint coordinates. |
|
Get current waypoint. |
|
Get final waypoint. |
|
Get unique ID of waypoint given its index. |
|
Get the waypoint index (its position in the current waypoints table). |
|
Get waypoint index after waypoint with given ID. |
|
Get current waypoint index. |
|
Get next waypoint index. |
|
Get next waypoint. |
|
Get waypoint speed. |
|
Get unique ID of waypoint. |
|
Get the waypoint UID from its index, i.e. |
|
Get the waypoints. |
|
Get weapon data. |
|
ARMYGROUP:HasLoS(Coordinate, Element, OffsetElement, OffsetCoordinate) |
Check if an element of the group has line of sight to a coordinate. |
Check if this group has passed its final waypoint. |
|
Initialize Mission Editor waypoints. |
|
Check if group is activated. |
|
Check if group is alive. |
|
Check if group is dead. |
|
Check if the group is engaging another unit or group. |
|
Check if group is exists. |
|
Check if group is in state in utero. |
|
Check if the group has currently switched a LASER on. |
|
Check if this group is currently "late activated" and needs to be "activated" to appear in the mission. |
|
Check if the group is currently rearming. |
|
Check if the group is currently retreating. |
|
Check if group is in state spawned. |
|
Check if FSM is stopped. |
|
Check if this group is currently "uncontrolled" and needs to be "started" to begin its route. |
|
Mark waypoints on F10 map. |
|
Number of destroyed units. |
|
Create a new OPSGROUP class object. |
|
ARMYGROUP:NewTaskScheduled(task, clock, description, prio, duration) |
Create a scheduled task. |
Number kills of this groups. |
|
Push DCS task. |
|
Remove mission from queue. |
|
Remove task from task queue. |
|
Remove a waypoint. |
|
Remove a waypoint with a ceratin UID. |
|
Remove waypoints markers on the F10 map. |
|
Route group along waypoints. |
|
Route group to mission. |
|
Self destruction of group. |
|
Define a SET of zones that trigger and event if the group enters or leaves any of the zones. |
|
Set the default Alarm State for the group. |
|
Set default callsign. |
|
Set default formation. |
|
ARMYGROUP:SetDefaultICLS(Channel, Morse, UnitName, OffSwitch) |
Set default ICLS parameters. |
Set the default ROE for the group. |
|
Set the default ROT for the group. |
|
Set default Radio frequency and modulation. |
|
Set default cruise speed. |
|
ARMYGROUP:SetDefaultTACAN(Channel, Morse, UnitName, Band, OffSwitch) |
Set default TACAN parameters. |
Set detection on or off. |
|
Set LASER parameters. |
|
Set LASER target. |
|
Set DCS task. |
|
Set verbosity level. |
|
Triggers the FSM event "Status". |
|
Set current Alarm State of the group. |
|
Switch to a specific callsign. |
|
Switch to a specific formation. |
|
Activate/switch ICLS beacon settings. |
|
Set current ROE for the group. |
|
Set ROT for the group. |
|
Turn radio on or switch frequency/modulation. |
|
Activate/switch TACAN beacon settings. |
|
Deactivate ICLS beacon. |
|
Turn radio off. |
|
Deactivate TACAN beacon. |
|
Initialize Mission Editor waypoints. |
|
Check if all elements of the group have the same status (or are dead). |
|
Check if all elements of the group have the same status (or are dead). |
|
Check ammo is full. |
|
Check ammo status. |
|
Check damage. |
|
Check detected units. |
|
Check if passed the final waypoint and, if necessary, update route. |
|
Check if group is in zones. |
|
Check if group got stuck. |
|
Get coordinate from an object. |
|
Enhance waypoint table. |
|
Get next mission. |
|
Get next task in queue. |
|
Get name of ROE corresponding to the numerical value. |
|
Returns a name of a missile category. |
|
Function called when a group is passing a waypoint. |
|
Print info on mission and task status to DCS log file. |
|
On after "QueueUpdate" event. |
|
Set status for all elements (except dead ones). |
|
Set tasks at this waypoint |
|
Sort task queue. |
|
Activate/switch ICLS beacon settings. |
|
Activate/switch TACAN beacon settings. |
|
Function called when a task is done. |
|
Function called when a task is executed. |
|
Update laser point. |
|
Check if all elements of the group have the same status (or are dead). |
|
Check if all elements of the group have the same status or are dead. |
|
Initialize Mission Editor waypoints. |
|
Triggers the FSM event "Status" after a delay. |
|
Triggers the FSM event "Stop" after a delay. |
|
Resume route at first waypoint when final waypoint is reached. |
|
Initial ammount of ammo. |
|
Generalized attribute. |
|
Current callsign settings. |
|
Default callsign settings. |
|
Set of zones. |
|
Current coordinate. |
|
The ID (auftragsnummer) of the currently assigned AUFTRAG. |
|
Current waypoint index. This is the index of the last passed waypoint. |
|
Set of detected groups. |
|
Set of detected units. |
|
If true, detected units of the group are analyzed. |
|
Table of elements, i.e. units of the group. |
|
Group object. |
|
If true, group parameters were initialized. |
|
Name of the group. |
|
Heading of the group at last status check. |
|
Backup of last heading to monitor changes. |
|
Current ICLS settings. |
|
Default ICLS settings. |
|
Set of zones in which the group is currently in. |
|
If true, group is purely AI. |
|
If true, group is airplane or helicopter. |
|
Is an ARMYGROUP. |
|
Is a FLIGHTGROUP. |
|
If true, group is some ground unit. |
|
Is the group late activated. |
|
If true, group is ships or submarine. |
|
Is a NAVYGROUP. |
|
Is the group uncontrolled. |
|
If true, group is on pathfinding route. |
|
Class id string for output to DCS log file. |
|
Paused mission. |
|
Queue of missions. |
|
On after "Dead" event. |
|
On after "DetectedGroup" event. |
|
On after "DetectedGroupNew" event. |
|
On after "DetectedUnit" event. |
|
On after "DetectedUnitNew" event. |
|
On after "ElementDead" event. |
|
On after "ElementDestroyed" event. |
|
On after "EnterZone" event. |
|
On after "GotoWaypoint" event. |
|
On after "LaserCode" event. |
|
On after "LaserGotLOS" event. |
|
On after "LaserLostLOS" event. |
|
On after "LaserOff" event. |
|
On after "LaserOn" event. |
|
On after "LaserPause" event. |
|
On after "LaserResume" event. |
|
On after "LeaveZone" event. |
|
On after "MissionCancel" event. |
|
On after "MissionDone" event. |
|
On after "MissionExecute" event. |
|
On after "MissionStart" event. |
|
On after "PassingWaypoint" event. |
|
On after "PauseMission" event. |
|
On after "Stop" event. |
|
On after "TaskCancel" event. |
|
On after "TaskDone" event. |
|
On after "TaskExecute" event. |
|
On after "UnpauseMission" event. |
|
On before "Dead" event. |
|
On before "LaserOff" event. |
|
On before "LaserOn" event. |
|
On before "LaserResume" event. |
|
On before "MissionStart" event. |
|
On before "TaskDone" event. |
|
Current optional settings. |
|
Default option settings. |
|
Orientation at last status check. |
|
Backup of last orientation to monitor changes. |
|
Group has passed the final waypoint. |
|
Position of the group at last status check. |
|
Backup of last position vec to monitor changes. |
|
Current radio settings. |
|
Default radio settings. |
|
Radio queue. |
|
Group is being respawned. |
|
Cruising speed in km/h. |
|
Max speed in km/h. |
|
Speed to the next waypoint in m/s. |
|
Laser and IR spot. |
|
Current TACAN settings. |
|
Default TACAN settings. |
|
Running number of task ids. |
|
ID of current task. If 0, there is no current task assigned. |
|
Enroute task of the group. |
|
Paused tasks. |
|
Queue of tasks. |
|
Template of the group. |
|
Timer for check zones. |
|
Timer for queue updates. |
|
Distance traveled in meters. This is a lower bound. |
|
Time. |
|
Verbosity level. 0=silent. |
|
NavyGroup version. |
|
Table of waypoints. |
|
Table of initial waypoints. |
|
Weapon data table with key=BitType. |
|
Running number counting waypoints. |
Fields and Methods inherited from FSM | Description |
---|---|
Adds an End state. |
|
Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task. |
|
Adds a score for the FSM to be achieved. |
|
ARMYGROUP:AddScoreProcess(From, Event, State, ScoreText, Score) |
Adds a score for the FSM_PROCESS to be achieved. |
Add a new transition rule to the FSM. |
|
Call scheduler. |
|
Name of the class. |
|
Get current state. |
|
Returns the End states. |
|
Returns a table of the SubFSM rules defined within the FSM. |
|
Returns a table with the scores defined. |
|
Returns the start state of the FSM. |
|
Get current state. |
|
Returns a table with the Subs defined. |
|
Returns a table of the transition rules defined within the FSM. |
|
Check if FSM is in state. |
|
Load call backs. |
|
Creates a new FSM object. |
|
Scores. |
|
Sets the start state of the FSM. |
|
Add to map. |
|
Call handler. |
|
Create transition. |
|
Delayed transition. |
|
Event map. |
|
Go sub. |
|
Handler. |
|
Is end state. |
|
Sub maps. |
|
Check if can do an event. |
|
Check if cannot do an event. |
|
Current state name. |
|
Check if FSM is in state. |
|
Options. |
|
Subs. |
Fields and Methods inherited from BASE | Description |
---|---|
The ID number of the class. |
|
The name of the class. |
|
The name of the class concatenated with the ID number of the class. |
|
Clear the state of an object. |
|
ARMYGROUP:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
Creation of a Crash Event. |
|
Creation of a Dead Event. |
|
Creation of a |
|
Creation of a Remove Unit Event. |
|
Creation of a Takeoff Event. |
|
Creation of a Crash Event. |
|
Log an exception which will be traced always. |
|
Returns the event dispatcher |
|
Remove all subscribed events |
|
Trace a function call. |
|
Trace a function call level 2. |
|
Trace a function call level 3. |
|
Get the ClassID of the class instance. |
|
Get the ClassName of the class instance. |
|
Get the ClassName + ClassID of the class instance. |
|
Get the Class Event processing Priority. |
|
This is the worker method to retrieve the Parent class. |
|
Get a Value given a Key from the Object. |
|
Subscribe to a DCS Event. |
|
Log an information which will be traced always. |
|
This is the worker method to inherit from a parent class. |
|
This is the worker method to check if an object is an (sub)instance of a class. |
|
Enquires if tracing is on (for the class). |
|
BASE constructor. |
|
Occurs when an object is completely destroyed. |
|
Occurs when a ground unit captures either an airbase or a farp. |
|
Occurs when any object is spawned into the mission. |
|
Occurs when any aircraft crashes into the ground and is completely destroyed. |
|
Occurs when an object is dead. |
|
Unknown precisely what creates this event, likely tied into newer damage model. |
|
Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected |
|
Occurs when any aircraft shuts down its engines. |
|
Occurs when any aircraft starts its engines. |
|
Occurs whenever an object is hit by a weapon. |
|
Occurs when any system fails on a human controlled aircraft. |
|
Occurs on the death of a unit. |
|
Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on. |
|
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up. |
|
Occurs when a new mark was added. |
|
Occurs when a mark text was changed. |
|
Occurs when a mark was removed. |
|
Occurs when a mission ends |
|
Occurs when a mission starts |
|
Occurs when the pilot of an aircraft is killed. |
|
Occurs when a player enters a slot and takes control of an aircraft. |
|
Occurs when any player assumes direct control of a unit. |
|
Occurs when any player relieves control of a unit to the AI. |
|
Occurs when an aircraft connects with a tanker and begins taking on fuel. |
|
Occurs when an aircraft is finished taking fuel. |
|
Occurs when any modification to the "Score" as seen on the debrief menu would occur. |
|
Occurs when any unit stops firing its weapon. |
|
Occurs when any unit begins firing a weapon that has a high rate of fire. |
|
Occurs whenever any unit in a mission fires a weapon. |
|
Occurs when an aircraft takes off from an airbase, farp, or ship. |
|
Occurs when the game thinks an object is destroyed. |
|
Schedule a new time event. |
|
ARMYGROUP:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...) |
Schedule a new time event. |
Stops the Schedule. |
|
Set the Class Event processing Priority. |
|
Set a state or property of the Object given a Key and a Value. |
|
Trace a function logic level 1. |
|
Trace a function logic level 2. |
|
Trace a function logic level 3. |
|
Trace all methods in MOOSE |
|
Set tracing for a class |
|
Set tracing for a specific method of class |
|
Set trace level |
|
Set trace off. |
|
Set trace on. |
|
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. |
|
UnSubscribe to a DCS event. |
|
ARMYGROUP:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
ARMYGROUP:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
Fields and Methods inherited from ARMYGROUP.Element | Description |
---|---|
Height of element in meters. |
|
Length of element in meters. |
|
Name of the element, i.e. the unit. |
|
The element status. |
|
Type name. |
|
The UNIT object. |
|
Width of element in meters. |
Fields and Methods inherited from ARMYGROUP.Target | Description |
---|---|
Last known coordinate of the target. |
|
The target. |
|
ARMYGROUP class.
Field(s)
Resume route at first waypoint when final waypoint is reached.
Group ammo.
Formation that is used permanently and overrules waypoint formations.
Init done.
Ground are always AI.
Define category.
Defaults
Is (template) group late activated.
If true, group is mobile.
Ground groups cannot be uncontrolled.
Set some string id for output to DCS.log file.
If true, the group will automatically retreat when out of ammo. Needs a retreat zone!
Max speed in km/h.
Current set speed in m/s.
Get template of group.
Start check zone timer.
Start queue update timer.
Army Group version.
Function(s)
Add a zone to the retreat zone set.
Defined in:
ARMYGROUP
Parameter:
Core.Zone#ZONE_BASE RetreatZone
The retreat zone.
Return value:
self
Add a scheduled task.
Defined in:
ARMYGROUP
Parameters:
Wrapper.Group#GROUP TargetGroup
Target group.
#number WeaponExpend
How much weapons does are used.
#number WeaponType
Type of weapon. Default auto.
#string Clock
Time when to start the attack.
#number Prio
Priority of the task.
Return value:
The task table.
Add a scheduled task to fire at a given coordinate.
Defined in:
ARMYGROUP
Parameters:
Core.Point#COORDINATE Coordinate
Coordinate of the target.
#string Clock
Time when to start the attack.
#number Radius
Radius in meters. Default 100 m.
#number Nshots
Number of shots to fire. Default 3.
#number WeaponType
Type of weapon. Default auto.
#number Prio
Priority of the task.
Return value:
The task table.
Add a waypoint task to fire at a given coordinate.
Defined in:
ARMYGROUP
Parameters:
Core.Point#COORDINATE Coordinate
Coordinate of the target.
Ops.OpsGroup#OPSGROUP.Waypoint Waypoint
Where the task is executed. Default is next waypoint.
#number Radius
Radius in meters. Default 100 m.
#number Nshots
Number of shots to fire. Default 3.
#number WeaponType
Type of weapon. Default auto.
#number Prio
Priority of the task.
Return value:
The task table.
Add an a waypoint to the route.
Defined in:
ARMYGROUP
Parameters:
Core.Point#COORDINATE Coordinate
The coordinate of the waypoint.
#number Speed
Speed in knots. Default is default cruise speed or 70% of max speed.
#number AfterWaypointWithID
Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
#number Formation
Formation the group will use.
#boolean Updateroute
If true or nil, call UpdateRoute. If false, no call.
Return value:
Waypoint table.
Get coordinate of the closest road.
Defined in:
ARMYGROUP
Return value:
Coordinate of a road closest to the group.
Get 2D distance to the closest road.
Defined in:
ARMYGROUP
Return value:
#number:
Distance in meters to the closest road.
Check if the group is ready for combat.
I.e. not reaming, retreating, retreated, out of ammo or engaging.
Defined in:
ARMYGROUP
Return value:
#boolean:
If true, group is on a combat ready.
Check if the group is currently cruising.
Defined in:
ARMYGROUP
Return value:
#boolean:
If true, group cruising.
Check if the group is currently holding its positon.
Defined in:
ARMYGROUP
Return value:
#boolean:
If true, group was ordered to hold.
Check if the group is currently on a detour.
Defined in:
ARMYGROUP
Return value:
#boolean:
If true, group is on a detour.
Create a new ARMYGROUP class object.
Defined in:
ARMYGROUP
Parameter:
Wrapper.Group#GROUP Group
The group object. Can also be given by its group name as #string
.
Return value:
self
Event function handling the birth of a unit.
Event function handling the crash of a unit.
Event function handling when a unit is hit.
Event function handling when a unit is removed from the game.
Group patrols ad inifintum.
If the last waypoint is reached, it will go to waypoint one and repeat its route.
Defined in:
ARMYGROUP
Parameter:
#boolean switch
If true or nil, patrol until the end of time. If false, go along the waypoints once and stop.
Return value:
self
Define a set of possible retreat zones.
Defined in:
ARMYGROUP
Parameter:
Core.Set#SET_ZONE RetreatZoneSet
The retreat zone set. Default is an empty set.
Return value:
self
Switch to a specific formation.
Defined in:
ARMYGROUP
Parameters:
#number Formation
New formation the group will fly in. Default is the setting of SetDefaultFormation()
.
#boolean Permanently
If true, formation always used from now on.
#boolean NoRouteUpdate
If true, route is not updated.
Return value:
self
Initialize group parameters.
Also initializes waypoints if self.waypoints is nil.
Triggers the FSM event "Stop" after a delay.
Stops the ARMYGROUP and all its event handlers.
Defined in:
ARMYGROUP
Parameter:
#number delay
Delay in seconds.
On after "Cruise" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#number Speed
Speed in knots.
#number Formation
Formation.
On after "Detour" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Point#COORDINATE Coordinate
Coordinate where to go.
#number Speed
Speed in knots. Default cruise speed.
#number Formation
Formation of the group.
#number ResumeRoute
If true, resume route after detour point was reached. If false, the group will stop at the detour point and wait for futher commands.
On after "DetourReached" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "Disengage" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "ElementSpawned" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#ARMYGROUP.Element Element
The group element.
On after "EngageTarget" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Group#GROUP Group
the group to be engaged.
Target
On after "FullStop" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "GotoWaypoint" event.
Group will got to the given waypoint and execute its route from there.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#number UID
The goto waypoint unique ID.
#number Speed
(Optional) Speed to waypoint in knots.
#number Formation
(Optional) Formation to waypoint.
On after "Rearm" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Point#COORDINATE Coordinate
Coordinate where to rearm.
#number Formation
Formation of the group.
On after "Rearmed" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "Rearming" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "Retreat" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Zone#ZONE_BASE Zone
(Optional) Zone where to retreat. Default is the closest retreat zone.
#number Formation
(Optional) Formation of the group.
On after "Retreated" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "Spawned" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Update status.
Defined in:
ARMYGROUP
Parameters:
From
Event
To
On after "Stop" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "UpdateRoute" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#number n
Waypoint number. Default is next waypoint.
#number Speed
Speed in knots. Default cruise speed.
#number Formation
Formation of the group.
On after "EngageTarget" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Group#GROUP Group
the group to be engaged.
Target
On before "Retreat" event.
Defined in:
ARMYGROUP
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Zone#ZONE_BASE Zone
(Optional) Zone where to retreat. Default is the closest retreat zone.
#number Formation
(Optional) Formation of the group.
- Update status.
Defined in:
ARMYGROUP
Parameters:
From
Event
To
Field(s)
Resume route at first waypoint when final waypoint is reached.
Group ammo.
Formation that is used permanently and overrules waypoint formations.
Init done.
Ground are always AI.
Define category.
Defaults
Is (template) group late activated.
If true, group is mobile.
Ground groups cannot be uncontrolled.
Set some string id for output to DCS.log file.
If true, the group will automatically retreat when out of ammo. Needs a retreat zone!
Max speed in km/h.
Current set speed in m/s.
Get template of group.
Start check zone timer.
Start queue update timer.
Army Group version.
Function(s)
Activate a late activated group.
Defined in:
Parameter:
#number delay
(Optional) Delay in seconds before the group is activated. Default is immediately.
Return value:
self
Add a zone that triggers and event if the group enters or leaves any of the zones.
Add mission to queue.
Add a scheduled task.
Defined in:
Parameters:
#table task
DCS task table structure.
#string clock
Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds.
#string description
Brief text describing the task, e.g. "Attack SAM".
#number prio
Priority of the task.
#number duration
Duration before task is cancelled in seconds counted after task started. Default never.
Return value:
The task structure.
Add an enroute task.
Add a waypoint task.
Defined in:
Parameters:
#table task
DCS task table structure.
#OPSGROUP.Waypoint Waypoint
where the task is executed. Default is the at next waypoint.
#string description
Brief text describing the task, e.g. "Attack SAM".
#number prio
Priority of the task. Number between 1 and 100. Default is 50.
#number duration
Duration before task is cancelled in seconds counted after task started. Default never.
Return value:
The task structure.
Add a weapon range for ARTY auftrag.
Defined in:
Parameters:
#number RangeMin
Minimum range in nautical miles. Default 0 NM.
#number RangeMax
Maximum range in nautical miles. Default 10 NM.
#number BitType
Bit mask of weapon type for which the given min/max ranges apply. Default is ENUMS.WeaponFlag.Auto
, i.e. for all weapon types.
Return value:
self
Check if task description is unique.
Defined in:
Parameter:
#string description
Task destription
Return value:
#boolean:
If true, no other task has the same description.
Clear DCS tasks.
Defined in:
Parameter:
#table DCSTask
DCS task structure.
Return value:
self
Count remaining missons.
Count the number of tasks that still pending in the queue.
Defined in:
Return values:
#number:
Total number of tasks remaining.
#number:
Number of SCHEDULED tasks remaining.
#number:
Number of WAYPOINT tasks remaining.
Count remaining waypoint tasks.
Defined in:
Parameters:
#number uid
Unique waypoint ID.
id
Return value:
#number:
Number of waypoint tasks.
Despawn the group.
The whole group is despawned and (optionally) a "Remove Unit" event is generated for all current units of the group.
Defined in:
Parameters:
#number Delay
Delay in seconds before the group will be despawned. Default immediately.
#boolean NoEventRemoveUnit
If true, no event "Remove Unit" is generated.
Return value:
self
Despawn an element/unit of the group.
Defined in:
Parameters:
#OPSGROUP.Element Element
The element that will be despawned.
#number Delay
Delay in seconds before the element will be despawned. Default immediately.
#boolean NoEventRemoveUnit
If true, no event "Remove Unit" is generated.
Return value:
self
Destroy group.
The whole group is despawned and a Unit Lost for aircraft or Dead event for ground/naval units is generated for all current units.
Defined in:
Parameter:
#number Delay
Delay in seconds before the group will be destroyed. Default immediately.
Return value:
self
Get current Alarm State of the group.
Get inital amount of ammunition.
Get the number of shells a unit or group currently has.
For a group the ammo count of all units is summed up.
Get total amount of ammunition of the whole group.
Get the number of shells a unit or group currently has.
For a group the ammo count of all units is summed up.
Defined in:
Parameters:
Wrapper.Unit#UNIT unit
The unit object.
#boolean display
Display ammo table as message to all. Default false.
Return value:
Ammo data.
Get coalition.
Get current coordinate of the group.
Defined in:
Parameter:
#boolean NewObject
Create a new coordiante object.
Return value:
The coordinate (of the first unit) of the group.
Get DCS GROUP object.
Get DCS GROUP object.
Defined in:
Parameter:
#number UnitNumber
Number of the unit in the group. Default first unit.
Return value:
DCS group object.
Get DCS units.
Get set of detected groups.
Get set of detected units.
Get distance to waypoint.
Defined in:
Parameter:
#number indx
Waypoint index. Default is the next waypoint.
Return value:
#number:
Distance in meters.
Get the first element of a group, which is alive.
Defined in:
Return value:
The element or #nil
if no element is alive any more.
Get the element of a group.
Defined in:
Parameter:
#string unitname
Name of unit.
Return value:
The element.
Returns the currently expected speed.
Get MOOSE GROUP object.
Get current heading of the group.
Get highest threat.
Defined in:
Return values:
Get LASER code.
Get current LASER coordinate, i.e.
where the beam is pointing at if the LASER is on.
Defined in:
Return value:
Current position where the LASER is pointing at.
Get current target of the LASER.
This can be a STATIC or UNIT object.
Defined in:
Return value:
Current target object.
Returns the absolute (average) life points of the group.
Defined in:
Return values:
#number:
Life points. If group contains more than one element, the average is given.
#number:
Initial life points.
Get mission by its id (auftragsnummer).
Defined in:
Parameter:
#number id
Mission id (auftragsnummer).
Return value:
The mission.
Get mission by its task id.
Defined in:
Parameter:
#number taskid
The id of the (waypoint) task of the mission.
Return value:
The mission.
Get current mission.
Get the group name.
Get number of elements alive.
Defined in:
Parameter:
#string status
(Optional) Only count number, which are in a special status.
Return value:
#number:
Number of elements.
Get coordinate of next waypoint of the group.
Defined in:
Parameter:
#boolean cyclic
If true, return first waypoint if last waypoint was reached.
Return value:
Coordinate of the next waypoint.
Get current orientation of the first unit in the group.
Defined in:
Return values:
Get current orientation of the first unit in the group.
Defined in:
Return value:
Orientation X parallel to where the "nose" is pointing.
Get current ROE of the group.
Get current ROT of the group.
Get current Radio frequency and modulation.
Defined in:
Return values:
#number:
Radio frequency in MHz or nil.
#number:
Radio modulation or nil.
#boolean:
If true, the radio is on. Otherwise, radio is turned off.
Get default cruise speed.
Returns a non-zero speed to the next waypoint (even if the waypoint speed is zero).
Defined in:
Parameter:
#number indx
Waypoint index.
Return value:
#number:
Speed to next waypoint (>0) in knots.
Get current TACAN parameters.
Defined in:
Return values:
#number:
TACAN channel.
#string:
TACAN Morse code.
#string:
TACAN band ("X" or "Y").
#boolean:
TACAN is On (true) or Off (false).
#string:
UnitName Name of the unit acting as beacon.
Get task by its id.
Defined in:
Parameters:
#number id
Task id.
#string status
(Optional) Only return tasks with this status, e.g. OPSGROUP.TaskStatus.SCHEDULED.
Return value:
The task or nil.
Get the currently executed task if there is any.
Get the unfinished waypoint tasks
Defined in:
Parameter:
#number id
Unique waypoint ID.
Return value:
#table:
Table of tasks. Table could also be empty {}.
Get highest detected threat.
Detection must be turned on. The threat level is a number between 0 and 10, where 0 is the lowest, e.g. unarmed units.
Defined in:
Parameters:
#number ThreatLevelMin
Only consider threats with level greater or equal to this number. Default 1 (so unarmed units wont be considered).
#number ThreatLevelMax
Only consider threats with level smaller or queal to this number. Default 10.
Return values:
Highest threat unit detected by the group or nil
if no threat is currently detected.
#number:
Threat level.
Get time to waypoint based on current velocity.
Defined in:
Parameter:
#number indx
Waypoint index. Default is the next waypoint.
Return value:
#number:
Time in seconds. If velocity is 0
Get MOOSE UNIT object.
Defined in:
Parameter:
#number UnitNumber
Number of the unit in the group. Default first unit.
Return value:
The MOOSE UNIT object.
Get current 2D position vector of the group.
Get current 3D position vector of the group.
Get current velocity of the group.
Get waypoint.
Defined in:
Parameter:
#number indx
Waypoint index.
Return value:
Waypoint table.
Get the waypoint from its unique ID.
Defined in:
Parameter:
#number uid
Waypoint unique ID.
Return value:
Waypoint data.
Get the waypoint from its index.
Defined in:
Parameter:
#number index
Waypoint index.
Return value:
Waypoint data.
Get waypoint coordinates.
Defined in:
Parameter:
#number index
Waypoint index.
Return value:
Coordinate of the next waypoint.
Get current waypoint.
Get final waypoint.
Get unique ID of waypoint given its index.
Defined in:
Parameter:
#number indx
Waypoint index.
Return value:
#number:
Unique ID.
Get the waypoint index (its position in the current waypoints table).
Defined in:
Parameter:
#number uid
Waypoint unique ID.
Return value:
Waypoint data.
Get waypoint index after waypoint with given ID.
So if the waypoint has index 3 it will return 4.
Defined in:
Parameter:
#number uid
Unique ID of the waypoint. Default is new waypoint index after the last current one.
Return value:
#number:
Index after waypoint with given ID.
Get current waypoint index.
This is the index of the last passed waypoint.
Get next waypoint index.
Defined in:
Parameters:
#boolean cyclic
If true, return first waypoint if last waypoint was reached. Default is patrol ad infinitum value set.
#number i
Waypoint index from which the next index is returned. Default is the last waypoint passed.
Return value:
#number:
Next waypoint index.
Get next waypoint.
Defined in:
Parameter:
#boolean cyclic
If true, return first waypoint if last waypoint was reached.
Return value:
Next waypoint table.
Get waypoint speed.
Defined in:
Parameter:
#number indx
Waypoint index.
Return value:
#number:
Speed set at waypoint in knots.
Get unique ID of waypoint.
Defined in:
Parameter:
#OPSGROUP.Waypoint waypoint
The waypoint data table.
Return value:
#number:
Unique ID.
Get the waypoint UID from its index, i.e.
its current position in the waypoints table.
Defined in:
Parameter:
#number index
Waypoint index.
Return value:
#number:
Unique waypoint ID.
Get the waypoints.
Get weapon data.
Defined in:
Parameter:
#number BitType
Type of weapon.
Return value:
Weapon range data.
Check if an element of the group has line of sight to a coordinate.
Defined in:
Parameters:
Core.Point#COORDINATE Coordinate
The position to which we check the LoS.
#OPSGROUP.Element Element
The (optinal) element. If not given, all elements are checked.
DCS#Vec3 OffsetElement
Offset vector of the element.
DCS#Vec3 OffsetCoordinate
Offset vector of the coordinate.
Return value:
#boolean:
If true
, there is line of sight to the specified coordinate.
Check if this group has passed its final waypoint.
Defined in:
Return value:
#boolean:
If true, this group has passed the final waypoint.
Initialize Mission Editor waypoints.
Check if group is activated.
Defined in:
Return value:
#boolean:
If true, the group exists or false if the group does not exist. If nil, the DCS group could not be found.
Check if group is alive.
Defined in:
Return value:
#boolean:
true if group is exists and is activated, false if group is exist but is NOT activated. nil otherwise, e.g. the GROUP object is nil or the group is not spawned yet.
Check if group is dead.
Defined in:
Return value:
#boolean:
If true, all units/elements of the group are dead.
Check if the group is engaging another unit or group.
Check if group is exists.
Defined in:
Return value:
#boolean:
If true, the group exists or false if the group does not exist. If nil, the DCS group could not be found.
Check if group is in state in utero.
Check if the group has currently switched a LASER on.
Check if this group is currently "late activated" and needs to be "activated" to appear in the mission.
Check if the group is currently rearming.
Check if the group is currently retreating.
Check if group is in state spawned.
Check if FSM is stopped.
Check if this group is currently "uncontrolled" and needs to be "started" to begin its route.
Mark waypoints on F10 map.
Defined in:
Parameter:
#number Duration
Duration in seconds how long the waypoints are displayed before they are automatically removed. Default is that they are never removed.
Return value:
self
Create a new OPSGROUP class object.
Defined in:
Parameter:
Wrapper.Group#GROUP Group
The group object. Can also be given by its group name as #string
.
Return value:
self
Create a scheduled task.
Defined in:
Parameters:
#table task
DCS task table structure.
#string clock
Mission time when task is executed. Default in 5 seconds. If argument passed as #number, it defines a relative delay in seconds.
#string description
Brief text describing the task, e.g. "Attack SAM".
#number prio
Priority of the task.
#number duration
Duration before task is cancelled in seconds counted after task started. Default never.
Return value:
The task structure.
Push DCS task.
Defined in:
Parameter:
#table DCSTask
DCS task structure.
Return value:
self
Remove mission from queue.
Remove task from task queue.
Defined in:
Parameter:
#OPSGROUP.Task Task
The task to be removed from the queue.
Return value:
#boolean:
True if task could be removed.
Remove a waypoint.
Defined in:
Parameter:
#number wpindex
Waypoint number.
Return value:
self
Remove a waypoint with a ceratin UID.
Defined in:
Parameter:
#number uid
Waypoint UID.
Return value:
self
Remove waypoints markers on the F10 map.
Defined in:
Parameter:
#number Delay
Delay in seconds before the markers are removed. Default is immediately.
Return value:
self
Route group along waypoints.
Defined in:
Parameters:
#table waypoints
Table of waypoints.
#number delay
Delay in seconds.
Return value:
self
Route group to mission.
Defined in:
Parameters:
Ops.Auftrag#AUFTRAG mission
The mission table.
#number delay
Delay in seconds.
Self destruction of group.
An explosion is created at the position of each element.
Defined in:
Parameters:
#number Delay
Delay in seconds. Default now.
#number ExplosionPower
(Optional) Explosion power in kg TNT. Default 500 kg.
Return value:
#number:
Relative fuel in percent.
Define a SET of zones that trigger and event if the group enters or leaves any of the zones.
Set the default Alarm State for the group.
This is the state gets when the group is spawned or to which it defaults back after a mission.
Defined in:
Parameter:
#number alarmstate
Alarm state of group. Default is AI.Option.Ground.val.ALARM_STATE.AUTO
(0).
Return value:
self
Set default callsign.
Defined in:
Parameters:
#number CallsignName
Callsign name.
#number CallsignNumber
Callsign number.
Return value:
self
Set default formation.
Defined in:
Parameter:
#number Formation
The formation the groups flies in.
Return value:
self
Set default ICLS parameters.
Defined in:
Parameters:
#number Channel
ICLS channel. Default is 1.
#string Morse
Morse code. Default "XXX".
#string UnitName
Name of the unit acting as beacon.
#boolean OffSwitch
If true, TACAN is off by default.
Return value:
self
Set the default ROE for the group.
This is the ROE state gets when the group is spawned or to which it defaults back after a mission.
Defined in:
Parameter:
#number roe
ROE of group. Default is ENUMS.ROE.ReturnFire
.
Return value:
self
Set the default ROT for the group.
This is the ROT state gets when the group is spawned or to which it defaults back after a mission.
Defined in:
Parameter:
#number rot
ROT of group. Default is ENUMS.ROT.PassiveDefense
.
Return value:
self
Set default Radio frequency and modulation.
Defined in:
Parameters:
#number Frequency
Radio frequency in MHz. Default 251 MHz.
#number Modulation
Radio modulation. Default radio.Modulation.AM
.
#boolean OffSwitch
If true, radio is OFF by default.
Return value:
self
Set default cruise speed.
Defined in:
Parameter:
#number Speed
Speed in knots.
Return value:
self
Set default TACAN parameters.
Defined in:
Parameters:
#number Channel
TACAN channel. Default is 74.
#string Morse
Morse code. Default "XXX".
#string UnitName
Name of the unit acting as beacon.
#string Band
TACAN mode. Default is "X" for ground and "Y" for airborne units.
#boolean OffSwitch
If true, TACAN is off by default.
Return value:
self
Set detection on or off.
If detection is on, detected targets of the group will be evaluated and FSM events triggered.
Defined in:
Parameter:
#boolean Switch
If true
, detection is on. If false
or nil
, detection is off. Default is off.
Return value:
self
Set LASER parameters.
Defined in:
Parameters:
#number Code
Laser code. Default 1688.
#boolean CheckLOS
Check if lasing unit has line of sight to target coordinate. Default is true
.
#boolean IROff
If true, then dont switch on the additional IR pointer.
#number UpdateTime
Time interval in seconds the beam gets up for moving targets. Default every 0.5 sec.
Return value:
self
Set LASER target.
Defined in:
Parameter:
The target to lase. Can also be a COORDINATE object.
Set DCS task.
Enroute tasks are injected automatically.
Defined in:
Parameter:
#table DCSTask
DCS task structure.
Return value:
self
Set verbosity level.
Defined in:
Parameter:
#number VerbosityLevel
Level of output (higher=more). Default 0.
Return value:
self
Set current Alarm State of the group.
- 0 = "Auto"
- 1 = "Green"
- 2 = "Red"
Defined in:
Parameter:
#number alarmstate
Alarm state of group. Default is 0="Auto".
Return value:
self
Switch to a specific callsign.
Defined in:
Parameters:
#number CallsignName
Callsign name.
#number CallsignNumber
Callsign number.
Return value:
self
Switch to a specific formation.
Defined in:
Parameter:
#number Formation
New formation the group will fly in. Default is the setting of SetDefaultFormation()
.
Return value:
self
Activate/switch ICLS beacon settings.
Defined in:
Parameters:
#number Channel
ICLS Channel. Default is what is set in SetDefaultICLS()
so usually channel 1.
#string Morse
ICLS morse code. Default is what is set in SetDefaultICLS()
so usually "XXX".
#string UnitName
Name of the unit in the group which should activate the ICLS beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group.
Return value:
self
Set current ROE for the group.
Defined in:
Parameter:
#string roe
ROE of group. Default is value set in SetDefaultROE
(usually ENUMS.ROE.ReturnFire
).
Return value:
self
Set ROT for the group.
Defined in:
Parameter:
#string rot
ROT of group. Default is value set in :SetDefaultROT
(usually ENUMS.ROT.PassiveDefense
).
Return value:
self
Turn radio on or switch frequency/modulation.
Defined in:
Parameters:
#number Frequency
Radio frequency in MHz. Default is value set in SetDefaultRadio
(usually 251 MHz).
#number Modulation
Radio modulation. Default is value set in SetDefaultRadio
(usually radio.Modulation.AM
).
Return value:
self
Activate/switch TACAN beacon settings.
Defined in:
Parameters:
#number Channel
TACAN Channel.
#string Morse
TACAN morse code. Default is the value set in OPSGROUP.SetDefaultTACAN or if not set "XXX".
#string UnitName
Name of the unit in the group which should activate the TACAN beacon. Can also be given as #number to specify the unit number. Default is the first unit of the group.
#string Band
TACAN channel mode "X" or "Y". Default is "Y" for aircraft and "X" for ground and naval groups.
Return value:
self
Deactivate ICLS beacon.
Turn radio off.
Deactivate TACAN beacon.
Initialize Mission Editor waypoints.
Defined in:
Parameters:
#OPSGROUP.Waypoint waypoint
Waypoint data.
#number wpnumber
Waypoint index/number. Default is as last waypoint.
Check if all elements of the group have the same status (or are dead).
Check if all elements of the group have the same status (or are dead).
Defined in:
Parameter:
#string status
Status to check.
Return value:
#boolean:
If true, all elements have a similar status.
Check ammo is full.
Check damage.
Check if passed the final waypoint and, if necessary, update route.
Get coordinate from an object.
Defined in:
Parameter:
Wrapper.Object#OBJECT Object
The object.
Return value:
The coordinate of the object.
Enhance waypoint table.
Defined in:
Parameters:
#OPSGROUP.Waypoint Waypoint
data.
waypoint
Return value:
Modified waypoint data.
Get next mission.
Get next task in queue.
Task needs to be in state SCHEDULED and time must have passed.
Get name of ROE corresponding to the numerical value.
Returns a name of a missile category.
Defined in:
Parameter:
#number categorynumber
Number of missile category from weapon missile category enumerator. See https://wiki.hoggitworld.com/view/DCS_Class_Weapon
Return value:
#string:
Missile category name.
Function called when a group is passing a waypoint.
Defined in:
Parameters:
Wrapper.Group#GROUP group
Group that passed the waypoint.
#OPSGROUP opsgroup
Ops group object.
#number uid
Waypoint UID.
Print info on mission and task status to DCS log file.
Defined in:
Set status for all elements (except dead ones).
Set tasks at this waypoint
Defined in:
Parameter:
#OPSGROUP.Waypoint Waypoint
The waypoint.
Return value:
#number:
Number of tasks.
Activate/switch ICLS beacon settings.
Activate/switch TACAN beacon settings.
Defined in:
Parameter:
#OPSGROUP.Beacon Tacan
TACAN data table. Default is the default TACAN settings.
Return value:
self
Function called when a task is done.
Defined in:
Parameters:
Wrapper.Group#GROUP group
Group for which the task is done.
#OPSGROUP opsgroup
Ops group.
#OPSGROUP.Task task
Task.
Function called when a task is executed.
Defined in:
Parameters:
Wrapper.Group#GROUP group
Group which should execute the task.
#OPSGROUP opsgroup
Ops group.
#OPSGROUP.Task task
Task.
Check if all elements of the group have the same status (or are dead).
Check if all elements of the group have the same status or are dead.
Defined in:
Parameters:
#OPSGROUP.Element element
Element.
#string newstatus
New status of element
Wrapper.Airbase#AIRBASE airbase
Airbase if applicable.
Initialize Mission Editor waypoints.
Triggers the FSM event "Status" after a delay.
Triggers the FSM event "Stop" after a delay.
Stops the OPSGROUP and all its event handlers.
On after "Dead" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "DetectedGroup" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Group#GROUP Group
The detected Group.
On after "DetectedGroupNew" event.
Add newly detected group to detected group set.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Group#GROUP Group
The detected group.
On after "DetectedUnit" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT Unit
The detected unit.
On after "DetectedUnitNew" event.
Add newly detected unit to detected unit set.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT Unit
The detected unit.
On after "ElementDead" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#OPSGROUP.Element Element
The flight group element.
On after "ElementDestroyed" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#OPSGROUP.Element Element
The flight group element.
On after "EnterZone" event.
Sets self.inzones[zonename]=true.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Zone#ZONE Zone
The zone that the group entered.
On after "GotoWaypoint" event.
Group will got to the given waypoint and execute its route from there.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#number UID
The goto waypoint unique ID.
On after "LaserCode" event.
Changes the LASER code.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#number Code
Laser code. Default is 1688.
On after "LaserGotLOS" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "LaserLostLOS" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "LaserOff" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "LaserOn" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Point#COORDINATE Target
Target Coordinate. Target can also be any POSITIONABLE from which we can obtain its coordinates.
On after "LaserPause" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "LaserResume" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "LeaveZone" event.
Sets self.inzones[zonename]=false.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Zone#ZONE Zone
The zone that the group entered.
On after "MissionCancel" event.
Cancels the mission.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Ops.Auftrag#AUFTRAG Mission
The mission to be cancelled.
On after "MissionDone" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Ops.Auftrag#AUFTRAG Mission
On after "MissionExecute" event.
Mission execution began.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Ops.Auftrag#AUFTRAG Mission
The mission table.
On after "MissionStart" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Ops.Auftrag#AUFTRAG Mission
The mission table.
On after "PassingWaypoint" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#OPSGROUP.Waypoint Waypoint
Waypoint data passed.
On after "PauseMission" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "Stop" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On after "TaskCancel" event.
Cancels the current task or simply sets the status to DONE if the task is not the current one.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#OPSGROUP.Task Task
The task to cancel. Default is the current task (if any).
On after "TaskDone" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#OPSGROUP.Task Task
On after "TaskExecute" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
The task.
On after "UnpauseMission" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On before "Dead" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On before "LaserOff" event.
Check if LASER is on.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On before "LaserOn" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Point#COORDINATE Target
Target Coordinate. Target can also be any POSITIONABLE from which we can obtain its coordinates.
On before "LaserResume" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On before "MissionStart" event.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Ops.Auftrag#AUFTRAG Mission
The mission table.
On before "TaskDone" event.
Deny transition if task status is PAUSED.
Defined in:
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#OPSGROUP.Task Task
Field(s)
Resume route at first waypoint when final waypoint is reached.
Group ammo.
Formation that is used permanently and overrules waypoint formations.
Init done.
Ground are always AI.
Define category.
Defaults
Is (template) group late activated.
If true, group is mobile.
Ground groups cannot be uncontrolled.
Set some string id for output to DCS.log file.
If true, the group will automatically retreat when out of ammo. Needs a retreat zone!
Max speed in km/h.
Current set speed in m/s.
Get template of group.
Start check zone timer.
Start queue update timer.
Army Group version.
Function(s)
Adds an End state.
Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.
Defined in:
Parameters:
#table From
Can contain a string indicating the From state or a table of strings containing multiple From states.
#string Event
The Event name.
Core.Fsm#FSM_PROCESS Process
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.
Returns the End states.
Returns a table of the SubFSM rules defined within the FSM.
Returns a table with the scores defined.
Returns the start state of the FSM.
Get current state.
Returns a table with the Subs defined.
Returns a table of the transition rules defined within the FSM.
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.
Sets the start state of the FSM.
Add to map.
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.
Go sub.
Defined in:
Parameters:
#string ParentFrom
Parent from state.
#string ParentEvent
Parent event name.
Return value:
#table:
Subs.
Handler.
Is end state.
Defined in:
Parameter:
#string Current
Current state name.
Return values:
#table:
FSM parent.
#string:
Event name.
Sub maps.
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)
Resume route at first waypoint when final waypoint is reached.
Group ammo.
Formation that is used permanently and overrules waypoint formations.
Init done.
Ground are always AI.
Define category.
Defaults
Is (template) group late activated.
If true, group is mobile.
Ground groups cannot be uncontrolled.
Set some string id for output to DCS.log file.
If true, the group will automatically retreat when out of ammo. Needs a retreat zone!
Max speed in km/h.
Current set speed in m/s.
Get template of group.
Start check zone timer.
Start queue update timer.
Army Group version.
Function(s)
Clear the state of an object.
Defined in:
Parameters:
Object
The object that holds the Value set by the Key.
StateName
The key that is should be cleared.
Creation of a Birth Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
#string IniUnitName
The initiating unit name.
place
subplace
Creation of a Crash Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Dead Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT
event.
Creation of a Remove Unit Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Takeoff Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Crash Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Log an exception which will be traced always.
Can be anywhere within the function logic.
Returns the event dispatcher
Remove all subscribed events
Trace a function call.
Must be at the beginning of the function logic.
Trace a function call level 2.
Must be at the beginning of the function logic.
Trace a function call level 3.
Must be at the beginning of the function logic.
Get the ClassID of the class instance.
Get the ClassName of the class instance.
Get the ClassName + ClassID of the class instance.
The ClassName + ClassID is formatted as '%s#%09d'.
Get the Class Event processing Priority.
The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.
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()
Get a Value given a Key from the Object.
Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.
Defined in:
Parameters:
Object
The object that holds the Value set by the Key.
Key
The key that is used to retrieve the value. Note that the key can be a #string, but it can also be any other type!
Return value:
The Value retrieved or nil if the Key was not found and thus the Value could not be retrieved.
Subscribe to a DCS Event.
Defined in:
Parameters:
Core.Event#EVENTS EventID
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.
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).
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
Occurs when an object is completely destroyed.
initiator : The unit that is was destroyed.
Occurs when a ground unit captures either an airbase or a farp.
initiator : The unit that captured the base place: The airbase that was captured, can be a FARP or Airbase. When calling place:getCoalition() the faction will already be the new owning faction.
Occurs when any object is spawned into the mission.
initiator : The unit that was spawned
Occurs when any aircraft crashes into the ground and is completely destroyed.
initiator : The unit that has crashed
Occurs when an object is dead.
initiator : The unit that is dead.
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.
Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected
Occurs when any aircraft shuts down its engines.
initiator : The unit that is stopping its engines.
Occurs when any aircraft starts its engines.
initiator : The unit that is starting its engines.
Occurs whenever an object is hit by a weapon.
initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.
Occurs when any system fails on a human controlled aircraft.
initiator : The unit that had the failure
Occurs on the death of a unit.
Contains more and different information. Similar to unit_lost it will occur for aircraft before the aircraft crash event occurs.
- initiator: The unit that killed the target
- target: Target Object
- weapon: Weapon Object
Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.
Can be an Airbase Object, FARP, or Ships
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.
Event does not occur if the pilot lands in the water and sub combs to Davey Jones Locker.
- initiator: Static object representing the ejected pilot. Place : Aircraft that the pilot ejected from.
- place: may not return as a valid object if the aircraft has crashed into the ground and no longer exists.
- subplace: is always 0 for unknown reasons.
Occurs when a new mark was added.
MarkID: ID of the mark.
Occurs when a mark text was changed.
MarkID: ID of the mark.
Occurs when a mark was removed.
MarkID: ID of the mark.
Occurs when a mission ends
Occurs when a mission starts
Occurs when the pilot of an aircraft is killed.
Can occur either if the player is alive and crashes or if a weapon kills the pilot without completely destroying the plane. initiator : The unit that the pilot has died in.
Occurs when a player enters a slot and takes control of an aircraft.
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.
Occurs when any player assumes direct control of a unit.
initiator : The unit that is being taken control of.
Occurs when any player relieves control of a unit to the AI.
initiator : The unit that the player left.
Occurs when an aircraft connects with a tanker and begins taking on fuel.
initiator : The unit that is receiving fuel.
Occurs when an aircraft is finished taking fuel.
initiator : The unit that was receiving fuel.
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.
Occurs when any unit stops firing its weapon.
Event will always correspond with a shooting start event. initiator : The unit that was doing the shooting.
Occurs when any unit begins firing a weapon that has a high rate of fire.
Most common with aircraft cannons (GAU-8), autocannons, and machine guns. initiator : The unit that is doing the shooting. target: The unit that is being targeted.
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.
Occurs when an aircraft takes off from an airbase, farp, or ship.
initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships
Occurs when the game thinks an object is destroyed.
- initiator: The unit that is was destroyed.
Schedule a new time event.
Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.
Defined in:
Parameters:
#number Start
Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.
#function SchedulerFunction
The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.
#table ...
Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.
Return value:
#number:
The ScheduleID of the planned schedule.
Schedule a new time event.
Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.
Defined in:
Parameters:
#number Start
Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.
#number Repeat
Specifies the interval in seconds when the scheduler will call the event function.
#number RandomizeFactor
Specifies a randomization factor between 0 and 1 to randomize the Repeat.
#number Stop
Specifies the amount of seconds when the scheduler will be stopped.
#function SchedulerFunction
The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.
#table ...
Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.
Return value:
#number:
The ScheduleID of the planned schedule.
Stops the Schedule.
Defined in:
Parameter:
#function SchedulerFunction
The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.
Set the Class Event processing Priority.
The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.
Set a state or property of the Object given a Key and a Value.
Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.
Defined in:
Parameters:
Object
The object that will hold the Value set by the Key.
Key
The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!
Value
The value to is stored in the object.
Return value:
The Value set.
Trace a function logic level 1.
Can be anywhere within the function logic.
Trace a function logic level 2.
Can be anywhere within the function logic.
Trace a function logic level 3.
Can be anywhere within the function logic.
Trace all methods in MOOSE
Set tracing for a class
Set tracing for a specific method of class
Set trace off.
Set trace on.
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.
Trace a function call.
This function is private.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
Trace a function logic.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
TODO: Complete DCS#Event structure.
- The main event handling function... This function captures all events generated for the class.
@param #BASE self
@param DCS#Event event
Army group element.
Field(s)
Height of element in meters.
Length of element in meters.
Name of the element, i.e. the unit.
The element status.
Type name.
Width of element in meters.