Task Framework Tutorial – Arma 3
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Fix <br /> / <br> replacement mistake) |
Lou Montana (talk | contribs) m (Text replacement - "Category:Arma 3: Editing" to "{{GameCategory|arma3|Editing}}") |
||
Line 159: | Line 159: | ||
[[Category:Scripting Topics]] | [[Category:Scripting Topics]] | ||
{{GameCategory|arma3|Editing}} | |||
[[Category:Arma 3: Tutorials]] | [[Category:Arma 3: Tutorials]] |
Revision as of 18:14, 26 July 2020
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
private _title = "Get the documents"; private _description = "Enter the house to find the documents. Hurry, as the enemy is on its way."; private _waypoint = "House"; private _myTask = [groupOfPlayers, "taskID", [_description, _title, _waypoint], objDocuments, true] call BIS_fnc_taskCreate;
Assign a task
"taskID" call BIS_fnc_taskSetCurrent;
Set a task's type
["taskID", "attack"] call BIS_fnc_taskSetType;
Set a task's visibility
["taskID", true] call BIS_fnc_taskSetAlwaysVisible;
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
["taskID", [theOfficer, true]] call BIS_fnc_taskSetDestination;
Update a task's status
["taskID", "SUCCEEDED"] call BIS_fnc_taskSetState;
Delete a task
["taskID"] call BIS_fnc_deleteTask;
How to read a task's information
Find if a task exists
["taskID"] call BIS_fnc_taskExists;
Find if a task is completed
"taskID" call BIS_fnc_taskCompleted;
Get a task's status
"taskID" call BIS_fnc_taskState;
Get a task's type
"taskID" call BIS_fnc_taskType;
Get a task's visibility
"taskID" call BIS_fnc_taskAlwaysVisible;
Get a task's description
"taskID" call BIS_fnc_taskDescription;
Get a task's destination
"taskID" call BIS_fnc_taskDestination;
Get a unit's tasks
player call BIS_fnc_tasksUnit;
Advanced
Define a task in mission config
You can define a task in Description.ext's CfgTaskDescriptions:
class CfgTaskDescriptions
{
class myTask1
{
title = "myTaskTitle";
description = "myTaskDescription";
marker = "myTaskDestinationMarker";
};
class myTask2
{
title = $STR_myTask2Title;
description = $STR_myTask2Description;
marker = $STR_myTask2Marker;
};
};
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
};