#include "..\script_component.hpp" /* * Author: IDSolutions * Assigns an AI unit to a task as a hvt * * Arguments: * 0: The AI unit * 1: ID of the task * * Return Value: * None * * Example: * [this, "task_name"] spawn forge_server_task_fnc_makeHVT; * * Public: Yes */ params [["_entity", objNull, [objNull, grpNull]], ["_taskID", "", [""]]]; if (isNull _entity) exitWith { ["ERROR", "Attempt to create entity from null object"] call EFUNC(common,log); }; if (_taskID == "") exitWith { ["ERROR", "No task ID provided for entity"] call EFUNC(common,log); }; ["INFO", format ["Make HVT: %1", _this]] call EFUNC(common,log); SETVAR(_entity,assignedTask,_taskID); GVAR(TaskStore) call ["registerTaskEntity", ["hvts", _taskID, _entity]]; if (alive _entity) then { [_entity, "hvt"] spawn FUNC(heartBeat); };