{"name":"BIS_fnc_basicTask","title":"BIS fnc basicTask","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_basicTask","revid":379544,"updated":"2026-10-31T13:40:20Z","groups":["Tasks"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","description":"> [!NOTE]\n> **Arma 3:** Internally used **.fsm**.\n\nCompiled FSM that creates a predefined task for the player or changes its state. The only defined task type is \"ATTACK\"; its task ID is \"ATTACK_\" followed by the given number.\n\n- If the task does not exist yet, it is created with BIS_fnc_taskCreate (title \"Attack *name*\", description \"Attack the location and neutralize all enemies.\").\n- If the task exists and its state is \"Assigned\" or \"Created\", its state is changed with BIS_fnc_taskSetState.\n\n> [!NOTE]\n> The state check is case-sensitive, while a task created as current is stored as \"ASSIGNED\"; such a task is therefore not updated by a second call.","syntaxes":[{"syntax":"[taskType, taskNumber, params] call BIS_fnc_basicTask","params":[{"name":"taskType","type":"String","description":"\"ATTACK\"; any other value logs an error","type_expr":"String"},{"name":"taskNumber","type":"Number","optional":true,"default":"0","description":"number appended to the task ID","type_expr":"Number","text":"taskNumber: Number - (Optional, default 0) number appended to the task ID"},{"name":"params","type":"Array","optional":true,"default":"`[]`","description":"when the task does not exist: [position, name, isCurrent]\n  - position: anything accepted by BIS_fnc_position - (Optional, default `markerPos \"BIS_attack\"`) task destination; none is set if the position is [0,0,0]\n  - name: String - (Optional, default \"the location\") name used in the task title\n  - isCurrent: Boolean - (Optional, default true) set the task as current\n- when the task exists: [state]\n  - state: String - (Optional, default \"succeeded\") new task state","type_expr":"Array","text":"params: Array - (Optional, default `[]`)\n\n- when the task does not exist: [position, name, isCurrent]\n  - position: anything accepted by BIS_fnc_position - (Optional, default `markerPos \"BIS_attack\"`) task destination; none is set if the position is [0,0,0]\n  - name: String - (Optional, default \"the location\") name used in the task title\n  - isCurrent: Boolean - (Optional, default true) set the task as current\n- when the task exists: [state]\n  - state: String - (Optional, default \"succeeded\") new task state"}],"returns":{"type":"Nothing","type_expr":"Nothing"}}],"examples":[{"code":["[\"ATTACK\", 1, [getMarkerPos \"target\", \"Agia Marina\"]] call BIS_fnc_basicTask; // creates task \"ATTACK_1\""]}],"see_also":["BIS_fnc_taskCreate","BIS_fnc_taskSetState","BIS_fnc_taskExists","BIS_fnc_taskState"]}