Module Functional.Autolase
Functional - Autolase targets in the field.
AUOTLASE - Autolase targets in the field.
Missions:
None yet.
Main Features:
- Detect and lase contacts automatically
- Targets are lased by threat priority order
- Use FSM events to link functionality into your scripts
- Easy setup
- Spot on!
1 Autolase concept
- Detect and lase contacts automatically
- Targets are lased by threat priority order
- Use FSM events to link functionality into your scripts
- Set laser codes and smoke colors per Recce unit
- Easy set-up
2 Basic usage
2.2 Set up a group of Recce Units:
local FoxSet = SET_GROUP:New():FilterPrefixes("Recce"):FilterCoalitions("blue"):FilterStart()
2.3 (Optional) Set up a group of pilots, this will drive who sees the F10 menu entry:
local Pilotset = SET_CLIENT:New():FilterCoalitions("blue"):FilterActive(true):FilterStart()
2.4 Set up and start Autolase:
local autolaser = AUTOLASE:New(FoxSet,coalition.side.BLUE,"Wolfpack",Pilotset)
2.5 Example - Using a fixed laser code and color for a specific Recce unit:
local recce = SPAWN:New("Reaper")
:InitDelayOff()
:OnSpawnGroup(
function (group)
local unit = group:GetUnit(1)
local name = unit:GetName()
autolaser:SetRecceLaserCode(name,1688)
autolaser:SetRecceSmokeColor(name,SMOKECOLOR.Red)
end
)
:InitCleanUp(60)
:InitLimit(1,0)
:SpawnScheduled(30,0.5)
2.6 Example - Inform pilots about events:
autolaser:SetNotifyPilots(true) -- defaults to true, also shown if debug == true
-- Note - message are shown to pilots in the #SET_CLIENT only if using the pilotset option, else to the coalition.
Author: applevangelist
Global(s)
Global AUTOLASE |
Type(s)
Fields and Methods inherited from AUTOLASE | Description |
---|---|
(User) Set list of #UNIT level attributes that won't be lased. |
|
(Internal) Function to check if a unit can be lased. |
|
Triggers the FSM event "Cancel". |
|
(Internal) Function to check if a unit is already lased. |
|
(Internal) Function to check on lased targets. |
|
(User) Do not show the "Switch smoke target..." menu entry for pilots. |
|
(User) Do not show the "Switch min threat lasing..." menu entry for pilots. |
|
(User) Show the "Switch smoke target..." menu entry for pilots. |
|
(User) Show the "Switch min threat lasing..." menu entry for pilots. |
|
(Internal) Function to get a laser code by recce name |
|
(Internal) Function to calculate line of sight. |
|
(Internal) Function to get a smoke color by recce name |
|
Constructor for a new Autolase instance. |
|
(Internal) Function to show messages. |
|
(User) Send messages via SRS. |
|
AUTOLASE:OnAfterLaserTimeout(From, Event, To, UnitName, RecceName) |
On After "LaserTimeout" event. |
On After "Lasing" event. |
|
On After "RecceKIA" event. |
|
AUTOLASE:OnAfterTargetDestroyed(From, Event, To, UnitName, RecceName) |
On After "TargetDestroyed" event. |
AUTOLASE:OnAfterTargetLost(From, Event, To, UnitName, RecceName) |
On After "TargetLost" event. |
[User] Set a table of possible laser codes. |
|
(User) Function to force laser cooldown and cool down time |
|
(User) Function to set lasing distance in meters and duration in seconds |
|
(User) Function set max lasing targets |
|
(User) Set minimum threat level for target selection, can be 0 (lowest) to 10 (highest). |
|
(Internal) Function set notify pilots on events |
|
(Internal) Function to set pilot menu. |
|
(User) Function to set a specific code to a Recce. |
|
(User) Function to set a specific smoke color for a Recce. |
|
(User) Function to set message show times. |
|
(User) Function to set smoking of targets. |
|
(User) Function enable sending messages via SRS. |
|
(Internal) Function to show status. |
|
Triggers the FSM event "Monitor". |
|
(Internal) Event function for new pilots. |
|
Triggers the FSM event "Cancel" after a delay. |
|
Triggers the FSM event "Monitor" after a delay. |
|
(Internal) FSM Function for monitoring |
|
(Internal) FSM Function onbeforeCancel |
|
AUTOLASE:onbeforeLaserTimeout(From, Event, To, UnitName, RecceName) |
(Internal) FSM Function onbeforeLaserTimeout |
(Internal) FSM Function onbeforeLasing |
|
(Internal) FSM Function for monitoring |
|
(Internal) FSM Function onbeforeRecceKIA |
|
AUTOLASE:onbeforeTargetDestroyed(From, Event, To, UnitName, RecceName) |
(Internal) FSM Function onbeforeTargetDestroyed |
AUTOLASE:onbeforeTargetLost(From, Event, To, UnitName, RecceName) |
(Internal) FSM Function onbeforeTargetLost |
AUTOLASE class version. |
Fields and Methods inherited from AUTOLASE.LaserSpot | Description |
---|---|
Field(s)
set up SRS
Set some string id for output to DCS.log file.
AUTOLASE class version.
Function(s)
(User) Set list of #UNIT level attributes that won't be lased.
For list of attributes see Hoggit Wiki and GitHub
Defined in:
AUTOLASE
Parameter:
#table Attributes
Table of #string attributes to blacklist. Can be handed over as a single #string.
Return value:
self
Usage:
To exclude e.g. manpads from being lased:
`myautolase:AddBlackListAttributes("MANPADS")`
To exclude trucks and artillery:
`myautolase:AddBlackListAttributes({"Trucks","Artillery"})`
(Internal) Function to check if a unit can be lased.
Defined in:
AUTOLASE
Parameters:
Wrapper.Unit#UNIT Recce
The Recce #UNIT
Wrapper.Unit#UNIT Unit
The lased #UNIT
Return value:
#boolean:
outcome True or false
(Internal) Function to check if a unit is already lased.
Defined in:
AUTOLASE
Parameter:
#string unitname
Name of the unit to check
Return value:
#boolean:
outcome True or false
(Internal) Function to check on lased targets.
(User) Do not show the "Switch smoke target..." menu entry for pilots.
(User) Do not show the "Switch min threat lasing..." menu entry for pilots.
(User) Show the "Switch smoke target..." menu entry for pilots.
On by default.
(User) Show the "Switch min threat lasing..." menu entry for pilots.
On by default.
(Internal) Function to get a laser code by recce name
Defined in:
AUTOLASE
Parameter:
#string RecceName
Unit(!) name of the Recce
Return value:
self
(Internal) Function to calculate line of sight.
Defined in:
AUTOLASE
Parameter:
Wrapper.Unit#UNIT Unit
Return value:
#number:
LOS Line of sight in meters
(Internal) Function to get a smoke color by recce name
Defined in:
AUTOLASE
Parameter:
#string RecceName
Unit(!) name of the Recce
Return value:
self
Constructor for a new Autolase instance.
Defined in:
AUTOLASE
Parameters:
Core.Set#SET_GROUP RecceSet
Set of detecting and lasing units
#number Coalition
Coalition side. Can also be passed as a string "red", "blue" or "neutral".
#string Alias
(Optional) An alias how this object is called in the logs etc.
Core.Set#SET_CLIENT PilotSet
(Optional) Set of clients for precision bombing, steering menu creation. Leave nil for a coalition-wide F10 entry and display.
Return value:
self
(Internal) Function to show messages.
Defined in:
AUTOLASE
Parameters:
#string Message
The message to be sent
#number Duration
Duration in seconds
Return value:
self
(User) Send messages via SRS.
Defined in:
AUTOLASE
Parameter:
#string Message
The (short!) message to be sent, e.g. "Lasing target!"
Return value:
self
Usage:
Step 1 - set up the radio basics **once** with
my_autolase:SetUsingSRS(true,"C:\\path\\SRS-Folder",251,radio.modulation.AM)
Step 2 - send a message, e.g.
function my_autolase:OnAfterLasing(From, Event, To, LaserSpot)
my_autolase:NotifyPilotsWithSRS("Reaper lasing new target!")
end
On After "LaserTimeout" event.
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
#string UnitName
The lost unit's name
#string RecceName
The Recce name lasing
On After "Lasing" event.
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
Functional.Autolase#AUTOLASE.LaserSpot LaserSpot
The LaserSpot data table
On After "RecceKIA" event.
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
#string RecceName
The lost Recce
On After "TargetDestroyed" event.
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
#string UnitName
The destroyed unit's name
#string RecceName
The Recce name lasing
On After "TargetLost" event.
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
#string UnitName
The lost unit's name
#string RecceName
The Recce name lasing
[User] Set a table of possible laser codes.
Each new RECCE can select a code from this table, default is { 1688, 1130, 4785, 6547, 1465, 4578 } .
(User) Function to force laser cooldown and cool down time
Defined in:
AUTOLASE
Parameters:
#boolean OnOff
Switch cool down on (true) or off (false) - defaults to true
#number Seconds
Number of seconds for cooldown - dafaults to 60 seconds
Return value:
self
(User) Function to set lasing distance in meters and duration in seconds
Defined in:
AUTOLASE
Parameters:
#number Distance
(Max) distance for lasing in meters - default 5000 meters
#number Duration
(Max) duration for lasing in seconds - default 300 secs
Return value:
self
(User) Function set max lasing targets
Defined in:
AUTOLASE
Parameter:
#number Number
Max number of targets to lase at once
Return value:
self
(User) Set minimum threat level for target selection, can be 0 (lowest) to 10 (highest).
Defined in:
AUTOLASE
Parameter:
#number Level
Level used for filtering, defaults to 0. SAM systems and manpads have level 7 to 10, AAA level 6, MTBs and armoured vehicles level 3 to 5, APC, Artillery, Infantry and EWR level 1 to 2.
Return value:
self
Usage:
Filter for level 3 and above:
`myautolase:SetMinThreatLevel(3)`
(Internal) Function set notify pilots on events
Defined in:
AUTOLASE
Parameter:
#boolean OnOff
Switch messaging on (true) or off (false)
Return value:
self
(Internal) Function to set pilot menu.
(User) Function to set a specific code to a Recce.
Defined in:
AUTOLASE
Parameters:
#string RecceName
(Unit!) Name of the Recce
#number Code
The lase code
#boolean Refresh
If true, refresh menu entries
Return value:
self
(User) Function to set a specific smoke color for a Recce.
Defined in:
AUTOLASE
Parameters:
#string RecceName
(Unit!) Name of the Recce
#number Color
The color, e.g. SMOKECOLOR.Red, SMOKECOLOR.Green etc
Return value:
self
(User) Function to set message show times.
Defined in:
AUTOLASE
Parameters:
#number long
Longer show time
#number short
Shorter show time
Return value:
self
(User) Function to set smoking of targets.
Defined in:
AUTOLASE
Parameters:
#boolean OnOff
Switch smoking on or off
#number Color
Smokecolor, e.g. SMOKECOLOR.Red
Return value:
self
(User) Function enable sending messages via SRS.
Defined in:
AUTOLASE
Parameters:
#boolean OnOff
Switch usage on and off
#string Path
Path to SRS directory, e.g. C:\Program Files\DCS-SimpleRadio-Standalone
#number Frequency
Frequency to send, e.g. 243
#number Modulation
Modulation i.e. radio.modulation.AM or radio.modulation.FM
#string Label
(Optional) Short label to be used on the SRS Client Overlay
#string Gender
(Optional) Defaults to "male"
#string Culture
(Optional) Defaults to "en-US"
#number Port
(Optional) Defaults to 5002
#string Voice
(Optional) Use a specifc voice with the Sound.SRS#SetVoice function, e.g, :SetVoice("Microsoft Hedda Desktop")
.
Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS.
#number Volume
(Optional) Volume - between 0.0 (silent) and 1.0 (loudest)
#string PathToGoogleKey
(Optional) Path to your google key if you want to use google TTS
Return value:
self
(Internal) Function to show status.
Defined in:
AUTOLASE
Parameters:
Wrapper.Group#GROUP Group
(Optional) show to a certain group
Wrapper.Unit#UNIT Unit
(Optional) show to a certain unit
Return value:
self
(Internal) Event function for new pilots.
Triggers the FSM event "Cancel" after a delay.
Defined in:
AUTOLASE
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "Monitor" after a delay.
Defined in:
AUTOLASE
Parameter:
#number delay
Delay in seconds.
(Internal) FSM Function for monitoring
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
Return value:
self
(Internal) FSM Function onbeforeCancel
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
Return value:
self
(Internal) FSM Function onbeforeLaserTimeout
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
#string UnitName
The lost unit's name
#string RecceName
The Recce name lasing
Return value:
self
(Internal) FSM Function onbeforeLasing
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
Functional.Autolase#AUTOLASE.LaserSpot LaserSpot
The LaserSpot data table
Return value:
self
(Internal) FSM Function for monitoring
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
Return value:
self
(Internal) FSM Function onbeforeRecceKIA
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
#string RecceName
The lost Recce
Return value:
self
(Internal) FSM Function onbeforeTargetDestroyed
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
#string UnitName
The destroyed unit's name
#string RecceName
The Recce name lasing
Return value:
self
(Internal) FSM Function onbeforeTargetLost
Defined in:
AUTOLASE
Parameters:
#string From
The from state
#string Event
The event
#string To
The to state
#string UnitName
The lost unit's name
#string RecceName
The Recce name lasing
Return value:
self
Laser spot info