Arma 3 Scripting

BIS_fnc_taskHandler

  • Arma 3 v0.50
  • First in Arma 2 v1.00

Function · Markdown · JSON · original wiki page

Description

Task handler: automatically sets a unit's current task. Whenever the unit receives a new task or a task is completed, the uncompleted task with the highest priority (lowest number) becomes current; among tasks of equal priority, the one with the nearest destination is chosen. The function is meant to be called by mission scripts; no Arma 3 script calls it. It must be called where the unit is local:

Important

This is legacy Arma 2 code: it only handles tasks created through the Arma 2 Multiplayer Framework (stored in BIS_missionScope) and sets the current task through the framework function RE, which is not part of Arma 3's Functions Library. For Arma 3 tasks see Arma 3: Task Framework.

Syntax

[unit, taskPriorities] call BIS_fnc_taskHandler

Parameters:

Returns: Nothing

Examples

Example 1

[
    BIS_cooper,
    [
        ["objShaftoe", 1],
        ["objEscortLagushina", 1],
        ["objRescueCrew", 2],
        ["objGorka", 3],
        ["objFindBase", 4]
    ]
] call BIS_fnc_taskHandler;

Example 2

Stop the handler for a unit:

BIS_cooper setVariable ["BIS_taskHandler_stop", true];

See also

currentTask · setCurrentTask · simpleTasks · Arma 3: Task Framework