Module Ops.PlayerTask
Ops - PlayerTask (mission) for Players.
Main Features:
- Simplifies defining and executing Player tasks
- FSM events when a mission is added, done, successful or failed, replanned
- Ready to use SRS and localization
- Mission locations can be smoked, flared, illuminated and marked on the map
Example Missions:
Demo missions can be found on GitHub.
Author: Applevangelist
Special thanks to: Streakeagle
Global(s)
Global PLAYERTASK |
Global PLAYERTASKCONTROLLER |
It is our attitude at the beginning of a difficult task which, more than anything else, which will affect its successful outcome. (William James) PLAYERTASKCONTROLLER
1 OverviewPLAYERTASKCONTROLLER is used to auto-create (optional) and control tasks for players. |
It is our attitude at the beginning of a difficult task which, more than anything else, which will affect its successful outcome. (William James)
PLAYERTASKCONTROLLER
- Simplifies defining, executing and controlling of Player tasks
- FSM events when a mission is added, done, successful or failed, replanned
- Ready to use SRS and localization
- Mission locations can be smoked, flared and marked on the map
1 Overview
PLAYERTASKCONTROLLER is used to auto-create (optional) and control tasks for players.
It can be set up as Air-to-Ground (A2G, main focus), Air-to-Ship (A2S) or Air-to-Air (A2A) controller. For the latter task type, also have a look at the Ops.AWACS#AWACS class which allows for more complex scenarios. One task at a time can be joined by the player from the F10 menu. A task can be joined by multiple players. Once joined, task information is available via the F10 menu, the task location can be marked on the map and for A2G/S targets, the target can be marked with smoke and flares.
For the mission designer, tasks can be auto-created by means of detection with the integrated Ops.Intel#INTEL class setup, or be manually added to the task queue.
2 Task Types
Targets can be of types GROUP, SET_GROUP, UNIT, SET_UNIT, STATIC, SET_STATIC, SET_SCENERY, AIRBASE, ZONE or COORDINATE. The system will auto-create tasks for players from these targets. Tasks are created as Ops.PlayerTask#PLAYERTASK objects, which leverage Ops.Target#TARGET for the management of the actual target. The system creates these task types from the target objects:
- A2A - AUFTRAG.Type.INTERCEPT
- A2S - AUFTRAG.Type.ANTISHIP
- A2G - AUFTRAG.Type.CAS, AUFTRAG.Type.BAI, AUFTRAG.Type.SEAD, AUFTRAG.Type.BOMBING, AUFTRAG.Type.PRECISIONBOMBING, AUFTRAG.Type.BOMBRUNWAY
- A2GS - A2S and A2G combined
Task types are derived from Ops.Auftrag#AUFTRAG:
- CAS - Close air support, created to attack ground units, where friendly ground units are around the location in a bespoke radius (default: 500m/1km diameter)
- BAI - Battlefield air interdiction, same as above, but no friendlies around
- SEAD - Same as CAS, but the enemy ground units field AAA, SAM or EWR units
- Bombing - Against static targets
- Precision Bombing - (if enabled) Laser-guided bombing, against static targets and high-value (non-SAM) ground targets (MBTs etc)
- Bomb Runway - Against Airbase runways (in effect, drop bombs over the runway)
- ZONE and COORDINATE - Targets will be scanned for GROUND or STATIC enemy units and tasks created from these
- Intercept - Any airborne targets, if the controller is of type "A2A"
- Anti-Ship - Any ship targets, if the controller is of type "A2S"
- CTLD - Combat transport and logistics deployment
- CSAR - Combat search and rescue
- RECON - Identify targets
- CAPTUREZONE - Capture an Ops.OpsZone#OPSZONE
- Any #string name can be passed as Auftrag type, but then you need to make sure to define a success condition, and possibly also add the task type to the standard scoring list:
PLAYERTASKCONTROLLER.Scores["yournamehere"]=100
3 Task repetition
On failure, tasks will be replanned by default for a maximum of 5 times.
3.1 Pre-configured success conditions
Pre-configured success conditions for #PLAYERTASK tasks are available as follows:
mytask:AddStaticObjectSuccessCondition()
-- success if static object is at least 80% dead
mytask:AddOpsZoneCaptureSuccessCondition(CaptureSquadGroupNamePrefix,Coalition)
-- success if a squad of the given (partial) name and coalition captures the OpsZone
mytask:AddReconSuccessCondition(MinDistance)
-- success if object is in line-of-sight with the given min distance in NM
mytask:AddTimeLimitSuccessCondition(TimeLimit)
-- failure if the task is not completed within the time limit in seconds given
3.2 Task chaining
You can create chains of tasks, which will depend on success or failure of the previous task with the following commands:
mytask:AddNextTaskAfterSuccess(FollowUpTask)
and
mytask:AddNextTaskAfterFailure(FollowUpTask)
4 SETTINGS, SRS and language options (localization)
The system can optionally communicate to players via SRS. Also localization is available, both "en" and "de" has been build in already. Player and global Core.Settings#SETTINGS for coordinates will be observed.
5 Setup
A basic setup is very simple:
-- Settings - we want players to have a settings menu, be on imperial measures, and get directions as BR
_SETTINGS:SetPlayerMenuOn()
_SETTINGS:SetImperial()
_SETTINGS:SetA2G_BR()
-- Set up the A2G task controller for the blue side named "82nd Airborne"
local taskmanager = PLAYERTASKCONTROLLER:New("82nd Airborne",coalition.side.BLUE,PLAYERTASKCONTROLLER.Type.A2G)
-- set locale to English
taskmanager:SetLocale("en")
-- Set up detection with grup names *containing* "Blue Recce", these will add targets to our controller via detection. Can be e.g. a drone.
taskmanager:SetupIntel("Blue Recce")
-- Add a single Recce group name "Blue Humvee"
taskmanager:AddAgent(GROUP:FindByName("Blue Humvee"))
-- Set the callsign for SRS and Menu name to be "Groundhog"
taskmanager:SetMenuName("Groundhog")
-- Add accept- and reject-zones for detection
-- Accept zones are handy to limit e.g. the engagement to a certain zone. The example is a round, mission editor created zone named "AcceptZone"
taskmanager:AddAcceptZone(ZONE:New("AcceptZone"))
-- Reject zones are handy to create borders. The example is a ZONE_POLYGON, created in the mission editor, late activated with waypoints,
-- named "AcceptZone#ZONE_POLYGON"
taskmanager:AddRejectZone(ZONE:FindByName("RejectZone"))
-- Set up using SRS for messaging
local hereSRSPath = "C:\\Program Files\\DCS-SimpleRadio-Standalone"
local hereSRSPort = 5002
-- local hereSRSGoogle = "C:\\Program Files\\DCS-SimpleRadio-Standalone\\yourkey.json"
taskmanager:SetSRS({130,255},{radio.modulation.AM,radio.modulation.AM},hereSRSPath,"female","en-GB",hereSRSPort,"Microsoft Hazel Desktop",0.7,hereSRSGoogle)
-- Controller will announce itself under these broadcast frequencies, handy to use cold-start frequencies here of your aircraft
taskmanager:SetSRSBroadcast({127.5,305},{radio.modulation.AM,radio.modulation.AM})
-- Example: Manually add an AIRBASE as a target
taskmanager:AddTarget(AIRBASE:FindByName(AIRBASE.Caucasus.Senaki_Kolkhi))
-- Example: Manually add a COORDINATE as a target
taskmanager:AddTarget(GROUP:FindByName("Scout Coordinate"):GetCoordinate())
-- Set a whitelist for tasks, e.g. skip SEAD tasks
taskmanager:SetTaskWhiteList({AUFTRAG.Type.CAS, AUFTRAG.Type.BAI, AUFTRAG.Type.BOMBING, AUFTRAG.Type.BOMBRUNWAY})
-- Set target radius
taskmanager:SetTargetRadius(1000)
6 Localization
Localization for English and German texts are build-in. Default setting is English. Change with PLAYERTASKCONTROLLER.SetLocale()
6.1 Adding Localization
A list of fields to be defined follows below. Note that in some cases string.format()
is used to format texts for screen and SRS.
Hence, the %d
, %s
and %f
special characters need to appear in the exact same amount and order of appearance in the localized text or it will create errors.
To add a localization, the following texts need to be translated and set in your mission script before PLAYERTASKCONTROLLER.New():
PLAYERTASKCONTROLLER.Messages = {
EN = {
TASKABORT = "Task aborted!",
NOACTIVETASK = "No active task!",
FREQUENCIES = "frequencies ",
FREQUENCY = "frequency %.3f",
BROADCAST = "%s, %s, switch to %s for task assignment!",
CASTTS = "close air support",
SEADTTS = "suppress air defense",
BOMBTTS = "bombing",
PRECBOMBTTS = "precision bombing",
BAITTS = "battle field air interdiction",
ANTISHIPTTS = "anti-ship",
INTERCEPTTS = "intercept",
BOMBRUNWAYTTS = "bomb runway",
HAVEACTIVETASK = "You already have one active task! Complete it first!",
PILOTJOINEDTASK = "%s, %s. You have been assigned %s task %03d",
TASKNAME = "%s Task ID %03d",
TASKNAMETTS = "%s Task ID %03d",
THREATHIGH = "high",
THREATMEDIUM = "medium",
THREATLOW = "low",
THREATTEXT = "%s\nThreat: %s\nTargets left: %d\nCoord: %s",
THREATTEXTTTS = "%s, %s. Target information for %s. Threat level %s. Targets left %d. Target location %s.",
MARKTASK = "%s, %s, copy, task %03d location marked on map!",
SMOKETASK = "%s, %s, copy, task %03d location smoked!",
FLARETASK = "%s, %s, copy, task %03d location illuminated!",
ABORTTASK = "All stations, %s, %s has aborted %s task %03d!",
UNKNOWN = "Unknown",
MENUTASKING = " Tasking ",
MENUACTIVE = "Active Task",
MENUINFO = "Info",
MENUMARK = "Mark on map",
MENUSMOKE = "Smoke",
MENUFLARE = "Flare",
MENUILLU = "Illuminate",
MENUABORT = "Abort",
MENUJOIN = "Join Task",
MENUTASKINFO = Task Info",
MENUTASKNO = "TaskNo",
MENUNOTASKS = "Currently no tasks available.",
TASKCANCELLED = "Task #%03d %s is cancelled!",
TASKCANCELLEDTTS = "%s, task %03d %s is cancelled!",
TASKSUCCESS = "Task #%03d %s completed successfully!",
TASKSUCCESSTTS = "%s, task %03d %s completed successfully!",
TASKFAILED = "Task #%03d %s was a failure!",
TASKFAILEDTTS = "%s, task %03d %s was a failure!",
TASKFAILEDREPLAN = "Task #%03d %s was a failure! Replanning!",
TASKFAILEDREPLANTTS = "%s, task %03d %s was a failure! Replanning!",
TASKADDED = "%s has a new task %s available!",
PILOTS = "\nPilot(s): ",
PILOTSTTS = ". Pilot(s): ",
YES = "Yes",
NO = "No",
NONE = "None",
POINTEROVERTARGET = "%s, %s, pointer in reach for task %03d, lasing!",
POINTERTARGETREPORT = "\nPointer in reach: %s\nLasing: %s",
RECCETARGETREPORT = "\nRecce %s in reach: %s\nLasing: %s",
POINTERTARGETLASINGTTS = ". Pointer in reach and lasing.",
TARGET = "Target",
FLASHON = "%s - Flashing directions is now ON!",
FLASHOFF = "%s - Flashing directions is now OFF!",
FLASHMENU = "Flash Directions Switch",
BRIEFING = "Briefing",
TARGETLOCATION ="Target location",
COORDINATE = "Coordinate",
INFANTRY = "Infantry",
TECHNICAL = "Technical",
ARTILLERY = "Artillery",
TANKS = "Tanks",
AIRDEFENSE = "Airdefense",
SAM = "SAM",
GROUP = "Group",
ELEVATION = "\nTarget Elevation: %s %s",
METER = "meter",
FEET = "feet",
},
e.g.
taskmanager.Messages = {
FR = {
TASKABORT = "Tâche abandonnée!",
NOACTIVETASK = "Aucune tâche active!",
FREQUENCIES = "fréquences ",
FREQUENCY = "fréquence %.3f",
BROADCAST = "%s, %s, passer au %s pour l'attribution des tâches!",
...
TASKADDED = "%s a créé une nouvelle tâche %s",
PILOTS = "\nPilote(s): ",
PILOTSTTS = ". Pilote(s): ",
},
and then taskmanager:SetLocale("fr")
after PLAYERTASKCONTROLLER.New() in your script.
If you just want to replace a single text block in the table, you can do this like so:
mycontroller.Messages.EN.NOACTIVETASK = "Choose a task first!"
mycontroller.Messages.FR.YES = "Oui"
7 Events
The class comes with a number of FSM-based events that missions designers can use to shape their mission. These are:
7.1 TaskAdded.
The event is triggered when a new task is added to the controller. Use PLAYERTASKCONTROLLER.OnAfterTaskAdded() to link into this event:
function taskmanager:OnAfterTaskAdded(From, Event, To, Task)
... your code here ...
end
7.2 TaskDone.
The event is triggered when a task has ended. Use PLAYERTASKCONTROLLER.OnAfterTaskDone() to link into this event:
function taskmanager:OnAfterTaskDone(From, Event, To, Task)
... your code here ...
end
7.3 TaskCancelled.
The event is triggered when a task was cancelled manually. Use PLAYERTASKCONTROLLER.OnAfterTaskCancelled()` to link into this event:
function taskmanager:OnAfterTaskCancelled(From, Event, To, Task)
... your code here ...
end
7.4 TaskSuccess.
The event is triggered when a task completed successfully. Use PLAYERTASKCONTROLLER.OnAfterTaskSuccess() to link into this event:
function taskmanager:OnAfterTaskSuccess(From, Event, To, Task)
... your code here ...
end
7.5 TaskFailed.
The event is triggered when a task failed, no repeats. Use PLAYERTASKCONTROLLER.OnAfterTaskFailed() to link into this event:
function taskmanager:OnAfterTaskFailed(From, Event, To, Task)
... your code here ...
end
7.6 TaskRepeatOnFailed.
The event is triggered when a task failed and is re-planned for execution. Use PLAYERTASKCONTROLLER.OnAfterRepeatOnFailed() to link into this event:
function taskmanager:OnAfterRepeatOnFailed(From, Event, To, Task)
... your code here ...
end
8 Using F10 map markers to create new targets
You can use F10 map markers to create new target points for player tasks.
Enable this option with e.g., setting the tag to be used to "TARGET":
taskmanager:EnableMarkerOps("TARGET")
Set a marker on the map and add the following text to create targets from it: "TARGET". This is effectively the same as adding a COORDINATE object as target. The marker can be deleted any time.
9 Discussion
If you have questions or suggestions, please visit the MOOSE Discord #ops-playertask channel.
Global _PlayerTaskNr |
Global PlayerTaskNr counter |
Global PlayerTaskNr counter
Type(s)
Fields and Methods inherited from PLAYERTASK | Description |
---|---|
[User] Add a client to this task |
|
[User] Add failure condition. |
|
[User] Add success condition. |
|
[USER] Add a free text description to this task. |
|
[USER] Add a free text description for TTS to this task. |
|
[USER] Add a task to be assigned to same clients when task was a failure. |
|
[USER] Add a task to be assigned to same clients when task was a success. |
|
PLAYERTASK:AddOpsZoneCaptureSuccessCondition(CaptureSquadGroupNamePrefix, Coalition) |
[USER] Adds task success condition for AUFTRAG.Type.CAPTUREZONE for OpsZone or OpsZone set target object. |
[USER] Adds task success condition for AUFTRAG.Type.RECON when a client is at a certain LOS distance from the target. |
|
[USER] Adds task success condition for dead STATIC, SET_STATIC, SCENERY or SET_SCENERY target object. |
|
[USER] Adds a time limit for the task to be completed. |
|
Name of the class. |
|
[User] Client has aborted task this task |
|
FiFo of Wrapper.Client#CLIENT planes executing this task |
|
[User] Count clients |
|
[User] Flare Target |
|
[User] Get #CLIENT objects assigned as table |
|
[User] Get client names assigned as table of #strings |
|
[User] Get the coalition side for this task |
|
[USER] Get the free text description from this task. |
|
[USER] Get the free text TTS description from this task. |
|
[USER] Get task sub type description from this task. |
|
[User] Get the Ops.Target#TARGET object for this task |
|
[User] Check if PLAYERTASK has clients assigned to it. |
|
[USER] Query if a task has free text description. |
|
[USER] Query if a task has free text TTS description. |
|
[User] Check if a player name is assigned to this task |
|
[User] Illuminate Target Area |
|
[User] Check if task is done |
|
[User] Create target mark on F10 map |
|
Constructor |
|
Constructor that automatically determines the task type based on the target. |
|
On After "Cancel" event. |
|
On After "ClientAborted" event. |
|
On After "ClientAdded" event. |
|
On After "ClientRemoved" event. |
|
On After "Done" event. |
|
On After "Executing" event. |
|
On After "Failed" event. |
|
On After "Planned" event. |
|
On After "Planned" event. |
|
On After "Requested" event. |
|
On After "Success" event. |
|
(Globally unique) Number of the task. |
|
[User] Remove a client from this task |
|
[User] Set a coalition side for this task |
|
[USER] Add a short free text description for the menu entry of this task. |
|
[USER] Set a task sub type description to this task. |
|
[User] Smoke Target |
|
The target for this Task |
|
The type of the task |
|
[Internal] Check OpsZone capture success condition. |
|
[Internal] Check if any of the given conditions is true. |
|
[Internal] Determines AUFTRAG type based on the target characteristics. |
|
[Internal] Add a PLAYERTASKCONTROLLER for this task |
|
Class id string for output to DCS log file. |
|
[Internal] On after cancel call |
|
[Internal] On after client added call |
|
[Internal] On after done call |
|
[Internal] On after executing call |
|
[Internal] On after failed call |
|
[Internal] On after planned call |
|
[Internal] On after progress call |
|
[Internal] On after requested call |
|
[Internal] On after status call |
|
[Internal] On after status call |
|
[Internal] On after success call |
|
Switch verbosity. |
|
PLAYERTASK class version. |
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. |
|
PLAYERTASK:AddScoreProcess(From, Event, State, ScoreText, Score) |
Adds a score for the FSM_PROCESS to be achieved. |
Add a new transition rule to the FSM. |
|
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. |
|
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. |
|
Check if FSM is in state. |
|
Fields and Methods inherited from PLAYERTASK.Condition | Description |
---|---|
Optional arguments passed to the condition callback function. |
|
Callback function to check for a condition. Should return a #boolean. |
Fields and Methods inherited from PLAYERTASKCONTROLLER | Description |
---|---|
[User] Add accept zone to INTEL detection. |
|
[User] Add accept SET_ZONE to INTEL detection. |
|
[User] Add agent group to INTEL detection. |
|
[User] Add agent SET_GROUP to INTEL detection. |
|
PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask, Silent, TaskFilter) |
[User] Add a PLAYERTASK object to the list of (open) tasks |
[User] Add reject zone to INTEL detection. |
|
[User] Add reject SET_ZONE to INTEL detection. |
|
[User] Add a target object to the target queue |
|
Flashing directions for players allowed |
|
[User] Manually cancel a specific task |
|
Name of the class. |
|
[User] Allow precision laser-guided bombing on statics and "high-value" ground units (MBT etc) with player units lasing. |
|
PLAYERTASKCONTROLLER:DisablePrecisionBombing(FlightGroup, LaserCode) |
[User] Disable precision laser-guided bombing on statics and "high-value" ground units (MBT etc) |
[User] Remove the SCORING object from this taskcontroller |
|
[User] Disable extra menu to show task detail information before joining |
|
[User] Allow precision laser-guided bombing on statics and "high-value" ground units (MBT etc) with player units lasing. |
|
[User] Allow addition of targets with user F10 map markers. |
|
PLAYERTASKCONTROLLER:EnablePrecisionBombing(FlightGroup, LaserCode, HoldingPoint, Alt, Speed) |
[User] Allow precision laser-guided bombing on statics and "high-value" ground units (MBT etc) |
[User] Set or create a SCORING object for this taskcontroller |
|
[User] Enable extra menu to show task detail information before joining |
|
List of player who switched Flashing Direction Info on |
|
PLAYERTASKCONTROLLER:New(Name, Coalition, Type, ClientFilter) |
Create and run a new TASKCONTROLLER instance. |
PLAYERTASKCONTROLLER:OnAfterPlayerAbortedTask(From, Event, To, Group, Client, Task) |
On After "PlayerAbortedTask" event. |
PLAYERTASKCONTROLLER:OnAfterPlayerJoinedTask(From, Event, To, Group, Client, Task) |
On After "PlayerJoinedTask" event. |
PLAYERTASKCONTROLLER:OnAfterTaskAdded(From, Event, To, Task) |
On After "TaskAdded" event. |
PLAYERTASKCONTROLLER:OnAfterTaskCancelled(From, Event, To, Task) |
On After "TaskCancelled" event. |
On After "TaskDone" event. |
|
PLAYERTASKCONTROLLER:OnAfterTaskFailed(From, Event, To, Task) |
On After "TaskFailed" event. |
PLAYERTASKCONTROLLER:OnAfterTaskProgress(From, Event, To, Task, TargetCount) |
On After "TaskProgress" event. |
PLAYERTASKCONTROLLER:OnAfterTaskRepeatOnFailed(From, Event, To, Task) |
On After "TaskRepeatOnFailed" event. |
PLAYERTASKCONTROLLER:OnAfterTaskSuccess(From, Event, To, Task) |
On After "TaskSuccess" event. |
PLAYERTASKCONTROLLER:OnAfterTaskTargetFlared(From, Event, To, Task) |
On After "TaskTargetFlared" event. |
PLAYERTASKCONTROLLER:OnAfterTaskTargetIlluminated(From, Event, To, Task) |
On After "TaskTargetIlluminated" event. |
PLAYERTASKCONTROLLER:OnAfterTaskTargetSmoked(From, Event, To, Task) |
On After "TaskTargetSmoked" event. |
[User] Remove accept zone from INTEL detection. |
|
[User] Remove reject zone from INTEL detection. |
|
[User] Set flash directions option for player (player based info) |
|
PLAYERTASKCONTROLLER:SetCallSignOptions(ShortCallsign, Keepnumber, CallsignTranslations) |
[User] Set callsign options for TTS output. |
[User] Set the cluster radius if you want to use target clusters rather than single group detection. |
|
[User] Do not show menu entries to illuminate targets. |
|
[User] Do not show menu entries to smoke or flare targets |
|
[User] Do not show target menu entries of type names for GROUND targets |
|
[User] Show menu entries to illuminate targets. |
|
[User] Show menu entries to smoke or flare targets (on by default!) |
|
[User] Show target menu entries of type names for GROUND targets (off by default!), e.g. |
|
[User] Show info text on screen with a coordinate info in any case (OFF by default) |
|
[User] Set locale for localization. |
|
[User] Allow F10 markers to be deleted by pilots. |
|
[User] Forbid F10 markers to be deleted by pilots. |
|
[User] Set the top menu name to a custom string. |
|
PLAYERTASKCONTROLLER:SetMenuOptions(InfoMenu, ItemLimit, HoldTime) |
[User] Set menu build fine-tuning options |
[User] Set the top menu to be a sub-menu of another MENU entry. |
|
[User] Change the list of attributes, which are considered on GROUP or SET_GROUP level of a target to create SEAD player tasks. |
|
[User] Set SRS TTS details - see Sound.SRS for details. |
|
[User] Set SRS Broadcast - for the announcement to joining players which SRS frequency, modulation to use. |
|
[User] Set target radius. |
|
[User] Set up a (negative) blacklist of forbidden task types. |
|
[User] Set repetition options for tasks |
|
[User] Set up a (positive) whitelist of allowed task types. |
|
[User] For SRS - Switch to only transmit if there are players on the server. |
|
[User] Set up INTEL detection |
|
Also show magnetic angles |
|
[User] Switch screen output. |
|
[User] Set up detection of STATIC objects. |
|
[User] Switch showing additional magnetic angles |
|
[User] Switch usage of target names for menu entries on or off |
|
[Internal] Abort Task |
|
[Internal] Show active task info |
|
[Internal] Add a task to the task queue |
|
[Internal] Check task queue for a specific player name |
|
[Internal] Check precision task queue |
|
[Internal] Check target queue |
|
[Internal] Check task queue |
|
[Internal] Check for allowed task type, if there is a (positive) whitelist |
|
[Internal] Check for allowed task type, if there is a (negative) blacklist |
|
[Internal] _CreateActiveTaskMenuTemplate |
|
[Internal] _CreateJoinMenuTemplate |
|
[Internal] Event handling |
|
[Internal] Flare task location |
|
[Internal] Flashing directional info for a client |
|
[Internal] Get task types for the menu |
|
[Internal] Get player name |
|
[Internal] Get task per type for the menu |
|
[Internal] Get text for text-to-speech. |
|
[Internal] Illuminate task location |
|
[Internal] Init localization |
|
[Internal] Function the check against SeadAttributes |
|
[Internal] Join a player to a task |
|
[Internal] Mark task on F10 map |
|
PLAYERTASKCONTROLLER:_RemoveMenuEntriesForTask(Task, Client) |
[Internal] _RemoveMenuEntriesForTask |
[Internal] Send message to SET_CLIENT of players |
|
[Internal] Smoke task location |
|
[Internal] Switch flashing info for a client |
|
PLAYERTASKCONTROLLER:_SwitchMenuForClient(Client, MenuType, Delay) |
[Internal] _SwitchMenuForClient |
Class id string for output to DCS log file. |
|
[Internal] On after start call |
|
[Internal] On after Status call |
|
[Internal] On after Stop call |
|
PLAYERTASKCONTROLLER:onafterTaskAdded(From, Event, To, Task) |
[Internal] On after task added |
PLAYERTASKCONTROLLER:onafterTaskCancelled(From, Event, To, Task) |
[Internal] On after task cancelled |
[Internal] On after task done |
|
PLAYERTASKCONTROLLER:onafterTaskFailed(From, Event, To, Task) |
[Internal] On after task failed |
PLAYERTASKCONTROLLER:onafterTaskRepeatOnFailed(From, Event, To, Task) |
[Internal] On after task failed, repeat planned |
PLAYERTASKCONTROLLER:onafterTaskSuccess(From, Event, To, Task) |
[Internal] On after task success |
Switch verbosity. |
|
PLAYERTASK class version. |
Fields and Methods inherited from FSM | Description |
---|---|
Adds an End state. |
|
PLAYERTASKCONTROLLER:AddProcess(From, Event, Process, ReturnEvents) |
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task. |
Adds a score for the FSM to be achieved. |
|
PLAYERTASKCONTROLLER:AddScoreProcess(From, Event, State, ScoreText, Score) |
Adds a score for the FSM_PROCESS to be achieved. |
Add a new transition rule to the FSM. |
|
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. |
|
Sets the start state of the FSM. |
|
Add to map. |
|
PLAYERTASKCONTROLLER:_call_handler(step, trigger, params, EventName) |
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. |
|
Check if FSM is in state. |
|
Fields and Methods inherited from SeadAttributes | Description |
---|---|
GROUP.Attribute.GROUND_AAA |
|
GROUP.Attribute.GROUND_EWR |
|
GROUP.Attribute.GROUND_SAM |
Fields and Methods inherited from Type | Description |
---|---|
Air-to-Air Controller |
|
Air-to-Ground Controller |
|
Air-to-Ground-and-Ship Controller |
|
Air-to-Ship Controller |
PLAYERTASK class.
Field(s)
Name of the class.
(Globally unique) Number of the task.
Class id string for output to DCS log file.
Switch verbosity.
PLAYERTASK class version.
Function(s)
[User] Add a client to this task
[User] Add failure condition.
Defined in:
PLAYERTASK
Parameters:
#function ConditionFunction
If this function returns true
, the task is cancelled.
...
Condition function arguments if any.
Return value:
self
[User] Add success condition.
Defined in:
PLAYERTASK
Parameters:
#function ConditionFunction
If this function returns true
, the mission is cancelled.
...
Condition function arguments if any.
Return value:
self
[USER] Add a free text description to this task.
[USER] Add a free text description for TTS to this task.
[USER] Add a task to be assigned to same clients when task was a failure.
[USER] Add a task to be assigned to same clients when task was a success.
[USER] Adds task success condition for AUFTRAG.Type.CAPTUREZONE for OpsZone or OpsZone set target object.
- At least one of the task clients and one capture group need to be inside the zone in order for the capture to be successful.
Defined in:
PLAYERTASK
Parameters:
#SET_BASE CaptureSquadGroupNamePrefix
The prefix of the group name that needs to capture the zone.
#number Coalition
The coalition that needs to capture the zone.
Return value:
self
Usage:
-- We can use either STATIC, SET_STATIC, SCENERY or SET_SCENERY as target objects.
local opsZone = OPSZONE:New(zone, coalition.side.RED)
...
-- We can use either OPSZONE or SET_OPSZONE.
local mytask = PLAYERTASK:NewFromTarget(opsZone, true, 50, "Capture the zone")
mytask:SetMenuName("Capture the ops zone")
mytask:AddFreetext("Transport capture squad to the ops zone.")
-- We set CaptureSquadGroupNamePrefix the group name prefix as set in the ME or the spawn of the group that need to be present at the OpsZone like a capture squad,
-- and set the capturing Coalition in order to trigger a successful task.
mytask:AddOpsZoneCaptureSuccessCondition("capture-squad", coalition.side.BLUE)
playerTaskManager:AddPlayerTaskToQueue(mytask)
[USER] Adds task success condition for AUFTRAG.Type.RECON when a client is at a certain LOS distance from the target.
Defined in:
PLAYERTASK
Parameter:
#number MinDistance
(Optional) Minimum distance in meters from client to target in LOS for success condition. (Default 5 NM)
Return value:
self
Usage:
-- target can be any object that has a `GetCoordinate()` function like STATIC, GROUP, ZONE...
local mytask = PLAYERTASK:New(AUFTRAG.Type.RECON, ZONE:New("WF Zone"), true, 50, "Deep Earth")
mytask:SetMenuName("Recon weapon factory")
mytask:AddFreetext("Locate and investigate underground weapons factory near Kovdor.")
-- We set the MinDistance (optional) in meters for the client to be in LOS from the target in order to trigger a successful task.
mytask:AddReconSuccessCondition(10000) -- 10 km (default is 5 NM if not set)
playerTaskManager:AddPlayerTaskToQueue(mytask)
[USER] Adds task success condition for dead STATIC, SET_STATIC, SCENERY or SET_SCENERY target object.
Defined in:
PLAYERTASK
Return value:
self
Usage:
-- We can use either STATIC, SET_STATIC, SCENERY or SET_SCENERY as target objects.
local mytask = PLAYERTASK:NewFromTarget(static, true, 50, "Destroy the target")
mytask:SetMenuName("Destroy Power Plant")
mytask:AddFreetext("Locate and destroy the power plant near Olenya.")
mytask:AddStaticObjectSuccessCondition()
playerTaskManager:AddPlayerTaskToQueue(mytask)
[USER] Adds a time limit for the task to be completed.
Defined in:
PLAYERTASK
Parameter:
#number TimeLimit
Time limit in seconds for the task to be completed. (Default 0 = no time limit)
Return value:
self
Usage:
local mytask = PLAYERTASK:New(AUFTRAG.Type.RECON, ZONE:New("WF Zone"), true, 50, "Deep Earth")
mytask:SetMenuName("Recon weapon factory")
mytask:AddFreetext("Locate and investigate underground weapons factory near Kovdor.")
mytask:AddReconSuccessCondition(10000) -- 10 km
-- We set the TimeLimit to 10 minutes (600 seconds) from the moment the task is started, once the time has passed and the task is not yet successful it will trigger a failure.
mytask:AddTimeLimitFailureCondition(600)
playerTaskManager:AddPlayerTaskToQueue(mytask)
[User] Client has aborted task this task
[User] Count clients
Defined in:
PLAYERTASK
Return value:
#number:
clientcount
[User] Flare Target
Defined in:
PLAYERTASK
Parameter:
#number Color
defaults to FLARECOLOR.Red
Return value:
self
[User] Get #CLIENT objects assigned as table
Defined in:
PLAYERTASK
Return values:
#table:
clients
#number:
clientcount
[User] Get client names assigned as table of #strings
Defined in:
PLAYERTASK
Return values:
#table:
clients
#number:
clientcount
[User] Get the coalition side for this task
Defined in:
PLAYERTASK
Return value:
#number:
Coalition Coaltion side, e.g. coalition.side.BLUE, or nil if not set
[USER] Get the free text description from this task.
Defined in:
PLAYERTASK
Return value:
#string:
Text
[USER] Get the free text TTS description from this task.
Defined in:
PLAYERTASK
Return value:
#string:
Text
[USER] Get task sub type description from this task.
Defined in:
PLAYERTASK
Return value:
#string:
Type or nil
[User] Get the Ops.Target#TARGET object for this task
[User] Check if PLAYERTASK has clients assigned to it.
Defined in:
PLAYERTASK
Return value:
#boolean:
hasclients
[USER] Query if a task has free text description.
[USER] Query if a task has free text TTS description.
[User] Check if a player name is assigned to this task
Defined in:
PLAYERTASK
Parameter:
#string Name
Return value:
#boolean:
HasName
[User] Illuminate Target Area
Defined in:
PLAYERTASK
Parameters:
#number Power
Power of illumination bomb in Candela. Default 1000 cd.
#number Height
Height above target used to release the bomb, default 150m.
Return value:
self
[User] Check if task is done
Defined in:
PLAYERTASK
Return value:
#boolean:
done
[User] Create target mark on F10 map
Defined in:
PLAYERTASK
Parameters:
#string Text
(optional) Text to show on the marker
#number Coalition
(optional) Coalition this marker is for. Default = All.
#boolean ReadOnly
(optional) Make target marker read-only. Default = false.
Return value:
self
Constructor
Defined in:
PLAYERTASK
Parameters:
Type of this task
Ops.Target#TARGET Target
Target for this task
#boolean Repeat
Repeat this task if true (default = false)
#number Times
Repeat on failure this many times if Repeat is true (default = 1)
#string TTSType
TTS friendly task type name
Return value:
self
Constructor that automatically determines the task type based on the target.
Defined in:
PLAYERTASK
Parameters:
Ops.Target#TARGET Target
Target for this task
#boolean Repeat
Repeat this task if true (default = false)
#number Times
Repeat on failure this many times if Repeat is true (default = 1)
#string TTSType
TTS friendly task type name
Return value:
self
On After "Cancel" event.
Task has been cancelled.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "ClientAborted" event.
A client has aborted the task.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "ClientAdded" event.
Client has been added to the task.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Client#CLIENT Client
On After "ClientRemoved" event.
Client has been removed from the task.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "Done" event.
Task is done.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "Executing" event.
Task is executed by the 1st client.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "Failed" event.
Task has been a failure.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "Planned" event.
Task has been planned.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "Planned" event.
Task has been planned.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "Requested" event.
Task has been Requested.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "Success" event.
Task has been a success.
Defined in:
PLAYERTASK
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
[User] Remove a client from this task
Defined in:
PLAYERTASK
Parameters:
Wrapper.Client#CLIENT Client
#string Name
Name of the client
Return value:
self
[User] Set a coalition side for this task
Defined in:
PLAYERTASK
Parameter:
#number Coalition
Coaltion side to add, e.g. coalition.side.BLUE
Return value:
self
[USER] Add a short free text description for the menu entry of this task.
[USER] Set a task sub type description to this task.
[User] Smoke Target
Defined in:
PLAYERTASK
Parameter:
#number Color
defaults to SMOKECOLOR.Red
Return value:
self
[Internal] Check OpsZone capture success condition.
Defined in:
PLAYERTASK
Parameters:
Ops.OpsZone#OPSZONE OpsZone
The OpsZone target object.
#string CaptureSquadGroupNamePrefix
The prefix of the group name that needs to capture the zone.
#number Coalition
The coalition that needs to capture the zone.
#boolean CheckClientInZone
Check if any of the clients are in zone.
Return value:
self
[Internal] Check if any of the given conditions is true.
Defined in:
PLAYERTASK
Parameter:
#table Conditions
Table of conditions.
Return value:
#boolean:
If true, at least one condition is true.
[Internal] Determines AUFTRAG type based on the target characteristics.
Defined in:
PLAYERTASK
Parameter:
Ops.Target#TARGET Target
Target for this task
Return value:
#string:
AUFTRAG.Type
[Internal] Add a PLAYERTASKCONTROLLER for this task
[Internal] On after cancel call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after client added call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] On after done call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after executing call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after failed call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after planned call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after progress call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
#number TargetCount
Return value:
self
[Internal] On after requested call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after status call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after status call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after success call
Defined in:
PLAYERTASK
Parameters:
#string From
#string Event
#string To
Return value:
self
Field(s)
Name of the class.
(Globally unique) Number of the task.
Class id string for output to DCS log file.
Switch verbosity.
PLAYERTASK class version.
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.
Generic task condition.
Field(s)
Optional arguments passed to the condition callback function.
Callback function to check for a condition. Should return a #boolean.
Function(s)
PLAYERTASKCONTROLLER class.
Field(s)
Flashing directions for players allowed
Name of the class.
List of player who switched Flashing Direction Info on
set up SRS
Also show magnetic angles
Class id string for output to DCS log file.
Switch verbosity.
PLAYERTASK class version.
Function(s)
[User] Add accept zone to INTEL detection.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Core.Zone#ZONE AcceptZone
Add a zone to the accept zone set.
Return value:
self
[User] Add accept SET_ZONE to INTEL detection.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Core.Set#SET_ZONE AcceptZoneSet
Add a SET_ZONE to the accept zone set.
Return value:
self
[User] Add agent group to INTEL detection.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Wrapper.Group#GROUP Recce
Group of agents. Can also be an Ops.OpsGroup#OPSGROUP object.
Return value:
self
[User] Add agent SET_GROUP to INTEL detection.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Core.Set#SET_GROUP RecceSet
SET_GROUP of agents.
Return value:
self
[User] Add a PLAYERTASK object to the list of (open) tasks
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Ops.PlayerTask#PLAYERTASK PlayerTask
#boolean Silent
If true, make no "has new task" announcement
#boolen TaskFilter
If true, apply the white/black-list task filters here, also
Return value:
self
Usage:
Example to create a PLAYERTASK of type CTLD and give Players 10 minutes to complete:
local newtask = PLAYERTASK:New(AUFTRAG.Type.CTLD,ZONE:Find("Unloading"),false,0,"Combat Transport")
newtask.Time0 = timer.getAbsTime() -- inject a timestamp for T0
newtask:AddFreetext("Transport crates to the drop zone and build a vehicle in the next 10 minutes!")
-- add a condition for failure - fail after 10 minutes
newtask:AddConditionFailure(
function()
local Time = timer.getAbsTime()
if Time - newtask.Time0 > 600 then
return true
end
return false
end
)
taskmanager:AddPlayerTaskToQueue(PlayerTask)
[User] Add reject zone to INTEL detection.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Core.Zone#ZONE RejectZone
Add a zone to the reject zone set.
Return value:
self
[User] Add reject SET_ZONE to INTEL detection.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Core.Set#SET_ZONE RejectZoneSet
Add a zone to the reject zone set.
Return value:
self
[User] Add a target object to the target queue
Defined in:
PLAYERTASKCONTROLLER
Parameter:
The target GROUP, SET_GROUP, UNIT, SET_UNIT, STATIC, SET_STATIC, AIRBASE, ZONE or COORDINATE.
Return value:
self
[User] Manually cancel a specific task
Defined in:
PLAYERTASKCONTROLLER
Parameter:
The task to be cancelled
Return value:
self
[User] Allow precision laser-guided bombing on statics and "high-value" ground units (MBT etc) with player units lasing.
[User] Disable precision laser-guided bombing on statics and "high-value" ground units (MBT etc)
Defined in:
PLAYERTASKCONTROLLER
Parameters:
FlightGroup
LaserCode
Return value:
self
[User] Remove the SCORING object from this taskcontroller
[User] Disable extra menu to show task detail information before joining
[User] Allow precision laser-guided bombing on statics and "high-value" ground units (MBT etc) with player units lasing.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
(Optional) The PLAYERRECCE object governing the lasing players.
Return value:
self
[User] Allow addition of targets with user F10 map markers.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#string Tag
(Optional) The tagname to use to identify commands, defaults to "TASK"
Return value:
self
Usage:
Enable the function like so:
mycontroller:EnableMarkerOps("TASK")
Then as a player in a client slot, you can add a map marker on the F10 map. Next edit the text
in the marker to make it identifiable, e.g
TASK Name=Tanks Sochi, Text=Destroy tank group located near Sochi!
Where **TASK** is the tag that tells the controller this mark is a target location (must).
**Name=** ended by a comma **,** tells the controller the supposed menu entry name (optional). No extra spaces! End with a comma!
**Text=** tells the controller the supposed free text task description (optional, only taken if **Name=** is present first). No extra spaces!
[User] Allow precision laser-guided bombing on statics and "high-value" ground units (MBT etc)
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Ops.FlightGroup#FLIGHTGROUP FlightGroup
The FlightGroup (e.g. drone) to be used for lasing (one unit in one group only). Can optionally be handed as Ops.ArmyGroup#ARMYGROUP - Note might not find an LOS spot or get lost on the way. Cannot island-hop.
#number LaserCode
The lasercode to be used. Defaults to 1688.
Core.Point#COORDINATE HoldingPoint
(Optional) Point where the drone should initially circle. If not set, defaults to BullsEye of the coalition.
#number Alt
(Optional) Altitude in feet. Only applies if using a FLIGHTGROUP object! Defaults to 10000.
#number Speed
(Optional) Speed in knots. Only applies if using a FLIGHTGROUP object! Defaults to 120.
Return value:
self
Usage:
-- Set up precision bombing, FlightGroup as lasing unit
local FlightGroup = FLIGHTGROUP:New("LasingUnit")
FlightGroup:Activate()
taskmanager:EnablePrecisionBombing(FlightGroup,1688)
-- Alternatively, set up precision bombing, ArmyGroup as lasing unit
local ArmyGroup = ARMYGROUP:New("LasingUnit")
ArmyGroup:SetDefaultROE(ENUMS.ROE.WeaponHold)
ArmyGroup:SetDefaultInvisible(true)
ArmyGroup:Activate()
taskmanager:EnablePrecisionBombing(ArmyGroup,1688)
[User] Set or create a SCORING object for this taskcontroller
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Functional.Scoring#SCORING Scoring
(optional) the Scoring object
Return value:
self
[User] Enable extra menu to show task detail information before joining
Create and run a new TASKCONTROLLER instance.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string Name
Name of this controller
#number Coalition
of this controller, e.g. coalition.side.BLUE
#string Type
Type of the tasks controlled, defaults to PLAYERTASKCONTROLLER.Type.A2G
#string ClientFilter
(optional) Additional prefix filter for the SET_CLIENT. Can be handed as Core.Set#SET_CLIENT also.
Return value:
self
On After "PlayerAbortedTask" event.
Player aborted a task.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Group#GROUP Group
The player group object
Wrapper.Client#CLIENT Client
The player client object
On After "PlayerJoinedTask" event.
Player joined a task.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Group#GROUP Group
The player group object
Wrapper.Client#CLIENT Client
The player client object
On After "TaskAdded" event.
Task has been added.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "TaskCancelled" event.
Task has been cancelled.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "TaskDone" event.
Task is done.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "TaskFailed" event.
Task has failed.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "TaskProgress" event.
Task target count has been reduced.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
The current Task.
#number TargetCount
Targets left over
On After "TaskRepeatOnFailed" event.
Task has failed and will be repeated.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "TaskSuccess" event.
Task has been a success.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "TaskTargetFlared" event.
Task flared.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "TaskTargetIlluminated" event.
Task illuminated.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
On After "TaskTargetSmoked" event.
Task smoked.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
[User] Remove accept zone from INTEL detection.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Core.Zone#ZONE AcceptZone
Add a zone to the accept zone set.
Return value:
self
[User] Remove reject zone from INTEL detection.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Core.Zone#ZONE RejectZone
Add a zone to the reject zone set.
Return value:
self
[User] Set flash directions option for player (player based info)
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#boolean OnOff
Set to true
to switch on and false
to switch off. Default is OFF.
Return value:
self
[User] Set callsign options for TTS output.
See Wrapper.Group#GROUP.GetCustomCallSign() on how to set customized callsigns.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#boolean ShortCallsign
If true, only call out the major flight number
#boolean Keepnumber
If true, keep the customized callsign in the #GROUP name for players as-is, no amendments or numbers.
#table CallsignTranslations
(optional) Table to translate between DCS standard callsigns and bespoke ones. Does not apply if using customized callsigns from playername or group name.
Return value:
self
[User] Set the cluster radius if you want to use target clusters rather than single group detection.
Note that for a controller type A2A target clustering is on by default. Also remember that the diameter of the resulting zone is double the radius.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#number Radius
Target cluster radius in kilometers. Default is 0.5km.
Return value:
self
[User] Do not show menu entries to illuminate targets.
[User] Do not show menu entries to smoke or flare targets
[User] Do not show target menu entries of type names for GROUND targets
[User] Show menu entries to illuminate targets.
Needs smoke/flare enabled.
[User] Show menu entries to smoke or flare targets (on by default!)
[User] Show target menu entries of type names for GROUND targets (off by default!), e.g.
"Tank Group..."
[User] Show info text on screen with a coordinate info in any case (OFF by default)
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#boolean OnOff
Switch on = true or off = false
#boolean LLDDM
Show LLDDM = true or LLDMS = false
Return value:
self
[User] Set locale for localization.
Defaults to "en"
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#string Locale
The locale to use
Return value:
self
[User] Allow F10 markers to be deleted by pilots.
Note: Marker will auto-delete when the undelying task is done.
[User] Forbid F10 markers to be deleted by pilots.
Note: Marker will auto-delete when the undelying task is done.
[User] Set the top menu name to a custom string.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#string Name
The name to use as the top menu designation.
Return value:
self
[User] Set menu build fine-tuning options
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#boolean InfoMenu
If true
this option will allow to show the Task Info-Menu also when a player has an active task.
Since the menu isn't refreshed if a player holds an active task, the info in there might be stale.
#number ItemLimit
Number of items per task type to show, default 5.
#number HoldTime
Minimum number of seconds between menu refreshes (called every 30 secs) if a player has no active task.
Return value:
self
[User] Set the top menu to be a sub-menu of another MENU entry.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Return value:
self
[User] Change the list of attributes, which are considered on GROUP or SET_GROUP level of a target to create SEAD player tasks.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#table Attributes
Table of attribute types considered to lead to a SEAD type player task.
Return value:
self
Usage:
Default attribute types are: GROUP.Attribute.GROUND_SAM, GROUP.Attribute.GROUND_AAA, and GROUP.Attribute.GROUND_EWR.
If you want to e.g. exclude AAA, so target groups with this attribute are assigned CAS or BAI tasks, and not SEAD, use this function as follows:
`mycontroller:SetSEADAttributes({GROUP.Attribute.GROUND_SAM, GROUP.Attribute.GROUND_EWR})`
[User] Set SRS TTS details - see Sound.SRS for details.SetSRS()
will try to use as many attributes configured with Sound.SRS#MSRS.LoadConfigFile() as possible.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#number Frequency
Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations!
#number Modulation
Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies!
#string PathToSRS
Defaults to "C:\Program Files\DCS-SimpleRadio-Standalone"
#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; if you use a config file for MSRS, hand in nil here.
#string AccessKey
(Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, hand in nil here.
Core.Point#COORDINATE Coordinate
Coordinate from which the controller radio is sending
Return value:
self
[User] Set SRS Broadcast - for the announcement to joining players which SRS frequency, modulation to use.
Use in case you want to set this differently to the standard SRS.
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#number Frequency
Frequency to be used. Can also be given as a table of multiple frequencies, e.g. 271 or {127,251}. There needs to be exactly the same number of modulations!
#number Modulation
Modulation to be used. Can also be given as a table of multiple modulations, e.g. radio.modulation.AM or {radio.modulation.FM,radio.modulation.AM}. There needs to be exactly the same number of frequencies!
Return value:
self
[User] Set target radius.
Determines the zone radius to distinguish CAS from BAI tasks and to find enemies if the TARGET object is a COORDINATE.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#number Radius
Radius to use in meters. Defaults to 500 meters.
Return value:
self
[User] Set up a (negative) blacklist of forbidden task types.
These types will not be generated.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#table BlackList
Table of task types that cannot be generated. Use to restrict available types.
Return value:
self
Usage:
Currently, the following task types will be generated, if detection has been set up:
A2A - AUFTRAG.Type.INTERCEPT
A2S - AUFTRAG.Type.ANTISHIP
A2G - AUFTRAG.Type.CAS, AUFTRAG.Type.BAI, AUFTRAG.Type.SEAD, AUFTRAG.Type.BOMBING, AUFTRAG.Type.PRECISIONBOMBING, AUFTRAG.Type.BOMBRUNWAY
A2GS - A2G + A2S
If you don't want SEAD tasks generated, use as follows where "mycontroller" is your PLAYERTASKCONTROLLER object:
`mycontroller:SetTaskBlackList({AUFTRAG.Type.SEAD})`
[User] Set repetition options for tasks
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#boolean OnOff
Set to true
to switch on and false
to switch off (defaults to true)
#number Repeats
Number of repeats (defaults to 5)
Return value:
self
Usage:
`taskmanager:SetTaskRepetition(true, 5)`
[User] Set up a (positive) whitelist of allowed task types.
Only these types will be generated.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#table WhiteList
Table of task types that can be generated. Use to restrict available types.
Return value:
self
Usage:
Currently, the following task types will be generated, if detection has been set up:
A2A - AUFTRAG.Type.INTERCEPT
A2S - AUFTRAG.Type.ANTISHIP
A2G - AUFTRAG.Type.CAS, AUFTRAG.Type.BAI, AUFTRAG.Type.SEAD, AUFTRAG.Type.BOMBING, AUFTRAG.Type.PRECISIONBOMBING, AUFTRAG.Type.BOMBRUNWAY
A2GS - A2G + A2S
If you don't want SEAD tasks generated, use as follows where "mycontroller" is your PLAYERTASKCONTROLLER object:
`mycontroller:SetTaskWhiteList({AUFTRAG.Type.CAS, AUFTRAG.Type.BAI, AUFTRAG.Type.BOMBING, AUFTRAG.Type.BOMBRUNWAY})`
[User] For SRS - Switch to only transmit if there are players on the server.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#boolean Switch
If true, only send SRS if there are alive Players.
Return value:
self
[User] Set up INTEL detection
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#string RecceName
This name will be used to build a detection group set. All groups with this string somewhere in their group name will be added as Recce.
Return value:
self
[User] Switch screen output.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#boolean OnOff
Switch screen output off (true) or on (false)
Return value:
self
[User] Set up detection of STATIC objects.
You need to set up detection with PLAYERTASKCONTROLLER.SetupIntel() before using this.
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#boolean OnOff
Set to true
for on and false
for off.
Return value:
self
[User] Switch showing additional magnetic angles
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#boolean OnOff
If true, set to on (default), if nil or false, set to off
Return value:
self
[User] Switch usage of target names for menu entries on or off
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#boolean OnOff
If true, set to on (default), if nil or false, set to off
Return value:
self
[Internal] Abort Task
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] Show active task info
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] Add a task to the task queue
[Internal] Check task queue for a specific player name
Defined in:
PLAYERTASKCONTROLLER
Parameter:
PlayerName
Return value:
#boolean:
outcome
[Internal] Check precision task queue
[Internal] Check target queue
[Internal] Check task queue
[Internal] Check for allowed task type, if there is a (positive) whitelist
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#string Type
Return value:
#boolean:
Outcome
[Internal] Check for allowed task type, if there is a (negative) blacklist
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#string Type
Return value:
#boolean:
Outcome
[Internal] _CreateActiveTaskMenuTemplate
[Internal] _CreateJoinMenuTemplate
[Internal] Event handling
[Internal] Flare task location
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] Flashing directional info for a client
[Internal] Get task types for the menu
Defined in:
PLAYERTASKCONTROLLER
Return value:
#table:
TaskTypes
[Internal] Get player name
Defined in:
PLAYERTASKCONTROLLER
Parameter:
Wrapper.Client#CLIENT Client
Return values:
#string:
playername
#string:
ttsplayername
[Internal] Get task per type for the menu
Defined in:
PLAYERTASKCONTROLLER
Return value:
#table:
TasksPerTypes
[Internal] Get text for text-to-speech.
Numbers are spaced out, e.g. "Heading 180" becomes "Heading 1 8 0 ".
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#string text
Original text.
Return value:
#string:
Spoken text.
[Internal] Illuminate task location
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] Init localization
[Internal] Function the check against SeadAttributes
Defined in:
PLAYERTASKCONTROLLER
Parameter:
#string Attribute
Return value:
#boolean:
IsSead
[Internal] Join a player to a task
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#boolean Force
Assign task even if client already has one
Wrapper.Group#GROUP Group
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] Mark task on F10 map
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] _RemoveMenuEntriesForTask
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#PLAYERTASK Task
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] Send message to SET_CLIENT of players
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string Text
the text to be send
#number Seconds
(optional) Seconds to show, default 10
Return value:
self
[Internal] Smoke task location
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] Switch flashing info for a client
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Client#CLIENT Client
Return value:
self
[Internal] _SwitchMenuForClient
Defined in:
PLAYERTASKCONTROLLER
Parameters:
Wrapper.Client#CLIENT Client
The client
#string MenuType
#number Delay
Return value:
self
TODO - New Menu Manager - [Internal] _UpdateJoinMenuTemplate @param #PLAYERTASKCONTROLLER self @return #PLAYERTASKCONTROLLER self
Defined in:
PLAYERTASKCONTROLLER
[Internal] On after start call
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after Status call
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after Stop call
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after task added
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after task cancelled
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after task done
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after task failed
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after task failed, repeat planned
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
[Internal] On after task success
Defined in:
PLAYERTASKCONTROLLER
Parameters:
#string From
#string Event
#string To
Return value:
self
Field(s)
Flashing directions for players allowed
Name of the class.
List of player who switched Flashing Direction Info on
set up SRS
Also show magnetic angles
Class id string for output to DCS log file.
Switch verbosity.
PLAYERTASK class version.
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)
GROUP.Attribute.GROUND_AAA
GROUP.Attribute.GROUND_EWR
GROUP.Attribute.GROUND_SAM