Cryptdik 5 Posted April 18, 2017 I'm having trouble with using the setTaskState command. Setup: I have multiple task modules and a trigger associated with each. It should work so that when you activate the associated trigger it will make the task successful (or failed) and then activate the Assigned phase for the next task. The triggers have this in Onact to "activate" other triggers objectivetrigger setTriggerActivation ["WEST", "PRESENT", true]; So far I've been able to use this to directly sync these triggers to taskState modules, but I'm running into a wall when I use commands to create new units. If I have a piece of wreckage with this in the init: this addAction ["Search Wreckage", {task1 setTaskState "Succeeded"; objective2trigger setTriggerActivation ["WEST", "PRESENT", true}]; I haven't had success with this yet, what's wrong here? It seems to be the settaskstate command that doesn't do anything and prevents any further progression for the scripting commands. I have one idea of making a taskstate module but not syncing it to any triggers that activate it, but calling it with some kind of activation command, but I haven't found anything on this. Share this post Link to post Share on other sites
pierremgi 4897 Posted April 18, 2017 Conditional trigger2 with trigger1 in onact of trigger2: this && triggerActivated trigger1 Use task state modules for tasks modules. For script: _tsk1 = ["task1", true, ["your title here","task description here",""],nil, "ASSIGNED", 0, true, true,"",true] call BIS_fnc_setTask; waitUntil {something true}; [_tsk1,"Succeeded",true] call BIS_fnc_taskSetState; Good luck with tasks ids. That can be weird. Share this post Link to post Share on other sites
Cryptdik 5 Posted April 18, 2017 2 hours ago, pierremgi said: Conditional trigger2 with trigger1 in onact of trigger2: this && triggerActivated trigger1 Use task state modules for tasks modules. For script: _tsk1 = ["task1", true, ["your title here","task description here",""],nil, "ASSIGNED", 0, true, true,"",true] call BIS_fnc_setTask; waitUntil {something true}; [_tsk1,"Succeeded",true] call BIS_fnc_taskSetState; Good luck with tasks ids. That can be weird. Would I be able to call BIS_fnc_setTask in just a trigger? Also looking at factors like task locality to make it usable in Multiplayer. I have no idea how to even start on that. https://community.bistudio.com/wiki/Arma_3_Task_Framework https://community.bistudio.com/wiki/BIS_fnc_setTask Share this post Link to post Share on other sites
Cryptdik 5 Posted April 18, 2017 I think I've figured it out for the most part, I'm still having one issue. Trigger to create task OnAct: [EAST,["task1"],["taskdescription","taskname","taskmarker"],taskobject,0,0,1,0,true] call BIS_fnc_taskCreate; ["task1","attack"] call BIS_fnc_taskSetType; Trigger to Succeed/Fail task OnAct: _task = ["task1", "SUCCEEDED",true] spawn BIS_fnc_taskSetState; This functions but the only problem is the taskobject section. It DOES work and set the location of the task to the object, but it spits out the following error: '... ])}),[0]]; private _showNotification = |#|param [6,true,[true]]; private _taskType...' Error Type Number, expected Bool File A3\functions_f\Tasks\fn_taskCreate.sqf [BIS_fnc_taskCreate], line 60 What's the problem here and can it just be ignored since it seems to function fine? https://community.bistudio.com/wiki/BIS_fnc_taskCreate Share this post Link to post Share on other sites
Larrow 2822 Posted April 18, 2017 46 minutes ago, Cryptdik said: [EAST,["task1"],["taskdescription","taskname","taskmarker"],taskobject,0,0,1,0,true] call BIS_fnc_taskCreate; 46 minutes ago, Cryptdik said: |#|param [6,true,[true]]; 46 minutes ago, Cryptdik said: Error Type Number, expected Bool Change param 6 (1) to a bool (true). As for your original query about the task commands, the taskIDs used by the modules and task functions are not the same as a TASK as needed by the commands. If you need to use the commands you can get the associated task by using.. _task = [ "TASKID", player ] BIS_fnc_taskReal; _task setTaskState "Succeeded"; Although you are better of handling it all via modules and functions to save from any compatibility issues between the two systems. 1 Share this post Link to post Share on other sites
Cryptdik 5 Posted April 18, 2017 Ah, perfect. As for param 7 needing to be a taskID, where do I put the code you provided to find out the taskID? Wish there was a list of them somewhere but I found out "attack" works. Also there's another error somewhere but I'm not sure how to read the console location for it. So now it's: [EAST,["task1"],["taskdescription","taskname","taskmarker"],taskobject,0,0,true,attack,true] call BIS_fnc_taskCreate; Here's the error: '... }; private ["_text"]; File A3\functions_f\Tasks\fn_setTask.sqf [BIS_fnc_setTask], line 230 { _text = _txt |#|param [_forEachIndex,"",["",[]]]; if (ty...' Error Type Object, expected Array,String HA! After some experimentation, I figured it out. I have a working linear task system that creates new ones X seconds after succeeding the last. [WEST,["task1"],["Find Flight Recorder description","Find Flight Recorder"],helowreck1,true,1,true,"attack",true] call BIS_fnc_taskCreate; flightrecorder addAction ["Take Flight Recorder", {task1triggersucceed setTriggerActivation ["WEST", "PRESENT", true]}]; Share this post Link to post Share on other sites