Jump to content
Hud561

Tasks Order Assigment

Recommended Posts

Hello everybody.

Does anybody know what could be the issue with the task order assignment? I mean,  I set task_1 and just after this task is completed it'd probably come task_2 and so on. Well, that'd be the normal sequence. But that's not what happens. Suppose i've created 6 tasks and when i'm still playing task_1,  it appears on my screen that task_4 has been created.

 

I set triggers with trigger owner, most of the tasks are to kill or destroy specific items or soldiers, SetTaskState set to completed.  Tasks are linked to Player, sinc'd to SetTaskState and also sync'd to the previous task trigger. So, What am i doing wrong?

 

Thanks for the help.

Share this post


Link to post
Share on other sites

 

Take a look at this video. it helped me to make task. with out using the modules in game.

  • Like 2

Share this post


Link to post
Share on other sites

Have you named the tasks differently? 

 

First thing that comes to mind is that two tasks have the same name. If not, try de-syncing and re-syncing everything.

  • Like 2

Share this post


Link to post
Share on other sites

Hello everyboy.

 

Sorry for taking too long to answer. I only got weekends to deal with scenarios. Actually, this is my first scenario, but i studied a bit before trying to create it. I decided to do it SP just to learn how things work before creating

a MP scenario

 

 

Share this post


Link to post
Share on other sites
On 25/01/2019 at 8:15 AM, Play3r said:

 

Take a look at this video. it helped me to make task. with out using the modules in game.

 

Thanks for the video PLAY3R (Sarge). It's been very helpful. I tried to adapt it to may needs, but i noticed that it was created for MP Scenario

scripting and i don't know exactly what do i have to do to set it up to SP. I still have to test it for all the 6 tasks, but i notice that all task are visible on the map.

I tested the first task and it went well so far. There's an error at the beggining of the game.

 

I had a picture of this, but i couldn't  insert it into the post. This way, I'll show the script itself.

 

Init.sqf

_myTasks = [] execVM "scripts\initTasks.sqf";

 

 initTask.sqf

/*
[owner, taskID, description, destination, state, priority, showNotification, type, visibleIn3D] call BIS_fnc_taskCreate

Parameters:
    owner: Task owner(s)
    Boolean - true to set task of all playable units
    Object - set task of a specific object
    Group - set tasks of all objects in the group
    Side - set tasks of all objects of the given side
    Array - collection of above types
    taskID:
    String - Task ID
    Array - In the format of [task ID, parent task ID]
    description:
    Array - Task description in the format ["description", "title", "marker"]
    String - CfgTaskDescriptions class name, if empty string is used then CfgTaskDescriptions is searched for a class matching the tasks TaskID
    destination (Optional): Task destination
    Object - Use objNull to set no position
    Array - Either position in format [x,y,z], or [object,precision] as used by setSimpleTaskTarget command
    state (Optional): Task state
    String - can be one of following:
    "CREATED"
    "ASSIGNED"
    "AUTOASSIGNED" ("ASSIGNED" when no task is assigned yet, otherwise "CREATED")
    "SUCCEEDED"
    "FAILED"
    "CANCELED"
    Boolean - true to set the task as current
    priority (Optional): Number - priority. When a current task is completed, system select a next one with the larges priority >= 0
    showNotification (Optional): Boolean - true to show notification (default), false to disable it
    type (Optional): String - task type from CfgTaskTypes, if not defined, type "" is being used
    visibleIn3D (Optional): Boolean - true to make task always visible in 3D (default: false)
*/
//Diedushka_Kill_Major_Tvsakhy_and_Terrorist_Nyeh_Khun
//Diedushka_Kill_Olyevich_and_Destroy_Enemy_Weapons
//Diedushka_Take_Control_of_COMM_Towers_and_Set_Prisoners_Free
//Diedushka_Eradicate_Enemy_Presence_and_Kill_Major_Nikolay
//Diedushka_Kill_Major_Castillo


[Diedushka, "tsk1", ["Kill Major Tvsakhy and a terrorist known as Nyeh Khun. Destroy Weapons.
Camp position uncertain, but  according to our intel it's on  position 113014 surroundings.",
"Kill  Major Tvsakhy and  Terrorist Nyeh Khun. Destroy Weapons.", ""], weapon_1, true, 99, true, "Kill", true]
call BIS_fnc_taskCreate;

 

[Diedushka, "tsk2", ["Kill colonel Olyevic and find  out what are the  enemy plans.  LZ on position 120097.  
He's  Position now is 120085. It's a COMM Tower with some small houses  under it. Caution on getting
in the area. Minefields  detected.", "Kill Colonel_Olyevich and  Destroy Enemy Weapons.", ""], weapon_2, "Created", 98, true, "Kill", false]
call BIS_fnc_taskCreate;

 

[Diedushka, "tsk3", ["Enemy is trying to embark a shipment of weapons. Prevent this from happening.",
"Destroy  Enemy Weapons Shipment" , ""], wpn1, "Created", 97, true, "Destroy", true]
call BIS_fnc_taskCreate;

 

[Diedushka, "tsk4", ["OPFOR is holding prisioners in a COMM facility on position 110114. Invade, take control  of the position  and set prisoners free.  
Hold control until american troops get there. LZ on 107101.  Brazilian  and american troops will meet you at the LZ.",
"Take  Control of COMM  Towers and Set Prisoners Free",""], Civ1, "Created", 96, true, "default", false]
call BIS_fnc_taskCreate;

 

[Diedushka, "tsk5", ["Your mission willl be eradicate  the enemy presence  in a Village on position 038134.
It's near  CampRenmants surroundings.  The village was taken  24 hours ago by enemy. Important: Kill Major Nikolai.
Safe LZ on position 033128. Keep a low profile.",
"Eradicate Enemy Presence and Kill Major Nikolay" , ""], Major_Nikolay, "Created", 95, true, "default", false]
call BIS_fnc_taskCreate;

 

[Diedushka, "tsk6", ["Your target is Major Castillo, an important officer who has   contacts with weapons dealers that
have been supplying enemy forces for around 3 years.  According to our intel, he's in Sosovu Island at this moment.  You'll
have to move your troops to Ile Doen Island, on the northwest of Sosovu. You gonna  jump on boat assault to get to the island.
Make no fuss and keep a low profile to prevent him to scape. Good luck.",
"Kill Major Castillo" , ""], 029092, "Created", 94, true, "Kill", false]
call BIS_fnc_taskCreate;

 

T1 = false;
T2 = false;
T3 = false;
T4 = false;
T5 = false;
T6 = false;

[] execVM "scripts\taskMonitor.sqf";

 

T1, T2 stands for trigger 1, 2 - this part is not in the scripting

 

Now follows the taskMonitor.sqf

 

_run = true;
_notifyT1 = true;
_notifyT2 = true;
_notifyT3 = true;
_notifyT4 = true;
_notifyT5 = true;
_notifyT6 = true;

While {_run} do {

if (T1 && _notifyT1) then {
["Tsk1","SUCCEEDED", true]call BIS_fnc_taskSetState;
_notifyT1 = false;
};

if (T2 && _notifyT2) then {
["Tsk2","SUCCEEDED", true]call BIS_fnc_taskSetState;
_notifyT2 = false;
};

if (T3 && _notifyT3) then {
["Tsk3","SUCCEEDED", true]call BIS_fnc_taskSetState;
_notifyT3 = false;
};

if (T4 && _notifyT4) then {
["Tsk4","SUCCEEDED", true]call BIS_fnc_taskSetState;
_notifyT4 = false;
};

if (T5 && _notifyT5) then {
["Tsk5","SUCCEEDED", true]call BIS_fnc_taskSetState;
_notifyT5 = false;
};

if (T6 && _notifyT6) then {
["Tsk6","SUCCEEDED", true]call BIS_fnc_taskSetState;
_notifyT6 = false;
};

sleep 15;

if (T1 && T2 && T3 && T4 && T5 && T6) then {"You got it!" call BIS_fnc_endMission;};
};

 

This is the error that appears at the beginning of the game:

 

'...     ])})],[[],""]];
private _dest + |#|param [3,(if ((missionNamespace getVaria....'
Error type Number, expected Array,String,Object
File A3\functions_f\Tasks\fn_taskCreate.sqf [BIS_fnc_taskCreate], line 57

 

Share this post


Link to post
Share on other sites
On 25/01/2019 at 8:15 AM, Play3r said:

 

Take a look at this video. it helped me to make task. with out using the modules in game.

Btw, i forgot to show the line 57. Thisis ist:

"Take  Control of COMM  Towers and Set Prisoners Free",""], Civ1, "Created", 96, true, "default", false]

Share this post


Link to post
Share on other sites
On 25/01/2019 at 12:26 PM, JohnKalo said:

Have you named the tasks differently? 

 

First thing that comes to mind is that two tasks have the same name. If not, try de-syncing and re-syncing everything.

Thanks for responding.

Actually, my tasks are listed as tsk1, tsk2 and so on. I decided to do it that way for the simplicity when looking for a specified one. I already

did the way you said, i mean, de-syncing and re-syncing. Nothing happened.

  • Like 1

Share this post


Link to post
Share on other sites
On 25/01/2019 at 1:15 PM, pierremgi said:

Are you sure for your trigger(s)? Sometimes they fires at start...

I just can't tell that for sure but the triggers are very simple and most of the time refers to !alive sb/sth and most of the time they are trigger owner.

I tend to create "trigger owner" just to make sure only "main Player" will be abe to start them.

Now, for me to assure that "trigger owner" will work exactly this way, this is another matter. Do you think it's  not enough to make sure a trigger

will not start before the order?

Share this post


Link to post
Share on other sites

I don't understand what you're doing but

if T1, T2,.. are triggers, you can't refer to them if you crash the variable with T1= false, T2 = false... They become boolean instead of triggers.

 

if you want to return a boolean (in condition field of the next trigger):

just write

triggerActivated T1   // returns true if T1 is activated or false if not.

 

That way you don't need && _notifyT1. Not sure to understand how you make it work.

 

If you want some delay, add it in trigger countdown.

 

So, adapting you script (I'd rather managed some triggers' conditions/on activation, in editor):

you could write something like:

 

<you task1 here>

waitUntil {sleep 2; triggerActivated T1};

["Tsk1","SUCCEEDED", true]call BIS_fnc_taskSetState;

<you task2 here>

waitUntil {sleep 2; triggerActivated T2};

["Tsk2","SUCCEEDED", true]call BIS_fnc_taskSetState;

<you task3 here>

waitUntil {sleep 2; triggerActivated T3};

["Tsk3","SUCCEEDED", true]call BIS_fnc_taskSetState;

<you task4 here>

waitUntil {sleep 2; triggerActivated T4};

["Tsk4","SUCCEEDED", true]call BIS_fnc_taskSetState;

<you task5 here>

waitUntil {sleep 2; triggerActivated T5};

["Tsk5","SUCCEEDED", true]call BIS_fnc_taskSetState;

<you task6 here>

waitUntil {sleep 2; triggerActivated T6};

["Tsk6","SUCCEEDED", true]call BIS_fnc_taskSetState;

sleep 15;

"end1" call BIS_fnc_endMission;
 

 

Share this post


Link to post
Share on other sites
20 hours ago, Hud561 said:

Btw, i forgot to show the line 57. Thisis ist:

"Take  Control of COMM  Towers and Set Prisoners Free",""], Civ1, "Created", 96, true, "default", false]

Guess that it is the WORD "default" maybe you need to use  "DEFAULT" and not "default"

just my guess.

Share this post


Link to post
Share on other sites

If needed the task script we use is mp and sp supported and you can find it here:

 

My post is post number 3.

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Hello everybody,

 

Once again, sorry for taking too long to answer.

 

Well, PIERREMGI was right. Triggers were firing at start. The mistake was in the way i was setting the trigger conditions.The only thing i didn't understand

was the fact that i set triggers to "owner only" and they were firing without owner presence in its radius. Well, the important is that they're working properly now.

Actually, I have to confess that i still get confused with some triggers conditions.

 

JOHNKALO, i've saved your script. Btw, i liked both yours and PLAY3R script mainly becausethey allow you to set task priority 99,98, 97.

 

I'v been using many types of "small scripts and commands" in triggers and units like hideObjects, parachuting, rapelling, setFuel and so on, just to make the mission more realistic,

but i've not been able to find a script to create CQB. Does anybody know a way of creating a script for that?


Thanks for the help

Share this post


Link to post
Share on other sites

As for triggers sometimes placing another trigger and writing by hand while NOT copy pasting the same condition makes the new trigger work. 

As for the CQB script we got a really cool one. If you know how to un-pbo a mission just download the latest mission of the Campaign indicated in my signature.

It is in the Scripts folder, the House Patrol one.

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, JohnKalo said:

As for triggers sometimes placing another trigger and writing by hand while NOT copy pasting the same condition makes the new trigger work. 

As for the CQB script we got a really cool one. If you know how to un-pbo a mission just download the latest mission of the Campaign indicated in my signature.

It is in the Scripts folder, the House Patrol one.

OK. I downloded  Flaming_Rain Lythium Campaign and extracted the House Patrol pbo file . Just a question: can i use it for placing OPFOR ,  BLUEFOR or any other faction unit? I mean, can i use

it for example, for placing an OPFOR defending  unit inside a building while i invade the city ? I read the script, but i only understood it partially.

 

Btw, thanks for the free mission/campaigns.

 

Edited: I already found the answer.

 

Excellent! Run smooth and by the books! Thanks for the help and the script.

 

 

 

 

Edited by Hud561
I already found the answer.
  • Like 1

Share this post


Link to post
Share on other sites

Thanks and yep it is one of my favorite scripts. Especially because when playing not even the editor can know where the hostile units are exactly  :thumbsup:

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

×