Module Suppression
- Functional - (R2.4) Suppress fire of ground units when they get hit.
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.
Demo Missions
MOOSE - ALL Demo Missions
YouTube Channel
MOOSE YouTube Channel
Author: funkyfranky
Contributions: FlightControl
Global(s)
SUPPRESSION |
SUPPRESSION class, extends Core.Fsm#FSM_CONTROLLABLEMimic suppressive enemy fire and let groups flee or retreat. |
Type SUPPRESSION
SUPPRESSION.AlarmState |
Enumerator of possible alarm states. |
SUPPRESSION.ClassName |
Name of the class. |
SUPPRESSION.Controllable |
Controllable of the FSM. Must be a ground group. |
SUPPRESSION.CurrentAlarmState |
Alam state the group is currently in. |
SUPPRESSION.CurrentROE |
ROE the group currently has. |
SUPPRESSION.DCSdesc | |
SUPPRESSION.Debug |
Write Debug messages to DCS log file and send Debug messages to all players. |
SUPPRESSION:DebugOn() |
Turn Debug mode on. |
SUPPRESSION.DefaultAlarmState |
Alarm state the group will go to when it is changed back from another state. Default is "Auto". |
SUPPRESSION.DefaultROE |
ROE the group will get once suppression is over. Default is "Free". |
SUPPRESSION:Fallback(switch) |
Enable fall back if a group is hit. |
SUPPRESSION.FallbackDist |
Distance in meters the unit will fall back. |
SUPPRESSION.FallbackHeading |
Heading in degrees to which the group should fall back. Default is directly away from the attacking unit. |
SUPPRESSION.FallbackON |
If true, group can fall back, i.e. move away from the attacking unit. |
SUPPRESSION.FallbackWait |
Time in seconds the unit will wait at the fall back point before it resumes its mission. |
SUPPRESSION:FlareOn() |
Flare units when they are hit, die or recover from suppression. |
SUPPRESSION.Formation |
Formation which will be used when falling back, taking cover or retreating. Default "Vee". |
SUPPRESSION.IniGroupStrength |
Number of units in a group at start. |
SUPPRESSION.IsInfantry |
True if group has attribute Infantry. |
SUPPRESSION.MenuF10 |
Main F10 menu for suppresion, i.e. |
SUPPRESSION.MenuON |
If true creates a entry in the F10 menu. |
SUPPRESSION:MenuOn(switch) |
Create an F10 menu entry for the suppressed group. |
SUPPRESSION:New(group) |
Creates a new AI_suppression object. |
SUPPRESSION.Nhit |
Number of times the group was hit. |
SUPPRESSION:OnAfterFallBack(Controllable, From, Event, To, AttackUnit) |
User function for OnAfter "FallBack" event. |
SUPPRESSION:OnAfterFightBack(Controllable, From, Event, To) |
User function for OnAfter "FlightBack" event. |
SUPPRESSION:OnAfterHit(Controllable, From, Event, To, Unit, AttackUnit) |
User function for OnAfer "Hit" event. |
SUPPRESSION:OnAfterRecovered(Controllable, From, Event, To) |
User function for OnAfter "Recovered" event. |
SUPPRESSION:OnAfterRetreat(Controllable, From, Event, To) |
User function for OnAfter "Retreat" event. |
SUPPRESSION:OnAfterRetreated(Controllable, From, Event, To) |
User function for OnAfter "Retreated" 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. |
SUPPRESSION:OnBeforeRetreat(Controllable, From, Event, To) |
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. |
SUPPRESSION:OrderFallBack() |
Order group to fall back between 100 and 150 meters in a random direction. |
SUPPRESSION:OrderRetreat() |
Order group to retreat to a pre-defined zone. |
SUPPRESSION:OrderTakeCover() |
Order group to take cover at a nearby scenery object. |
SUPPRESSION.PmaxFlee |
Maximum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 90 %. |
SUPPRESSION.PminFlee |
Minimum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 10 %. |
SUPPRESSION.ROE |
Enumerator of possible rules of engagement. |
SUPPRESSION.RetreatDamage |
Damage in percent at which the group will be ordered to retreat. |
SUPPRESSION.RetreatWait |
Time in seconds the group will wait in the retreat zone before it resumes its mission. Default two hours. |
SUPPRESSION.RetreatZone |
Zone to which a group retreats. |
SUPPRESSION:SetDefaultAlarmState(alarmstate) |
Set alarm state a group will get after it returns from a fall back or take cover. |
SUPPRESSION:SetDefaultROE(roe) |
Set Rules of Engagement (ROE) a group will get when it recovers from suppression. |
SUPPRESSION:SetFallbackDistance(distance) |
Set distance a group will fall back when it gets hit. |
SUPPRESSION:SetFallbackWait(time) |
Set time a group waits at its fall back position before it resumes its normal mission. |
SUPPRESSION:SetFormation(formation) |
Set the formation a group uses for fall back, hide or retreat. |
SUPPRESSION:SetMaximumFleeProbability(probability) |
Set maximum probability that a group flees (falls back or takes cover) after a hit event. |
SUPPRESSION:SetMinimumFleeProbability(probability) |
Set minimum probability that a group flees (falls back or takes cover) after a hit event. |
SUPPRESSION:SetRetreatDamage(damage) |
Set damage threshold before a group is ordered to retreat if a retreat zone was defined. |
SUPPRESSION:SetRetreatWait(time) |
Set time a group waits in the retreat zone before it resumes its mission. |
SUPPRESSION:SetRetreatZone(zone) |
Set the zone to which a group retreats after being damaged too much. |
SUPPRESSION:SetSpeed(speed) |
Set speed a group moves at for fall back, hide or retreat. |
SUPPRESSION:SetSuppressionTime(Tave, Tmin, Tmax) |
Set average, minimum and maximum time a unit is suppressed each time it gets hit. |
SUPPRESSION:SetTakecoverPlace(Hideout) |
Set hideout place explicitly. |
SUPPRESSION:SetTakecoverRange(range) |
Set distance a group searches for hideout places. |
SUPPRESSION:SetTakecoverWait(time) |
Set time a group waits at its hideout position before it resumes its normal mission. |
SUPPRESSION:SmokeOn() |
Smoke positions where units fall back to, hide or retreat. |
SUPPRESSION.Speed |
Speed the unit will use when falling back, taking cover or retreating. Default 999. |
SUPPRESSION.SpeedMax |
Maximum speed of group in km/h. |
SUPPRESSION:Status(message) |
Status of group. |
SUPPRESSION:Takecover(switch) |
Enable take cover option if a unit is hit. |
SUPPRESSION.TakecoverON |
If true, group can hide at a nearby scenery object. |
SUPPRESSION.TakecoverRange |
Range in which the group will search for scenery objects to hide at. |
SUPPRESSION.TakecoverWait |
Time in seconds the group will hide before it will resume its mission. |
SUPPRESSION.Tsuppress_ave |
Average time in seconds a group gets suppressed. Actual value is sampled randomly from a Gaussian distribution. |
SUPPRESSION.Tsuppress_max |
Maximum time in seconds the group gets suppressed. |
SUPPRESSION.Tsuppress_min |
Minimum time in seconds the group gets suppressed. |
SUPPRESSION.TsuppressionOver |
Time at which the suppression will be over. |
SUPPRESSION.Type |
Type of the group. |
SUPPRESSION:_CreateMenuGroup() |
Create F10 main menu, i.e. |
SUPPRESSION:_EventFromTo(BA, Event, From, To) |
Print event-from-to string to DCS log file. |
SUPPRESSION:_GetLife() |
Get (relative) life in percent of a group. |
SUPPRESSION:_Heading(a, b, distance) |
Heading from point a to point b in degrees. |
SUPPRESSION:_OnEventDead(EventData) |
Event handler for Dead event of suppressed groups. |
SUPPRESSION:_OnEventHit(EventData) |
Event handler for Dead event of suppressed groups. |
SUPPRESSION._Passing_Waypoint(group, Fsm, i, final) |
Function called when group is passing a waypoint. |
SUPPRESSION:_Random_Gaussian(x0, sigma, xmin, xmax) |
Generate Gaussian pseudo-random numbers. |
SUPPRESSION:_Run(fin, speed, formation, wait) |
Make group run/drive to a certain point. |
SUPPRESSION:_SearchHideout() |
Search a place to hide. |
SUPPRESSION:_SetAlarmState(state) |
Sets the alarm state of the group and updates the current alarm state variable. |
SUPPRESSION:_SetROE(roe) |
Sets the ROE for the group and updates the current ROE variable. |
SUPPRESSION:_Suppress() |
Suppress fire of a unit by setting its ROE to "Weapon Hold". |
SUPPRESSION.eventmoose |
If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true. |
SUPPRESSION.flare |
Flare units when they get hit or die. |
SUPPRESSION.hideout |
Coordinate/place where the group will try to take cover. |
SUPPRESSION.id |
Some ID to identify who we are in output of the DCS.log file. |
SUPPRESSION:onEvent(Event) |
Event handler for suppressed groups. |
SUPPRESSION:onafterDead(Controllable, From, Event, To) |
After "Dead" event, when a unit has died. |
SUPPRESSION:onafterFallBack(Controllable, From, Event, To, AttackUnit) |
After "FallBack" event. |
SUPPRESSION:onafterFightBack(Controllable, From, Event, To) |
After "FightBack" event. |
SUPPRESSION:onafterHit(Controllable, From, Event, To, Unit, AttackUnit) |
After "Hit" event. |
SUPPRESSION:onafterRecovered(Controllable, From, Event, To) |
After "Recovered" event. |
SUPPRESSION:onafterRetreat(Controllable, From, Event, To) |
After "Retreat" event. |
SUPPRESSION:onafterRetreated(Controllable, From, Event, To) |
After "Retreateded" event. |
SUPPRESSION:onafterStart(Controllable, From, Event, To) |
After "Start" event. |
SUPPRESSION:onafterTakeCover(Controllable, From, Event, To, Hideout) |
After "TakeCover" event. |
SUPPRESSION:onbeforeFallBack(Controllable, From, Event, To, AttackUnit) |
Before "FallBack" event. |
SUPPRESSION:onbeforeHit(Controllable, From, Event, To, Unit, AttackUnit) |
Before "Hit" event. |
SUPPRESSION:onbeforeRecovered(Controllable, From, Event, To) |
Before "Recovered" event. |
SUPPRESSION:onbeforeRetreat(Controllable, From, Event, To) |
Before "Retreat" event. |
SUPPRESSION:onbeforeRetreated(Controllable, From, Event, To) |
Before "Retreateded" event. |
SUPPRESSION:onbeforeTakeCover(Controllable, From, Event, To, Hideout) |
Before "TakeCover" event. |
SUPPRESSION.smoke |
Smoke places to which the group retreats, falls back or hides. |
SUPPRESSION.version |
PSEUDOATC version. |
Global(s)
- #SUPPRESSION SUPPRESSION
-
SUPPRESSION class, extends Core.Fsm#FSM_CONTROLLABLE
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 Suppression
Type SUPPRESSION
Extends Core.Fsm#FSM_CONTROLLABLE
SUPPRESSION class
Field(s)
- #table SUPPRESSION.AlarmState
-
Enumerator of possible alarm states.
- #string SUPPRESSION.ClassName
-
Name of the class.
- Wrapper.Controllable#CONTROLLABLE SUPPRESSION.Controllable
-
Controllable of the FSM. Must be a ground group.
- #string SUPPRESSION.CurrentAlarmState
-
Alam state the group is currently in.
- #string SUPPRESSION.CurrentROE
-
ROE the group currently has.
- #boolean SUPPRESSION.Debug
-
Write Debug messages to DCS log file and send Debug messages to all players.
- SUPPRESSION:DebugOn()
-
Turn Debug mode on.
Enables messages and more output to DCS log file.
- #string SUPPRESSION.DefaultAlarmState
-
Alarm state the group will go to when it is changed back from another state. Default is "Auto".
- #string SUPPRESSION.DefaultROE
-
ROE the group will get once suppression is over. Default is "Free".
- SUPPRESSION:Fallback(switch)
-
Enable fall back if a group is hit.
Parameter
-
#boolean switch
: Enable=true or disable=false fall back of group.
-
- #number SUPPRESSION.FallbackDist
-
Distance in meters the unit will fall back.
- #number SUPPRESSION.FallbackHeading
-
Heading in degrees to which the group should fall back. Default is directly away from the attacking unit.
- #boolean SUPPRESSION.FallbackON
-
If true, group can fall back, i.e. move away from the attacking unit.
- #number SUPPRESSION.FallbackWait
-
Time in seconds the unit will wait at the fall back point before it resumes its mission.
- SUPPRESSION:FlareOn()
-
Flare units when they are hit, die or recover from suppression.
- #string SUPPRESSION.Formation
-
Formation which will be used when falling back, taking cover or retreating. Default "Vee".
- #number SUPPRESSION.IniGroupStrength
-
Number of units in a group at start.
- #boolean SUPPRESSION.IsInfantry
-
True if group has attribute Infantry.
- #string SUPPRESSION.MenuF10
-
Main F10 menu for suppresion, i.e.
F10/Suppression.
- #boolean SUPPRESSION.MenuON
-
If true creates a entry in the F10 menu.
- SUPPRESSION:MenuOn(switch)
-
Create an F10 menu entry for the suppressed group.
The menu is mainly for Debugging purposes.
Parameter
-
#boolean switch
: Enable=true or disable=false menu group. Default is true.
-
- SUPPRESSION:New(group)
-
Creates a new AI_suppression object.
Parameter
-
Wrapper.Group#GROUP group
: The GROUP object for which suppression should be applied.
Return values
-
#SUPPRESSION: SUPPRESSION object.
-
nil If group does not exist or is not a ground group.
-
- #number SUPPRESSION.Nhit
-
Number of times the group was hit.
- SUPPRESSION:OnAfterFallBack(Controllable, From, Event, To, AttackUnit)
-
User function for OnAfter "FallBack" event.
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.
-
- SUPPRESSION:OnAfterFightBack(Controllable, From, Event, To)
-
User function for OnAfter "FlightBack" event.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:OnAfterHit(Controllable, From, Event, To, Unit, AttackUnit)
-
User function for OnAfer "Hit" event.
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.
-
- SUPPRESSION:OnAfterRecovered(Controllable, From, Event, To)
-
User function for OnAfter "Recovered" event.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:OnAfterRetreat(Controllable, From, Event, To)
-
User function for OnAfter "Retreat" event.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:OnAfterRetreated(Controllable, From, Event, To)
-
User function for OnAfter "Retreated" event.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:OnAfterTakeCover(Controllable, From, Event, To, Hideout)
-
User function for OnAfter "TakeCover" event.
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.
-
- SUPPRESSION:OnBeforeFallBack(Controllable, From, Event, To, AttackUnit)
-
User function for OnBefore "FallBack" event.
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:
-
- SUPPRESSION:OnBeforeFightBack(Controllable, From, Event, To)
-
User function for OnBefore "FlightBack" event.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
Return value
#boolean:
-
- SUPPRESSION:OnBeforeHit(Controllable, From, Event, To, Unit, AttackUnit)
-
User function for OnBefore "Hit" event.
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:
-
- SUPPRESSION:OnBeforeRecovered(Controllable, From, Event, To)
-
User function for OnBefore "Recovered" event.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
Return value
#boolean:
-
- SUPPRESSION:OnBeforeRetreat(Controllable, From, Event, To)
-
User function for OnBefore "Retreat" event.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
Return value
#boolean:
-
- SUPPRESSION:OnBeforeRetreated(Controllable, From, Event, To)
-
User function for OnBefore "Retreated" event.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
Return value
#boolean:
-
- SUPPRESSION:OnBeforeTakeCover(Controllable, From, Event, To, Hideout)
-
User function for OnBefore "TakeCover" event.
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:
-
- SUPPRESSION:OrderFallBack()
-
Order group to fall back between 100 and 150 meters in a random direction.
- SUPPRESSION:OrderRetreat()
-
Order group to retreat to a pre-defined zone.
- SUPPRESSION:OrderTakeCover()
-
Order group to take cover at a nearby scenery object.
- #number SUPPRESSION.PmaxFlee
-
Maximum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 90 %.
- #number SUPPRESSION.PminFlee
-
Minimum probability in percent that a group will flee (fall back or take cover) at each hit event. Default is 10 %.
- #table SUPPRESSION.ROE
-
Enumerator of possible rules of engagement.
- #number SUPPRESSION.RetreatDamage
-
Damage in percent at which the group will be ordered to retreat.
- #number SUPPRESSION.RetreatWait
-
Time in seconds the group will wait in the retreat zone before it resumes its mission. Default two hours.
- Core.Zone#ZONE SUPPRESSION.RetreatZone
-
Zone to which a group retreats.
- SUPPRESSION:SetDefaultAlarmState(alarmstate)
-
Set alarm state a group will get after it returns from a fall back or take cover.
Parameter
-
#string alarmstate
: Alarm state. Possible "Auto", "Green", "Red". Default is "Auto".
-
- SUPPRESSION:SetDefaultROE(roe)
-
Set Rules of Engagement (ROE) a group will get when it recovers from suppression.
Parameter
-
#string roe
: ROE after suppression. Possible "Free", "Hold" or "Return". Default "Free".
-
- SUPPRESSION:SetFallbackDistance(distance)
-
Set distance a group will fall back when it gets hit.
Parameter
-
#number distance
: Distance in meters.
-
- SUPPRESSION:SetFallbackWait(time)
-
Set time a group waits at its fall back position before it resumes its normal mission.
Parameter
-
#number time
: Time in seconds.
-
- SUPPRESSION:SetFormation(formation)
-
Set the formation a group uses for fall back, hide or retreat.
Parameter
-
#string formation
: Formation of the group. Default "Vee".
-
- SUPPRESSION:SetMaximumFleeProbability(probability)
-
Set maximum probability that a group flees (falls back or takes cover) after a hit event.
Default is 90%.
Parameter
-
#number probability
: Probability in percent.
-
- SUPPRESSION:SetMinimumFleeProbability(probability)
-
Set minimum probability that a group flees (falls back or takes cover) after a hit event.
Default is 10%.
Parameter
-
#number probability
: Probability in percent.
-
- SUPPRESSION:SetRetreatDamage(damage)
-
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.
Parameter
-
#number damage
: Damage in percent. If group gets damaged above this value, the group will retreat. Default 50 %.
-
- SUPPRESSION:SetRetreatWait(time)
-
Set time a group waits in the retreat zone before it resumes its mission.
Default is two hours.
Parameter
-
#number time
: Time in seconds. Default 7200 seconds = 2 hours.
-
- SUPPRESSION:SetRetreatZone(zone)
-
Set the zone to which a group retreats after being damaged too much.
Parameter
-
Core.Zone#ZONE zone
: MOOSE zone object.
-
- SUPPRESSION:SetSpeed(speed)
-
Set speed a group moves at for fall back, hide or retreat.
Parameter
-
#number speed
: Speed in km/h of group. Default max speed the group can do.
-
- SUPPRESSION:SetSuppressionTime(Tave, Tmin, Tmax)
-
Set average, minimum and maximum time a unit is suppressed each time it gets hit.
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.
-
- SUPPRESSION:SetTakecoverPlace(Hideout)
-
Set hideout place explicitly.
Parameter
-
Core.Point#COORDINATE Hideout
: Place where the group will hide after the TakeCover event.
-
- SUPPRESSION:SetTakecoverRange(range)
-
Set distance a group searches for hideout places.
Parameter
-
#number range
: Search range in meters.
-
- SUPPRESSION:SetTakecoverWait(time)
-
Set time a group waits at its hideout position before it resumes its normal mission.
Parameter
-
#number time
: Time in seconds.
-
- SUPPRESSION:SmokeOn()
-
Smoke positions where units fall back to, hide or retreat.
- #number SUPPRESSION.Speed
-
Speed the unit will use when falling back, taking cover or retreating. Default 999.
- #number SUPPRESSION.SpeedMax
-
Maximum speed of group in km/h.
- SUPPRESSION:Status(message)
-
Status of group.
Current ROE, alarm state, life.
Parameter
-
#boolean message
: Send message to all players.
-
- SUPPRESSION:Takecover(switch)
-
Enable take cover option if a unit is hit.
Parameter
-
#boolean switch
: Enable=true or disable=false fall back of group.
-
- #boolean SUPPRESSION.TakecoverON
-
If true, group can hide at a nearby scenery object.
- #number SUPPRESSION.TakecoverRange
-
Range in which the group will search for scenery objects to hide at.
- #number SUPPRESSION.TakecoverWait
-
Time in seconds the group will hide before it will resume its mission.
- #number SUPPRESSION.Tsuppress_ave
-
Average time in seconds a group gets suppressed. Actual value is sampled randomly from a Gaussian distribution.
- #number SUPPRESSION.Tsuppress_max
-
Maximum time in seconds the group gets suppressed.
- #number SUPPRESSION.Tsuppress_min
-
Minimum time in seconds the group gets suppressed.
- #number SUPPRESSION.TsuppressionOver
-
Time at which the suppression will be over.
- #string SUPPRESSION.Type
-
Type of the group.
- SUPPRESSION:_CreateMenuGroup()
-
Create F10 main menu, i.e.
F10/Suppression. The menu is mainly for Debugging purposes.
- SUPPRESSION:_EventFromTo(BA, Event, From, To)
-
Print event-from-to string to DCS log file.
Parameters
-
#string BA
: Before/after info. -
#string Event
: Event. -
#string From
: From state. -
#string To
: To state.
-
- SUPPRESSION:_GetLife()
-
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.
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.
-
- SUPPRESSION:_Heading(a, b, distance)
-
Heading from point a to point b in degrees.
Parameters
-
Core.Point#COORDINATE a
: Coordinate. -
Core.Point#COORDINATE b
: Coordinate. -
distance
:
Return value
#number: angle Angle from a to b in degrees.
-
- SUPPRESSION:_OnEventDead(EventData)
-
Event handler for Dead event of suppressed groups.
Parameter
-
Core.Event#EVENTDATA EventData
:
-
- SUPPRESSION:_OnEventHit(EventData)
-
Event handler for Dead event of suppressed groups.
Parameter
-
Core.Event#EVENTDATA EventData
:
-
- SUPPRESSION._Passing_Waypoint(group, Fsm, i, final)
-
Function called when group is passing a waypoint.
At the last waypoint we set the group back to CombatReady.
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.
-
- SUPPRESSION:_Random_Gaussian(x0, sigma, xmin, xmax)
-
Generate Gaussian pseudo-random numbers.
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.
-
- SUPPRESSION:_Run(fin, speed, formation, wait)
-
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.
Parameters
-
Core.Point#COORDINATE fin
: 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.
-
- SUPPRESSION:_SearchHideout()
-
Search a place to hide.
This is any scenery object in the vicinity.
Return values
-
Core.Point#COORDINATE: Coordinate of the hideout place.
-
nil If no scenery object is within search radius.
-
- SUPPRESSION:_SetAlarmState(state)
-
Sets the alarm state of the group and updates the current alarm state variable.
Parameter
-
#string state
: Alarm state the group will get. Possible "Auto", "Green", "Red". Default is self.DefaultAlarmState.
-
- SUPPRESSION:_SetROE(roe)
-
Sets the ROE for the group and updates the current ROE variable.
Parameter
-
#string roe
: ROE the group will get. Possible "Free", "Hold", "Return". Default is self.DefaultROE.
-
- SUPPRESSION:_Suppress()
-
Suppress fire of a unit by setting its ROE to "Weapon Hold".
- #boolean SUPPRESSION.eventmoose
-
If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.
- #boolean SUPPRESSION.flare
-
Flare units when they get hit or die.
- Core.Point#COORDINATE SUPPRESSION.hideout
-
Coordinate/place where the group will try to take cover.
- #string SUPPRESSION.id
-
Some ID to identify who we are in output of the DCS.log file.
- SUPPRESSION:onEvent(Event)
-
Event handler for suppressed groups.
Parameter
-
Event
:
-
- SUPPRESSION:onafterDead(Controllable, From, Event, To)
-
After "Dead" event, when a unit has died.
When all units of a group are dead, FSM is stopped and eventhandler removed.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:onafterFallBack(Controllable, From, Event, To, AttackUnit)
-
After "FallBack" event.
We get the heading away from the attacker and route the group a certain distance in that direction.
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.
-
- SUPPRESSION:onafterFightBack(Controllable, From, Event, To)
-
After "FightBack" event.
ROE and Alarm state are set back to default.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:onafterHit(Controllable, From, Event, To, Unit, AttackUnit)
-
After "Hit" event.
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.
-
- SUPPRESSION:onafterRecovered(Controllable, From, Event, To)
-
After "Recovered" event.
Group has recovered and its ROE is set back to the "normal" unsuppressed state. Optionally the group is flared green.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:onafterRetreat(Controllable, From, Event, To)
-
After "Retreat" event.
Find a random point in the retreat zone and route the group there.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:onafterRetreated(Controllable, From, Event, To)
-
After "Retreateded" event.
Group has reached the retreat zone. Set ROE to return fire and alarm state to auto.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:onafterStart(Controllable, From, Event, To)
-
After "Start" event.
Initialized ROE and alarm state. Starts the event handler.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:onafterTakeCover(Controllable, From, Event, To, Hideout)
-
After "TakeCover" event.
Group will run to a nearby scenery object and "hide" there for a certain time.
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.
-
- SUPPRESSION:onbeforeFallBack(Controllable, From, Event, To, AttackUnit)
-
Before "FallBack" event.
We check that group is not already falling back.
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:
-
- SUPPRESSION:onbeforeHit(Controllable, From, Event, To, Unit, AttackUnit)
-
Before "Hit" event.
(Of course, this is not really before the group got hit.)
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
-
- SUPPRESSION:onbeforeRecovered(Controllable, From, Event, To)
-
Before "Recovered" event.
Check if suppression time is over.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
Return value
#boolean:
-
- SUPPRESSION:onbeforeRetreat(Controllable, From, Event, To)
-
Before "Retreat" event.
We check that the group is not already retreating.
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.
-
- SUPPRESSION:onbeforeRetreated(Controllable, From, Event, To)
-
Before "Retreateded" event.
Check that the group is really in the retreat zone.
Parameters
-
Wrapper.Controllable#CONTROLLABLE Controllable
: Controllable of the group. -
#string From
: From state. -
#string Event
: Event. -
#string To
: To state.
-
- SUPPRESSION:onbeforeTakeCover(Controllable, From, Event, To, Hideout)
-
Before "TakeCover" event.
Search an area around the group for possible scenery objects where the group can hide.
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:
-
- #boolean SUPPRESSION.smoke
-
Smoke places to which the group retreats, falls back or hides.
- #number SUPPRESSION.version
-
PSEUDOATC version.