- Updated fnc_extCall.sqf to suppress logging for specific functions. - Added object model prototypes for task instances in prototypes/taskObjectPrototypes.sqf. - Enhanced README.md to document the new object model and its purpose. - Modified XEH_postInit.sqf to improve event handling for defuse tasks. - Updated various task functions (fnc_attack, fnc_defend, fnc_defuse, fnc_delivery, fnc_destroy, fnc_heartBeat, fnc_hostage, fnc_hvt) to include task acceptance checks. - Improved fnc_makeHostage and fnc_makeIED to ensure proper task registration and state management. - Introduced new methods in task object prototypes for better state management and task flow control.
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: IDSolutions
|
|
* Assigns an IED to a task and starts its required countdown timer
|
|
*
|
|
* Arguments:
|
|
* 0: The object <OBJECT>
|
|
* 1: ID of the task <STRING>
|
|
* 2: Countdown timer in seconds <NUMBER> (must be greater than 0)
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [this, "task_name", 30] spawn forge_server_task_fnc_makeIED;
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params [["_entity", objNull, [objNull]], ["_taskID", "", [""]], ["_time", 0, [0]]];
|
|
|
|
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); };
|
|
if (_time <= 0) exitWith { ["ERROR", "Invalid time provided for IED"] call EFUNC(common,log); };
|
|
|
|
["INFO", format ["Make IED: %1", _this]] call EFUNC(common,log);
|
|
|
|
SETPVAR(_entity,assignedTask,_taskID);
|
|
GVAR(TaskStore) call ["registerTaskEntity", ["ieds", _taskID, _entity]];
|
|
|
|
if (alive _entity) then { [_entity, "ied", _time] spawn FUNC(heartBeat); };
|