{"name":"BIS_fnc_setTask","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"taskId","type":null,"optional":false,"default":null,"description":"String - Task ID\n\nArray -  In the format of [task ID, parent task ID]","types":[],"since":null,"text":"**taskId**:\n\nString - Task ID\n\nArray -  In the format of [task ID, parent task ID]"},{"name":"target","type":null,"optional":false,"default":null,"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","types":[],"since":null,"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","type":null,"optional":false,"default":null,"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","types":[],"since":null,"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)","type":"Task destination","optional":false,"default":null,"description":"(Optional): Task destination\n\nObject\n\nArray - either position in format [x,y,z], or [object,precision] as used by setSimpleTaskTarget command","types":[],"since":null,"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)","type":"Task state","optional":false,"default":null,"description":"(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","types":[],"since":null,"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 (Optional)","type":"Number","optional":false,"default":null,"description":"priority. When a current task is completed, system select a next one with the larges priority >= 0","types":["Number"],"since":null,"text":"**priority** (Optional): Number - priority. When a current task is completed, system select a next one with the larges priority >= 0"},{"name":"showNotification (Optional)","type":"Boolean","optional":false,"default":null,"description":"true to show notification (default), false to disable it","types":["Boolean"],"since":null,"text":"**showNotification** (Optional): Boolean - true to show notification (default), false to disable it"},{"name":"isGlobal (Optional)","type":"Boolean","optional":false,"default":null,"description":"true to set task globally (default), false to set it only locally","types":["Boolean"],"since":null,"text":"**isGlobal** (Optional): Boolean - true to set task globally (default), false to set it only locally"},{"name":"type (Optional)","type":"String","optional":false,"default":null,"description":"task type from CfgTaskTypes, if not defined, type \"\" is being used","types":["String"],"since":null,"text":"**type** (Optional): String - task type from CfgTaskTypes, if not defined, type \"\" is being used"},{"name":"visibleIn3D (Optional)","type":"Boolean","optional":false,"default":null,"description":"true to make task always visible in 3D (default: false)","types":["Boolean"],"since":null,"text":"**visibleIn3D** (Optional): Boolean - true to make task always visible in 3D (default: false)"}],"returns":{"type":"String","types":["String"],"description":"task ID","text":"String - task ID"}}],"examples":[{"text":"```sqf\n[\"Task_01\", true, [\"Protect the respawn point.\",\"Respawn Point West\",\"respawn_west\"], [MHQ,false], \"ASSIGNED\", 5, true, true, \"Defend\", true] call BIS_fnc_setTask;\n```","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;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Arma 3: Task Framework"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Tasks","Functions","Functions: Global Effect","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}