{"name":"BIS_fnc_setTask","title":"BIS fnc setTask","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_setTask","revid":352179,"updated":"2024-02-01T23:25:46Z","groups":["Tasks"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","locality":{"argument":"global","effect":"global"},"description":"Set task parameters.\n\nCreate the task when it doesn't exist.\n\n> [!NOTE]\n> See Arma 3: Task Framework for more information.","syntaxes":[{"syntax":"[taskId, target, description, (destination, state, priority, showNotification, isGlobal, type, visibleIn3D)] call BIS_fnc_setTask","params":[{"name":"taskId","description":"String - Task ID\n\nArray - In the format of [task ID, parent task ID]","type_expr":"String | Array","text":"**taskId**:\n\nString - Task ID\n\nArray - In the format of [task ID, parent task ID]"},{"name":"target","description":"Task owner(s)\n\nBoolean - true to set task of all playable units\n\nObject - set task of a specific object\n\nGroup - set tasks of all objects in the group\n\nSide - set tasks of all objects of the given side\n\nArray - collection of above types","type_expr":"Boolean | Object | Group | Side | Array","text":"**target**: Task owner(s)\n\nBoolean - true to set task of all playable units\n\nObject - set task of a specific object\n\nGroup - set tasks of all objects in the group\n\nSide - set tasks of all objects of the given side\n\nArray - collection of above types"},{"name":"description","description":"Array - Task description in the format [\"description\", \"title\", \"marker\"]\n\nString - CfgTaskDescriptions class name, if empty string is used then CfgTaskDescriptions is searched for a class matching the tasks TaskID","type_expr":"Array | String","text":"**description**:\n\nArray - Task description in the format [\"description\", \"title\", \"marker\"]\n\nString - CfgTaskDescriptions class name, if empty string is used then CfgTaskDescriptions is searched for a class matching the tasks TaskID"},{"name":"destination","optional":true,"description":"Task destination\n\nObject\n\nArray - either position in format [x,y,z], or [object,precision] as used by setSimpleTaskTarget command","type_expr":"Object | Array","text":"**destination** (Optional): Task destination\n\nObject\n\nArray - either position in format [x,y,z], or [object,precision] as used by setSimpleTaskTarget command"},{"name":"state","optional":true,"description":"Task state\n\nString - can be one of following:\n\n\"CREATED\"\n\n\"ASSIGNED\"\n\n\"AUTOASSIGNED\" (\"ASSIGNED\" when no task is assigned yet, otherwise \"CREATED\")\n\n\"SUCCEEDED\"\n\n\"FAILED\"\n\n\"CANCELED\"\n\nBoolean - true to set the task as current","type_expr":"String | Boolean","text":"**state** (Optional): Task state\n\nString - can be one of following:\n\n\"CREATED\"\n\n\"ASSIGNED\"\n\n\"AUTOASSIGNED\" (\"ASSIGNED\" when no task is assigned yet, otherwise \"CREATED\")\n\n\"SUCCEEDED\"\n\n\"FAILED\"\n\n\"CANCELED\"\n\nBoolean - true to set the task as current"},{"name":"priority","type":"Number","optional":true,"description":"priority. When a current task is completed, system select a next one with the larges priority >= 0","type_expr":"Number","text":"**priority** (Optional): Number - priority. When a current task is completed, system select a next one with the larges priority >= 0"},{"name":"showNotification","type":"Boolean","optional":true,"description":"true to show notification (default), false to disable it","type_expr":"Boolean","text":"**showNotification** (Optional): Boolean - true to show notification (default), false to disable it"},{"name":"isGlobal","type":"Boolean","optional":true,"description":"true to set task globally (default), false to set it only locally","type_expr":"Boolean","text":"**isGlobal** (Optional): Boolean - true to set task globally (default), false to set it only locally"},{"name":"type","type":"String","optional":true,"description":"task type from CfgTaskTypes, if not defined, type \"\" is being used","type_expr":"String","text":"**type** (Optional): String - task type from CfgTaskTypes, if not defined, type \"\" is being used"},{"name":"visibleIn3D","type":"Boolean","optional":true,"default":"false","description":"true to make task always visible in 3D","type_expr":"Boolean","text":"**visibleIn3D** (Optional): Boolean - true to make task always visible in 3D (default: false)"}],"returns":{"type":"String","type_expr":"String","description":"task ID"}}],"examples":[{"code":["[\"Task_01\", true, [\"Protect the respawn point.\",\"Respawn Point West\",\"respawn_west\"], [MHQ,false], \"ASSIGNED\", 5, true, true, \"Defend\", true] call BIS_fnc_setTask;"]}],"see_also":["Arma 3: Task Framework"]}