Welcome, Guest Wednesday 16th April 2014, 05:57:31
   Home   Help Search Login Register  


Author Topic: Task_manager function  (Read 252 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline


« on: 22 Jul 2009, 21:57:27 »

Ifind a interesting function called BIS_fnc_taskManager. This function automatically sets tasks as current. You only set priorities for your tasks (lower number means higher priority). It also randomize the selection of tasks with the same priority. But i can't get it to work. Has anybody an idea how we/I can get it to work? Is this only for MP?  Don't Know

You can find this function under ArmA 2\AddOns\modules\Functions\misc\fn_taskHandler

 * version: 1.0
 * name: Task handler
 * description: automatically sets tasks as current
 * author: Chose
 * paramaters: _this select 0: a unit whose tasks will be handled (Array)
  _this select 1: links to tasks created via MP Framwork with
  priorities (loewr number means higher
 * return value: none

 * TODO: * generalize so it can be used in WF
  * add support for standard tasks
  * randomize the selection of tasks with the same priority

["objShaftoe",    1],
["objGorka", 3],
["objNikolayev", 5],
["objLagushina",    5],
["objSmugglers",    5],
["objFindBase",    4],
["objSentries",    3],
["objLeader", 3],
["objDestroyBase", 3],
["objEscortLagushina", 1],
["objRescueCrew",    2],
["objSafehouse",    3],
["objMaksim",    6],
["objEvidence",    7]
] call BIS_fnc_taskManager

//validity checks
if (typeName (_this select 0) != "OBJECT") exitWith {debugLog format ["Error: taskHandler.sqf :: 1st parsed variable is %1 must be OBJECT!!!", typeName (_this select 0)]};
if (typeName (_this select 1) != "ARRAY") exitWith {debugLog format ["Error: taskHandler.sqf :: 2nd parsed variable is %1 must be ARRAY!!!", typeName (_this select 1)]};
if ({typeName (_x select 0) != "STRING"} count (_this select 1) > 0) exitWith {debugLog "Error: taskHandler.sqf :: All of the task links must be STRING!!!"};
if ({typeName (_x select 1) != "SCALAR"} count (_this select 1) > 0) exitWith {debugLog "Error: taskHandler.sqf :: All of the task priorities must be SCALAR!!!"};

//execute the FSM
BIS_taskHandler = _this execFSM "ca\modules\functions\misc\fn_taskHandler.fsm"

Assault Mission Strudio<br />It\'s always something!!
Editors Depot
Offline Offline

Suum cuique

« Reply #1 on: 23 Jul 2009, 13:59:14 »

Uhm, why did you uncomment the example?  Huh?

Anyway, the function "BIS_fnc_taskHandler" appears several times in the campaign (it's called from "C1_IntoTheStorm.Chernarus\grpMain.fsm" for example). So it might be worth to take a look at this file and see how the function is used.

try { return true; } finally { return false; }
Pages: [1]   Go Up
  Send this topicPrint  
Jump to: