Task Tutorial – Arma 2

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Add bigger A3 warning about task overhaul, add locality information)
Line 1: Line 1:
== Important Information ==
{{Feature arma3|In Arma 3 version 1.58 task system was greatly enhanced. To name few improvements:
In Arma 3 version 1.58 task system was greatly enhanced. To name few improvements:
* improved 2D & 3D visualization
* improved 2D & 3D visualization
* improved UX (user experience)
* improved UX (user experience)
* new features - e.g. shared objectives, task overview, always visible tasks, task types, ...
* new features - e.g. shared objectives, task overview, always visible tasks, task types, ...


Check [[Arma 3 Tasks Overhaul]] page for more information.
Check [[Arma 3 Tasks Overhaul]] page for more information.}}
 
<div style="float: right;">__TOC__</div>


== Description ==
== Description ==
Tasks were introduced in [[ArmA 2]]. They replaced the old objective system used in [[Armed Assault]] and [[Operation Flashpoint]].
Tasks were introduced in [[ArmA 2]] and improved in [[Arma 3 Tasks Overhaul|Arma 3]]. They replaced the [[Briefing.html|old objective system]] used in [[Armed Assault]] and [[Operation Flashpoint]].


== Basics ==
== Basics ==
=== Creation ===
=== Creation ===
Tasks can be created at any time from anywhere (trigger, script, etc). They do not need to be created in a file called "briefing.sqf".
Tasks can be created at any time from anywhere (trigger, script, etc). They do not need to be created in a file called "briefing.sqf".
=== Hiding ===
=== Hiding ===
As opposite to the old method of showing and hiding objectives, tasks are instead created "on the fly" as they are required.
As opposite to the old method of showing and hiding objectives, tasks are instead created "on the fly" as they are required.
=== State ===
=== State ===
Task state is in [[String]] format.
Task state is in [[String]] format.
Line 23: Line 27:
* "Failed"
* "Failed"
* "Succeeded"
* "Succeeded"
=== Icon / Color ===
=== Icon / Color ===
'''Arma 2'''
'''Arma 2'''
Line 31: Line 36:
* Failed: red X
* Failed: red X
* Succeeded: green
* Succeeded: green


== Good To Know ==
== Good To Know ==
=== Creation ===
=== Creation ===
Tasks are unit ([[object]]) specific. They are created to a unit and not to a client (human player).
Tasks are unit ([[object]]) specific. They are created to a unit and not to a client (human player). The effect is local and should be executed on every client.
 


For example:
For example:
You start mission in a unit which is named "unit1". The briefing creates following task:
You start mission in a unit which is named "unit1". The briefing creates following task:
 
task1 = unit1 [[createSimpleTask]] ["taskName1"];
<code>task1 = unit1 [[createSimpleTask]] ["taskName1"]</code>


Now, if you [[teamSwitch]] to another unit, he will not have the task. This is common with the usual "task = player createsimpletask" type of creation as the task will only be created to the unit [[player]] is referring to.
Now, if you [[teamSwitch]] to another unit, he will not have the task. This is common with the usual "task = player createsimpletask" type of creation as the task will only be created to the unit [[player]] is referring to.
Line 50: Line 54:


== Examples ==
== Examples ==
=== Creation ===
=== Creation ===
==== Simplest ====
==== Simplest ====
<code>task1 = [[player]] [[createSimpleTask]] ["taskName1"];
task1 = [[player]] [[createSimpleTask]] ["taskName1"];
</code>
 
==== Common ====
==== Common ====
<code>task1 = [[player]] [[createSimpleTask]] ["taskName1"];
task1 = [[player]] [[createSimpleTask]] ["taskName1"];
task1 [[setSimpleTaskDescription]] ["To be successful in this example task you need to...","Example Task",""];
task1 [[setSimpleTaskDescription]] ["To be successful in this example task you need to...","Example Task",""];
</code>
 
==== Advanced ====
==== Advanced ====
<code>task1 = [[player]] [[createSimpleTask]] ["taskName1"];
task1 = [[player]] [[createSimpleTask]] ["taskName1"];
task1 [[setSimpleTaskDescription]] ["To be successful in this example task you need to...","Example Task",""];
task1 [[setSimpleTaskDescription]] ["To be successful in this example task you need to...","Example Task",""];
task1 [[setTaskState]] "Assigned";
task1 [[setTaskState]] "Assigned";
player [[setCurrentTask]] task1;
player [[setCurrentTask]] task1;
</code>
 
=== Update ===
=== Update ===
==== Simplest ====
==== Simplest ====
<code>task1 [[setTaskState]] "Succeeded";
task1 [[setTaskState]] "Succeeded";
</code>
 
==== Common ====
==== Common ====
<code>task1 [[setTaskState]] "Succeeded";
task1 [[setTaskState]] "Succeeded";
task2 [[setTaskState]] "Assigned";
task2 [[setTaskState]] "Assigned";
player [[setCurrentTask]] task2;
player [[setCurrentTask]] task2;
</code>
 
==== Advanced ====
==== Advanced ====
<code>task1 [[setTaskState]] "Succeeded";
task1 [[setTaskState]] "Succeeded";
task2 = [[player]] [[createSimpleTask]] ["taskName2"];
task2 = [[player]] [[createSimpleTask]] ["taskName2"];
task2 [[setSimpleTaskDescription]] ["Another task has been issued...","Another Example Task",""];
task2 [[setSimpleTaskDescription]] ["Another task has been issued...","Another Example Task",""];
task2 [[setTaskState]] "Assigned";
task2 [[setTaskState]] "Assigned";
player [[setCurrentTask]] task2;
player [[setCurrentTask]] task2;
</code>
 


== See also ==
== See also ==
[[briefing]]
[[briefing]], [[Arma 3 Tasks Overhaul]]


[[Category: Arma 2: Editing]]
[[Category: Arma 2: Editing]]

Revision as of 13:43, 12 April 2018

Arma 3
In Arma 3 version 1.58 task system was greatly enhanced. To name few improvements:
  • improved 2D & 3D visualization
  • improved UX (user experience)
  • new features - e.g. shared objectives, task overview, always visible tasks, task types, ...
Check Arma 3 Tasks Overhaul page for more information.

Description

Tasks were introduced in ArmA 2 and improved in Arma 3. They replaced the old objective system used in Armed Assault and Operation Flashpoint.

Basics

Creation

Tasks can be created at any time from anywhere (trigger, script, etc). They do not need to be created in a file called "briefing.sqf".

Hiding

As opposite to the old method of showing and hiding objectives, tasks are instead created "on the fly" as they are required.

State

Task state is in String format. The possible state of a task is one of these:

  • "Assigned"
  • "Canceled"
  • "Created"
  • "Failed"
  • "Succeeded"

Icon / Color

Arma 2

Task States
  • Assigned: gray
  • Canceled: one gray diagonal line
  • Created: black (empty)
  • Failed: red X
  • Succeeded: green


Good To Know

Creation

Tasks are unit (object) specific. They are created to a unit and not to a client (human player). The effect is local and should be executed on every client.

For example: You start mission in a unit which is named "unit1". The briefing creates following task:

task1 = unit1 createSimpleTask ["taskName1"];

Now, if you teamSwitch to another unit, he will not have the task. This is common with the usual "task = player createsimpletask" type of creation as the task will only be created to the unit player is referring to.

Return Variable / Handle

Command createSimpleTask returns a handle (variable which refers to the created task). Each task has a unique handle. Even using same line of code on different client will result in a different handle for the "same" task.


Examples

Creation

Simplest

task1 = player createSimpleTask ["taskName1"];

Common

task1 = player createSimpleTask ["taskName1"];
task1 setSimpleTaskDescription ["To be successful in this example task you need to...","Example Task",""];

Advanced

task1 = player createSimpleTask ["taskName1"];
task1 setSimpleTaskDescription ["To be successful in this example task you need to...","Example Task",""];
task1 setTaskState "Assigned";
player setCurrentTask task1;

Update

Simplest

task1 setTaskState "Succeeded";

Common

task1 setTaskState "Succeeded";
task2 setTaskState "Assigned";
player setCurrentTask task2;

Advanced

task1 setTaskState "Succeeded";
task2 = player createSimpleTask ["taskName2"];
task2 setSimpleTaskDescription ["Another task has been issued...","Another Example Task",""];
task2 setTaskState "Assigned";
player setCurrentTask task2;


See also

briefing, Arma 3 Tasks Overhaul