Jump to content

Recommended Posts

Hello, everyone! I have played missions with such tasks. For example: the player can finish a main task, shown above the others, when 2 or more other side/secondary tasks are completed. My simple example:
-> Main Task: Survive
 - Kill The Officer
 - Destroy Tank
When I kill the officer and destroy the enemy tank, I have completed these side/secondary tasks, and with that the main task: Survive, is also completed.
Is this some special script that should be used or just placing down any modules in the Eden editor?

Share this post


Link to post
Share on other sites

My mission follows this form.

There may be modules that allow this design, but I achieve it in scripts.

It's not very complex, but it can be long winded.

Share this post


Link to post
Share on other sites

Both works. Tasks module and triggers  or scripts. You can mix both. I recently tested a randomization for enemies position, then a "task module teleportation". It's OK. So, you have choice.

Share this post


Link to post
Share on other sites

Thank you for the answers, but I still don't get it. It looks so complicated to me... Would you place a little example of a script with different MAIN and SECONDARY tasks and tell me where to put it? I guess in the init.sqf file, but you'd better tell me. :)

Share this post


Link to post
Share on other sites

This is how I want it to work:

-> Main Task: Destroy CSAT base

  - Destroy AA Guns

  - Destroy Arty

When I destroy both AA and Arty, these 2 subtasks are completed. And the main task will be completed, too. All I am asking for is an example of how to do it. Some script or the mix of a script + the task modules. I know pretty much about normal tasks creation, but I want to try this way as well. Would you help me with that? :)

 

Share this post


Link to post
Share on other sites
51 minutes ago, black_hawk_mw2_87 said:

This is how I want it to work:

-> Main Task: Destroy CSAT base

  - Destroy AA Guns

  - Destroy Arty

When I destroy both AA and Arty, these 2 subtasks are completed. And the main task will be completed, too. All I am asking for is an example of how to do it. Some script or the mix of a script + the task modules. I know pretty much about normal tasks creation, but I want to try this way as well. Would you help me with that? :)

 

 @JohnKalo pointed you in the right direction. @Grumpy Old Man example is perfect for your needs, and as i did once, take the time to dig in that example mission to see how it works.

Anyway, following his teachings, I'm gonna get you a small example on Parent/child tasks by script.I used it in my GHOST RECON WILDLANDS campaign, with 3 different parents tasks and more than 20 child tasks...all without triggers or modules.

//make sure these 3 are identical inside the _makeTaskN arrays
_myTaskIDs = ["Task01","Task02","Task03"];

//this task will be the parent task and checks if all three sub tasks are complete
_makeParentTask = ["ParentTask01",player,[format ["Destroy ALL OBJECTIVE AT CSAT BASE","Destroy CSAT base",""],objNull,"ASSIGNED",4,true,true,"target"];



_makeTask1 = [["Task01","ParentTask01"],player,["Destroy AA GUNS" to allow CAS and AIR TRAFFIC over AO,"Destroy AA GUNS",""],getMarkerPos "AAmarker","ASSIGNED",1,true,true,"destroy"]; 
_makeTask2 = [["Task02","ParentTask01"],player,["Destroy ARTILLERY positions to deny support to enemy trups","Destroy ARTILLERY",""],getMarkerPos "ARTYmarker","ASSIGNED",2,true,true,"attack"];
_makeTask3 = [["Task03","ParentTask01"],player,["Eliminate BASE COMMANDER to cripple enemy chain of command ","KILL OFFICER",""],objNull,"ASSIGNED",3,true,true,"kill"];



//spawning loops to handle individual task conditions
//this is an easy way to edit and read/handle task conditions and results
TexTask1 = false;
TexTask2 = false;
TexTask3 = false;
ParentTask01 = false;




_watchTask1 = [] spawn {
	
	waitUntil {sleep 0.5; !alive (name of AA gun)};// this is child-subtask task 1 succedeed 
	["Task01", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
	TexTask1 = true;
	sleep 5;
	saveGame;
};

_watchTask2 = [] spawn {


	waitUntil {sleep 0.5;!alive (ARTYname)};// this is child-subtask task 2 succedeed 
	["Task02", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
	TexTask2 = true;
	sleep 5;
	saveGame;

};


_watchTask3 = [] spawn {

	waitUntil {sleep 0.5;!alive (OFFICERname)};// this is child-subtask task 3 succedeed 
	["Task03", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
	TexTask3 = true;
	sleep 5;
	saveGame;

};
_watchParentTask = [] spawn {



	waitUntil {sleep 1;(TexTask1 AND TexTask2 AND TexTask3)};///here it cecks if all child task is completed and then fire the SUCCEEDED state of the PARENT-MAIN task

	if (TexTask1 AND TexTask2 AND TexTask3) then {

		["ParentTask01", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
		systemchat "ALL TASK COMPLETED";
		ParentTask01 = true;
		sleep 5;
		"END1" call BIS_fnc_endMission;
	    

	};
};

{_x call BIS_fnc_setTask;sleep 3;} foreach [_makeParentTask,_makeTask1,_makeTask2,_makeTask3];

Call this "Task_handling.sqf" for example and call it from the init.sqf of the mission with

[] execVM "Task_handling.sqf";

Obviously, You can expand the number of parents/child tree as needed.

  • Like 4

Share this post


Link to post
Share on other sites
16 hours ago, black_hawk_mw2_87 said:

THANK YOU VERY MUCH! This will definitely help me! :) I am going to use it for my new mission. That was REALLY helpful! Cheers!

Try it out...you'll never go back to the maze of modules,triggers and sinc lines it takes to get multiple dynamic tasks in the editor. Also, it's easy to see how you could expand it.

For example:

parentTask01> Destroy CSAT base

 

parentTask02> Destroy AA sites

    childtask01    > Destroy AA nr. 1

    childtask02    > Destroy AA nr. 2

    childtask03    > Destroy AA nr. 3

Following the example I give you earlier, once ALL 3 AA guns are destroyed the parentTask02 become true. Basically, every sub-task could be spitted in "sub-sub" tasks...

 

 

  • Like 1

Share this post


Link to post
Share on other sites
On 09/11/2018 at 3:25 PM, black_hawk_mw2_87 said:

THANK YOU VERY MUCH! This will definitely help me! :) I am going to use it for my new mission. That was REALLY helpful! Cheers!

*English translated by Google

 

Is that what you want to do?

If it is, you can do this directly from the publisher.

* The video is not in English, but it is easy to understand what should be done.

 



@Edit

 

I found an English video

 

 

  • Like 3

Share this post


Link to post
Share on other sites
On 11/9/2018 at 8:18 AM, pierremgi said:

Both works. Tasks module and triggers  or scripts. You can mix both. I recently tested a randomization for enemies position, then a "task module teleportation". It's OK. So, you have choice.

 

On 11/9/2018 at 10:19 AM, zagor64bz said:

 @JohnKalo pointed you in the right direction. @Grumpy Old Man example is perfect for your needs, and as i did once, take the time to dig in that example mission to see how it works.

Anyway, following his teachings, I'm gonna get you a small example on Parent/child tasks by script.I used it in my GHOST RECON WILDLANDS campaign, with 3 different parents tasks and more than 20 child tasks...all without triggers or modules.


//make sure these 3 are identical inside the _makeTaskN arrays
_myTaskIDs = ["Task01","Task02","Task03"];

//this task will be the parent task and checks if all three sub tasks are complete
_makeParentTask = ["ParentTask01",player,[format ["Destroy ALL OBJECTIVE AT CSAT BASE","Destroy CSAT base",""],objNull,"ASSIGNED",4,true,true,"target"];



_makeTask1 = [["Task01","ParentTask01"],player,["Destroy AA GUNS" to allow CAS and AIR TRAFFIC over AO,"Destroy AA GUNS",""],getMarkerPos "AAmarker","ASSIGNED",1,true,true,"destroy"]; 
_makeTask2 = [["Task02","ParentTask01"],player,["Destroy ARTILLERY positions to deny support to enemy trups","Destroy ARTILLERY",""],getMarkerPos "ARTYmarker","ASSIGNED",2,true,true,"attack"];
_makeTask3 = [["Task03","ParentTask01"],player,["Eliminate BASE COMMANDER to cripple enemy chain of command ","KILL OFFICER",""],objNull,"ASSIGNED",3,true,true,"kill"];



//spawning loops to handle individual task conditions
//this is an easy way to edit and read/handle task conditions and results
TexTask1 = false;
TexTask2 = false;
TexTask3 = false;
ParentTask01 = false;




_watchTask1 = [] spawn {
	
	waitUntil {sleep 0.5; !alive (name of AA gun)};// this is child-subtask task 1 succedeed 
	["Task01", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
	TexTask1 = true;
	sleep 5;
	saveGame;
};

_watchTask2 = [] spawn {


	waitUntil {sleep 0.5;!alive (ARTYname)};// this is child-subtask task 2 succedeed 
	["Task02", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
	TexTask2 = true;
	sleep 5;
	saveGame;

};


_watchTask3 = [] spawn {

	waitUntil {sleep 0.5;!alive (OFFICERname)};// this is child-subtask task 3 succedeed 
	["Task03", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
	TexTask3 = true;
	sleep 5;
	saveGame;

};
_watchParentTask = [] spawn {



	waitUntil {sleep 1;(TexTask1 AND TexTask2 AND TexTask3)};///here it cecks if all child task is completed and then fire the SUCCEEDED state of the PARENT-MAIN task

	if (TexTask1 AND TexTask2 AND TexTask3) then {

		["ParentTask01", "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
		systemchat "ALL TASK COMPLETED";
		ParentTask01 = true;
		sleep 5;
		"END1" call BIS_fnc_endMission;
	    

	};
};

{_x call BIS_fnc_setTask;sleep 3;} foreach [_makeParentTask,_makeTask1,_makeTask2,_makeTask3];

Call this "Task_handling.sqf" for example and call it from the init.sqf of the mission with


[] execVM "Task_handling.sqf";

Obviously, You can expand the number of parents/child tree as needed.

@zagor64bz Hello zag, I need to move my mission making in this direction. Is this still a good start for doing that and will this work for MP on dedicated?

Share this post


Link to post
Share on other sites
On 11/9/2018 at 8:18 AM, pierremgi said:

Both works. Tasks module and triggers  or scripts. You can mix both. I recently tested a randomization for enemies position, then a "task module teleportation". It's OK. So, you have choice.

@pierremgi Hello pierre, I am looking to do something similar in UNSUNG and was curious as to how this looked?

Share this post


Link to post
Share on other sites
1 hour ago, Soapbox0331 said:

Hello zag, I need to move my mission making in this direction. Is this still a good start for doing that and will this work for MP on dedicated?

Hey man, pretty sure it still works in an SP scenario...but I have NOT tested (or have ANY experience about) on an MP environment...never the less dedicated. Sorry bro..wish I could help ya.🤷‍♀️

  • Thanks 1

Share this post


Link to post
Share on other sites
11 hours ago, zagor64bz said:

Hey man, pretty sure it still works in an SP scenario...but I have NOT tested (or have ANY experience about) on an MP environment...never the less dedicated. Sorry bro..wish I could help ya.🤷‍♀️

No worries zag, this is still very helpful!

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

×