Jump to content
Sign in to follow this  
Somoo

setTaskState not working at all

Recommended Posts

Mission 1

 

So I am trying to make a mission that involves killing a virtual character. 

 

Here is my setup when testing it out simply in the VR map

 

Made two characters

Blufor named joe

Opfor player, is not named

 

-Using the module system created a task for all opfor units, variable name is "task1_v" and task ID name is "task1_ID" in the single module

-Made a trigger that the condition "!alive joe" and in activation "task1_ID setTaskState "Succeeded"

 

Cannot get the to complete the task after joe has been killed by anything, player of otherwise

 

Mission 2

 

Player needs to steam intelligence documents...

 

"unt_player1" is the actual player... forgot to add

 

Module Create Task, Variable name "task1_v" and task id "task1_ID"

Module Assign Task syncronized to "task1_v"

Module Set Task State Syncornized to "task1_v"

Trigger1 is syncronized to Module Set Task State.

The condition in that trigger are "Intel_File2_F" in (items unt_player1 + assigneditems unt_player1) and the activation is "task1_ID setTaskState "Succeeded"

 

Why is none of these task being completed when the action happens, where in my coding is the errors?

 

Sidenote...

If I wanted to make the player steal a laptop I would use this code and call it on the laptops intialization ingame..

 

laptop ingame has the name laptop1

 

addaction ["Pick up Laptop",collect.sqf]

 

and this would go into the sqf file...

 

"Player SwitchMove "AinvPercMstpSrasWrflDnon_Putdown_A­movP­ercMstpSrasWrflDnon";

 

delete laptop1;

sleep 0.5;"
 

 

Edit: I think I just figured out the first mission, used   "  nul = [] execVM "test.sqf";  " in the activation field of the trigger when joe died.  In the  the script "task1_ID setTaskState "succeeded" when the script was called.  Is their a list of functions that can be filtered that only work in a SQF script?  I know of but their is no filter currently? https://community.bistudio.com/wiki/Category:Scripting_Commands

Share this post


Link to post
Share on other sites


fnc_create_task = {

/*

function for create tasks by DaVidoSS

parameters are:

[

task position, ==> position array

task id, ==> short STRING

side, ==> task side (WEST, EAST or INDEPENDENT)

"task description", ==> STRING

"task title", ==> short STRING

"3d ingame sign" ==> short STRING

]

or if you want use radio sounds

[

task position,

task id,

side,

"task description",

"task title",

"3d ingame sign",

HQunit, ==> unit OBJECT

"cfgRadio_class" ==> STRING

]

Usage:

[getpos trigger1, "tsk1", WEST, "Kill all enemy, have no mercy", "Kill enemy", "Enemy", papabear, "secureobj"] call fnc_create_task;

*/

params ["_task_pos", "_taskID", "_side", "_description", "_title", "_ingameMrkr", ["_radioHQ", nil], ["_radio_class", nil], "_task"];

_task = [_side,_taskID,[_description, _title, _ingameMrkr], _task_pos, true] call BIS_fnc_taskCreate;

_task = [_taskID, "CREATED",true] spawn BIS_fnc_taskSetState;

if ((count _this) > 6) then {

[[_radioHQ,_radio_class],"sideRadio",_side,false,false] call BIS_fnc_MP;

};

diag_log format ["*********** : Task %1 objective created at %2. ***********", _title, _task_pos];

};


fnc_result_task = {

/*

function for results the tasks by DaVidoSS

parameters are:

[

task id, ==> short STRING

result ==> STRING ("CREATED", "ASSIGNED", "SUCCEEDED", "FAILED" or "CANCELED")

]

or if you want use radio sounds

[

task id,

result,

side, ==> task side (WEST, EAST or INDEPENDENT)

HQunit, ==> unit OBJECT

"cfgRadio_class" ==> STRING

]

Usage:

["tsk1", "SUCCEEDED", WEST, papabear, "goodjob"] call fnc_result_task;

Use _task = [_taskID, _side] call BIS_fnc_deleteTask after result task if romoving needed.

*/

params ["_taskID", "_result", ["_side", nil], ["_radioHQ", nil], ["_radio_class", nil], "_task"];

_task = [_taskID, _result, true] spawn BIS_fnc_taskSetState;

if ((count _this) > 2) then {

[[_radioHQ, _radio_class],"sideRadio",_side,false,false] call BIS_fnc_MP;

};

diag_log format ["*********** : %1 task %2. ***********", _result, _taskID];

};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×