Module Functional.Suppression
Functional - Suppress fire of ground units when they get hit.
Features:
- Hold fire of attacked units when being fired upon.
- Retreat to a user defined zone.
- Fall back on hits.
- Take cover on hits.
- Gaussian distribution of suppression time.
Missions:
MOOSE - ALL Demo Missions
When ground units get hit by (suppressive) enemy fire, they will not be able to shoot back for a certain amount of time.
The implementation is based on an idea and script by MBot. See the DCS forum threat for details.
In addition to suppressing the fire, conditions can be specified, which let the group retreat to a defined zone, move away from the attacker or hide at a nearby scenery object.
YouTube Channel
MOOSE YouTube Channel
Author: funkyfranky
Contributions: FlightControl
Global(s)
Global SUPPRESSION |
Mimic suppressive enemy fire and let groups flee or retreat. |
Mimic suppressive enemy fire and let groups flee or retreat.
Suppression Process
The suppression process can be described as follows.
CombatReady
A group starts in the state CombatReady. In this state the group is ready to fight. The ROE is set to either "Weapon Free" or "Return Fire". The alarm state is set to either "Auto" or "Red".
Event Hit
The most important event in this scenario is the Hit event. This is an event of the FSM and triggered by the DCS event hit.
Suppressed
After the Hit event the group changes its state to Suppressed. Technically, the ROE of the group is changed to "Weapon Hold". The suppression of the group will last a certain amount of time. It is randomized an will vary each time the group is hit. The expected suppression time is set to 15 seconds by default. But the actual value is sampled from a Gaussian distribution.
The graph shows the distribution of suppression times if a group would be hit 100,000 times. As can be seen, on most hits the group gets suppressed for around 15 seconds. Other values are also possible but they become less likely the further away from the "expected" suppression time they are. Minimal and maximal suppression times can also be specified. By default these are set to 5 and 25 seconds, respectively. This can also be seen in the graph because the tails of the Gaussian distribution are cut off at these values.
Event Recovered
After the suppression time is over, the event Recovered is initiated and the group becomes CombatReady again. The ROE of the group will be set to "Weapon Free".
Of course, it can also happen that a group is hit again while it is still suppressed. In that case a new random suppression time is calculated. If the new suppression time is longer than the remaining suppression of the previous hit, then the group recovers when the suppression time of the last hit has passed. If the new suppression time is shorter than the remaining suppression, the group will recover after the longer time of the first suppression has passed.
For example:
- A group gets hit the first time and is suppressed for - let's say - 15 seconds.
- After 10 seconds, i.e. when 5 seconds of the old suppression are left, the group gets hit a again.
- A new suppression time is calculated which can be smaller or larger than the remaining 5 seconds.
- If the new suppression time is smaller, e.g. three seconds, than five seconds, the group will recover after the 5 remaining seconds of the first suppression have passed.
- If the new suppression time is longer than last suppression time, e.g. 10 seconds, then the group will recover after the 10 seconds of the new hit have passed.
Generally speaking, the suppression times are not just added on top of each other. Because this could easily lead to the situation that a group never becomes CombatReady again before it gets destroyed.
The mission designer can capture the event Recovered by the function SUPPRESSION.OnAfterRecovered().
Flee Events and States
Apart from being suppressed the groups can also flee from the enemy under certain conditions.
Event Retreat
The first option is a retreat. This can be enabled by setting a retreat zone, i.e. a trigger zone defined in the mission editor.
If the group takes a certain amount of damage, the event Retreat will be called and the group will start to move to the retreat zone. The group will be in the state Retreating, which means that its ROE is set to "Weapon Hold" and the alarm state is set to "Green". Setting the alarm state to green is necessary to enable the group to move under fire.
When the group has reached the retreat zone, the event Retreated is triggered and the state will change to Retreated (note that both the event and the state of the same name in this case). ROE and alarm state are set to "Return Fire" and "Auto", respectively. The group will stay in the retreat zone and not actively participate in the combat any more.
If no option retreat zone has been specified, the option retreat is not available.
The mission designer can capture the events Retreat and Retreated by the functions SUPPRESSION.OnAfterRetreat() and SUPPRESSION.OnAfterRetreated().
Fallback
If a group is attacked by another ground group, it has the option to fall back, i.e. move away from the enemy. The probability of the event FallBack to happen depends on the damage of the group that was hit. The more a group gets damaged, the more likely FallBack event becomes.
If the group enters the state FallingBack it will move 100 meters in the opposite direction of the attacking unit. ROE and alarmstate are set to "Weapon Hold" and "Green", respectively.
At the fallback point the group will wait for 60 seconds before it resumes its normal mission.
The mission designer can capture the event FallBack by the function SUPPRESSION.OnAfterFallBack().
TakeCover
If a group is hit by either another ground or air unit, it has the option to "take cover" or "hide". This means that the group will move to a random scenery object in it vicinity.
Analogously to the fall back case, the probability of a TakeCover event to occur, depends on the damage of the group. The more a group is damaged, the more likely it becomes that a group takes cover.
When a TakeCover event occurs an area with a radius of 300 meters around the hit group is searched for an arbitrary scenery object. If at least one scenery object is found, the group will move there. One it has reached its "hideout", it will wait there for two minutes before it resumes its normal mission.
If more than one scenery object is found, the group will move to a random one. If no scenery object is near the group the TakeCover event is rejected and the group will not move.
The mission designer can capture the event TakeCover by the function SUPPRESSION.OnAfterTakeCover().
Choice of FallBack or TakeCover if both are enabled?
If both FallBack and TakeCover events are enabled by the functions SUPPRESSION.Fallback() and SUPPRESSION.Takecover() the algorithm does the following:
- If the attacking unit is a ground unit, then the FallBack event is executed.
- Otherwise, i.e. if the attacker is not a ground unit, then the TakeCover event is triggered.
FightBack
When a group leaves the states TakingCover or FallingBack the event FightBack is triggered. This changes the ROE and the alarm state back to their default values.
The mission designer can capture the event FightBack by the function SUPPRESSION.OnAfterFightBack()
Examples
Simple Suppression
This example shows the basic steps to use suppressive fire for a group.
Customization and Fine Tuning
The following user functions can be used to change the default values
- SUPPRESSION.SetSuppressionTime() can be used to set the time a goup gets suppressed.
- SUPPRESSION.SetRetreatZone() sets the retreat zone and enables the possiblity for the group to retreat.
- SUPPRESSION.SetFallbackDistance() sets a value how far the unit moves away from the attacker after the fallback event.
- SUPPRESSION.SetFallbackWait() sets the time after which the group resumes its mission after a FallBack event.
- SUPPRESSION.SetTakecoverWait() sets the time after which the group resumes its mission after a TakeCover event.
- SUPPRESSION.SetTakecoverRange() sets the radius in which hideouts are searched.
- SUPPRESSION.SetTakecoverPlace() explicitly sets the place where the group will run at a TakeCover event.
- SUPPRESSION.SetMinimumFleeProbability() sets the minimum probability that a group flees (FallBack or TakeCover) after a hit. Note taht the probability increases with damage.
- SUPPRESSION.SetMaximumFleeProbability() sets the maximum probability that a group flees (FallBack or TakeCover) after a hit. Default is 90%.
- SUPPRESSION.SetRetreatDamage() sets the damage a group/unit can take before it is ordered to retreat.
- SUPPRESSION.SetRetreatWait() sets the time a group waits in the retreat zone after a retreat.
- SUPPRESSION.SetDefaultAlarmState() sets the alarm state a group gets after it becomes CombatReady again.
- SUPPRESSION.SetDefaultROE() set the rules of engagement a group gets after it becomes CombatReady again.
- SUPPRESSION.FlareOn() is mainly for debugging. A flare is fired when a unit is hit, gets suppressed, recovers, dies.
- SUPPRESSION.SmokeOn() is mainly for debugging. Puts smoke on retreat zone, hideouts etc.
- SUPPRESSION.MenuON() is mainly for debugging. Activates a radio menu item where certain functions like retreat etc. can be triggered manually.
Type(s)
Fields and Methods inherited from SUPPRESSION | Description |
---|---|
Name of the class. |
|
Controllable of the FSM. Must be a ground group. |
|
Alam state the group is currently in. |
|
ROE the group currently has. |
|
Trigger "Dead" event. |
|
Write Debug messages to DCS log file and send Debug messages to all players. |
|
Turn Debug mode on. |
|
Alarm state the group will go to when it is changed back from another state. Default is "Auto". |
|
ROE the group will get once suppression is over. Default is "Free". |
|
Trigger "FallBack" event. |
|
Enable fall back if a group is hit. |
|
Distance in meters the unit will fall back. |
|
Heading in degrees to which the group should fall back. Default is directly away from the attacking unit. |
|
If true, group can fall back, i.e. move away from the attacking unit. |
|
Time in seconds the unit will wait at the fall back point before it resumes its mission. |
|
Trigger "FightBack" event. |
|
Flare units when they are hit, die or recover from suppression. |
|
Formation which will be used when falling back, taking cover or retreating. Default "Vee". |
|
Trigger "Hit" event. |
|
Number of units in a group at start. |
|
True if group has attribute Infantry. |
|
Main F10 menu for suppresion, i.e. |
|
If true creates a entry in the F10 menu. |
|
Create an F10 menu entry for the suppressed group. |
|
Creates a new AI_suppression object. |
|
Number of times the group was hit. |
|
User function for OnAfter "Dead" event. |
|
SUPPRESSION:OnAfterFallBack(Controllable, From, Event, To, AttackUnit) |
User function for OnAfter "FallBack" event. |
User function for OnAfter "FlightBack" event. |
|
SUPPRESSION:OnAfterHit(Controllable, From, Event, To, Unit, AttackUnit) |
User function for OnAfter "Hit" event. |
User function for OnAfter "OutOfAmmo" event. |
|
User function for OnAfter "Recovered" event. |
|
User function for OnAfter "Retreat" event. |
|
User function for OnAfter "Retreated" event. |
|
User function for OnAfter "Status" event. |
|
SUPPRESSION:OnAfterTakeCover(Controllable, From, Event, To, Hideout) |
User function for OnAfter "TakeCover" event. |
SUPPRESSION:OnBeforeFallBack(Controllable, From, Event, To, AttackUnit) |
User function for OnBefore "FallBack" event. |
SUPPRESSION:OnBeforeFightBack(Controllable, From, Event, To) |
User function for OnBefore "FlightBack" event. |
SUPPRESSION:OnBeforeHit(Controllable, From, Event, To, Unit, AttackUnit) |
User function for OnBefore "Hit" event. |
SUPPRESSION:OnBeforeRecovered(Controllable, From, Event, To) |
User function for OnBefore "Recovered" event. |
User function for OnBefore "Retreat" event. |
|
SUPPRESSION:OnBeforeRetreated(Controllable, From, Event, To) |
User function for OnBefore "Retreated" event. |
SUPPRESSION:OnBeforeTakeCover(Controllable, From, Event, To, Hideout) |
User function for OnBefore "TakeCover" event. |
Order group to fall back between 100 and 150 meters in a random direction. |
|
Order group to retreat to a pre-defined zone. |
|
Order group to take cover at a nearby scenery object. |
|
Trigger "OutOfAmmo" event. |
|
Maximum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 90 %. |
|
Minimum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 10 %. |
|
Trigger "Recovered" event after a delay. |
|
Trigger "Retreat" event. |
|
Damage in percent at which the group will be ordered to retreat. |
|
Time in seconds the group will wait in the retreat zone before it resumes its mission. Default two hours. |
|
Zone to which a group retreats. |
|
Trigger "Retreated" event. |
|
Set alarm state a group will get after it returns from a fall back or take cover. |
|
Set Rules of Engagement (ROE) a group will get when it recovers from suppression. |
|
Set distance a group will fall back when it gets hit. |
|
Set time a group waits at its fall back position before it resumes its normal mission. |
|
Set the formation a group uses for fall back, hide or retreat. |
|
Set maximum probability that a group flees (falls back or takes cover) after a hit event. |
|
Set minimum probability that a group flees (falls back or takes cover) after a hit event. |
|
Set damage threshold before a group is ordered to retreat if a retreat zone was defined. |
|
Set time a group waits in the retreat zone before it resumes its mission. |
|
Set the zone to which a group retreats after being damaged too much. |
|
Set speed a group moves at for fall back, hide or retreat. |
|
Set average, minimum and maximum time a unit is suppressed each time it gets hit. |
|
Set hideout place explicitly. |
|
Set distance a group searches for hideout places. |
|
Set time a group waits at its hideout position before it resumes its normal mission. |
|
Smoke positions where units fall back to, hide or retreat. |
|
Speed the unit will use when falling back, taking cover or retreating. Default 999. |
|
Maximum speed of group in km/h. |
|
Trigger "Status" event. |
|
Status of group. |
|
Trigger "TakeCover" event. |
|
Enable take cover option if a unit is hit. |
|
If true, group can hide at a nearby scenery object. |
|
Range in which the group will search for scenery objects to hide at. |
|
Time in seconds the group will hide before it will resume its mission. |
|
Average time in seconds a group gets suppressed. Actual value is sampled randomly from a Gaussian distribution. |
|
Maximum time in seconds the group gets suppressed. |
|
Minimum time in seconds the group gets suppressed. |
|
Time at which the suppression will be over. |
|
Type of the group. |
|
Create F10 main menu, i.e. |
|
Print event-from-to string to DCS log file. |
|
Get (relative) life in percent of a group. |
|
Heading from point a to point b in degrees. |
|
Event handler for Dead event of suppressed groups. |
|
Event handler for Dead event of suppressed groups. |
|
Function called when group is passing a waypoint. |
|
Generate Gaussian pseudo-random numbers. |
|
Make group run/drive to a certain point. |
|
Search a place to hide. |
|
Sets the alarm state of the group and updates the current alarm state variable. |
|
Sets the ROE for the group and updates the current ROE variable. |
|
Suppress fire of a unit by setting its ROE to "Weapon Hold". |
|
Trigger "Dead" event after a delay. |
|
Trigger "FallBack" event after a delay. |
|
Trigger "FightBack" event after a delay. |
|
Trigger "Hit" event after a delay. |
|
Trigger "OutOfAmmo" event after a delay. |
|
Trigger "Retreat" event after a delay. |
|
Trigger "Retreated" event after a delay. |
|
Trigger "Status" event after a delay. |
|
Trigger "TakeCover" event after a delay. |
|
If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true. |
|
Flare units when they get hit or die. |
|
Coordinate/place where the group will try to take cover. |
|
String for DCS log file. |
|
Event handler for suppressed groups. |
|
After "Dead" event, when a unit has died. |
|
SUPPRESSION:onafterFallBack(Controllable, From, Event, To, AttackUnit) |
After "FallBack" event. |
After "FightBack" event. |
|
SUPPRESSION:onafterHit(Controllable, From, Event, To, Unit, AttackUnit) |
After "Hit" event. |
After "OutOfAmmo" event. |
|
After "Recovered" event. |
|
After "Retreat" event. |
|
After "Retreateded" event. |
|
After "Start" event. |
|
After "Status" event. |
|
After "Stop" event. |
|
SUPPRESSION:onafterTakeCover(Controllable, From, Event, To, Hideout) |
After "TakeCover" event. |
SUPPRESSION:onbeforeFallBack(Controllable, From, Event, To, AttackUnit) |
Before "FallBack" event. |
SUPPRESSION:onbeforeRecovered(Controllable, From, Event, To) |
Before "Recovered" event. |
Before "Retreat" event. |
|
SUPPRESSION:onbeforeRetreated(Controllable, From, Event, To) |
Before "Retreateded" event. |
SUPPRESSION:onbeforeTakeCover(Controllable, From, Event, To, Hideout) |
Before "TakeCover" event. |
Smoke places to which the group retreats, falls back or hides. |
|
PSEUDOATC version. |
|
Waypoints of the group as defined in the ME. |
Fields and Methods inherited from FSM_CONTROLLABLE | Description |
---|---|
Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs. |
|
Creates a new FSM_CONTROLLABLE object. |
|
OnAfter Transition Handler for Event Stop. |
|
OnBefore Transition Handler for Event Stop. |
|
OnEnter Transition Handler for State Stopped. |
|
OnLeave Transition Handler for State Stopped. |
|
Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs. |
|
Synchronous Event Trigger for Event Stop. |
|
Asynchronous Event Trigger for Event Stop. |
|
Fields and Methods inherited from FSM | Description |
---|---|
Adds an End 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. |
|
Adds a score for the FSM to be achieved. |
|
SUPPRESSION: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. |
|
SUPPRESSION:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
SUPPRESSION:CreateEventCrash(EventTime, Initiator, IniObjectCategory) |
Creation of a Crash Event. |
SUPPRESSION:CreateEventDead(EventTime, Initiator, IniObjectCategory) |
Creation of a Dead Event. |
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event. |
|
Creation of a S_EVENT_NEW_DYNAMIC_CARGO 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 Core.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 Event for an object is triggered. |
|
BDA. |
|
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. |
|
Discard chair after ejection. |
|
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo. |
|
Occurs when a dynamic cargo crate is removed. |
|
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo. |
|
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
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 Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up. |
|
Landing quality mark. |
|
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 Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu. |
|
Weapon add. |
|
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. |
|
Trigger zone. |
|
Occurs when the game thinks an object is destroyed. |
|
Schedule a new time event. |
|
SUPPRESSION:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...) |
Schedule a new time event. |
Stops the Schedule. |
|
Set the Class Core.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. |
|
SUPPRESSION:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
(Internal) Serialize arguments |
|
SUPPRESSION:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
The main event handling function... |
Fields and Methods inherited from SUPPRESSION.AlarmState | Description |
---|---|
Automatic. |
|
Green. |
|
Red. |
Fields and Methods inherited from SUPPRESSION.ROE | Description |
---|---|
Weapon fire. |
|
Hold fire. |
|
Return fire. |
SUPPRESSION class
Field(s)
Name of the class.
Controllable of the FSM. Must be a ground group.
Alam state the group is currently in.
ROE the group currently has.
Get DCS descriptors of group.
Write Debug messages to DCS log file and send Debug messages to all players.
Alarm state the group will go to when it is changed back from another state. Default is "Auto".
ROE the group will get once suppression is over. Default is "Free".
Distance in meters the unit will fall back.
Heading in degrees to which the group should fall back. Default is directly away from the attacking unit.
If true, group can fall back, i.e. move away from the attacking unit.
Time in seconds the unit will wait at the fall back point before it resumes its mission.
Formation which will be used when falling back, taking cover or retreating. Default "Vee".
Number of units in a group at start.
True if group has attribute Infantry.
If true creates a entry in the F10 menu.
Number of times the group was hit.
Maximum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 90 %.
Minimum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 10 %.
Damage in percent at which the group will be ordered to retreat.
Time in seconds the group will wait in the retreat zone before it resumes its mission. Default two hours.
Speed the unit will use when falling back, taking cover or retreating. Default 999.
Maximum speed of group in km/h.
If true, group can hide at a nearby scenery object.
Range in which the group will search for scenery objects to hide at.
Time in seconds the group will hide before it will resume its mission.
Average time in seconds a group gets suppressed. Actual value is sampled randomly from a Gaussian distribution.
Maximum time in seconds the group gets suppressed.
Minimum time in seconds the group gets suppressed.
Time at which the suppression will be over.
Type of the group.
If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.
Flare units when they get hit or die.
String for DCS log file.
Smoke places to which the group retreats, falls back or hides.
PSEUDOATC version.
Waypoints of the group as defined in the ME.
Function(s)
Turn Debug mode on.
Enables messages and more output to DCS log file.
Defined in:
SUPPRESSION
Trigger "FallBack" event.
Defined in:
SUPPRESSION
Parameter:
Wrapper.Unit#UNIT AttackUnit
Attacking unit. We will move away from this.
Enable fall back if a group is hit.
Defined in:
SUPPRESSION
Parameter:
#boolean switch
Enable=true or disable=false fall back of group.
Flare units when they are hit, die or recover from suppression.
Defined in:
SUPPRESSION
Trigger "Hit" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Unit#UNIT Unit
Unit that was hit.
Wrapper.Unit#UNIT AttackUnit
Unit that attacked.
Create an F10 menu entry for the suppressed group.
The menu is mainly for Debugging purposes.
Defined in:
SUPPRESSION
Parameter:
#boolean switch
Enable=true or disable=false menu group. Default is true.
Creates a new AI_suppression object.
Defined in:
SUPPRESSION
Parameter:
Wrapper.Group#GROUP group
The GROUP object for which suppression should be applied.
Return value:
self
User function for OnAfter "Dead" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
User function for OnAfter "FallBack" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT AttackUnit
Attacking unit. We will move away from this.
User function for OnAfter "FlightBack" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
User function for OnAfter "Hit" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT Unit
Unit that was hit.
Wrapper.Unit#UNIT AttackUnit
Unit that attacked.
User function for OnAfter "OutOfAmmo" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
User function for OnAfter "Recovered" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
User function for OnAfter "Retreat" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
User function for OnAfter "Retreated" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
User function for OnAfter "Status" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
User function for OnAfter "TakeCover" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Point#COORDINATE Hideout
Place where the group will hide.
User function for OnBefore "FallBack" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT AttackUnit
Attacking unit. We will move away from this.
Return value:
#boolean:
User function for OnBefore "FlightBack" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Return value:
#boolean:
User function for OnBefore "Hit" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT Unit
Unit that was hit.
Wrapper.Unit#UNIT AttackUnit
Unit that attacked.
Return value:
#boolean:
User function for OnBefore "Recovered" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Return value:
#boolean:
User function for OnBefore "Retreat" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Return value:
#boolean:
User function for OnBefore "Retreated" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Return value:
#boolean:
User function for OnBefore "TakeCover" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Point#COORDINATE Hideout
Place where the group will hide.
Return value:
#boolean:
Order group to fall back between 100 and 150 meters in a random direction.
Defined in:
SUPPRESSION
Order group to take cover at a nearby scenery object.
Defined in:
SUPPRESSION
Trigger "Recovered" event after a delay.
Set alarm state a group will get after it returns from a fall back or take cover.
Defined in:
SUPPRESSION
Parameter:
#string alarmstate
Alarm state. Possible "Auto", "Green", "Red". Default is "Auto".
Set Rules of Engagement (ROE) a group will get when it recovers from suppression.
Defined in:
SUPPRESSION
Parameter:
#string roe
ROE after suppression. Possible "Free", "Hold" or "Return". Default "Free".
Set distance a group will fall back when it gets hit.
Defined in:
SUPPRESSION
Parameter:
#number distance
Distance in meters.
Set time a group waits at its fall back position before it resumes its normal mission.
Defined in:
SUPPRESSION
Parameter:
#number time
Time in seconds.
Set the formation a group uses for fall back, hide or retreat.
Defined in:
SUPPRESSION
Parameter:
#string formation
Formation of the group. Default "Vee".
Set maximum probability that a group flees (falls back or takes cover) after a hit event.
Default is 90%.
Defined in:
SUPPRESSION
Parameter:
#number probability
Probability in percent.
Set minimum probability that a group flees (falls back or takes cover) after a hit event.
Default is 10%.
Defined in:
SUPPRESSION
Parameter:
#number probability
Probability in percent.
Set damage threshold before a group is ordered to retreat if a retreat zone was defined.
If the group consists of only a singe unit, this referrs to the life of the unit. If the group consists of more than one unit, this referrs to the group strength relative to its initial strength.
Defined in:
SUPPRESSION
Parameter:
#number damage
Damage in percent. If group gets damaged above this value, the group will retreat. Default 50 %.
Set time a group waits in the retreat zone before it resumes its mission.
Default is two hours.
Defined in:
SUPPRESSION
Parameter:
#number time
Time in seconds. Default 7200 seconds = 2 hours.
Set the zone to which a group retreats after being damaged too much.
Set speed a group moves at for fall back, hide or retreat.
Defined in:
SUPPRESSION
Parameter:
#number speed
Speed in km/h of group. Default max speed the group can do.
Set average, minimum and maximum time a unit is suppressed each time it gets hit.
Defined in:
SUPPRESSION
Parameters:
#number Tave
Average time [seconds] a group will be suppressed. Default is 15 seconds.
#number Tmin
(Optional) Minimum time [seconds] a group will be suppressed. Default is 5 seconds.
#number Tmax
(Optional) Maximum time a group will be suppressed. Default is 25 seconds.
Set hideout place explicitly.
Defined in:
SUPPRESSION
Parameter:
Core.Point#COORDINATE Hideout
Place where the group will hide after the TakeCover event.
Set distance a group searches for hideout places.
Defined in:
SUPPRESSION
Parameter:
#number range
Search range in meters.
Set time a group waits at its hideout position before it resumes its normal mission.
Defined in:
SUPPRESSION
Parameter:
#number time
Time in seconds.
Smoke positions where units fall back to, hide or retreat.
Defined in:
SUPPRESSION
Status of group.
Current ROE, alarm state, life.
Defined in:
SUPPRESSION
Parameter:
#boolean message
Send message to all players.
Trigger "TakeCover" event.
Enable take cover option if a unit is hit.
Defined in:
SUPPRESSION
Parameter:
#boolean switch
Enable=true or disable=false fall back of group.
Create F10 main menu, i.e.
F10/Suppression. The menu is mainly for Debugging purposes.
Defined in:
SUPPRESSION
Print event-from-to string to DCS log file.
Defined in:
SUPPRESSION
Parameters:
#string BA
Before/after info.
#string Event
Event.
#string From
From state.
#string To
To state.
Get (relative) life in percent of a group.
Function returns the value of the units with the smallest and largest life. Also the average value of all groups is returned.
Defined in:
SUPPRESSION
Return values:
#number:
Smallest life value of all units.
#number:
Largest life value of all units.
#number:
Average life value of all alife groups
#number:
Average life value of all groups including already dead ones.
#number:
Relative group strength.
Heading from point a to point b in degrees.
Defined in:
SUPPRESSION
Parameters:
Coordinate.
Coordinate.
Return value:
#number:
angle Angle from a to b in degrees.
Event handler for Dead event of suppressed groups.
Event handler for Dead event of suppressed groups.
Function called when group is passing a waypoint.
At the last waypoint we set the group back to CombatReady.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Group#GROUP group
Group which is passing a waypoint.
#SUPPRESSION Fsm
The suppression object.
#number i
Waypoint number that has been reached.
#boolean final
True if it is the final waypoint. Start Fightback.
Generate Gaussian pseudo-random numbers.
Defined in:
SUPPRESSION
Parameters:
#number x0
Expectation value of distribution.
#number sigma
(Optional) Standard deviation. Default 10.
#number xmin
(Optional) Lower cut-off value.
#number xmax
(Optional) Upper cut-off value.
Return value:
#number:
Gaussian random number.
Make group run/drive to a certain point.
We put in several intermediate waypoints because sometimes the group stops before it arrived at the desired point.
Defined in:
SUPPRESSION
Parameters:
Coordinate where we want to go.
#number speed
Speed of group. Default is 20.
#string formation
Formation of group. Default is "Vee".
#number wait
Time the group will wait/hold at final waypoint. Default is 30 seconds.
Search a place to hide.
This is any scenery object in the vicinity.
Defined in:
SUPPRESSION
Return values:
Coordinate of the hideout place.
nil If no scenery object is within search radius.
Sets the alarm state of the group and updates the current alarm state variable.
Defined in:
SUPPRESSION
Parameter:
#string state
Alarm state the group will get. Possible "Auto", "Green", "Red". Default is self.DefaultAlarmState.
Sets the ROE for the group and updates the current ROE variable.
Defined in:
SUPPRESSION
Parameter:
#string roe
ROE the group will get. Possible "Free", "Hold", "Return". Default is self.DefaultROE.
Suppress fire of a unit by setting its ROE to "Weapon Hold".
Defined in:
SUPPRESSION
Trigger "Dead" event after a delay.
Defined in:
SUPPRESSION
Parameter:
#number Delay
Delay in seconds.
Trigger "FallBack" event after a delay.
Defined in:
SUPPRESSION
Parameters:
#number Delay
Delay in seconds.
Wrapper.Unit#UNIT AttackUnit
Attacking unit. We will move away from this.
Trigger "FightBack" event after a delay.
Defined in:
SUPPRESSION
Parameter:
#number Delay
Delay in seconds.
Trigger "Hit" event after a delay.
Defined in:
SUPPRESSION
Parameters:
#number Delay
Delay in seconds.
Wrapper.Unit#UNIT Unit
Unit that was hit.
Wrapper.Unit#UNIT AttackUnit
Unit that attacked.
Trigger "OutOfAmmo" event after a delay.
Defined in:
SUPPRESSION
Parameter:
#number Delay
Delay in seconds.
Trigger "Retreat" event after a delay.
Defined in:
SUPPRESSION
Parameter:
#number Delay
Delay in seconds.
Trigger "Retreated" event after a delay.
Defined in:
SUPPRESSION
Parameter:
#number Delay
Delay in seconds.
Trigger "Status" event after a delay.
Defined in:
SUPPRESSION
Parameter:
#number Delay
Delay in seconds.
Trigger "TakeCover" event after a delay.
Defined in:
SUPPRESSION
Parameters:
#number Delay
Delay in seconds.
Core.Point#COORDINATE Hideout
Place where the group will hide.
Event handler for suppressed groups.
Defined in:
SUPPRESSION
Parameter:
Event
After "Dead" event, when a unit has died.
When all units of a group are dead, FSM is stopped and eventhandler removed.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "FallBack" event.
We get the heading away from the attacker and route the group a certain distance in that direction.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT AttackUnit
Attacking unit. We will move away from this.
After "FightBack" event.
ROE and Alarm state are set back to default.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "Hit" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT Unit
Unit that was hit.
Wrapper.Unit#UNIT AttackUnit
Unit that attacked.
After "OutOfAmmo" event.
Triggered when group is completely out of ammo.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "Recovered" event.
Group has recovered and its ROE is set back to the "normal" unsuppressed state. Optionally the group is flared green.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "Retreat" event.
Find a random point in the retreat zone and route the group there.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "Retreateded" event.
Group has reached the retreat zone. Set ROE to return fire and alarm state to auto.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "Start" event.
Initialized ROE and alarm state. Starts the event handler.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "Status" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "Stop" event.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
After "TakeCover" event.
Group will run to a nearby scenery object and "hide" there for a certain time.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Point#COORDINATE Hideout
Place where the group will hide.
Before "FallBack" event.
We check that group is not already falling back.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT AttackUnit
Attacking unit. We will move away from this.
Return value:
#boolean:
Before "Recovered" event.
Check if suppression time is over.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Return value:
#boolean:
Before "Retreat" event.
We check that the group is not already retreating.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Return value:
#boolean:
True if transition is allowed, False if transition is forbidden.
Before "Retreateded" event.
Check that the group is really in the retreat zone.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Before "TakeCover" event.
Search an area around the group for possible scenery objects where the group can hide.
Defined in:
SUPPRESSION
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
Controllable of the group.
#string From
From state.
#string Event
Event.
#string To
To state.
Core.Point#COORDINATE Hideout
Place where the group will hide.
Return value:
#boolean:
Field(s)
Name of the class.
Controllable of the FSM. Must be a ground group.
Alam state the group is currently in.
ROE the group currently has.
Get DCS descriptors of group.
Write Debug messages to DCS log file and send Debug messages to all players.
Alarm state the group will go to when it is changed back from another state. Default is "Auto".
ROE the group will get once suppression is over. Default is "Free".
Distance in meters the unit will fall back.
Heading in degrees to which the group should fall back. Default is directly away from the attacking unit.
If true, group can fall back, i.e. move away from the attacking unit.
Time in seconds the unit will wait at the fall back point before it resumes its mission.
Formation which will be used when falling back, taking cover or retreating. Default "Vee".
Number of units in a group at start.
True if group has attribute Infantry.
If true creates a entry in the F10 menu.
Number of times the group was hit.
Maximum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 90 %.
Minimum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 10 %.
Damage in percent at which the group will be ordered to retreat.
Time in seconds the group will wait in the retreat zone before it resumes its mission. Default two hours.
Speed the unit will use when falling back, taking cover or retreating. Default 999.
Maximum speed of group in km/h.
If true, group can hide at a nearby scenery object.
Range in which the group will search for scenery objects to hide at.
Time in seconds the group will hide before it will resume its mission.
Average time in seconds a group gets suppressed. Actual value is sampled randomly from a Gaussian distribution.
Maximum time in seconds the group gets suppressed.
Minimum time in seconds the group gets suppressed.
Time at which the suppression will be over.
Type of the group.
If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.
Flare units when they get hit or die.
String for DCS log file.
Smoke places to which the group retreats, falls back or hides.
PSEUDOATC version.
Waypoints of the group as defined in the ME.
Function(s)
Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.
Creates a new FSM_CONTROLLABLE object.
Defined in:
Parameters:
#table FSMT
Finite State Machine Table
Wrapper.Controllable#CONTROLLABLE Controllable
(optional) The CONTROLLABLE object that the FSM_CONTROLLABLE governs.
Return value:
OnAfter Transition Handler for Event Stop.
Defined in:
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
The Controllable Object managed by the FSM.
#string From
The From State string.
#string Event
The Event string.
#string To
The To State string.
OnBefore Transition Handler for Event Stop.
Defined in:
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
The Controllable Object managed by the FSM.
#string From
The From State string.
#string Event
The Event string.
#string To
The To State string.
Return value:
#boolean:
Return false to cancel Transition.
OnEnter Transition Handler for State Stopped.
Defined in:
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
The Controllable Object managed by the FSM.
#string From
The From State string.
#string Event
The Event string.
#string To
The To State string.
OnLeave Transition Handler for State Stopped.
Defined in:
Parameters:
Wrapper.Controllable#CONTROLLABLE Controllable
The Controllable Object managed by the FSM.
#string From
The From State string.
#string Event
The Event string.
#string To
The To State string.
Return value:
#boolean:
Return false to cancel Transition.
Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.
Asynchronous Event Trigger for Event Stop.
Field(s)
Name of the class.
Controllable of the FSM. Must be a ground group.
Alam state the group is currently in.
ROE the group currently has.
Get DCS descriptors of group.
Write Debug messages to DCS log file and send Debug messages to all players.
Alarm state the group will go to when it is changed back from another state. Default is "Auto".
ROE the group will get once suppression is over. Default is "Free".
Distance in meters the unit will fall back.
Heading in degrees to which the group should fall back. Default is directly away from the attacking unit.
If true, group can fall back, i.e. move away from the attacking unit.
Time in seconds the unit will wait at the fall back point before it resumes its mission.
Formation which will be used when falling back, taking cover or retreating. Default "Vee".
Number of units in a group at start.
True if group has attribute Infantry.
If true creates a entry in the F10 menu.
Number of times the group was hit.
Maximum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 90 %.
Minimum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 10 %.
Damage in percent at which the group will be ordered to retreat.
Time in seconds the group will wait in the retreat zone before it resumes its mission. Default two hours.
Speed the unit will use when falling back, taking cover or retreating. Default 999.
Maximum speed of group in km/h.
If true, group can hide at a nearby scenery object.
Range in which the group will search for scenery objects to hide at.
Time in seconds the group will hide before it will resume its mission.
Average time in seconds a group gets suppressed. Actual value is sampled randomly from a Gaussian distribution.
Maximum time in seconds the group gets suppressed.
Minimum time in seconds the group gets suppressed.
Time at which the suppression will be over.
Type of the group.
If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.
Flare units when they get hit or die.
String for DCS log file.
Smoke places to which the group retreats, falls back or hides.
PSEUDOATC version.
Waypoints of the group as defined in the ME.
Function(s)
Adds an End 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.
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)
Name of the class.
Controllable of the FSM. Must be a ground group.
Alam state the group is currently in.
ROE the group currently has.
Get DCS descriptors of group.
Write Debug messages to DCS log file and send Debug messages to all players.
Alarm state the group will go to when it is changed back from another state. Default is "Auto".
ROE the group will get once suppression is over. Default is "Free".
Distance in meters the unit will fall back.
Heading in degrees to which the group should fall back. Default is directly away from the attacking unit.
If true, group can fall back, i.e. move away from the attacking unit.
Time in seconds the unit will wait at the fall back point before it resumes its mission.
Formation which will be used when falling back, taking cover or retreating. Default "Vee".
Number of units in a group at start.
True if group has attribute Infantry.
If true creates a entry in the F10 menu.
Number of times the group was hit.
Maximum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 90 %.
Minimum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 10 %.
Damage in percent at which the group will be ordered to retreat.
Time in seconds the group will wait in the retreat zone before it resumes its mission. Default two hours.
Speed the unit will use when falling back, taking cover or retreating. Default 999.
Maximum speed of group in km/h.
If true, group can hide at a nearby scenery object.
Range in which the group will search for scenery objects to hide at.
Time in seconds the group will hide before it will resume its mission.
Average time in seconds a group gets suppressed. Actual value is sampled randomly from a Gaussian distribution.
Maximum time in seconds the group gets suppressed.
Minimum time in seconds the group gets suppressed.
Time at which the suppression will be over.
Type of the group.
If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.
Flare units when they get hit or die.
String for DCS log file.
Smoke places to which the group retreats, falls back or hides.
PSEUDOATC version.
Waypoints of the group as defined in the ME.
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.
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
Creation of a S_EVENT_NEW_DYNAMIC_CARGO 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 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.
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, 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:
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 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.
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.
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
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
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.
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.
Discard chair after ejection.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
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.
Occurs when a dynamic cargo crate is removed.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
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.
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
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.
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.
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.
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
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
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
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.
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.
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.
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.
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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
(Internal) Serialize arguments
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.
Enumerator of possible alarm states.
Field(s)
Automatic.
Green.
Red.
Function(s)
Enumerator of possible rules of engagement.
Field(s)
Weapon fire.
Hold fire.
Return fire.