Task Framework Tutorial – Arma 3
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 21: | Line 21: | ||
</sqf> | </sqf> | ||
{{Feature | | {{Feature|informative|The '''"taskID"''' argument is the task's ID used for later references.<!-- | ||
--> This string gets defined here on creation and must be unique for each task.<!-- | --> This string gets defined here on creation and must be unique for each task.<!-- | ||
--> It should be kept short for network economy.}} | --> It should be kept short for network economy.}} | ||
Line 61: | Line 61: | ||
== How to Read a Task's Information == | == How to Read a Task's Information == | ||
=== Find if a | === Find if a Task Exists === | ||
<sqf>["taskID"] call BIS_fnc_taskExists;</sqf> | <sqf>["taskID"] call BIS_fnc_taskExists;</sqf> | ||
Line 68: | Line 68: | ||
<sqf>"taskID" call BIS_fnc_taskCompleted;</sqf> | <sqf>"taskID" call BIS_fnc_taskCompleted;</sqf> | ||
{{Feature | | {{Feature|informative|"Completed" means that the task is either "SUCCEEDED", "FAILED" or "CANCELED".}} | ||
==== Check if Multiple Tasks Are All Completed ==== | ==== Check if Multiple Tasks Are All Completed ==== | ||
Line 96: | Line 96: | ||
=== Get a Unit's Tasks === | === Get a Unit's Tasks === | ||
<sqf>player call BIS_fnc_tasksUnit;</sqf> | <sqf>private _taskIDs = player call BIS_fnc_tasksUnit;</sqf> | ||
== Advanced == | == Advanced == | ||
{{Feature | | {{Feature|informative|All these details can be found in the [[Description.ext#Tasks|Description.ext's Tasks chapter]].}} | ||
=== Define a Task in Mission Config === | === Define a Task in Mission Config === |
Revision as of 22:43, 13 March 2023
Basics
Tasks are a group's objectives. Arma 3 introduced the Arma 3: Task Framework to work with tasks with ease.
The Task Framework functions have a global effect.
How to Use a Task
Create a Task
Assign a Task
Set a Task's Type
Set a Task's Visibility
Update a Task's Description
_description = _description + "<br/><br/>UPDATE: an officer stole the documents; we got the GPS tracking, follow your HUD.";
["taskID", [_description, _title, _waypoint]] call BIS_fnc_taskSetDescription;
Update a Task's Waypoint Position
Update a Task's Status
Delete a Task
How to Read a Task's Information
Find if a Task Exists
Find if a Task is Completed
Check if Multiple Tasks Are All Completed
Get a Task's Status
Get a Task's Type
Get a Task's Visibility
Get a Task's Description
Get a Task's Destination
Get a Unit's Tasks
Advanced
Define a Task in Mission Config
You can define a task in Description.ext's CfgTaskDescriptions:
class CfgTaskDescriptions
{
class myTask1
{
title = "my task title";
description = "my task description";
marker = "my task destination marker";
};
class myTask2
{
title = "STR_myTask2Title"; // note the lack of $ sign here!
description = "STR_myTask2Description"; // without $, it translates for each client
marker = "STR_myTask2Marker"; // with $ everyone sees the server's language
};
};
Define a new Task Type
class CfgTaskTypes
{
class Attack
{
icon = "\A3\UI_F_MP_Mark\Data\Tasks\Types\Attack_ca.paa";
icon3D = "\A3\UI_F_MP_Mark\Data\Tasks\Types3D\Attack_ca.paa";
};
class Defend
{
icon = "\A3\UI_F_MP_Mark\Data\Tasks\Types\Defend_ca.paa";
icon3D = "\A3\UI_F_MP_Mark\Data\Tasks\Types3D\Defend_ca.paa";
};
};
Define Task Display Behaviour
class CfgTaskEnhancements
{
enable = 1; // 0: disable new task features (default), 1: enable new task features & add new task markers and task widgets into the map
3d = 1; // 0: do not use new 3D markers (default), 1: replace task waypoints with new 3D markers
3dDrawDist = 0; // 3d marker draw distance (default: 2000)
share = 1; // 0: do not count assigned players (default), 1: count how many players have the task assigned
propagate = 1; // 0: do not propagate (default), 1: propagate shared tasks to subordinates
};